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

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

@ -5,6 +5,7 @@ const profile = require('../../utils/profile.js')
Page({ Page({
data: { data: {
needBindMobile: true, needBindMobile: true,
useCodeToLogIn: true,
mobile: '', mobile: '',
userInfo: { userInfo: {
avatarUrl: '', avatarUrl: '',
@ -88,6 +89,15 @@ Page({
profile.getCustomerInfo(data, this.infoCallback) 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) { bindLogout: function(e) {
var that = this var that = this
app.request({ app.request({

@ -7,8 +7,8 @@
<view class="separate"></view> <view class="separate"></view>
<view wx:if="{{needBindMobile}}"> <view wx:if="{{needBindMobile}}">
<view wx:if="{{useCodeToLogIn}}">
<view class="login-title">关联手机号</view> <view class="login-title">关联手机号</view>
<form bindsubmit="bindSubmitMobile"> <form bindsubmit="bindSubmitMobile">
<form bindsubmit="bindGetPassCode"> <form bindsubmit="bindGetPassCode">
<view class="login"> <view class="login">
@ -21,6 +21,17 @@
</form> </form>
<view class="third-line"><button formType="submit" disabled="{{disableSubmitMobileCode}}">提交</button></view> <view class="third-line"><button formType="submit" disabled="{{disableSubmitMobileCode}}">提交</button></view>
</form> </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="login-type" bindtap="changeLoginType"><text>使用手机验证码登录</text></view>
</view>
</view> </view>
<view wx:else> <view wx:else>
<view class="zichan"> <view class="zichan">

@ -109,7 +109,7 @@
/* 绑定手机号的两个form */ /* 绑定手机号的两个form */
.login-title { .login-title {
margin: 20rpx 0 25rpx; margin: 20rpx 0 35rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
} }
@ -137,7 +137,7 @@
.login .second-line { .login .second-line {
height: 80rpx; height: 80rpx;
display: flex; display: flex;
width: 600rpx; width: 602rpx;
margin-bottom: 50rpx; margin-bottom: 50rpx;
} }
@ -159,11 +159,25 @@
background-color: #FFC800; 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 { .third-line {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
width: 600rpx; width: 600rpx;
margin-bottom: 20rpx;
} }
.third-line button { .third-line button {
@ -171,6 +185,16 @@
font-size: 32rpx; font-size: 32rpx;
background-color: #FFC800; 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 { .profile-button-container {

Loading…
Cancel
Save