测试
This commit is contained in:
+40
-25
@@ -16,9 +16,9 @@
|
||||
|
||||
<!-- 手机号显示 -->
|
||||
<!-- #ifdef APP -->
|
||||
<view class="phone-display">
|
||||
<!-- <view class="phone-display">
|
||||
<text class="phone-number">176****8628</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 登录按钮 -->
|
||||
<view class="login-button" @click="onOneClickLogin">
|
||||
@@ -129,15 +129,16 @@
|
||||
};
|
||||
// 一键登录
|
||||
const onOneClickLogin = () => {
|
||||
if (!isAgreed.value) {
|
||||
uni.showToast({
|
||||
title: '请先同意相关协议',
|
||||
icon: 'none'
|
||||
const res = checkUniverifyLogin()
|
||||
if(res){
|
||||
uni.redirectTo({
|
||||
url: '/pages/univerify/univerify'
|
||||
});
|
||||
}else{
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/smsLogin/smsLogin'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('一键登录');
|
||||
};
|
||||
|
||||
// 短信验证码登录
|
||||
@@ -320,11 +321,31 @@
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
const univerify = ref(1)
|
||||
// 页面加载
|
||||
onLoad(() => {
|
||||
console.log('登录页面加载完成');
|
||||
// #ifdef APP
|
||||
|
||||
onLoad((options) => {
|
||||
if(options.univerify){
|
||||
univerify.value = options.univerify // 已支持 App-Plus
|
||||
}
|
||||
})
|
||||
const res = checkUniverifyLogin()
|
||||
if(res){
|
||||
uni.redirectTo({
|
||||
url: '/pages/univerify/univerify'
|
||||
});
|
||||
}else{
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/smsLogin/smsLogin'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const checkUniverifyLogin=()=>{
|
||||
let res = false
|
||||
// #ifdef APP
|
||||
uni.getProvider({
|
||||
service: 'oauth',
|
||||
success: function (res) {
|
||||
@@ -334,33 +355,27 @@
|
||||
provider: 'univerify',
|
||||
success(){ //预登录成功
|
||||
// 显示一键登录选项
|
||||
uni.redirectTo({
|
||||
url: '/pages/univerify/univerify'
|
||||
});
|
||||
if(univerify.value == 1){
|
||||
return true
|
||||
}
|
||||
},
|
||||
fail(res){ // 预登录失败
|
||||
// 不显示一键登录选项(或置灰)
|
||||
// 根据错误信息判断失败原因,如有需要可将错误提交给统计服务器
|
||||
console.log(res.errCode)
|
||||
console.log(res.errMsg)
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/smsLogin/smsLogin'
|
||||
});
|
||||
return false
|
||||
}
|
||||
})
|
||||
}else{
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/smsLogin/smsLogin'
|
||||
});
|
||||
return false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// #endif
|
||||
});
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// 页面显示
|
||||
onShow(() => {
|
||||
// #ifdef APP
|
||||
|
||||
Reference in New Issue
Block a user