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