Commit f9d816ec authored by linwenqing's avatar linwenqing

fix:授权手机

parent 1b04b30b
......@@ -27,9 +27,8 @@
</button>
</view>
<view @click.capture="getCode" v-else>
<button class="loginBtn" :class="{disable:isClickGetPhone}"
open-type="getPhoneNumber" throttle-time="1000"
@getphonenumber="signupLogin" :disabled="isClickGetPhone">
<button class="loginBtn" open-type="getPhoneNumber"
throttle-time="1000" @getphonenumber="signupLogin">
<text class="u-font-32 white">{{ bindTitle }}</text>
</button>
</view>
......@@ -51,7 +50,6 @@ export default {
bindPhone: '绑定手机',
bindTips: '首次登录的用户需绑定手机才可接单',
code: '',
isClickGetPhone: false,
}
},
computed: {
......@@ -76,8 +74,6 @@ export default {
return process.uniEnv.qn_base_url + src
},
async getCode() {
this.isClickGetPhone = true
this.inGetAuth()
login.appLogin().then(res => {
this.code = res.code
})
......@@ -104,6 +100,7 @@ export default {
}
},
fail: function (res) {
uni.hideLoading()
uni.showModal({
title: '授权失败',
content: '请允许获取用户信息的授权',
......@@ -112,6 +109,7 @@ export default {
}
})
} else {
uni.hideLoading()
// 可能由于账号配置,或者其他原因导致无法调起微信用户授权
uni.showModal({
title: '授权失败',
......@@ -152,7 +150,6 @@ export default {
});
},
signupLogin(e) {
this.inGetAuth()
var that = this
if(e && e.detail) {
if(e.detail.errMsg.indexOf('user deny') > -1) {
......@@ -169,6 +166,7 @@ export default {
iv: e.detail.iv,
}
if (that.code) {
that.inGetAuth()
uni.checkSession({
success () {
//session_key 未过期,并且在本生命周期一直有效
......@@ -176,7 +174,6 @@ export default {
that.inGetAuth()
login.signup(params).then(res => {
that.inGetAuth()
that.isClickGetPhone = false
if (res) {
login.setUserData(res.data, that)
app.track('signup_login', {mobile: res.data.mobile});
......@@ -194,7 +191,6 @@ export default {
that.setLoginStatus(false)
}
}).catch(res => {
that.isClickGetPhone = false
uni.hideLoading()
that.setLoginStatus(false)
})
......@@ -208,6 +204,7 @@ export default {
that.toLogin(params)
}
} else {
uni.hideLoading()
uni.showModal({
title: '提示',
showCancel: false,
......@@ -215,6 +212,7 @@ export default {
});
}
} else {
uni.hideLoading()
uni.showModal({
title: '提示',
showCancel: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment