获取权限,随机播放引导页
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user