diff --git a/src/project/fengdu/AppHome/openPage.vue b/src/project/fengdu/AppHome/openPage.vue index 877476e..3b947db 100644 --- a/src/project/fengdu/AppHome/openPage.vue +++ b/src/project/fengdu/AppHome/openPage.vue @@ -11,9 +11,29 @@ export default { data() { return { picUrl: '', + status: '', } }, methods: { + getStatus() { + this.$instance.post('/app/appwechatguidepage/enableStatus').then(res=> { + 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' + }) + }, 2000) + } + } + }) + }, getList() { this.$instance.post('/app/appwechatguidepage/listForXCX',null, { params: { @@ -22,18 +42,15 @@ export default { } }).then(res=> { if(res?.data) { - this.picUrl = res.data.records[0]?.picUrl + let nums = res.data.records.length + let index = Math.random() * nums.length + this.picUrl = nums[index].picUrl } }) } }, onLoad() { - this.getList() - setTimeout(()=> { - uni.switchTab({ - url: '/pages/AppHome/AppHome' - }) - }, 2000) + this.getStatus() }, }