|
@@ -27,6 +27,7 @@ const form = ref<{
|
|
|
userId?: number
|
|
|
videoNumber?: string
|
|
|
}>()
|
|
|
+const windowInfo = ref<{}>
|
|
|
const { data, run: setData } = useRequest(() => getDesignerInfo(userInfo.value.userId))
|
|
|
const { loading, run: submiting } = useRequest(() => updateDesignerInfo(form.value))
|
|
|
const posterUrl = ref()
|
|
@@ -35,10 +36,11 @@ const createPoster = () => {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
;(async () => {
|
|
|
uni.showLoading({ title: '生成中' })
|
|
|
- const [path, bgPath, logoPath, avatarPath, icon1, icon2, icon3, icon4] = await Promise.all(
|
|
|
+ const [path, bgPath, qrcode, logoPath, avatarPath, icon1, icon2, icon3, icon4] = await Promise.all(
|
|
|
[
|
|
|
data.value.sharePageUrl,
|
|
|
NetImages.InviteBg,
|
|
|
+ data.value.qrcodeUrl,
|
|
|
NetImages.Logo,
|
|
|
data.value.headImgUrl || userInfo.value?.avatar || NetImages.DefaultAvatar,
|
|
|
'https://image.zhuchaohui.com/zhucaohui/315c5ca680bc6b47a5344dbff701cf1e6802d8a240754e25ef3d4308bc1deef6.png',
|
|
@@ -60,6 +62,7 @@ const createPoster = () => {
|
|
|
ctx.drawImage(path, 0, 0, w, w / 1.56)
|
|
|
canvas.CircleImage(avatarPath, 17, 21, 14)
|
|
|
canvas.Image(logoPath, 17, 230, 24, 24)
|
|
|
+ canvas.Image(qrcode, 200, 350, 100, 100)
|
|
|
canvas.FillText(userInfo.value?.nickname, '#ffffff', 14, 53, 40)
|
|
|
canvas.FillText('筑巢荟—助力设计师成长平台', '#ffffff', 18, 53, 248)
|
|
|
canvas.FillText('国内外设计游学', '#ffffff', 12, 62, 303)
|
|
@@ -77,6 +80,8 @@ const createPoster = () => {
|
|
|
canvasId: 'firstCanvas',
|
|
|
width: 300,
|
|
|
height: 460,
|
|
|
+ fileType: "jpg",
|
|
|
+ quality: 1,
|
|
|
success: (res) => {
|
|
|
// console.log('生成海报', res)
|
|
|
uni.hideLoading()
|
|
@@ -117,6 +122,7 @@ const share = () => {
|
|
|
onMounted(async () => {
|
|
|
await setData()
|
|
|
form.value = pick(data.value, ['id', 'userId', 'videoNumber'])
|
|
|
+ uni.getWindowInfo()
|
|
|
posterUrl.value = await createPoster()
|
|
|
})
|
|
|
// onAppShare(() => {})
|
|
@@ -140,9 +146,12 @@ onMounted(async () => {
|
|
|
:src="posterUrl"
|
|
|
@displayed="canvasHidden = true"
|
|
|
></ImageEvo>
|
|
|
- <div class="absolute bottom-5.5 left-5.5" v-if="canvasHidden">
|
|
|
+ <div class="absolute bottom-5.5 left-5.5 flex justify-between" v-if="canvasHidden">
|
|
|
<!-- <cover-view> -->
|
|
|
<wd-button custom-class="bg-white/10!" @click="save">保存到相册</wd-button>
|
|
|
+ <!-- <div style="margin-left: 100rpx;">
|
|
|
+ <wd-img :width="50" :height="50" :src="data.qrcodeUrl"></wd-img>
|
|
|
+ </div> -->
|
|
|
<!-- </cover-view> -->
|
|
|
<!-- <wd-button @click="share">微信</wd-button>
|
|
|
<wd-button @click="share">朋友圈</wd-button> -->
|