优化
This commit is contained in:
@@ -34,8 +34,21 @@ const _sfc_main = {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 返回首页
|
||||
Return() {
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/Home/Home"
|
||||
});
|
||||
},
|
||||
// 获取手机号
|
||||
async getPhoneNumber(e) {
|
||||
if (e.detail.code == void 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "登录失败",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showLoading({
|
||||
title: "登录中...",
|
||||
mask: true
|
||||
@@ -94,7 +107,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: $data.userInfo.avatarUrl,
|
||||
b: common_vendor.t($data.userInfo.nickName),
|
||||
c: common_vendor.o$1((...args) => $options.getPhoneNumber && $options.getPhoneNumber(...args))
|
||||
c: common_vendor.o$1((...args) => $options.getPhoneNumber && $options.getPhoneNumber(...args)),
|
||||
d: common_vendor.o$1((...args) => $options.Return && $options.Return(...args))
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="container"><image class="logo" src="{{a}}"></image><view class="nickname">{{b}}</view><button class="login-btn" open-type="getPhoneNumber" bindgetphonenumber="{{c}}"> 使用微信登录 </button></view>
|
||||
<view class="container"><image class="logo" src="{{a}}"></image><view class="nickname">{{b}}</view><button class="login-btn" open-type="getPhoneNumber" bindgetphonenumber="{{c}}"> 使用微信登录 </button><view class="return" bindtap="{{d}}">返回首页</view></view>
|
||||
@@ -33,3 +33,11 @@
|
||||
font-size: 24rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
.return{
|
||||
margin-top: 30rpx;
|
||||
width: 300rpx;
|
||||
height: 100rpx;
|
||||
color: rgb(255, 255, 255);
|
||||
text-align: center;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user