|
@@ -27,7 +27,6 @@
|
|
color="#000"
|
|
color="#000"
|
|
shape="square"
|
|
shape="square"
|
|
:custom-style="btnStyle"
|
|
:custom-style="btnStyle"
|
|
- :loading="loading"
|
|
|
|
@click="handleLogin"
|
|
@click="handleLogin"
|
|
/>
|
|
/>
|
|
<view
|
|
<view
|
|
@@ -54,7 +53,6 @@ export default {
|
|
password: ''
|
|
password: ''
|
|
},
|
|
},
|
|
path: '/pages/index',
|
|
path: '/pages/index',
|
|
- loading: false,
|
|
|
|
inputStyle: {
|
|
inputStyle: {
|
|
borderRadius: 0,
|
|
borderRadius: 0,
|
|
borderColor: '#000 !important',
|
|
borderColor: '#000 !important',
|
|
@@ -84,26 +82,45 @@ export default {
|
|
this.$u.toast('请输入密码')
|
|
this.$u.toast('请输入密码')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.loading = true
|
|
|
|
|
|
+ this.$loading('登陆中...')
|
|
uni.login({
|
|
uni.login({
|
|
provider: uni.$u.platform,
|
|
provider: uni.$u.platform,
|
|
success: loginRes => {
|
|
success: loginRes => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
this.$api.user.login(this.model.account, this.model.password, loginRes.code).then(async res => {
|
|
this.$api.user.login(this.model.account, this.model.password, loginRes.code).then(async res => {
|
|
- this.loading = false
|
|
|
|
|
|
+ this.$hideLoading()
|
|
await this.$store.dispatch('user/token', res.data.token)
|
|
await this.$store.dispatch('user/token', res.data.token)
|
|
await this.$store.dispatch('user/info', res.data.user_info)
|
|
await this.$store.dispatch('user/info', res.data.user_info)
|
|
uni.reLaunch({
|
|
uni.reLaunch({
|
|
url: this.path.replace('//', '/')
|
|
url: this.path.replace('//', '/')
|
|
})
|
|
})
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- this.loading = false
|
|
|
|
|
|
+ this.$hideLoading()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getPhoneNumber(res) {
|
|
|
|
- console.log('-->data', res)
|
|
|
|
|
|
+ getPhoneNumber({ detail }) {
|
|
|
|
+ this.$loading('登陆中...')
|
|
|
|
+ uni.login({
|
|
|
|
+ provider: uni.$u.platform,
|
|
|
|
+ success: loginRes => {
|
|
|
|
+ const data = {
|
|
|
|
+ iv: detail.iv,
|
|
|
|
+ encryptedData: detail.encryptedData,
|
|
|
|
+ code: loginRes.code
|
|
|
|
+ }
|
|
|
|
+ this.$api.user.phoneQuickLogin(data).then(async res => {
|
|
|
|
+ await this.$store.dispatch('user/token', res.data.token)
|
|
|
|
+ await this.$store.dispatch('user/info', res.data.user_info)
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url: this.path.replace('//', '/')
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$hideLoading()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|