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

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() { data() {
return { return {
picUrl: '', picUrl: '',
status: '',
} }
}, },
methods: { 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() { getList() {
this.$instance.post('/app/appwechatguidepage/listForXCX',null, { this.$instance.post('/app/appwechatguidepage/listForXCX',null, {
params: { params: {
@@ -22,18 +42,15 @@ export default {
} }
}).then(res=> { }).then(res=> {
if(res?.data) { 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() { onLoad() {
this.getList() this.getStatus()
setTimeout(()=> {
uni.switchTab({
url: '/pages/AppHome/AppHome'
})
}, 2000)
}, },
} }
</script> </script>