|
|
|
@@ -5,11 +5,9 @@
|
|
|
|
<!-- <van-cell-group v-if="status === 1" inset style="padding-top: 15px"> -->
|
|
|
|
<!-- <van-cell-group v-if="status === 1" inset style="padding-top: 15px"> -->
|
|
|
|
<van-cell-group inset style="padding-top: 15px">
|
|
|
|
<van-cell-group inset style="padding-top: 15px">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<img
|
|
|
|
<img width="100%"
|
|
|
|
width="100%"
|
|
|
|
|
|
|
|
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u14.jpg?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333"
|
|
|
|
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u14.jpg?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333"
|
|
|
|
alt=""
|
|
|
|
alt="" />
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="qrcode">
|
|
|
|
<div class="qrcode">
|
|
|
|
<img :src="publishInfo.img_url" alt="" width="100px" height="100px" />
|
|
|
|
<img :src="publishInfo.img_url" alt="" width="100px" height="100px" />
|
|
|
|
@@ -44,7 +42,7 @@
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
import { onMounted, reactive, ref, watch } from 'vue';
|
|
|
|
import { onMounted, reactive, ref, watch } from 'vue';
|
|
|
|
import { showFailToast, showSuccessToast } from 'vant';
|
|
|
|
import { showFailToast, showToast } from 'vant';
|
|
|
|
import utils from '@/assets/js/common';
|
|
|
|
import utils from '@/assets/js/common';
|
|
|
|
import appBridge from '@/assets/js/appBridge';
|
|
|
|
import appBridge from '@/assets/js/appBridge';
|
|
|
|
import { getQrcode } from '@/api/publish';
|
|
|
|
import { getQrcode } from '@/api/publish';
|
|
|
|
@@ -110,7 +108,7 @@ type OperateItem = (typeof operateList)[0];
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
function getCode() {
|
|
|
|
function getCode () {
|
|
|
|
publishInfo.value.img_url
|
|
|
|
publishInfo.value.img_url
|
|
|
|
= 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png';
|
|
|
|
= 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png';
|
|
|
|
publishInfo.value.url = `${configUrl.proxyDomain}/publish?sn=${sn && sn !== undefined ? sn : ''}`;
|
|
|
|
publishInfo.value.url = `${configUrl.proxyDomain}/publish?sn=${sn && sn !== undefined ? sn : ''}`;
|
|
|
|
@@ -125,7 +123,7 @@ function getCode() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((error) => {
|
|
|
|
.catch((error) => {
|
|
|
|
// showFailToast(error.data?.message || error.message || '服务器错误');
|
|
|
|
showFailToast(error.data?.message || error.message || '服务器错误');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// function fetchInfo() {
|
|
|
|
// function fetchInfo() {
|
|
|
|
@@ -142,37 +140,37 @@ watch(status, (val) => {
|
|
|
|
getCode();
|
|
|
|
getCode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
onMounted(async() => {
|
|
|
|
onMounted(async () => {
|
|
|
|
// fetchInfo();
|
|
|
|
// fetchInfo();
|
|
|
|
getCode();
|
|
|
|
getCode();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const operateBtn = (item: OperateItem) => {
|
|
|
|
const operateBtn = (item: OperateItem) => {
|
|
|
|
switch (item.type) {
|
|
|
|
switch (item.type) {
|
|
|
|
case 'shareLink':
|
|
|
|
case 'shareLink':
|
|
|
|
shareLink();
|
|
|
|
shareLink();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'copyLink':
|
|
|
|
case 'copyLink':
|
|
|
|
copyLink();
|
|
|
|
copyLink();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'qrCode':
|
|
|
|
case 'qrCode':
|
|
|
|
downLoadImg();
|
|
|
|
downLoadImg();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 复制链接
|
|
|
|
// 复制链接
|
|
|
|
function copyLink() {
|
|
|
|
function copyLink () {
|
|
|
|
const input = document.createElement('input');
|
|
|
|
const input = document.createElement('input');
|
|
|
|
input.value = publishInfo.value.url;
|
|
|
|
input.value = publishInfo.value.url;
|
|
|
|
document.body.appendChild(input);
|
|
|
|
document.body.appendChild(input);
|
|
|
|
input.select();
|
|
|
|
input.select();
|
|
|
|
document.execCommand('Copy');
|
|
|
|
document.execCommand('Copy');
|
|
|
|
document.body.removeChild(input);
|
|
|
|
document.body.removeChild(input);
|
|
|
|
showSuccessToast('复制成功');
|
|
|
|
showToast('复制成功');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 分享链接
|
|
|
|
// 分享链接
|
|
|
|
function shareLink() {
|
|
|
|
function shareLink () {
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
type: 'shareToWx',
|
|
|
|
type: 'shareToWx',
|
|
|
|
title: publishInfo.value.download_url.title,
|
|
|
|
title: publishInfo.value.download_url.title,
|
|
|
|
@@ -181,16 +179,18 @@ function shareLink() {
|
|
|
|
webpageUrl: publishInfo.value.url,
|
|
|
|
webpageUrl: publishInfo.value.url,
|
|
|
|
scene: 0 // 朋友圈1 微信好友0
|
|
|
|
scene: 0 // 朋友圈1 微信好友0
|
|
|
|
};
|
|
|
|
};
|
|
|
|
console.log('shareUrl',publishInfo.value.url)
|
|
|
|
console.log('shareUrl', publishInfo.value.url)
|
|
|
|
appBridge.shareToWeChat(params, () => {
|
|
|
|
appBridge.shareToWeChat(params, () => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 下载二维码
|
|
|
|
// 下载二维码
|
|
|
|
function downLoadImg() {
|
|
|
|
function downLoadImg () {
|
|
|
|
const { title, url } = publishInfo.value.download_url;
|
|
|
|
const { title, url } = publishInfo.value.download_url;
|
|
|
|
if (utils.getSessionStorage('xToken')) {
|
|
|
|
if (utils.getSessionStorage('xToken')) {
|
|
|
|
appBridge.save2Album(url, () => {});
|
|
|
|
appBridge.save2Album(url, () => {
|
|
|
|
|
|
|
|
showToast('二维码已成功保存到相册');
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const link = document.createElement('a');
|
|
|
|
const link = document.createElement('a');
|
|
|
|
link.href = url;
|
|
|
|
link.href = url;
|
|
|
|
|