提交 bb45b7fd 作者: wk

授权登录图标处理

父级 516fc5f3
......@@ -3,7 +3,11 @@
<image src="../../../static/hbd-login-logo.png" class="logo-image"></image>
<view class="app-name">智慧工地一点通</view>
<image src="../../../static/loginimage-bg.png" class="image-bg"></image>
<button class="wx-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信一键登录</button>
<view class="wx-btn-content">
<button class="wx-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"></button>
<image src="../../../static/wechat-ic.png" class="wx-image" @click.passive></image>
<text class="wx-text">微信一键登录</text>
</view>
<view class="login-btn-content" @click="toAccountLogin">
<image src="../../../static/account-circle-ic.png" class="ac-image"></image>
<text class="text">账号密码登录</text>
......@@ -76,6 +80,7 @@
})
},
getPhoneNumber(e) {
console.log("获取手机号授权", e); //getPhoneNumber:fail user deny
Api.getWxPhone({
data: {
code: e.detail.code
......@@ -83,6 +88,10 @@
}).then((result) => {
console.log("获取手机号", result);
if (result.code == 0) {
if (result.data.errcode == 40029) {
this.$toast.showToast("获取手机号授权失败")
return
}
this.wxPhoneLogin(result.data.phoneNumber)
} else {
this.$toast.showToast(result.msg)
......@@ -150,23 +159,47 @@
height: 220px;
}
.wx-btn-content {
position: absolute;
top: 400px;
left: 24px;
.wx-btn {
width: 650rpx;
height: 48px;
background: #3B73FE;
padding-left: 24px;
border-radius: 24px;
}
.wx-image {
width: 48rpx;
top: 10px;
pointer-events: none;
left: 98px;
height: 48rpx;
position: absolute;
}
.wx-text {
top: 10px;
left: 129px;
pointer-events: none;
color: #FFFFFF;
font-size: 34rpx;
position: absolute;
}
}
.login-btn-content {
position: absolute;
top: 464px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 650rpx;
height: 48px;
margin-top: 16px;
border-radius: 24px;
background: #fff;
border: 1px solid #4972f5;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment