You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
oa-base/App.vue

41 lines
666 B
Vue

<script>
export default {
methods:{
networkStatusChange(res){
if(res.isConnected){
uni.redirectTo({
url:'/pages/index/index'
})
}else{
uni.redirectTo({
url:'/pages/networko/index'
})
}
}
},
onLaunch: function() {
},
onShow: function() {
uni.getNetworkType({
success:(res)=> {
if(res.networkType==='none') {
uni.redirectTo({
url: '/pages/networko/index'
})
}
}
})
uni.onNetworkStatusChange(this.networkStatusChange);
},
onHide: function() {
uni.offNetworkStatusChange(this.networkStatusChange)
}
}
</script>
<style>
/*每个页面公共css */
</style>