百度小程序手机号码登录
parent
dd1fc7bd54
commit
80f015d899
|
|
@ -25,6 +25,20 @@
|
|||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_user_is_onekey_bind_mobile.name}}<span class="am-form-group-label-tips">{{$data.common_user_is_onekey_bind_mobile.describe}}</span></label>
|
||||
<select name="{{$data.common_user_is_onekey_bind_mobile.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_user_is_onekey_bind_mobile.error_tips}}" required>
|
||||
{{foreach $common_is_text_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['common_user_is_onekey_bind_mobile']['value']) and $data['common_user_is_onekey_bind_mobile']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
<div class="am-alert am-alert-warning" data-am-alert>
|
||||
<button type="button" class="am-close">×</button>
|
||||
<p>1. 获取当前小程序平台账户或者本本机的手机号码一键登录绑定</p>
|
||||
<p>2. 无需用户输入手机号码进行验证绑定</p>
|
||||
<p>3. 依赖需要开启《强制绑定手机》有效</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_app_is_enable_search.name}}<span class="am-form-group-label-tips">{{$data.common_app_is_enable_search.describe}}</span></label>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ class BaseService
|
|||
'common_app_customer_service_tel' => MyC('common_app_customer_service_tel', null, true),
|
||||
'common_order_is_booking' => (int) MyC('common_order_is_booking'),
|
||||
'common_is_exhibition_mode_btn_text'=> MyC('common_is_exhibition_mode_btn_text', '立即咨询', true),
|
||||
'common_user_is_mandatory_bind_mobile'=> (int) MyC('common_user_is_mandatory_bind_mobile', 0),
|
||||
'common_user_is_onekey_bind_mobile' => (int) MyC('common_user_is_onekey_bind_mobile', 0),
|
||||
|
||||
// 用户中心相关
|
||||
'common_user_center_notice' => MyC('common_user_center_notice', null, true),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ page{
|
|||
height: 100vh;
|
||||
}
|
||||
.content {
|
||||
padding: 30% 40rpx 0 40rpx;
|
||||
padding: 25% 40rpx 0 40rpx;
|
||||
}
|
||||
.content .mobile{
|
||||
width: 100%;
|
||||
|
|
@ -65,14 +65,18 @@ page{
|
|||
/**
|
||||
* 登录确认
|
||||
*/
|
||||
.login-logo {
|
||||
.confirm-container .login-logo {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.submit-list {
|
||||
.confirm-container .nickname {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.confirm-container .submit-list {
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
.submit-list button:not(:last-child) {
|
||||
.confirm-container .submit-list button:not(:last-child) {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
|
@ -10,22 +10,38 @@ Page({
|
|||
form_submit_loading: false,
|
||||
verify_time_total: 60,
|
||||
temp_clear_time: null,
|
||||
// 0确认页面, 1验证码绑定, 2一键获取绑定
|
||||
login_status: 2,
|
||||
|
||||
// 基础配置
|
||||
// 0 确认绑定方式, 1 验证码绑定
|
||||
login_type_status: 0,
|
||||
common_user_is_onekey_bind_mobile: 0,
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面加载初始化
|
||||
*/
|
||||
// 页面加载初始化
|
||||
onLoad(option) {
|
||||
// 设置用户信息
|
||||
this.setData({
|
||||
params: option,
|
||||
user: app.get_user_cache_info() || null
|
||||
user: app.get_user_cache_info() || null,
|
||||
});
|
||||
},
|
||||
|
||||
// 标题设置
|
||||
// 页面显示
|
||||
onShow() {
|
||||
swan.setNavigationBarTitle({ title: this.data.user == null ? '授权用户信息' : '手机绑定' });
|
||||
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if((status || false) == true) {
|
||||
this.setData({
|
||||
common_user_is_onekey_bind_mobile: app.get_config('config.common_user_is_onekey_bind_mobile'),
|
||||
});
|
||||
} else {
|
||||
app.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -234,7 +250,7 @@ Page({
|
|||
|
||||
// 确认使用验证码
|
||||
confirm_verify_event(e) {
|
||||
this.setData({login_status: 1});
|
||||
this.setData({login_type_status: 1});
|
||||
},
|
||||
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<view s-if="user != null" class="content">
|
||||
<!-- 表单验证码 -->
|
||||
<form s-if="login_status == 1" bindsubmit="formSubmit">
|
||||
<form s-if="login_type_status == 1" bindsubmit="formSubmit">
|
||||
<input type="number" placeholder="输入手机号码" maxlength="11" name="mobile" bindinput="bind_key_input" class="mobile" />
|
||||
<view class="code clearfix">
|
||||
<input type="number" placeholder="验证码" maxlength="4" name="verify" class="verify" />
|
||||
|
|
@ -10,10 +10,11 @@
|
|||
</form>
|
||||
|
||||
<!-- 确认授权方式 -->
|
||||
<view s-if="login_status == 2" class="tc">
|
||||
<image class="login-logo" src="/images/user-nav-customer-service-icon.png" mode="widthFix" />
|
||||
<view s-if="login_type_status == 0" class="tc confirm-container">
|
||||
<image class="login-logo" src="{{(user.avatar || null) == null ? '/images/default-user.png' : user.avatar}}" mode="widthFix" />
|
||||
<view s-if="{{(user.nickname || null) != null}}" class="cr-666 nickname">{{user.nickname}}</view>
|
||||
<view class="submit-list">
|
||||
<button type="warn" class="mobile-submit" open-type="getPhoneNumber" bindgetphonenumber="confirm_phone_number_event">获取手机号码一键登录</button>
|
||||
<button s-if="{{common_user_is_onekey_bind_mobile == 1}}" type="warn" class="mobile-submit" open-type="getPhoneNumber" bindgetphonenumber="confirm_phone_number_event">获取手机号码一键登录</button>
|
||||
<button type="warn" class="mobile-submit" plain="{{true}}" bindtap="confirm_verify_event">验证码登录</button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
Loading…
Reference in New Issue