Files
dvcp_v2_wechat_app/src/project/fengdu/AppHome/openPage.vue

70 lines
1.4 KiB
Vue
Raw Normal View History

2023-03-17 11:25:54 +08:00
<template>
<div class="openPage">
2023-03-20 11:49:03 +08:00
<img class="images" :src="picUrl" alt="">
2023-03-17 11:25:54 +08:00
</div>
</template>
<script>
export default {
name: "openPage",
customNavigation: true,
data() {
return {
2023-03-20 11:49:03 +08:00
picUrl: '',
2023-03-21 09:03:59 +08:00
status: '',
2023-03-17 11:25:54 +08:00
}
},
methods: {
2023-03-21 09:03:59 +08:00
getStatus() {
2023-03-21 11:04:23 +08:00
this.$instance.post('/app/appwechatguidepage/enableStatus',null, { withoutToken: true }).then(res=> {
2023-03-21 09:03:59 +08:00
if(res?.data) {
this.status = res.data
if(this.status==0) {
uni.switchTab({
url: '/pages/AppHome/AppHome'
})
} else {
this.getList()
setTimeout(() => {
uni.switchTab({
url: '/pages/AppHome/AppHome'
})
2023-03-21 09:10:07 +08:00
}, 6000)
2023-03-21 09:03:59 +08:00
}
}
})
},
2023-03-20 11:49:03 +08:00
getList() {
this.$instance.post('/app/appwechatguidepage/listForXCX',null, {
2023-03-21 11:45:25 +08:00
withoutToken: true,
2023-03-20 11:49:03 +08:00
params: {
current: 1,
size: 100,
}
}).then(res=> {
if(res?.data) {
2023-03-21 09:03:59 +08:00
let nums = res.data.records.length
let index = Math.random() * nums.length
this.picUrl = nums[index].picUrl
2023-03-20 11:49:03 +08:00
}
})
}
2023-03-17 11:25:54 +08:00
},
2023-03-21 10:22:54 +08:00
onShow() {
2023-03-21 09:03:59 +08:00
this.getStatus()
2023-03-17 11:25:54 +08:00
},
}
</script>
<style scoped lang="scss">
.openPage {
width: 100%;
height: 100vh;
box-sizing: border-box;
.images {
width: 100%;
height: 100vh;
}
}
</style>