开门红:微信头像生成页面样式调整 --提交人:阳华祥

This commit is contained in:
yang.huaxiang
2020-11-26 13:43:00 +08:00
parent dc3d64e721
commit 9ab8853fe9

View File

@@ -11,11 +11,24 @@
</template> </template>
<template v-slot:error>加载失败</template> <template v-slot:error>加载失败</template>
</van-image> </van-image>
<div class="flex justify-content-c bottom-btn"> <div class="flex justify-content-a bottom-btn">
<van-button <van-button
:disabled="downLoadFlag" v-if="!clickUpLoadFlag"
class="bottom50 left0" class="bottom50"
style="width: 40%;border-radius: 6px;" style="width: 30%;border-radius: 6px;"
square
round
type="danger"
size="normal"
@click="clickUploadImg"
v-no-more-click="1000"
>
上传图片
</van-button>
<van-button
v-if="!downLoadFlag"
class="bottom50"
style="width: 30%;border-radius: 6px;"
square square
round round
type="danger" type="danger"
@@ -62,7 +75,8 @@ export default {
type: 'align' type: 'align'
}, },
downLoadUrl: '', downLoadUrl: '',
downLoadFlag: true downLoadFlag: true,
clickUpLoadFlag: true
} }
}, },
filters: {}, filters: {},
@@ -73,13 +87,13 @@ export default {
forbidClick: true, forbidClick: true,
loadingType: 'spinner' loadingType: 'spinner'
}) })
setTimeout(() => { /*setTimeout(() => {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_right_button', { EWebBridge.webCallAppInJs('webview_right_button', {
btns: [{ img: this.$assetsUrl + 'images/ebiz/more_check.png' }] btns: [{ img: this.$assetsUrl + 'images/ebiz/more_check.png' }]
}) })
window.appCallBack = this.appCallBack //app回调 window.appCallBack = this.appCallBack //app回调
}, 1000) }, 1000)*/
await this.getWxHeadConfig() await this.getWxHeadConfig()
this.$toast.clear() this.$toast.clear()
}, },
@@ -108,6 +122,27 @@ export default {
}) })
} }
}, },
clickUploadImg() {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('uploadImg', {
imgWidth: this.cutConfig.width,
imgHeight: this.cutConfig.height,
maxSize: this.cutConfig.size
})
.then(res => {
console.log(res)
// 截取后图片
// this.src = config.imgDomain + '/returnImageStream?a=b.jpg&imgPath=' + encodeURIComponent(JSON.parse(res).path)
// this.path = JSON.parse(res).path
// this.base64 = 'data:image/jpg;base64' + JSON.parse(res).base64
this.composeReqDTO.headPath = JSON.parse(res).path
// 生成合成图
this.composeWxHeadConfig()
})
.catch(() => {
return
})
},
downLoadImages() { downLoadImages() {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('download', { EWebBridge.webCallAppInJs('download', {
@@ -130,6 +165,7 @@ export default {
// 下载图片地址 // 下载图片地址
this.downLoadUrl = config.imgDomain + '/returnDirectStream?imgPath=' + encodeURIComponent(res.composePath) this.downLoadUrl = config.imgDomain + '/returnDirectStream?imgPath=' + encodeURIComponent(res.composePath)
this.downLoadFlag = false this.downLoadFlag = false
this.clickUpLoadFlag = true //隐藏上传
} else { } else {
this.$toast(res.resultMessage) this.$toast(res.resultMessage)
} }
@@ -160,6 +196,7 @@ export default {
that.composeReqDTO.backPath = res.content.backImgInfo[0].aesPath that.composeReqDTO.backPath = res.content.backImgInfo[0].aesPath
} }
that.showImgInfo.showFlag = '1' that.showImgInfo.showFlag = '1'
that.clickUpLoadFlag = false // 显示上传按钮
} else { } else {
that.$toast(res.resultMessage) that.$toast(res.resultMessage)
} }