|
|
@ -52,6 +52,7 @@ |
|
|
import {ref} from 'vue' |
|
|
import {ref} from 'vue' |
|
|
import SharePopup from '@/components/SharePopup.vue' |
|
|
import SharePopup from '@/components/SharePopup.vue' |
|
|
import {getUserInfo} from "@/api/member"; |
|
|
import {getUserInfo} from "@/api/member"; |
|
|
|
|
|
import {Share} from "@/api/setting/share"; |
|
|
|
|
|
|
|
|
/* =============== 数据与引用 =============== */ |
|
|
/* =============== 数据与引用 =============== */ |
|
|
const shareRef = ref(null) |
|
|
const shareRef = ref(null) |
|
|
@ -81,19 +82,36 @@ const platformIconMap = ref({ |
|
|
'复制链接': '/static/my/share/share.png' |
|
|
'复制链接': '/static/my/share/share.png' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 用户信息 |
|
|
|
|
|
const userInfoRes = ref() |
|
|
|
|
|
|
|
|
|
|
|
// 分享人的dccode |
|
|
|
|
|
const shareLink = ref('') |
|
|
|
|
|
|
|
|
/* =============== 方法 =============== */ |
|
|
/* =============== 方法 =============== */ |
|
|
|
|
|
|
|
|
const userInfoRes = ref() |
|
|
|
|
|
userInfoRes.value = getUserInfo() |
|
|
userInfoRes.value = getUserInfo() |
|
|
userInfoRes.value.then(res => { |
|
|
userInfoRes.value.then(res => { |
|
|
dccode.value = res.data.dccode |
|
|
dccode.value = res.data.dccode |
|
|
console.log('用户信息', res.data) |
|
|
console.log('用户信息', res.data) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const ShareRes = ref() |
|
|
|
|
|
ShareRes.value = Share() |
|
|
|
|
|
ShareRes.value.then(res => { |
|
|
|
|
|
if (res.code === 200){ |
|
|
|
|
|
shareLink.value = res.message |
|
|
|
|
|
console.log('分享接口返回', res.data) |
|
|
|
|
|
}else { |
|
|
|
|
|
console.log('分享接口返回失败', res.data) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 打开分享弹窗 |
|
|
// 打开分享弹窗 |
|
|
function openShare() { |
|
|
function openShare() { |
|
|
|
|
|
Share() |
|
|
shareRef.value.open() |
|
|
shareRef.value.open() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -109,14 +127,14 @@ function onShareSelect({item}) { |
|
|
console.log('选择了:', item.name) |
|
|
console.log('选择了:', item.name) |
|
|
selectedPlatform.value = item.name // 记录选中的平台 |
|
|
selectedPlatform.value = item.name // 记录选中的平台 |
|
|
|
|
|
|
|
|
// 生成动态助力链接 todo 这里只能传代参的,header传不了 |
|
|
|
|
|
const baseUrl = '下载链接' |
|
|
|
|
|
// const shareLink = `${baseUrl}?token=${encodeURIComponent(token.value)}&deviceId=${encodeURIComponent(deviceId.value)}&version=${encodeURIComponent(version.value)}&client=${encodeURIComponent(client.value)}` |
|
|
|
|
|
const shareLink = `${baseUrl}` |
|
|
|
|
|
|
|
|
// // 生成动态助力链接 |
|
|
|
|
|
// const baseUrl = 'https:' |
|
|
|
|
|
// // const shareLink = `${baseUrl}?token=${encodeURIComponent(token.value)}&deviceId=${encodeURIComponent(deviceId.value)}&version=${encodeURIComponent(version.value)}&client=${encodeURIComponent(client.value)}` |
|
|
|
|
|
// const shareLink = `$ ` |
|
|
|
|
|
|
|
|
// 关闭第一个弹窗 |
|
|
// 关闭第一个弹窗 |
|
|
shareRef.value.close() |
|
|
shareRef.value.close() |
|
|
popupMsg.value = `【DeepChart】邀请你加入,点击链接帮我助力: ${shareLink}` |
|
|
|
|
|
|
|
|
popupMsg.value = `【DeepChart】邀请你加入,点击链接帮我助力: ${shareLink.value}` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uni.setClipboardData({ |
|
|
uni.setClipboardData({ |
|
|
|