OnekeyLogin() {
var that = this
const univerifyManager = uni.getUniverifyManager()
univerifyManager.preLogin()
// 调用一键登录弹框
univerifyManager.login({
univerifyStyle: {
"fullScreen": true,
"textColor": "#ffffff",
"backgroundColor": "#ffffff",
"backgroundImage": "/static/img/logo-bg.png",
"authButton": {
"normalColor": "#FF3A3A",
"disabledColor": "#FF3A3A",
"highlightColor": "#FF3A3A"
},
"slogan": {
"color": "#ffffff" // slogan 字体颜色 默认值:#BBBBBB
},
"phoneNum": {
"color": "#ffffff" // 手机号文字颜色 默认值:#202020
},
"otherLoginButton": {
"borderColor": "#ffffff",
"textColor": "#ffffff",
"title": "切换账号密码登录", // 其他登录方式按钮文字 默认值:“其他登录方式”
},
"privacyTerms": {
"checkBoxSize": 20,
"textColor": "#ffffff",
"defaultCheckBoxState": false,
"privacyItems": [ // 自定义协议条款,最大支持2个,需要同时设置url和title. 否则不生效
{
"url": "", // 点击跳转的协议详情页面
"title": "用户协议" // 协议名称
},
{
"url": "", // 点击跳转的协议详情页面
"title": "隐私政策" // 协议名称
}
],
},
"buttons": {
"iconWidth": "45px",
"list": [{
"provider": "apple",
"iconPath": "/static/img/pg.png"
},
{
"provider": "weixin",
"iconPath": "/static/img/wx1.png"
}
]
}
},
success(res) {
that.phonelogin(res.authResult.access_token, res.authResult.openid)
},
fail(err) {
console.log(err)
if (err.code == 30002 || err.code == 30005) {
uni.closeAuthView()
uni.navigateTo({
url: ''
})
}
}
})
univerifyManager.onButtonsClick(function(btnres) {
uni.getCheckBoxState({
success(res) {
}
})
})
},