提交 bb45b7fd 作者: wk

授权登录图标处理

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