gy-app-shop/pages/index/enter.vue

79 lines
1.6 KiB
Vue

<style lang='scss' scoped>
.enter-ctn{
position: absolute;
left: 0;
top: 0;
/* bottom: 0;
right: 0; */
width: 100%;
height: 100%;
}
</style>
<template>
<view class="enter-ctn">
<!-- <u-image mode="scaleToFill" width="100%" height="100%" src="@/static/images/registerGuide-bg.jpg"></u-image>-->
</view>
</template>
<script>
export default {
data() {
return {}
},
onLoad(option) {
console.log("当前获取参数",option)
this.isHaveTokenFn()
},
methods: {
isHaveTokenFn:async function(){
let userToken = await uni.getStorageSync('userToken');
let userType = await uni.getStorageSync('userType');
console.log(userType,"userType");
if (!!userToken) {
// if(userType=="普通用户"){
// uni.reLaunch({
// url:"../oneselfUser/index"
// })
// } else{
uni.switchTab({
url:"../tabBar/home"
})
// }
}else{
// if(userType=="普通用户"){
// uni.reLaunch({
// url:"../oneselfUser/index"
// })
// } else
if(userType=="企业用户"){
uni.switchTab({
url:"../tabBar/home"
})
}else{
// uni.reLaunch({
// url:"../auth/registerGuide"
// })
uni.navigateTo({
url:"../auth/login?userType=company"
})
}
// uni.reLaunch({
// url:"./guidePage"
// })
// // #ifdef MP-WEIXIN
// uni.reLaunch({
// url:"../auth/userLogin"
// })
// // #endif
// // #ifndef MP-WEIXIN
// uni.reLaunch({
// url:"../auth/login"
// })
// // #endif
}
},
}
}
</script>