feat:app嵌套h5
This commit is contained in:
@@ -7,30 +7,30 @@ import { onMounted,ref } from 'vue';
|
||||
import utils from '@/assets/js/common';
|
||||
import { getUserInfo } from '@/api/common/index.js';
|
||||
import { showFailToast } from 'vant';
|
||||
let contentShow = ref(false);
|
||||
const contentShow = ref(false);
|
||||
onMounted(async() => {
|
||||
if (utils.getParameter('digitalYiliToken')) {
|
||||
const appToken = utils.getParameter('digitalYiliToken');
|
||||
getUserInfo(appToken).then((res) => {
|
||||
if (res.data) {
|
||||
contentShow = true;
|
||||
contentShow.value = true;
|
||||
utils.setSessionStorage('userInfo', res.data.data);
|
||||
} else {
|
||||
contentShow = false;
|
||||
contentShow.value = false;
|
||||
showFailToast(error.response.data?.message || error.data?.message || error.message || '服务器错误');
|
||||
}
|
||||
}).catch((error) => {
|
||||
contentShow = false;
|
||||
contentShow.value = false;
|
||||
showFailToast(error.response.data?.message || error.message || '服务器错误');
|
||||
});
|
||||
} else {
|
||||
contentShow = true
|
||||
contentShow.value = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container" v-if="contentShow">
|
||||
<div v-if="contentShow" class="container">
|
||||
<create-survey />
|
||||
|
||||
<!-- 最新问卷 -->
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
|
||||
<van-cell-group inset style="margin-top: 20px; padding: 30px">
|
||||
<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"
|
||||
alt="" />
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div class="qrcode">
|
||||
<img :src="publishInfo.img_url" alt="" width="100px" height="100px" />
|
||||
@@ -18,14 +20,17 @@
|
||||
<div>移动端仅做数据回收,问卷数据分析请前往PC端浏览</div>
|
||||
<div class="operation">
|
||||
<span v-for="(item, index) in operateList" :key="index" @click="operateBtn(item)">
|
||||
<img 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" />
|
||||
<img
|
||||
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 }}
|
||||
</span>
|
||||
</div>
|
||||
</van-cell-group>
|
||||
<!-- 底部功能性按钮 -->
|
||||
<div style="
|
||||
<div
|
||||
style="
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
@@ -35,7 +40,8 @@
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background-color: white;
|
||||
">
|
||||
"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -48,22 +54,21 @@ import utils from '@/assets/js/common';
|
||||
import appBridge from '@/assets/js/appBridge';
|
||||
import { getQrcode } from '@/api/survey';
|
||||
|
||||
|
||||
const route = useRoute();
|
||||
const surveyTitle = route.meta.title as string;
|
||||
appBridge.setTitle(surveyTitle)
|
||||
appBridge.setTitle(surveyTitle);
|
||||
const operateList = reactive([
|
||||
{
|
||||
title: '复制链接',
|
||||
type: 'copyLink',
|
||||
type: 'copyLink'
|
||||
},
|
||||
{
|
||||
title: '转发到微信',
|
||||
type: 'shareLink',
|
||||
type: 'shareLink'
|
||||
},
|
||||
{
|
||||
title: '下载二维码',
|
||||
type: 'qrCode',
|
||||
type: 'qrCode'
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -170,6 +175,7 @@ function downLoadImg () {
|
||||
.qrcode {
|
||||
display: flex;
|
||||
margin: 10px 0;
|
||||
|
||||
.tit{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -190,6 +196,7 @@ function downLoadImg () {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
img{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user