This commit is contained in:
yanran200730
2022-03-14 17:15:42 +08:00
parent 7af6c0d30e
commit e67e3b3a85

View File

@@ -103,6 +103,7 @@ export default {
info: {}, info: {},
isMore: false, isMore: false,
list: [], list: [],
linkUrl: '',
isShow: false isShow: false
} }
}, },
@@ -123,18 +124,16 @@ export default {
}) })
}, },
showPopup(item) { showPopup (item) {
// if (item.status === '2') {
// this.$confirm('表单已停止发布,请在后台管理系统中查看调查结果', '', {
// showCancel: false
// })
//
// return false
// }
this.info = item this.info = item
this.id = item.id this.id = item.id
this.isShow = true this.isShow = true
this.$http.post(`/app/appquestionnairetemplate/queryQrCode?id=${item.id}`).then(res => {
if (res.code == 0) {
this.linkUrl = res.data.linkUrl
}
})
}, },
toStop() { toStop() {
@@ -158,35 +157,31 @@ export default {
uni.showActionSheet({ uni.showActionSheet({
itemList: ['分享', '微信分享', '获取链接'], itemList: ['分享', '微信分享', '获取链接'],
success: data => { success: data => {
this.$http.post(`/app/appquestionnairetemplate/queryQrCode?id=${this.info.id}`).then(res => { if (data.tapIndex === 2) {
if (res.code == 0) { this.copy(this.linkUrl)
if (data.tapIndex === 2) { this.isShow = false
this.copy(res.data.linkUrl) }
if (data.tapIndex === 0 || data.tapIndex === 1) {
if (data.tapIndex === 0) {
this.wxInvoke(['shareAppMessage', {
title: this.info.title,
desc: this.info.tableExplain,
link: this.linkUrl,
imgUrl: this.info.headPicture
}, () => {
this.isShow = false this.isShow = false
} }])
if (data.tapIndex === 0 || data.tapIndex === 1) { } else {
if (data.tapIndex === 0) { this.wxInvoke(['shareWechatMessage', {
this.wxInvoke(['shareAppMessage', { title: this.info.title,
title: this.info.title, desc: this.info.tableExplain,
desc: this.info.tableExplain, link: this.linkUrl,
link: res.data.linkUrl, imgUrl: this.info.headPicture
imgUrl: this.info.headPicture }, () => {
}, () => { this.isShow = false
this.isShow = false }])
}])
} else {
this.wxInvoke(['shareWechatMessage', {
title: this.info.title,
desc: this.info.tableExplain,
link: res.data.linkUrl,
imgUrl: this.info.headPicture
}, () => {
this.isShow = false
}])
}
}
} }
}) }
} }
}) })
}, },
@@ -197,7 +192,7 @@ export default {
document.body.appendChild(oInput) document.body.appendChild(oInput)
oInput.select() oInput.select()
document.execCommand('Copy') document.execCommand('Copy')
this.$u.toast('复制') this.$u.toast('复制成功')
oInput.remove() oInput.remove()
}, },