feat:app嵌套h5

This commit is contained in:
liu.huiying@ebiz-digits.com
2025-03-12 18:26:17 +08:00
parent b486dd4ccd
commit f813485bcd
2 changed files with 41 additions and 34 deletions

View File

@@ -7,30 +7,30 @@ import { onMounted,ref } from 'vue';
import utils from '@/assets/js/common'; import utils from '@/assets/js/common';
import { getUserInfo } from '@/api/common/index.js'; import { getUserInfo } from '@/api/common/index.js';
import { showFailToast } from 'vant'; import { showFailToast } from 'vant';
let contentShow = ref(false); const contentShow = ref(false);
onMounted(async() => { onMounted(async() => {
if (utils.getParameter('digitalYiliToken')) { if (utils.getParameter('digitalYiliToken')) {
const appToken = utils.getParameter('digitalYiliToken'); const appToken = utils.getParameter('digitalYiliToken');
getUserInfo(appToken).then((res) => { getUserInfo(appToken).then((res) => {
if (res.data) { if (res.data) {
contentShow = true; contentShow.value = true;
utils.setSessionStorage('userInfo', res.data.data); utils.setSessionStorage('userInfo', res.data.data);
} else { } else {
contentShow = false; contentShow.value = false;
showFailToast(error.response.data?.message || error.data?.message || error.message || '服务器错误'); showFailToast(error.response.data?.message || error.data?.message || error.message || '服务器错误');
} }
}).catch((error) => { }).catch((error) => {
contentShow = false; contentShow.value = false;
showFailToast(error.response.data?.message || error.message || '服务器错误'); showFailToast(error.response.data?.message || error.message || '服务器错误');
}); });
} else { } else {
contentShow = true contentShow.value = true;
} }
}); });
</script> </script>
<template> <template>
<div class="container" v-if="contentShow"> <div v-if="contentShow" class="container">
<create-survey /> <create-survey />
<!-- 最新问卷 --> <!-- 最新问卷 -->

View File

@@ -4,9 +4,11 @@
<van-cell-group inset style="margin-top: 20px; padding: 30px"> <van-cell-group inset style="margin-top: 20px; padding: 30px">
<div> <div>
<img width="100%" <img
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" />
@@ -18,14 +20,17 @@
<div>移动端仅做数据回收问卷数据分析请前往PC端浏览</div> <div>移动端仅做数据回收问卷数据分析请前往PC端浏览</div>
<div class="operation"> <div class="operation">
<span v-for="(item, index) in operateList" :key="index" @click="operateBtn(item)"> <span v-for="(item, index) in operateList" :key="index" @click="operateBtn(item)">
<img width="30px" <img
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u21.png?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333" /> width="30px"
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u21.png?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333"
/>
{{ item.title }} {{ item.title }}
</span> </span>
</div> </div>
</van-cell-group> </van-cell-group>
<!-- 底部功能性按钮 --> <!-- 底部功能性按钮 -->
<div style=" <div
style="
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: flex; display: flex;
@@ -35,7 +40,8 @@
width: 100%; width: 100%;
height: 50px; height: 50px;
background-color: white; background-color: white;
"> "
>
</div> </div>
</div> </div>
</template> </template>
@@ -48,22 +54,21 @@ import utils from '@/assets/js/common';
import appBridge from '@/assets/js/appBridge'; import appBridge from '@/assets/js/appBridge';
import { getQrcode } from '@/api/survey'; import { getQrcode } from '@/api/survey';
const route = useRoute(); const route = useRoute();
const surveyTitle = route.meta.title as string; const surveyTitle = route.meta.title as string;
appBridge.setTitle(surveyTitle) appBridge.setTitle(surveyTitle);
const operateList = reactive([ const operateList = reactive([
{ {
title: '复制链接', title: '复制链接',
type: 'copyLink', type: 'copyLink'
}, },
{ {
title: '转发到微信', title: '转发到微信',
type: 'shareLink', type: 'shareLink'
}, },
{ {
title: '下载二维码', title: '下载二维码',
type: 'qrCode', type: 'qrCode'
} }
]); ]);
@@ -170,6 +175,7 @@ function downLoadImg () {
.qrcode { .qrcode {
display: flex; display: flex;
margin: 10px 0; margin: 10px 0;
.tit{ .tit{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -190,6 +196,7 @@ function downLoadImg () {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
img{ img{
margin-bottom: 10px; margin-bottom: 10px;
} }