|
|
@@ -181,17 +181,13 @@ export default {
|
|
|
mobileLogin(){
|
|
|
let that = this
|
|
|
|
|
|
- // if(this.hasMobileNet == false){
|
|
|
- // that.$msg('请关闭wifi,打开流量,再登录')
|
|
|
- // return
|
|
|
- // }
|
|
|
|
|
|
if(this.agree == 0){
|
|
|
this.$msg('请同意并勾选服务协议和隐私政策')
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- //uni.showLoading({mask:true})
|
|
|
+ uni.showLoading({mask:true})
|
|
|
uni.preLogin({
|
|
|
provider: 'univerify',
|
|
|
success:()=>{
|
|
|
@@ -211,7 +207,7 @@ export default {
|
|
|
let access_token = res.authResult.access_token
|
|
|
phoneLogin({openid,access_token}).then(subRes=>{
|
|
|
let token = subRes.data.token || ''
|
|
|
- //uni.hideLoading()
|
|
|
+ uni.hideLoading()
|
|
|
if (that.$util.isEmpty(token)) {
|
|
|
that.$msg('请先注册')
|
|
|
return false
|
|
|
@@ -247,30 +243,29 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
fail(res){
|
|
|
- // 登录失败
|
|
|
+ uni.showToast({title:'登录失败', duration: 3000, icon:'none'})
|
|
|
//关闭一键登录弹出窗口
|
|
|
uni.closeAuthView()
|
|
|
console.log(res)
|
|
|
- setTimeout(function(){
|
|
|
- //uni.showToast({ title: '登录失败,请打开流量,关闭wifi,再登录', duration: 3000, icon:'none' })
|
|
|
- },1000)
|
|
|
},
|
|
|
complete: (res) => {
|
|
|
- console.log(res)
|
|
|
+ uni.hideLoading()
|
|
|
uni.closeAuthView()
|
|
|
- //uni.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail(res){
|
|
|
- // 预登录失败
|
|
|
- //如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭
|
|
|
- //都有可能造成预登录校验失败
|
|
|
- console.log(res)
|
|
|
+ //如果手机没有插入有效的sim卡,或者手机蜂窝数据网络关闭,都有可能造成预登录校验失败
|
|
|
if (res.code == 30005) {
|
|
|
- //that.$msg('登录失败,请打开流量,再登录')
|
|
|
- uni.showToast({title: '登录失败,请打开流量,或安装上手机卡', duration: 3000, icon:'none'})
|
|
|
+ uni.showToast({title: '登录失败,请打开移动流量', duration: 3000, icon:'none'})
|
|
|
+ } else if(res.code == 1000) {
|
|
|
+ uni.showToast({title: '即将开通', duration: 3000, icon:'none'})
|
|
|
+ } else if(res.code == 40004) {
|
|
|
+ uni.showToast({title: '即将开通...', duration: 3000, icon:'none'})
|
|
|
+ } else {
|
|
|
+ uni.showToast({title: '登录失败', duration: 3000, icon:'none'})
|
|
|
}
|
|
|
+ console.log(res)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -294,10 +289,10 @@ export default {
|
|
|
this.$msg('请输入密码')
|
|
|
return false
|
|
|
}
|
|
|
- //uni.showLoading({mask:true})
|
|
|
+ uni.showLoading({mask:true})
|
|
|
//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
|
|
|
appLogin({mobile,password}).then(subRes=>{
|
|
|
- //uni.hideLoading()
|
|
|
+ uni.hideLoading()
|
|
|
if(subRes.code == 1){
|
|
|
if (that.$util.isEmpty(subRes)) {
|
|
|
return false
|