获取权限,随机播放引导页

This commit is contained in:
shijingjing
2023-03-21 09:03:59 +08:00
parent 99e5cfea09
commit 97d9f8dab2

View File

@@ -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()
},
}
</script>