|
|
|
@ -1,12 +1,6 @@ |
|
|
|
|
<template> |
|
|
|
|
<view> |
|
|
|
|
<u-popup |
|
|
|
|
:show="loginPopupShow" |
|
|
|
|
mode="bottom" |
|
|
|
|
:round="10" |
|
|
|
|
@close="closeLogin" |
|
|
|
|
zIndex="999998" |
|
|
|
|
> |
|
|
|
|
<u-popup :show="loginPopupShow" mode="bottom" :round="10" @close="closeLogin" zIndex="10071"> |
|
|
|
|
<view class="f__login"> |
|
|
|
|
<view class="loginLoading" v-if="isLoading"> |
|
|
|
|
<u-loadmore status="loading" loadingText="正在登录..."></u-loadmore> |
|
|
|
@ -16,21 +10,12 @@ |
|
|
|
|
<view class="loginButton" v-if="!isPhoneLogin"> |
|
|
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
|
|
<!-- <button class="button" @click="onAuthorization" :style="{background:PrimaryColor}">微信授权登录</button> --> |
|
|
|
|
<button |
|
|
|
|
class="button marginT" |
|
|
|
|
open-type="getPhoneNumber" |
|
|
|
|
@getphonenumber="decryptPhoneNumber" |
|
|
|
|
:style="{ background: PrimaryColor }" |
|
|
|
|
> |
|
|
|
|
微信手机号登录</button |
|
|
|
|
><!-- 此功能需微信认证 --> |
|
|
|
|
<button class="button marginT" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber" |
|
|
|
|
:style="{ background: PrimaryColor }"> |
|
|
|
|
微信手机号登录</button><!-- 此功能需微信认证 --> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
<button |
|
|
|
|
class="button" |
|
|
|
|
@click="closeLogin" |
|
|
|
|
style="background: #fff; margin-top: 24rpx" |
|
|
|
|
:style="{ border: '2rpx solid ' + PrimaryColor, color: PrimaryColor }" |
|
|
|
|
> |
|
|
|
|
<button class="button" @click="closeLogin" style="background: #fff; margin-top: 24rpx" |
|
|
|
|
:style="{ border: '2rpx solid ' + PrimaryColor, color: PrimaryColor }"> |
|
|
|
|
暂不登录 |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
@ -100,7 +85,7 @@ export default { |
|
|
|
|
//授权手机号登录 |
|
|
|
|
decryptPhoneNumber(e) { |
|
|
|
|
console.log(e, "授权手机号"); |
|
|
|
|
// store.commit("setLoadingShow", true); |
|
|
|
|
store.commit("setLoadingShow", true); |
|
|
|
|
var that = this; |
|
|
|
|
debugger |
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
@ -146,7 +131,6 @@ export default { |
|
|
|
|
// this.setUserInfo(userInfo) |
|
|
|
|
//生成token |
|
|
|
|
this.setUserInfo(userInfo); |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "登录成功", |
|
|
|
@ -155,8 +139,9 @@ export default { |
|
|
|
|
|
|
|
|
|
this.closeLogin(); |
|
|
|
|
}, 100); |
|
|
|
|
}).catch((err) => { |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
|
|
|
|
|
}).catch((err) => { |
|
|
|
|
this.closeLogin() |
|
|
|
|
|
|
|
|
|
// this.isPhoneLogin = true; |
|
|
|
@ -164,11 +149,12 @@ export default { |
|
|
|
|
title: err.msg, |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
fail: (error) => { |
|
|
|
|
// 授权失败请使用验证码登录 |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
this.closeLogin() |
|
|
|
|
|
|
|
|
|
// this.isPhoneLogin = true; |
|
|
|
@ -176,6 +162,8 @@ export default { |
|
|
|
|
title: "登陆失败,请重试", |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -185,24 +173,28 @@ export default { |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
this.closeLogin() |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
// 授权失败请使用验证码登录 |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
|
|
|
|
|
this.isPhoneLogin = true; |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "登录失败,请重试", |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "暂无法登录,请重试", |
|
|
|
|
title: "已拒绝", |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
this.closeLogin() |
|
|
|
|
store.commit("setLoadingShow", false); |
|
|
|
|
} |
|
|
|
|
// #endif |
|
|
|
|
}, |
|
|
|
|