Files
huangjingfen/pro_v3.5.1/view/uniapp_v2/pages/guide/index.vue
apple 8e17762510 feat(uniapp_v2): 二开功能迁移与小程序主包优化
- 从 uniapp 迁移 HJF 页面、API、组件及用户/订单相关改动
- queue、assets 使用独立分包以降低主包体积
- 修复首页单根节点与支付结果页 v-if 链
- 关闭 HjfDemoPanel 全局注册;uniNoticeBar 注释 $getAppWebview 避免 __webviewId__ 报错
- 配置域名与 manifest 应用名称;cache/store 防御性处理

Made-with: Cursor
2026-03-26 12:16:01 +08:00

73 lines
1.5 KiB
Vue

<template>
<view class="main">
<guide v-if="guidePages" :advData="advData"></guide>
</view>
</template>
<script>
import guide from '@/components/guide/index.vue'
import Cache from '@/utils/cache';
import {
getOpenAdv
} from '@/api/api.js'
export default {
components: {
guide
},
data() {
return {
guidePages: false,
advData: []
}
},
onShow() {
// #ifdef H5
if(this.$wechat.isWeixin()){
this.$wechat.wechat();
}
// #endif
this.loadExecution()
},
methods: {
loadExecution() {
const tagDate = uni.getStorageSync('guideDate') || 0,
nowDate = new Date().getTime();
if ((nowDate - tagDate) <= uni.getStorageSync('intervalTime')) {
uni.switchTab({
url: '/pages/index/index'
});
return
}
getOpenAdv().then(res => {
if (res.data.status == 0 || res.data.value.length == 0) {
uni.switchTab({
url: '/pages/index/index'
});
} else if (res.data.status && (res.data.value.length || res.data.video_link)) {
this.advData = res.data
let intervalTime = parseFloat(res.data.interval_time)*60*60*1000 || 0;
uni.setStorageSync('intervalTime', intervalTime);
uni.setStorageSync('guideDate', new Date().getTime());
this.guidePages = true
}
}).catch(err => {
uni.switchTab({
url: '/pages/index/index'
});
})
}
},
onHide() {
this.guidePages = false
}
}
</script>
<style>
page,
.main {
width: 100%;
height: 100%;
}
</style>