修改登录,添加密码登录,样式改版(无法发布,rapi还需要修改)

wechat_user_type
Ge Hao 8 years ago
parent ef4ea946fd
commit 36644f8eb3
  1. 10
      pages/mine/mine.js
  2. 35
      pages/mine/mine.wxml
  3. 30
      pages/mine/mine.wxss

@ -5,6 +5,7 @@ const profile = require('../../utils/profile.js')
Page({
data: {
needBindMobile: true,
useCodeToLogIn: true,
mobile: '',
userInfo: {
avatarUrl: '',
@ -88,6 +89,15 @@ Page({
profile.getCustomerInfo(data, this.infoCallback)
},
bindLoginPassword: function(e) {
var data = {mobile: e.detail.mobile, password: e.detail.password}
profile.getCustomerInfo(data, this.infoCallback)
},
changeLoginType: function(e) {
this.setData({useCodeToLogIn: !this.data.useCodeToLogIn})
},
bindLogout: function(e) {
var that = this
app.request({

@ -7,20 +7,31 @@
<view class="separate"></view>
<view wx:if="{{needBindMobile}}">
<view class="login-title">关联手机号</view>
<form bindsubmit="bindSubmitMobile">
<form bindsubmit="bindGetPassCode">
<view class="login">
<view class="first-line"><input type="digit" name="mobile" placeholder="输入手机号"></input></view>
<view class="second-line">
<input type="digit" name="code" placeholder="四位验证码"></input>
<button formType="submit" disabled="{{disableGetMobileCode}}">{{getCodeButtonText}}</button>
<view wx:if="{{useCodeToLogIn}}">
<view class="login-title">关联手机号</view>
<form bindsubmit="bindSubmitMobile">
<form bindsubmit="bindGetPassCode">
<view class="login">
<view class="first-line"><input type="digit" name="mobile" placeholder="输入手机号"></input></view>
<view class="second-line">
<input type="digit" name="code" placeholder="四位验证码"></input>
<button formType="submit" disabled="{{disableGetMobileCode}}">{{getCodeButtonText}}</button>
</view>
</view>
</view>
</form>
<view class="third-line"><button formType="submit" disabled="{{disableSubmitMobileCode}}">提交</button></view>
</form>
<view class="login-type" bindtap="changeLoginType"><text>使用密码登录</text></view>
</view>
<view class="login" wx:else>
<view class="login-title">使用密码登录</view>
<form bindsubmit="bindLoginPassword">
<view class="first-line"><input type="digit" name="mobile" placeholder="输入手机号"></input></view>
<view class="password-second-line"><input type="password" name="password" placeholder="密码"></input></view>
<view class="third-line"><button formType="submit">登录</button></view>
</form>
<view class="third-line"><button formType="submit" disabled="{{disableSubmitMobileCode}}">提交</button></view>
</form>
<view class="login-type" bindtap="changeLoginType"><text>使用手机验证码登录</text></view>
</view>
</view>
<view wx:else>
<view class="zichan">

@ -109,7 +109,7 @@
/* 绑定手机号的两个form */
.login-title {
margin: 20rpx 0 25rpx;
margin: 20rpx 0 35rpx;
text-align: center;
font-size: 30rpx;
}
@ -137,7 +137,7 @@
.login .second-line {
height: 80rpx;
display: flex;
width: 600rpx;
width: 602rpx;
margin-bottom: 50rpx;
}
@ -159,11 +159,25 @@
background-color: #FFC800;
}
.login .password-second-line {
height: 80rpx;
display: flex;
width: 600rpx;
margin-bottom: 50rpx;
}
.login .password-second-line input {
height: 80rpx;
width: 600rpx;
border: 1rpx solid rgb(217, 217, 217);
padding-left: 20rpx;
border-radius: 5px;
}
.third-line {
margin-left: auto;
margin-right: auto;
width: 600rpx;
margin-bottom: 20rpx;
}
.third-line button {
@ -171,6 +185,16 @@
font-size: 32rpx;
background-color: #FFC800;
}
.login-type {
width: 600rpx;
margin: 60rpx auto 0 auto;
padding: 20rpx 0 20rpx;
font-size: 32rpx;
text-align: right;
text-decoration: underline;
}
/*************/
.profile-button-container {

Loading…
Cancel
Save