提交 83736345 编写于 作者: DCloud_iOS_WZT's avatar DCloud_iOS_WZT

Update univerify-custom-page.uvue

上级 37f185ff
...@@ -70,41 +70,49 @@ ...@@ -70,41 +70,49 @@
const loginButtonElement = this.$page.getElementById('login-button'); const loginButtonElement = this.$page.getElementById('login-button');
const privacyCheckBoxElement = this.$page.getElementById('privacy-checkbox'); const privacyCheckBoxElement = this.$page.getElementById('privacy-checkbox');
const privacyTextElement = this.$page.getElementById('privacy-text'); const privacyTextElement = this.$page.getElementById('privacy-text');
if(numberTextElement != null && sloganTextElement != null && loginButtonElement != null && privacyCheckBoxElement != null && privacyTextElement != null){
this.univerifyManager?.customLogin({ this.univerifyManager?.customLogin({
numberTextElement: numberTextElement!, numberTextElement: numberTextElement!,
sloganTextElement: sloganTextElement!, sloganTextElement: sloganTextElement!,
loginButtonElement: loginButtonElement!, loginButtonElement: loginButtonElement!,
privacyCheckBoxElement: privacyCheckBoxElement!, privacyCheckBoxElement: privacyCheckBoxElement!,
privacyTextElement: privacyTextElement!, privacyTextElement: privacyTextElement!,
success: (res) => { success: (res) => {
console.log(res); console.log(res);
this.takePhoneNumber(res.accessToken, res.openId); this.takePhoneNumber(res.accessToken, res.openId);
}, },
fail: (error) => { fail: (error) => {
if (error.errCode == 40001){ if (error.errCode == 40001){
uni.showToast({ uni.showToast({
title:"请同意服务条款", title:"请同意服务条款",
position: "bottom", position: "bottom",
duration:2000 duration:2000
}) })
}else if(error.errCode == 40002){ }else if(error.errCode == 40002){
uni.showToast({ uni.showToast({
title:"授权页不符合规范", title:"授权页不符合规范",
position: "bottom", position: "bottom",
duration:2000 duration:2000
}) })
}else{ }else{
const errorMsg = JSON.parseObject(error.cause?.cause?.message ?? "")?.getString("errorDesc") ?? error.errMsg; const errorMsg = JSON.parseObject(error.cause?.cause?.message ?? "")?.getString("errorDesc") ?? error.errMsg;
uni.showToast({ uni.showToast({
title:errorMsg, title:errorMsg,
position: "bottom", position: "bottom",
duration:2000 duration:2000
}) })
} }
} }
}) })
}else{
uni.showToast({
title:"元素不能为空",
position: "bottom",
duration:2000
})
}
}, },
takePhoneNumber(token : string, openId : string) { takePhoneNumber(token : string, openId : string) {
//云函数取号 //云函数取号
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册