From 97d9f8dab2efefc160e8eddfb26c8f33b2fb3f7e Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Tue, 21 Mar 2023 09:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9D=83=E9=99=90=EF=BC=8C?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=92=AD=E6=94=BE=E5=BC=95=E5=AF=BC=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/project/fengdu/AppHome/openPage.vue | 31 +++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) 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() }, }