2022-03-14 09:09:10 +00:00
|
|
|
|
<template>
|
2022-03-16 11:40:58 +00:00
|
|
|
|
<view :style="{height: windowHeight+'px'}" style="overflow: hidden;">
|
2022-05-20 09:46:27 +00:00
|
|
|
|
<image :src="ad_img || '/static/public/icon-guide.png'" mode="widthFix" style="width: 100%;"></image>
|
2022-03-14 09:09:10 +00:00
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-05-20 09:46:27 +00:00
|
|
|
|
windowHeight:uni.getSystemInfoSync().windowHeight,
|
|
|
|
|
ad_img:''
|
2022-03-14 09:09:10 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.checkContext();
|
2022-05-20 09:46:27 +00:00
|
|
|
|
this.$requst.get('/universal/api.other/advertise').then(res=>{
|
|
|
|
|
if(res.code) {
|
|
|
|
|
this.ad_img = res.data.ad_img;
|
|
|
|
|
uni.setStorageSync('adImg',this.ad_img);
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-03-14 09:09:10 +00:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
checkContext(){
|
2022-05-13 09:39:50 +00:00
|
|
|
|
if(uni.getStorageSync('password')) {
|
|
|
|
|
// 是否登录过,登录过就直接刷新token重新登录
|
|
|
|
|
let params = {
|
|
|
|
|
login_type: 'account', // 登陆手机类型: mobile:手机登陆、account:账号密码登陆
|
|
|
|
|
phone: '', // 手机号码,login_type 为 mobile 时必填
|
|
|
|
|
password: uni.getStorageSync('password'), // 密码,login_type 为 account 时必填
|
|
|
|
|
sms_code: '', // 短信验证码,login_type 为 mobile 时必填
|
|
|
|
|
username: uni.getStorageSync('phone'), //账号,login_type 为 account 时必填
|
|
|
|
|
affiliation: uni.getStorageSync('unitName') // 单位名称
|
|
|
|
|
}
|
|
|
|
|
this.$requst.post('/universal/api.login/login',params).then(res=>{
|
|
|
|
|
if(res.code==1) {
|
|
|
|
|
// 缓存token和角色类型
|
|
|
|
|
uni.setStorageSync('token',res.data.token);
|
|
|
|
|
} else {
|
|
|
|
|
this.$toolAll.tools.showToast(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.goPage(1);
|
2022-04-29 11:00:02 +00:00
|
|
|
|
} else {
|
2022-05-13 09:39:50 +00:00
|
|
|
|
this.goPage(0);
|
2022-04-29 11:00:02 +00:00
|
|
|
|
}
|
2022-05-13 09:39:50 +00:00
|
|
|
|
},
|
|
|
|
|
// 跳转页面
|
|
|
|
|
goPage(index) {
|
|
|
|
|
let arr = [
|
|
|
|
|
'/pages/login/login',
|
|
|
|
|
'/pages/tabbar/pagehome/pagehome'
|
|
|
|
|
]
|
2022-05-20 09:46:27 +00:00
|
|
|
|
setTimeout(()=>{uni.reLaunch({url:arr[index]})},6000)
|
2022-03-14 09:09:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2022-03-22 10:15:22 +00:00
|
|
|
|
page{background-color: #FFFFFF;}
|
2022-03-14 09:09:10 +00:00
|
|
|
|
</style>
|