|
|
@@ -134,10 +134,10 @@ export default {
|
|
|
img:this.$imgBase+'questionnaire_info.png',
|
|
|
text:'团队信息'
|
|
|
},
|
|
|
- // {
|
|
|
- // img:this.$imgBase+'questionnaire_copy.png',
|
|
|
- // text:'复制链接'
|
|
|
- // },
|
|
|
+ {
|
|
|
+ img:this.$imgBase+'questionnaire_copy.png',
|
|
|
+ text:'复制链接'
|
|
|
+ },
|
|
|
{
|
|
|
img:this.$imgBase+'questionnaire_users.png',
|
|
|
text:'团队人员'
|
|
|
@@ -164,7 +164,7 @@ export default {
|
|
|
onShareAppMessage(res) {
|
|
|
// res.from === 'button' // 来自页面内分享按钮
|
|
|
// res.from === 'menu' // 来自右上角菜单分享
|
|
|
- const sharerId = JSON.parse(uni.getStorageSync('userInfo')).id;
|
|
|
+ const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id;
|
|
|
console.log(`准备分享,团队问卷ID: ${this.dto.teamQuestionnaireId}, 分享者ID: ${sharerId}`);
|
|
|
return {
|
|
|
title: this.dto.title || '发现一个好物,分享给你!',
|
|
|
@@ -233,11 +233,23 @@ export default {
|
|
|
this.$refs.teamRef.teamLevelText = this.teamLevelData.find(d=>d.id==res.data.hierarchy).name;
|
|
|
})
|
|
|
}
|
|
|
- else if(item.text==='复制链接') {
|
|
|
- uni.setClipboardData({
|
|
|
-
|
|
|
+ else if(item.text==='复制链接') {
|
|
|
+ let shareUserId = JSON.parse(uni.getStorageSync('userInfo')).id;
|
|
|
+ let res = await this.$api.post('/wx/genInviteLink',{
|
|
|
+ 'path': '',
|
|
|
+ 'query': `shareTQId=${this.dto.teamQuestionnaireId}&shareUserId=${shareUserId}`,
|
|
|
+ 'env_version': 'develop'//默认"release",正式版"release",体验版"trial",开发版"develop"
|
|
|
+ });
|
|
|
+ if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
+ uni.setClipboardData({
|
|
|
+ data:res.data.data.openlink,
|
|
|
+ success: () => {
|
|
|
+ this.$showToast('复制成功')
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ this.$showToast('复制失败')
|
|
|
+ }
|
|
|
})
|
|
|
- this.$showToast('复制成功')
|
|
|
}
|
|
|
else if(item.text==='团队人员'){
|
|
|
await this.getUserCategoryData()
|