Selaa lähdekoodia

手机验证登录信息修改

lucheng 1 vuosi sitten
vanhempi
commit
a49b52a9ec
49 muutettua tiedostoa jossa 3412 lisäystä ja 374 poistoa
  1. 8 2
      app.json
  2. 311 0
      pages/bindPhone/bindPhone.js
  3. 4 0
      pages/bindPhone/bindPhone.json
  4. 23 0
      pages/bindPhone/bindPhone.wxml
  5. 174 0
      pages/bindPhone/bindPhone.wxss
  6. 8 0
      pages/chargemoney/chargemoney.js
  7. 1 1
      pages/chargemoneyresult/chargemoneyresult.js
  8. 148 50
      pages/forget/forget.js
  9. 12 2
      pages/forget/forget.wxml
  10. 39 0
      pages/forget/forget.wxss
  11. 3 3
      pages/index/index.js
  12. 330 0
      pages/login/phone_login/phone_login.js
  13. 0 0
      pages/login/phone_login/phone_login.json
  14. 32 0
      pages/login/phone_login/phone_login.wxml
  15. 252 0
      pages/login/phone_login/phone_login.wxss
  16. 20 3
      pages/login/username_login/username_login.js
  17. 5 0
      pages/login/username_login/username_login.json
  18. 9 4
      pages/login/username_login/username_login.wxml
  19. 200 178
      pages/login/username_login/username_login.wxss
  20. 1 1
      pages/outmoney/outmoney.js
  21. 1 1
      pages/register/register.js
  22. 5 10
      pages/reset_password/reset_password.js
  23. 5 6
      pages/reset_password/reset_password.wxml
  24. 59 12
      pages/reset_password/reset_password.wxss
  25. 9 1
      pages/scan_result/scan_result.js
  26. 268 0
      pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.js
  27. 3 0
      pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.json
  28. 25 0
      pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.wxml
  29. 181 0
      pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.wxss
  30. 99 0
      pages/ucenter/accountsecurity/index/index.js
  31. 3 0
      pages/ucenter/accountsecurity/index/index.json
  32. 22 0
      pages/ucenter/accountsecurity/index/index.wxml
  33. 67 0
      pages/ucenter/accountsecurity/index/index.wxss
  34. 163 0
      pages/ucenter/accountsecurity/mdfpassword/mdfpassword.js
  35. 3 0
      pages/ucenter/accountsecurity/mdfpassword/mdfpassword.json
  36. 22 0
      pages/ucenter/accountsecurity/mdfpassword/mdfpassword.wxml
  37. 168 0
      pages/ucenter/accountsecurity/mdfpassword/mdfpassword.wxss
  38. 313 0
      pages/ucenter/accountsecurity/unbindphone/unbindphone.js
  39. 3 0
      pages/ucenter/accountsecurity/unbindphone/unbindphone.json
  40. 25 0
      pages/ucenter/accountsecurity/unbindphone/unbindphone.wxml
  41. 174 0
      pages/ucenter/accountsecurity/unbindphone/unbindphone.wxss
  42. 119 69
      pages/ucenter/center/center.js
  43. 21 13
      pages/ucenter/center/center.wxml
  44. 19 6
      pages/ucenter/center/center.wxss
  45. 18 5
      pages/ucenter/index/index.js
  46. 11 0
      pages/ucenter/index/index.wxml
  47. 14 5
      pages/ucenter/purse/purse.js
  48. 7 1
      project.config.json
  49. 5 1
      project.private.config.json

+ 8 - 2
app.json

@@ -15,7 +15,8 @@
     "pages/scan_result/scan_result",
     "pages/charging/charging",
     "pages/chargemoney/chargemoney",
-    "pages/login/login",
+    "pages/login/phone_login/phone_login",
+    "pages/login/username_login/username_login",
     "pages/register/register",
     "pages/order/order",
     "pages/ucenter/mychargestation/mychargestation",
@@ -34,7 +35,12 @@
     "pages/ucenter/chargpilemonitor/chargpilemonitorsearch",
     "pages/chargemoneyresult/chargemoneyresult",
     "pages/ucenter/help/help",
-    "pages/worksheetinfo/findstation"
+    "pages/worksheetinfo/findstation",
+    "pages/bindPhone/bindPhone",
+    "pages/ucenter/accountsecurity/index/index",
+    "pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity",
+    "pages/ucenter/accountsecurity/mdfpassword/mdfpassword",
+    "pages/ucenter/accountsecurity/unbindphone/unbindphone"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 311 - 0
pages/bindPhone/bindPhone.js

@@ -0,0 +1,311 @@
+// pages/bindphone/bindPhone.js
+Page({
+  /**
+   * 组件的初始数据
+   */
+  data: {
+      userInfo: {},
+      isLogin: false,
+      phone: null,
+      errorMsg: '',
+      vcodeFlag: true,
+      vcodeTimeOut: 0,
+      vcodeTimeOutDefault: 0,
+      scene: "LN_PHONE",
+      vcodeLen:2,
+      vcodeInterval:null,
+      vcode_button_text:'获取验证码',
+      servicetel: '4009608068'
+  },
+
+  onError(e) {
+    wx.showModal({
+      title: '温馨提示',
+      content: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话4009608068,接听时段08:30-17:00。',
+      showCancel: false
+    });
+  },
+
+  inputPhone(e) {
+    this.setData({
+      phone: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  inputVerificatrCode(e) {
+    this.setData({
+      vcode: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  checkAll() {
+    if (!this.checkPhoneNumber()) {
+      this.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkPhone: false,
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        checkPhone: true,
+        errorMsg: ''
+      });
+    }
+
+    if (!this.checkVcode()) {
+      this.setData({
+        errorMsg: '验证码格式不正确'
+      });
+      this.setData({
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        errorMsg: ''
+      });
+    }
+
+    if (this.data.phone && this.data.vcode) {
+      this.setData({
+        checkCode: true
+      });
+    } else {
+      this.setData({
+        checkCode: false
+      });
+    }
+  },
+
+  checkPhoneNumber() {
+    if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
+      return false;
+    }
+    return true;
+  },
+
+  checkVcode() {
+    if (this.data.vcode==undefined || this.data.vcode=="") {
+      return false;
+    }
+    if(this.data.vcode.length==this.data.vcodeLen){
+      return true;
+    }
+    return false;
+  },
+
+  getVerificateCode(){
+    let vcodeFlag = this.data.vcodeFlag;
+    let checkPhone = this.data.checkPhone;
+    let phone = this.data.phone;
+    let that = this;
+
+    if (!vcodeFlag) {
+      return;
+    }
+
+    if (!checkPhone) {
+      that.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkCode: false
+      });
+      return;
+    } else {
+      that.setData({
+        errorMsg: ''
+      });
+    }
+
+    this.setData({
+      vcodeTimeOut:this.data.vcodeTimeOutDefault
+    })
+
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeUnique',
+      data: {
+        scene: that.data.scene,
+        terminal: phone,
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+          wx.showModal({
+            title: '提示',
+            content:res.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+        }else if (res.data.code == 2) {
+          // 跳转
+          wx.showModal({
+            title: '提示',
+            content: '手机已绑定账户,请检查手机号是否填写正确或联系客服',
+            showCancel:false,
+          });
+        }else if (res.data.code == 200) {
+          wx.showToast({
+            title: '验证码已发送',
+            icon: 'success',
+            duration: 1000 //持续的时间
+          })
+          let vcodeInterval = setInterval(function () {
+            if (that.data.vcodeTimeOut <= 0) {
+              that.setData({
+                vcodeFlag: true,
+                vcode_button_text: '获取验证码'
+              })
+              clearInterval(vcodeInterval);
+            }else{
+              let str = '获取验证码'+'(' + that.data.vcodeTimeOut + 's)'
+              that.setData({
+                vcodeTimeOut:that.data.vcodeTimeOut-1,
+                vcodeFlag: false,
+                vcode_button_text: str
+              })
+            }
+          }, 1000);
+        }
+      }
+    });
+
+  },
+
+  bindPhone(e) {
+    let that = this;
+    let loginName = this.data.userInfo.loginName;
+    let { phone, vcode } = this.data;
+    log.info('[绑定手机]', '[绑定手机]', '[请求]', { phone, vcode });
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/bindPhone',
+      data: {
+        loginName,
+        phonenumber: phone,
+        vcode
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+           that.setData({
+             vcode: null,
+           });
+          wx.showModal({
+            title: '提示',
+            content:res.data.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+          log.info('[绑定手机号]', '[绑定手机号]', '[失败code==1]', res.data);
+        } else {
+          //跳转到上一页
+          log.info('[绑定手机号]', '[绑定手机号]', '[成功返回上一个界面]', res.data);
+          wx.navigateBack();
+        }
+      },
+      fail(e){
+        getApp().showNetworkError();
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    // 页面显示
+    if (userInfo && isLogin) {
+      this.setData({
+        userInfo: userInfo,
+        isLogin: isLogin
+      });
+      if ((!userInfo.userId && userInfo.userId != 0)){
+        log.info('[首页]', '[已登陆未有用户ID跳转登录界面]');
+        let url = `/pages/login/phone_login/phone_login`;
+        wx.navigateTo({
+          url
+        });
+        return;
+      }
+    } else {
+      //未登录信息
+      this.setData({
+        userInfo: {}
+      });
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+
+    let scene = this.data.scene;
+    let that = this
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
+      data: {
+        scene,
+      },
+      method: 'POST',
+      success(res) {
+        that.setData({
+          vcodeInfo:false,
+          vcodeTimeOut:res.data.result.expire,
+          vcodeTimeOutDefault:res.data.result.expire,
+          vcodeLen:res.data.result.len
+        })
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/bindPhone/bindPhone.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "绑定手机"
+}

+ 23 - 0
pages/bindPhone/bindPhone.wxml

@@ -0,0 +1,23 @@
+<view class='main'>
+  <image class='main_image' src='/images/login.png'></image>
+  <view class='context'>
+    <view class='context_input'>
+      <view class='input_view'>
+        <image class='phone_img' src='/images/phone.png'></image><div class="line"></div>
+        <input placeholder='请输手机号' maxlength='11' bindinput='inputPhone' type='number' placeholder-class='placeholder'></input>
+      </view>  
+
+      <view class='input_view'>
+        <image class='phone_img' src='/images/vcode.png'></image><div class="line"></div>
+        <input placeholder='请输入验证码' bindinput='inputVerificatrCode' type='number' placeholder-class='placeholder'></input>
+        <view bindtap='{{vcodeFlag?"getVerificateCode":""}}' class='varification_button {{vcodeFlag?"getCode":"getCode_disable"}}'>{{vcode_button_text}}</view>
+      </view>  
+    </view>
+     <view class="errorMsg"><text>{{errorMsg}}</text></view>
+    
+    <button class='{{checkCode?"confirm_button":"confirm_button_disable"}}' bindtap="{{checkCode?'bindPhone':''}}">
+      确认
+    </button>
+
+  </view>
+</view>

+ 174 - 0
pages/bindPhone/bindPhone.wxss

@@ -0,0 +1,174 @@
+/* pages/reset_password/reset_password.wxss */
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+}
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 20rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  margin-top:20rpx;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+.context_input {
+  margin-top: 70rpx;
+  margin-right: 60rpx;
+  margin-left: 60rpx;
+  margin-bottom: 20rpx;
+}
+
+.input_view .line{height:43rpx;width:2rpx;background:#999999;display: inline-block;margin:20rpx 0}
+.context_input input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 32rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context_input .placeholder {
+  color: #999999;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.input_view{
+  box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 20rpx 0rpx;
+  height: 88rpx;
+  position: relative;
+}
+.errorMsg{
+  height: 28rpx;
+  margin: -20rpx 30rpx 0rpx 30rpx;
+  font-size: 28rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: red;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.phone_img {
+  width: 31rpx;
+  height: 30rpx;
+  margin: 29rpx 0rpx 29rpx 30rpx;
+  padding-right:29rpx;
+}
+
+.confirm_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 60rpx 135rpx 0 135rpx;
+}
+.confirm_button_disable{
+   width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 60rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+
+.varification_button {
+  display: inline-block;
+  position: absolute;
+  margin-top: 15rpx;
+  padding: 0 15rpx;
+  right: 45rpx;
+  z-index:999;
+  height: 60rpx;
+  border-radius: 8rpx;
+  color:rgba(255, 255, 255, 1);
+  line-height:60rpx;
+  text-align:center;
+  font-size:24rpx;
+  font-family: 'Lucida Sans',
+    'Lucida Sans Regular',
+    'Lucida Grande',
+    'Lucida Sans Unicode',
+    Geneva,
+    Verdana,
+    sans-serif;
+ }
+
+ .getCode {
+  background:#00AADD;
+ }
+ .getCode_disable {
+  background-color: #c9c9c9;
+ }

+ 8 - 0
pages/chargemoney/chargemoney.js

@@ -162,6 +162,14 @@ Page({
     log.info('[充值]', '[页面加载完成]');
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
+    let isBindPhone = wx.getStorageSync('isBindPhone');
+    if(isBindPhone==0){
+      let url = `/pages/bindPhone/bindPhone`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
 
     // 页面显示
     if (userInfo && isLogin) {

+ 1 - 1
pages/chargemoneyresult/chargemoneyresult.js

@@ -55,7 +55,7 @@ Page({
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
-          let url = '/pages/login/login';
+          let url = '/pages/login/phone_login/phone_login';
           wx.redirectTo({
             url,
           });

+ 148 - 50
pages/forget/forget.js

@@ -5,34 +5,40 @@ Page({
    * 页面的初始数据
    */
   data: {
-    userName: null,
+    // userName: null,
+    // email: null,
+    // checkPass: false,
     phone: null,
-    email: null,
-    checkPass: false,
+    vcode: null,
+    checkCode: false,
+    checkPhone: false,
+    vcodeFlag: true,
+    errorMsg: '',
+    varificatCodeFocus:false,
+    vcode_button_text: '获取验证码',
+    scene: "FORGET_PWD",
+    vcodeTimeOut: 0,
+    vcodeTimeOutDefault: 0,
+    vcodeLen: 2,
     errorMsg: ''
   },
   goNext(e){
     let that = this;
-    let {
-      userName: loginName,
-      phone,
-      email
-    } = this.data;
+    let { phone, vcode } = this.data;
+    //跳转到下一步
+    let url = `/pages/reset_password/reset_password?phone=`+phone;
+    wx.redirectTo({
+      url
+    });
     wx.request({
       url: getApp().globalData.postHeadAgreement + '/restapi/wechat/forget',
       data: {
-        loginName,
         phonenumber: phone,
-        email
+        vcode
       },
       method: 'POST',
       success(res) {
-        //console.log(res);
-        //console.log(res.data.code == 1);
         if (res.data.code == 1) {
-          // that.setData({
-          //   errorMsg: res.data.msg
-          // });
           wx.showModal({
             title: '提示',
             content: res.data.msg,
@@ -41,7 +47,7 @@ Page({
           });1
         } else {
           //跳转到下一步
-          let url = `/pages/reset_password/reset_password?loginName=${loginName}`;
+          let url = `/pages/reset_password/reset_password?phone=`+phone;
           wx.redirectTo({
             url
           });
@@ -49,56 +55,42 @@ Page({
       }
     });
   },
-  inputAccount(e) {
-    this.setData({
-      userName: e.detail.value
-    });
-    this.checkAll();
-  },
+  
   inputPhone(e) {
     this.setData({
       phone: e.detail.value
     });
     this.checkAll();
   },
-  inputEmail(e) {
+
+  inputVerificatrCode(e) {
     this.setData({
-      email: e.detail.value
+      vcode: e.detail.value
     });
     this.checkAll();
   },
-  checkPhone() {
-    if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
-      return false;
-    }
-    return true;
-  },
-  checkMail() {
-    if (!(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.email))) {
-      return false;
-    }
-    return true;
-  },
+
   checkAll() {
-    if (!this.data.userName || !this.data.userName.replace(/(^\s*)|(\s*$)/g, "")) {
+    if (!this.checkPhoneNumber()) {
       this.setData({
-        errorMsg: '账号不能为空'
-      });
-      this.setData({
-        checkPass: false
+        errorMsg: '手机号输入有误,请重新输入',
+        checkPhone: false,
+        checkCode: false
       });
       return;
     } else {
       this.setData({
+        checkPhone: true,
         errorMsg: ''
       });
     }
-    if (!this.checkPhone()) {
+
+    if (!this.checkVcode()) {
       this.setData({
-        errorMsg: '手机号输入有误,请重新输入'
+        errorMsg: '验证码格式不正确'
       });
       this.setData({
-        checkPass: false
+        checkCode: false
       });
       return;
     } else {
@@ -106,28 +98,134 @@ Page({
         errorMsg: ''
       });
     }
-    if (!this.checkMail()) {
+
+    if (this.data.phone && this.data.vcode) {
       this.setData({
-        errorMsg: '邮箱输入有误,请重新输入'
+        checkCode: true
       });
+    } else {
       this.setData({
-        checkPass: false
+        checkCode: false
+      });
+    }
+  },
+
+  checkPhoneNumber() {
+    if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
+      return false;
+    }
+    return true;
+  },
+
+  checkVcode() {
+    if (this.data.vcode==undefined || this.data.vcode=="") {
+      return false;
+    }
+    if(this.data.vcode.length==this.data.vcodeLen){
+      return true;
+    }
+    return false;
+  },
+
+  getVerificateCode(){
+    let vcodeFlag = this.data.vcodeFlag;
+    let checkPhone = this.data.checkPhone;
+    let phone = this.data.phone;
+    let that = this;
+
+    if (!vcodeFlag) {
+      return;
+    }
+    if (!checkPhone) {
+      that.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkCode: false
       });
       return;
     } else {
-      this.setData({
+      that.setData({
         errorMsg: ''
       });
     }
     this.setData({
-      checkPass: true
+      vcodeTimeOut:this.data.vcodeTimeOutDefault
+    })
+
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeNoUnique',
+      data: {
+        scene: that.data.scene,
+        terminal: phone,
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+          wx.showModal({
+            title: '提示',
+            content:res.data.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+        }else if (res.data.code == 2) {
+          // 跳转
+          wx.showModal({
+            title: '提示',
+            content: '手机号未绑定账户。若您已注册,请检查手机号是否填写正确或联系客服',
+            showCancel:false,
+            confirmText: '确认',
+            confirmColor:'#36a9a6',
+            success: function (res1) {
+            }
+          });
+        }else if (res.data.code == 200) {
+          wx.showToast({
+            title: '验证码已发送',
+            icon: 'success',
+            duration: 1000 //持续的时间
+          })
+          let vcodeInterval = setInterval(function () {
+            if (that.data.vcodeTimeOut <= 0) {
+              that.setData({
+                vcodeFlag: true,
+                vcode_button_text: '获取验证码'
+              })
+              clearInterval(vcodeInterval);
+            }else{
+              let str = '获取验证码'+'(' + that.data.vcodeTimeOut + 's)'
+              that.setData({
+                vcodeTimeOut:that.data.vcodeTimeOut-1,
+                vcodeFlag: false,
+                vcode_button_text: str
+              })
+            }
+          }, 1000);
+        }
+      }
     });
+
   },
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
-
+    let scene = this.data.scene;
+    let that = this
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
+      data: {
+        scene,
+      },
+      method: 'POST',
+      success(res) {
+        that.setData({
+          vcodeInfo:false,
+          vcodeTimeOut:res.data.result.expire,
+          vcodeTimeOutDefault:res.data.result.expire,
+          vcodeLen:res.data.result.len
+        })
+      }
+    });
   },
 
   /**

+ 12 - 2
pages/forget/forget.wxml

@@ -6,6 +6,16 @@
     <view class="logo_view"><image class="login_logo2" src="/images/login_logo2.png"></image></view>
     <view class='context_input'>
       <view class='input_view'>
+        <image class='phone_img' src='/images/phone.png'></image>
+        <input placeholder='请输入绑定手机号' bindinput='inputPhone' maxlength='11' focus='true' type='number' placeholder-class='placeholder'></input>
+      </view>
+      <view class='input_view'>
+        <image class='password_img' src='/images/password.png'></image>
+        <input name="phoneCode" placeholder="请输入验证码" focus="{{varificatCodeFocus}}"  placeholder-class='placeholder' bindinput="inputVerificatrCode" />
+        <view bindtap='{{vcodeFlag?"getVerificateCode":""}}' class='varification_button {{vcodeFlag?"getCode":"getCode_disable"}}'>{{vcode_button_text}}</view>
+      </view>
+
+      <!-- <view class='input_view'>
         <image class='account_img' src='/images/account.png'></image>
         <input placeholder='请设置账号' bindinput='inputAccount' focus='true' placeholder-class='placeholder'></input>
       </view>
@@ -16,10 +26,10 @@
        <view class='input_view'>
         <image class='email_img' src='/images/email1.png'></image>
         <input placeholder='请输入邮箱' maxlength='48' bindinput='inputEmail' type='text' placeholder-class='placeholder'></input>
-      </view>
+      </view> -->
     </view>
     <view class="errorMsg"><text>{{errorMsg}}</text></view>
-    <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'goNext':''}}">
+    <button class='{{checkCode?"login_button":"login_button_disable"}}' bindtap="{{checkCode?'goNext':''}}">
       下一步
     </button>
 

+ 39 - 0
pages/forget/forget.wxss

@@ -151,6 +151,45 @@
   border: none;
   margin: 20rpx 135rpx 0 135rpx;
 }
+
+.password_img {
+  width: 26rpx;
+  height: 34rpx;
+  margin: 27rpx 0rpx 27rpx 32rpx;
+  padding-right:32rpx;
+  border-right: 2rpx #999999 solid;
+}
+
 .login_button.button-hover {
   background-color: #36a9a6;
 }
+
+.varification_button {
+  display: inline-block;
+  position: absolute;
+  margin-top: 15rpx;
+  padding: 0 15rpx;
+  right: 45rpx;
+  z-index:999;
+  height: 60rpx;
+  border-radius: 8rpx;
+  color:rgba(255, 255, 255, 1);
+  line-height:60rpx;
+  text-align:center;
+  font-size:24rpx;
+  font-family: 'Lucida Sans',
+    'Lucida Sans Regular',
+    'Lucida Grande',
+    'Lucida Sans Unicode',
+    Geneva,
+    Verdana,
+    sans-serif;
+ }
+
+ .getCode {
+  background:#00AADD;
+ }
+
+ .getCode_disable {
+  background-color: #c9c9c9;
+ }

+ 3 - 3
pages/index/index.js

@@ -85,7 +85,7 @@ Page({
       }
       if (!isLogin) {
         log.info('[首页]', '[未登陆跳转登录界面]');
-        let url = `/pages/login/login`;
+        let url = `/pages/login/phone_login/phone_login`;
         wx.navigateTo({
           url
         });
@@ -617,7 +617,7 @@ Page({
     let that = this;
     if (!this.data.isLogin) {
       log.info('[首页]', '[未登陆跳转登录界面]');
-      let url = `/pages/login/login`;
+      let url = `/pages/login/phone_login/phone_login`;
       that.scanFlag = false;
       wx.hideLoading();
       wx.navigateTo({
@@ -878,7 +878,7 @@ Page({
       });
       if ((!userInfo.userId && userInfo.userId != 0)){
         log.info('[首页]', '[已登陆未有用户ID跳转登录界面]');
-        let url = `/pages/login/login`;
+        let url = `/pages/login/phone_login/phone_login`;
         wx.navigateTo({
           url
         });

+ 330 - 0
pages/login/phone_login/phone_login.js

@@ -0,0 +1,330 @@
+// pages/login/phone_login/phone_login.js
+let log = require('../../../utils/log.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    phone: null,
+    vcode: null,
+    checkCode: false,
+    checkPhone: false,
+    vcodeFlag: true,
+    errorMsg: '',
+    varificatCodeFocus:false,
+    vcode_button_text: '获取验证码',
+    scene: "LOGIN",
+    vcodeTimeOut: 0,
+    vcodeTimeOutDefault: 0,
+    vcodeLen: 2,
+    servicetel: getApp().globalData.helpPhoneNum
+  },
+  onError(e) {
+    wx.showModal({
+      title: '温馨提示',
+      content: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话4009608068,接听时段08:30-17:00。',
+      showCancel: false
+    });
+  },
+  inputPhone(e) {
+    this.setData({
+      phone: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  inputVerificatrCode(e) {
+    this.setData({
+      vcode: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  checkAll() {
+    if (!this.checkPhoneNumber()) {
+      this.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkPhone: false,
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        checkPhone: true,
+        errorMsg: ''
+      });
+    }
+
+    if (!this.checkVcode()) {
+      this.setData({
+        errorMsg: '验证码格式不正确'
+      });
+      this.setData({
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        errorMsg: ''
+      });
+    }
+
+    if (this.data.phone && this.data.vcode) {
+      this.setData({
+        checkCode: true
+      });
+    } else {
+      this.setData({
+        checkCode: false
+      });
+    }
+  },
+
+  checkPhoneNumber() {
+    if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
+      return false;
+    }
+    return true;
+  },
+
+  checkVcode() {
+    if (this.data.vcode==undefined || this.data.vcode=="") {
+      return false;
+    }
+    if(this.data.vcode.length==this.data.vcodeLen){
+      return true;
+    }
+    return false;
+  },
+
+  getVerificateCode(){
+    let vcodeFlag = this.data.vcodeFlag;
+    let checkPhone = this.data.checkPhone;
+    let phone = this.data.phone;
+    let that = this;
+
+    if (!vcodeFlag) {
+      return;
+    }
+
+    if (!checkPhone) {
+      that.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkCode: false
+      });
+      return;
+    } else {
+      that.setData({
+        errorMsg: ''
+      });
+    }
+
+    this.setData({
+      vcodeTimeOut:this.data.vcodeTimeOutDefault
+    })
+
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeNoUnique',
+      data: {
+        scene: that.data.scene,
+        terminal: phone,
+      },
+      method: 'POST',
+      success(res) {
+        console.info(res.data.code);
+        if (res.data.code == 1) {
+          wx.showModal({
+            title: '提示',
+            content:res.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+        }else if (res.data.code == 2) {
+          // 跳转
+          wx.showModal({
+            title: '提示',
+            content: '手机号未绑定账户。若您已注册,请通过账号密码方式登录,登陆后根据系统提示绑定手机号或联系客服处理',
+            confirmText: '账号登录',
+            showCancel:true,
+            confirmColor:'#36a9a6',
+            success: function (res1) {
+              if (res1.confirm) {
+                let url = '/pages/login/username_login/username_login';
+                wx.redirectTo({
+                  url
+                })
+              }
+            }
+          });
+        }else if (res.data.code == 200) {
+          wx.showToast({
+            title: '验证码已发送',
+            icon: 'success',
+            duration: 1000 //持续的时间
+          })
+          let vcodeInterval = setInterval(function () {
+            if (that.data.vcodeTimeOut <= 0) {
+              that.setData({
+                vcodeFlag: true,
+                vcode_button_text: '获取验证码'
+              })
+              clearInterval(vcodeInterval);
+            }else{
+              let str = '获取验证码'+'(' + that.data.vcodeTimeOut + 's)'
+              that.setData({
+                vcodeTimeOut:that.data.vcodeTimeOut-1,
+                vcodeFlag: false,
+                vcode_button_text: str
+              })
+            }
+          }, 1000);
+        }
+      }
+    });
+
+  },
+
+  loginUser(e) {
+    let that = this;
+    let { phone, vcode } = this.data;
+    log.info('[登录]', '[登录]', '[请求]', { phone, vcode });
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/phoneLogin',
+      data: {
+        phonenumber: phone,
+        vcode
+      },
+      method: 'POST',
+      success(res) {
+        console.log(res);
+        log.info('[登录]', '[登录]', '[响应]', res.data);
+        if (res.data.code == 1) {
+           that.setData({
+             vcode: null,
+             passwordFocus:true//,
+             //errorMsg: res.data.msg
+           });
+          wx.showModal({
+            title: '提示',
+            content:res.data.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+          log.info('[登录]', '[登录]', '[失败code==1]', res.data);
+        } else {
+          //返回该用户
+          //跳转到上一页
+          wx.setStorageSync("userInfo", res.data);
+          wx.setStorageSync("isBindPhone", res.data.bindingPhone);
+          wx.setStorageSync("isLogin", true);
+          //let url = `/pages/ucenter/index/index`;
+          log.info('[登录]', '[登录]', '[成功返回上一个界面]', res.data);
+          wx.navigateBack();
+          //wx.redirectTo({
+          // url
+          //});
+        }
+      },
+      fail(e){
+        getApp().showNetworkError();
+      }
+    });
+  },
+
+  phoneCall(){
+    wx.makePhoneCall({
+      phoneNumber: this.data.servicetel
+    })
+  },
+
+  goToAccountLogin(e){
+    let url = '/pages/login/username_login/username_login';
+    wx.redirectTo({
+      url
+    })
+  },
+
+  goToRegister(e) {
+    let url = '/pages/register/register';
+    wx.redirectTo({
+      url
+    })
+  },
+  goToForget(e){
+    let url = '/pages/forget/forget';
+    wx.redirectTo({
+      url
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let scene = this.data.scene;
+    let that = this
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
+      data: {
+        scene,
+      },
+      method: 'POST',
+      success(res) {
+        that.setData({
+          vcodeInfo:false,
+          vcodeTimeOut:res.data.result.expire,
+          vcodeTimeOutDefault:res.data.result.expire,
+          vcodeLen:res.data.result.len
+        })
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 0 - 0
pages/login/login.json → pages/login/phone_login/phone_login.json


+ 32 - 0
pages/login/phone_login/phone_login.wxml

@@ -0,0 +1,32 @@
+<!--pages/login/phone_login/phone_login.wxml-->
+<view class='main'>
+  <image class='main_image' src='/images/login.png'></image>
+  <view class='context'>
+    <view class="logo_view"><image class="login_logo1" src="/images/login_logo1.png"></image></view>
+    <view class="logo_view"><image class="login_logo2" src="/images/login_logo2.png"></image></view>
+    <view class='context_input'>
+      <view class='input_view'>
+        <image class='phone_img' src='/images/phone.png'></image>
+        <input placeholder='请输入您的手机号' bindinput='inputPhone' maxlength='11' focus='true' type='number' placeholder-class='placeholder'></input>
+      </view>
+      <view class='input_view'>
+        <image class='password_img' src='/images/password.png'></image>
+        <input name="phoneCode" placeholder="请输入验证码" type='number' focus="{{varificatCodeFocus}}"  placeholder-class='placeholder' bindinput="inputVerificatrCode" />
+        <view bindtap='{{vcodeFlag?"getVerificateCode":""}}' class='varification_button {{vcodeFlag?"getCode":"getCode_disable"}}'>{{vcode_button_text}}</view>
+        <view class="errorMsg"><text>{{errorMsg}}</text></view>
+      </view>
+    </view>
+    <button class='{{checkCode?"login_button":"login_button_disable"}}' bindtap="{{checkCode?'loginUser':''}}" >登录</button>
+    <view class="other_button">
+      <text class='account_login'  bindtap='goToAccountLogin'>账户密码登录</text>
+      <text class='register_view'  bindtap='goToRegister'>注册账户</text>
+      <text class='forget_view'  bindtap='goToForget'>忘记密码</text>
+    </view>
+    <view class='phone_call_class' bindtap="phoneCall">
+          <span>联系客服:  {{servicetel}}</span>
+   </view>
+    <!-- <view style="width: 100%;margin-top:50rpx">
+      <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view> -->
+  </view>
+</view>

+ 252 - 0
pages/login/phone_login/phone_login.wxss

@@ -0,0 +1,252 @@
+/* pages/login/phone_login/phone_login.wxss */
+
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+ 
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+  top: 0; 
+}
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 90rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+.context_input {
+  margin-top: 20rpx;
+  margin-right: 32rpx;
+  margin-left: 32rpx;
+  margin-bottom: 30rpx;
+}
+
+.account_img {
+  width: 30rpx;
+  height: 32rpx;
+  margin: 28rpx 0rpx 28rpx 30rpx;
+  padding-right:30rpx;
+  border-right: 2rpx #999999 solid;
+}
+
+.phone_img {
+  width: 31rpx;
+  height: 30rpx;
+  margin: 29rpx 0rpx 29rpx 30rpx;
+  padding-right:29rpx;
+  border-right: 2rpx #999999 solid;
+}
+
+.password_img {
+  width: 26rpx;
+  height: 34rpx;
+  margin: 27rpx 0rpx 27rpx 32rpx;
+  padding-right:32rpx;
+  border-right: 2rpx #999999 solid;
+}
+
+.context_input input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 32rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context_input .placeholder {
+  color: #999999;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.input_view{
+  box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 40rpx 0rpx;
+  height: 88rpx;
+}
+.errorMsg{
+  margin-left: 10rpx;
+  color: red;
+  font-size:24rpx;
+  font-family: 'Lucida Sans',
+    'Lucida Sans Regular',
+    'Lucida Grande',
+    'Lucida Sans Unicode',
+    Geneva,
+    Verdana,
+    sans-serif;
+}
+
+.login_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button_disable {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+
+.other_button {
+  width: calc(100% - 270rpx);
+  margin: 20rpx 135rpx; 
+}
+
+.account_login {
+  display: inline-block;
+  height: 48rpx;
+  color: #999999;
+  font-size: 24rpx;
+  line-height: 48rpx;
+  text-align: left;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.register_view {
+  position: absolute;
+  right: 320rpx;
+  height: 48rpx;
+  color: #999999;
+  font-size: 24rpx;
+  line-height: 48rpx;
+  text-align: center;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.forget_view {
+  position: absolute;
+  right: 145rpx;
+  display: inline-block;
+  height: 48rpx;
+  color: #999999;
+  font-size: 24rpx;
+  line-height: 48rpx;
+  text-align: right;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+ .varification_button {
+  display: inline-block;
+  position: absolute;
+  margin-top: 15rpx;
+  padding: 0 15rpx;
+  right: 45rpx;
+  z-index:999;
+  height: 60rpx;
+  border-radius: 8rpx;
+  color:rgba(255, 255, 255, 1);
+  line-height:60rpx;
+  text-align:center;
+  font-size:24rpx;
+  font-family: 'Lucida Sans',
+    'Lucida Sans Regular',
+    'Lucida Grande',
+    'Lucida Sans Unicode',
+    Geneva,
+    Verdana,
+    sans-serif;
+ }
+
+ .getCode {
+  background:#00AADD;
+ }
+
+ .getCode_disable {
+  background-color: #c9c9c9;
+ }
+
+ .phone_call_class{
+  text-align: center;
+  margin: 40rpx;
+  color: #c9c9c9;
+  font-size: 28rpx;
+}

+ 20 - 3
pages/login/login.js → pages/login/username_login/username_login.js

@@ -1,5 +1,5 @@
-// pages/login/login.js
-let log = require('../../utils/log.js');
+// pages/username_login/username_login.js
+let log = require('../../../utils/log.js');
 Page({
 
   /**
@@ -10,7 +10,8 @@ Page({
     password: null,
     checkPass: false,
     errorMsg: '',
-    passwordFocus:false
+    passwordFocus:false,
+    servicetel: getApp().globalData.helpPhoneNum
   },
   onError(e) {
     wx.showModal({
@@ -82,6 +83,7 @@ Page({
           //返回该用户
           //跳转到上一页
           wx.setStorageSync("userInfo", res.data);
+          wx.setStorageSync("isBindPhone", res.data.bindingPhone);
           wx.setStorageSync("isLogin", true);
           //let url = `/pages/ucenter/index/index`;
           log.info('[登录]', '[登录]', '[成功返回上一个界面]', res.data);
@@ -96,6 +98,20 @@ Page({
       }
     });
   },
+
+  phoneCall(){
+    wx.makePhoneCall({
+      phoneNumber: this.data.servicetel
+    })
+  },
+
+  goToVcodeLogin(e){
+    let url = '/pages/login/phone_login/phone_login';
+    wx.redirectTo({
+      url
+    })
+  },
+
   goToRegister(e) {
     console.log(e);
     let url = '/pages/register/register';
@@ -103,6 +119,7 @@ Page({
       url
     })
   },
+
   goToForget(e){
     console.log(e);
     let url = '/pages/forget/forget';

+ 5 - 0
pages/login/username_login/username_login.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "登录",
+  "usingComponents": {}
+
+}

+ 9 - 4
pages/login/login.wxml → pages/login/username_login/username_login.wxml

@@ -1,4 +1,4 @@
-<!--pages/login/login.wxml-->
+<!--pages/username_login/username_login.wxml-->
 <view class='main'>
   <image class='main_image' src='/images/login.png'></image>
   <view class='context'>
@@ -17,11 +17,16 @@
     <!-- <view class="errorMsg"><text>{{errorMsg}}</text></view> -->
     <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'loginUser':''}}" >登录</button>
     <view class="other_button">
-    <text class='register_view'  bindtap='goToRegister'>注册账户</text>
-    <text class='forget_view'  bindtap='goToForget'>忘记密码?</text>
+      <text class='vcode_login'  bindtap='goToVcodeLogin'>验证码登录</text>
+      <text class='register_view'  bindtap='goToRegister'>注册账户</text>
+      <text class='forget_view'  bindtap='goToForget'>忘记密码</text>
     </view>
+
+    <view class='phone_call_class' bindtap="phoneCall">
+          <span>联系客服:  {{servicetel}}</span>
+   </view>
     <!-- <view style="width: 100%;margin-top:50rpx">
       <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
     </view> -->
   </view>
-</view>
+</view>

+ 200 - 178
pages/login/login.wxss → pages/login/username_login/username_login.wxss

@@ -1,178 +1,200 @@
-/* pages/login/login.wxss */
-
-.main {
-  height: 100%;
-  width: 100%;
-  position: relative;
- 
-}
-
-.main_image {
-  height: 1334rpx;
-  width: 750rpx;
-  margin-top: -128rpx;
-  top: 0; 
-}
-.logo_view{
-  margin: 0rpx 268rpx;
-}
-.login_logo1 {
-  height: 213rpx;
-  width: 214rpx;
-  margin-top: 90rpx;
-}
-.login_logo2 {
-  height: 120rpx;
-  width: 184rpx;
-  margin: 0rpx 15rpx;
-}
-.main .context {
-  height: 100%;
-  width: 100%;
-  position: absolute;
-  top: 0;
-  left: 0;
-  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
-}
-
-.context_input {
-  margin-top: 20rpx;
-  margin-right: 32rpx;
-  margin-left: 32rpx;
-  margin-bottom: 30rpx;
-}
-
-.account_img {
-  width: 30rpx;
-  height: 32rpx;
-  margin: 28rpx 0rpx 28rpx 30rpx;
-  padding-right:30rpx;
-  border-right: 2rpx #999999 solid;
-}
-
-.password_img {
-  width: 26rpx;
-  height: 34rpx;
-  margin: 27rpx 0rpx 27rpx 32rpx;
-  padding-right:32rpx;
-  border-right: 2rpx #999999 solid;
-}
-
-.context_input input {
-  width: calc(100% - 122rpx);
-  display: inline-block;
-  font-size: 32rpx;
-  height: 88rppx;
-  line-height: 88rpx;
-  min-height: 88rpx;
-  padding-left: 30rpx;
-  color: #434343;
-  font-family: 'Lucida Sans',
-                 'Lucida Sans Regular',
-                 'Lucida Grande',
-                 'Lucida Sans Unicode',
-                 Geneva,
-                 Verdana,
-                 sans-serif;
-}
-
-.context_input .placeholder {
-  color: #999999;
-  font-family: 'Lucida Sans',
-                 'Lucida Sans Regular',
-                 'Lucida Grande',
-                 'Lucida Sans Unicode',
-                 Geneva,
-                 Verdana,
-                 sans-serif;
-}
-.input_view{
-  box-shadow: 0rpx 0rpx 10rpx  #dedede;
-  border-radius: 10rpx;
-  margin: 40rpx 0rpx;
-  height: 88rpx;
-}
-.login_button {
-  width: calc(100% - 270rpx);
-  font-size: 32rpx;
-  /* margin: 0rpx 32rpx; */
-  font-family: 'Lucida Sans',
-                 'Lucida Sans Regular',
-                 'Lucida Grande',
-                 'Lucida Sans Unicode',
-                 Geneva,
-                 Verdana,
-                 sans-serif;
-  color: #fff;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-  background-color: #00a8dc;
-  border-radius: 40rpx;
-  height: 80rpx;
-  border: none;
-  margin: 125rpx 135rpx 0 135rpx;
-}
-
-.login_button_disable {
-  width: calc(100% - 270rpx);
-  font-size: 32rpx;
-  /* margin: 0rpx 32rpx; */
-  font-family: 'Lucida Sans',
-                 'Lucida Sans Regular',
-                 'Lucida Grande',
-                 'Lucida Sans Unicode',
-                 Geneva,
-                 Verdana,
-                 sans-serif;
-  color: #fff;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-  background-color: #c9c9c9;
-  border-radius: 40rpx;
-  height: 80rpx;
-  border: none;
-  margin: 125rpx 135rpx 0 135rpx;
-}
-
-.login_button.button-hover {
-  background-color: #36a9a6;
-}
-
-.other_button {
-  width: calc(100% - 270rpx);
-  margin: 20rpx 135rpx; 
-}
-
-.register_view {
-  display: inline-block;
-  height: 48rpx;
-  color: #999999;
-  font-size: 24rpx;
-  line-height: 48rpx;
-  text-align: left;
-  font-family: 'Lucida Sans',
-                 'Lucida Sans Regular',
-                 'Lucida Grande',
-                 'Lucida Sans Unicode',
-                 Geneva,
-                 Verdana,
-                 sans-serif;
-}
-.forget_view {
-  position: absolute;
-  right: 135rpx;
-  display: inline-block;
-  height: 48rpx;
-  color: #999999;
-  font-size: 24rpx;
-  line-height: 48rpx;
-  text-align: right;
-  font-family: 'Lucida Sans',
-                 'Lucida Sans Regular',
-                 'Lucida Grande',
-                 'Lucida Sans Unicode',
-                 Geneva,
-                 Verdana,
-                 sans-serif;
-}
-
+/* pages/username_login/username_login.wxss */
+
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+ 
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+  top: 0; 
+}
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 90rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+.context_input {
+  margin-top: 20rpx;
+  margin-right: 32rpx;
+  margin-left: 32rpx;
+  margin-bottom: 30rpx;
+}
+
+.account_img {
+  width: 30rpx;
+  height: 32rpx;
+  margin: 28rpx 0rpx 28rpx 30rpx;
+  padding-right:30rpx;
+  border-right: 2rpx #999999 solid;
+}
+
+.password_img {
+  width: 26rpx;
+  height: 34rpx;
+  margin: 27rpx 0rpx 27rpx 32rpx;
+  padding-right:32rpx;
+  border-right: 2rpx #999999 solid;
+}
+
+.context_input input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 32rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context_input .placeholder {
+  color: #999999;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.input_view{
+  box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 40rpx 0rpx;
+  height: 88rpx;
+}
+.login_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button_disable {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #b14b4b;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 125rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+
+.other_button {
+  width: calc(100% - 270rpx);
+  margin: 20rpx 135rpx; 
+}
+
+.vcode_login {
+  display: inline-block;
+  height: 48rpx;
+  color: #999999;
+  font-size: 24rpx;
+  line-height: 48rpx;
+  text-align: left;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.register_view {
+  position: absolute;
+  right: 320rpx;
+  height: 48rpx;
+  color: #999999;
+  font-size: 24rpx;
+  line-height: 48rpx;
+  text-align: center;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.forget_view {
+  position: absolute;
+  right: 135rpx;
+  display: inline-block;
+  height: 48rpx;
+  color: #999999;
+  font-size: 24rpx;
+  line-height: 48rpx;
+  text-align: right;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.phone_call_class{
+  text-align: center;
+  margin: 40rpx;
+  color: #c9c9c9;
+  font-size: 28rpx;
+}

+ 1 - 1
pages/outmoney/outmoney.js

@@ -203,7 +203,7 @@ Page({
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
-          let url = '/pages/login/login';
+          let url = '/pages/login/phone_login/phone_login';
           wx.redirectTo({
             url,
           });

+ 1 - 1
pages/register/register.js

@@ -312,7 +312,7 @@ Page({
             confirmColor:'#00aadd',
             success: function (res1) {
               if (res1.confirm) {
-                let url = '/pages/login/login';
+                let url = '/pages/login/phone_login/phone_login';
                 wx.redirectTo({
                   url
                 })

+ 5 - 10
pages/reset_password/reset_password.js

@@ -5,7 +5,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    userName: null,
+    phone: null,
     password: null,
     rePassword: null,
     checkPass: false,
@@ -14,23 +14,18 @@ Page({
   resetPassword(e) {
     let that = this;
     let{
-      userName : loginName,
+      phone : phonenumber,
       password
     } = this.data;
     wx.request({
       url: getApp().globalData.postHeadAgreement + '/restapi/wechat/resetPassword',
       data: {
-        loginName,
+        phonenumber,
         password
       },
       method: 'POST',
       success(res) {
-        //console.log(res);
-        //console.log(res.data.code == 1);
         if (res.data.code == 1) {
-          // that.setData({
-          //   errorMsg: res.data.msg
-          // });
           wx.showModal({
             title: '提示',
             content: res.data.msg,
@@ -93,10 +88,10 @@ Page({
    */
   onLoad: function(options) {
     let {
-      loginName
+      phone
     } = options;
     this.setData({
-      userName: loginName
+      phone: phone
     });
     //resetPassword
   },

+ 5 - 6
pages/reset_password/reset_password.wxml

@@ -2,17 +2,16 @@
 <view class='main'>
   <image class='main_image' src='/images/login.png'></image>
   <view class='context'>
+    <view class="logo_view"><image class="login_logo1" src="/images/login_logo1.png"></image></view>
+    <view class="logo_view"><image class="login_logo2" src="/images/login_logo2.png"></image></view>
     <view class='context_input'>
-    <view class='input_view'>
-        <!-- <image class='password_img' src='/images/password.png'></image> -->
-        <input placeholder='请输入您的手机号/邮箱/账号' value='{{userName}}' disabled='true' placeholder-class='placeholder'></input>
-      </view>
+      <view class="bindPhoneInfo"><text>绑定手机号:{{phone}}</text></view>
       <view class='input_view'>
-        <!-- <image class='password_img' src='/images/password.png'></image> -->
+        <image class='password_img' src='/images/password.png'></image>
         <input placeholder='输入新密码' maxlength='16'  bindinput='inputPassword' type='password' placeholder-class='placeholder'></input>
       </view>
       <view class='input_view'>
-        <!-- <image class='password_img' src='/images/password.png'></image> -->
+        <image class='password_img' src='/images/password.png'></image>
         <input placeholder='确认新密码' maxlength='16' bindinput='inputRepassword' type='password' placeholder-class='placeholder'></input>
       </view>
     </view>

+ 59 - 12
pages/reset_password/reset_password.wxss

@@ -24,20 +24,43 @@
   margin: 30rpx 32rpx;
 } */
 
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 90rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+
+.context_input {
+  margin-top: 70rpx;
+  margin-right: 60rpx;
+  margin-left: 60rpx;
+  margin-bottom: 20rpx;
+}
 
 .context_input .input_view {
-  border-bottom: 2rpx solid #f1f1f1;
-  padding-left: 60rpx;
-  height: 100rpx;
+   box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 20rpx 0rpx;
+  height: 88rpx;
+  position: relative;
 }
 
 .context_input input {
-  width: calc(100% - 58rpx);
+  width: calc(100% - 122rpx);
   display: inline-block;
   font-size: 32rpx;
-  height: 100rpx;
-  line-height: 100rpx;
-  min-height: 100rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
   color: #434343;
   font-family: 'Lucida Sans',
                  'Lucida Sans Regular',
@@ -60,7 +83,7 @@
 }
 .errorMsg{
   height: 28rpx;
-  margin: 32rpx 60rpx 32rpx 60rpx;
+  margin: 12rpx 60rpx 32rpx 60rpx;
   font-size: 28rpx;
   font-family: 'Lucida Sans',
                  'Lucida Sans Regular',
@@ -75,7 +98,7 @@
 }
 
 .login_button {
-  width: calc(100% - 152rpx);
+  width: calc(100% - 300rpx);
   font-size: 32rpx;
   /* margin: 0rpx 32rpx; */
   font-family: 'Lucida Sans',
@@ -92,11 +115,11 @@
   border-radius: 40rpx;
   height: 80rpx;
   border: none;
-  margin: 235rpx 76rpx 0 76rpx;
+  text-align: center;
 }
 
 .login_button_disable {
-  width: calc(100% - 152rpx);
+  width: calc(100% - 300rpx);
   font-size: 32rpx;
   /* margin: 0rpx 32rpx; */
   font-family: 'Lucida Sans',
@@ -113,9 +136,33 @@
   border-radius: 40rpx;
   height: 80rpx;
   border: none;
-  margin: 235rpx 76rpx 0 76rpx;
+  text-align: center;
 }
 
 .login_button.button-hover {
   background-color: #36a9a6;
+}
+
+.bindPhoneInfo{
+  text-align: center;
+  font-size: 32rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  min-height: 100rpx;
+  color: #C0C0C0;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.password_img {
+  width: 26rpx;
+  height: 34rpx;
+  margin: 27rpx 0rpx 27rpx 32rpx;
+  padding-right:32rpx;
+  border-right: 2rpx #999999 solid;
 }

+ 9 - 1
pages/scan_result/scan_result.js

@@ -70,6 +70,14 @@ Page({
     });
   },
   beginCharge(e) {
+    let isBindPhone = wx.getStorageSync('isBindPhone');
+    if(isBindPhone==0){
+      let url = `/pages/bindPhone/bindPhone`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
     wx.showLoading({
       title: '开启充电中...',
       mask: true
@@ -100,7 +108,7 @@ Page({
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
-          let url = '/pages/login/login';
+          let url = '/pages/login/phone_login/phone_login';
           wx.redirectTo({
             url,
           });

+ 268 - 0
pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.js

@@ -0,0 +1,268 @@
+// pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    scene: '',
+    userInfo: {},
+    hidePhone: null,
+    errorMsg: '',
+    vcodeFlag: true,
+    vcodeTimeOut: 0,
+    vcodeTimeOutDefault: 0,
+    vcodeLen:2,
+    vcodeInterval:null,
+    vcode_button_text:'获取验证码',
+    reviserPasswordScene: 'MDF_PWD',
+    unbindPhoneScene: 'UN_PHONE'
+  },
+
+  onError(e) {
+    wx.showModal({
+      title: '温馨提示',
+      content: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话4009608068,接听时段08:30-17:00。',
+      showCancel: false
+    });
+  },
+  
+  inputVerificatrCode(e) {
+    this.setData({
+      vcode: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  checkAll() {
+    if (!this.checkVcode()) {
+      this.setData({
+        errorMsg: '验证码格式不正确'
+      });
+      this.setData({
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        errorMsg: ''
+      });
+    }
+
+    if (this.data.vcode) {
+      this.setData({
+        checkCode: true
+      });
+    } else {
+      this.setData({
+        checkCode: false
+      });
+    }
+  },
+
+  checkVcode() {
+    if (this.data.vcode==undefined || this.data.vcode=="") {
+      return false;
+    }
+    if(this.data.vcode.length==this.data.vcodeLen){
+      return true;
+    }
+    return false;
+  },
+
+  getVerificateCode(){
+    let vcodeFlag = this.data.vcodeFlag;
+    let phone = this.data.userInfo.phonenumber;
+    let that = this;
+
+    if (!vcodeFlag) {
+      return;
+    }
+
+    this.setData({
+      vcodeTimeOut:this.data.vcodeTimeOutDefault
+    })
+
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeNoUnique',
+      data: {
+        scene: that.data.scene,
+        terminal: phone,
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 200) {
+          wx.showToast({
+            title: '验证码已发送',
+            icon: 'success',
+            duration: 1000 //持续的时间
+          })
+          let vcodeInterval = setInterval(function () {
+            if (that.data.vcodeTimeOut <= 0) {
+              that.setData({
+                vcodeFlag: true,
+                vcode_button_text: '获取验证码'
+              })
+              clearInterval(vcodeInterval);
+            }else{
+              let str = '获取验证码'+'(' + that.data.vcodeTimeOut + 's)'
+              that.setData({
+                vcodeTimeOut:that.data.vcodeTimeOut-1,
+                vcodeFlag: false,
+                vcode_button_text: str
+              })
+            }
+          }, 1000);
+        }else{
+          wx.showModal({
+            title: '提示',
+            content: res.data.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+        }
+      }
+    });
+
+  },
+
+  nextConfirm(e){
+    let that = this;
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/checkPhoneSecruity',
+      data: {
+        phonenumber: that.data.userInfo.phonenumber,
+        scene: that.data.scene,
+        vcode: that.data.vcode
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+           that.setData({
+             vcode: null,
+           });
+          wx.showModal({
+            title: '提示',
+            content:res.data.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+        } else {
+          if(that.data.scene==that.data.reviserPasswordScene){
+            let url = `/pages/ucenter/accountsecurity/mdfpassword/mdfpassword`;
+            wx.navigateTo({
+              url
+            });
+          }else if(that.data.scene==that.data.unbindPhoneScene){
+            let url = `/pages/ucenter/accountsecurity/unbindphone/unbindphone`;
+            wx.navigateTo({
+              url
+            });
+          }
+        }
+      },
+      fail(e){
+        getApp().showNetworkError();
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let {
+      scene
+    } = options;
+    this.setData({
+      scene
+    });
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    // 页面显示
+    if (userInfo && isLogin) {
+      let phonenumber = userInfo.phonenumber;
+      let hidePhone = phonenumber.substring(0,3)+'****'+phonenumber.substring(7);
+      this.setData({
+        userInfo: userInfo,
+        hidePhone
+      });
+    } else {
+      //未登录信息
+      this.setData({
+        userInfo: {}
+      });
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+
+    let that = this
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
+      data: {
+        scene:this.data.scene,
+      },
+      method: 'POST',
+      success(res) {
+        that.setData({
+          vcodeInfo:false,
+          vcodeTimeOut:res.data.result.expire,
+          vcodeTimeOutDefault:res.data.result.expire,
+          vcodeLen:res.data.result.len
+        })
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "安全验证"
+}

+ 25 - 0
pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.wxml

@@ -0,0 +1,25 @@
+<!--pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.wxml-->
+<view class='main'>
+  <image class='main_image' src='/images/login.png'></image>
+  <view class='context'>
+    <view class='context_input'>
+      <view class='text_view'>
+        <text>为了您的账户安全,需要验证您的手机</text>
+      </view>  
+      <view class='text_view'>
+        <text>{{hidePhone}}</text>
+      </view> 
+
+      <view class='input_view'>
+        <image class='phone_img' src='/images/vcode.png'></image><div class="line"></div>
+        <input placeholder='请输入验证码' bindinput='inputVerificatrCode' type='number' placeholder-class='placeholder'></input>
+        <view bindtap='{{vcodeFlag?"getVerificateCode":""}}' class='varification_button {{vcodeFlag?"getCode":"getCode_disable"}}'>{{vcode_button_text}}</view>
+      </view>  
+    </view>
+    <view class="errorMsg"><text>{{errorMsg}}</text></view>
+    
+    <button class='{{checkCode?"confirm_button":"confirm_button_disable"}}' bindtap="{{checkCode?'nextConfirm':''}}">
+      下一步
+    </button>
+  </view>
+</view>

+ 181 - 0
pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.wxss

@@ -0,0 +1,181 @@
+/* pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity.wxss */
+/* pages/reset_password/reset_password.wxss */
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+}
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 20rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  margin-top:20rpx;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+.context_input {
+  margin-top: 50rpx;
+  margin-right: 60rpx;
+  margin-left: 60rpx;
+  margin-bottom: 20rpx;
+}
+
+.context_input .text_view{
+  text-align: center;
+  margin-bottom: 60rpx;
+  font-size: 28rpx;
+}
+
+.input_view .line{height:43rpx;width:2rpx;background:#999999;display: inline-block;margin:20rpx 0}
+.context_input input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 32rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context_input .placeholder {
+  color: #999999;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.input_view{
+  box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 20rpx 0rpx;
+  height: 88rpx;
+  position: relative;
+}
+.errorMsg{
+  height: 28rpx;
+  margin: 0rpx 30rpx 0rpx 60rpx;
+  font-size: 28rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: red;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.phone_img {
+  width: 31rpx;
+  height: 30rpx;
+  margin: 29rpx 0rpx 29rpx 30rpx;
+  padding-right:29rpx;
+}
+
+.confirm_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 60rpx 135rpx 0 135rpx;
+}
+.confirm_button_disable{
+   width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 60rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+
+.varification_button {
+  display: inline-block;
+  position: absolute;
+  margin-top: 15rpx;
+  padding: 0 15rpx;
+  right: 45rpx;
+  z-index:999;
+  height: 60rpx;
+  border-radius: 8rpx;
+  color:rgba(255, 255, 255, 1);
+  line-height:60rpx;
+  text-align:center;
+  font-size:24rpx;
+  font-family: 'Lucida Sans',
+    'Lucida Sans Regular',
+    'Lucida Grande',
+    'Lucida Sans Unicode',
+    Geneva,
+    Verdana,
+    sans-serif;
+ }
+
+ .getCode {
+  background:#00AADD;
+ }
+ .getCode_disable {
+  background-color: #c9c9c9;
+ }

+ 99 - 0
pages/ucenter/accountsecurity/index/index.js

@@ -0,0 +1,99 @@
+// pages/ucenter/accountsecurity/accountsecurity.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    isBindPhone: 0,
+    reviserPasswordScene: 'MDF_PWD',
+    unbindPhoneScene: 'UN_PHONE'
+  },
+
+  goModifuPassword(e) {
+    if (this.data.isBindPhone==0) {
+      let url = `/pages/bindPhone/bindPhone`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+    let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.reviserPasswordScene;
+    wx.navigateTo({
+      url
+    });
+  },
+
+  goModifyPhone(e) {
+    if (this.data.isBindPhone==0) {
+      let url = `/pages/bindPhone/bindPhone`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+    let url = '/pages/ucenter/accountsecurity/checkphonesecuirty/checkphonesecruity?scene='+this.data.unbindPhoneScene;
+    wx.navigateTo({
+      url
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let isBindPhone = wx.getStorageSync('isBindPhone');
+    this.setData({
+      isBindPhone
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/ucenter/accountsecurity/index/index.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "账号安全"
+}

+ 22 - 0
pages/ucenter/accountsecurity/index/index.wxml

@@ -0,0 +1,22 @@
+<!--pages/ucenter/accountsecurity/accountsecurity.wxml-->
+<view class='main'>
+  <image class='main_image' src='/images/login.png'></image>
+  <view class='context'>
+    <view class="zan-cell" hover-class="active" bindtap="goModifuPassword">
+        <view class="zan-text">
+          <text>修改密码</text>
+        </view>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
+      </view>
+      <view class="zan-cell" hover-class="active" bindtap="goModifyPhone">
+        <view class="zan-text">
+          <text>更改绑定手机</text>
+        </view>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
+      </view>
+  </view>
+</view>

+ 67 - 0
pages/ucenter/accountsecurity/index/index.wxss

@@ -0,0 +1,67 @@
+/* pages/ucenter/accountsecurity/accountsecurity.wxss */
+/* pages/reset_password/reset_password.wxss */
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+}
+
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+/* .context_input {
+  margin: 30rpx 32rpx;
+} */
+
+.zan-cell {
+  height:80rpx;
+  position: relative;
+  padding: 0rpx;
+  margin: 0rpx 30rpx 0rpx 40rpx;
+  display: flex;
+  align-items: center;
+  border-bottom: 2rpx solid #f1f1f1;
+}
+.zan-cell.active {
+  background: #ebebeb;
+}
+
+.zan-icon {
+  margin:12rpx 0rpx 0rpx -25rpx;
+  width: 68rpx;
+  height: 69rpx;
+}
+.zan-icon image {
+  display: block;
+  width: 68rpx;
+  height: 69rpx;
+}
+
+.zan-text{
+  width:100%;
+  font-size: 28rpx;
+}
+.zan-ft{
+  margin: 0;
+  width: 14rpx;
+  height: 24rpx;
+}
+
+.zan-ft image{
+  display: block;
+  width: 14rpx;
+  height: 24rpx;
+  /*transform:rotate(180deg);*/
+}

+ 163 - 0
pages/ucenter/accountsecurity/mdfpassword/mdfpassword.js

@@ -0,0 +1,163 @@
+// pages/ucenter/accountsecurity/mdfpassword/mdfpassword.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    phone: null,
+    password: null,
+    rePassword: null,
+    checkPass: false,
+    errorMsg: ''
+  },
+
+  resetPassword(e) {
+    let that = this;
+    let{
+      phone : phonenumber,
+      password
+    } = this.data;
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/r1estapi/wechat/resetPassword',
+      data: {
+        phonenumber,
+        password
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+          wx.showModal({
+            title: '提示',
+            content: res.data.msg,
+            showCancel: false,
+            confirmColor: '#4359b5'
+          });
+        } else {
+          let url = `/pages/ucenter/index/index`;
+          wx.navigateTo({
+            url
+          });
+        }
+      }
+    });
+  },
+  inputPassword(e) {
+    this.setData({
+      password: e.detail.value
+    });
+    this.checkAll();
+  },
+  inputRepassword(e) {
+    this.setData({
+      rePassword: e.detail.value
+    });
+    this.checkAll();
+  },
+  checkPassword() {
+    if (!this.data.password || !this.data.rePassword || this.data.password != this.data.rePassword) {
+      return false;
+    }
+    return true;
+  },
+  checkAll() {
+    if (this.data.password && (this.data.password.length < 5 || this.data.password.length > 20)) {
+      this.setData({
+        errorMsg: '密码长度应为5-20'
+      });
+      this.setData({
+        checkPass: false
+      });
+      return;
+    }
+    if (!this.checkPassword()) {
+      this.setData({
+        errorMsg: '两次密码输入不一致,请重新输入'
+      });
+      this.setData({
+        checkPass: false
+      });
+      return;
+    } else {
+      this.setData({
+        errorMsg: ''
+      });
+    }
+    this.setData({
+      checkPass: true
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    // 页面显示
+    if (userInfo && isLogin) {
+      this.setData({
+        phone: userInfo.phonenumber,
+      });
+    } else {
+      //未登录信息
+      this.setData({
+        userInfo: {}
+      });
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/ucenter/accountsecurity/mdfpassword/mdfpassword.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "重置密码"
+}

+ 22 - 0
pages/ucenter/accountsecurity/mdfpassword/mdfpassword.wxml

@@ -0,0 +1,22 @@
+<!--pages/ucenter/accountsecurity/mdfpassword/mdfpassword.wxml-->
+<view class='main'>
+  <image class='main_image' src='/images/login.png'></image>
+  <view class='context'>
+    <view class='context_input'>
+      <view class='input_view'>
+        <image class='password_img' src='/images/password.png'></image>
+        <input placeholder='输入新密码' maxlength='16'  bindinput='inputPassword' type='password' placeholder-class='placeholder'></input>
+      </view>
+      <view class='input_view'>
+        <image class='password_img' src='/images/password.png'></image>
+        <input placeholder='确认新密码' maxlength='16' bindinput='inputRepassword' type='password' placeholder-class='placeholder'></input>
+      </view>
+    </view>
+    <view class="errorMsg"><text>{{errorMsg}}</text></view>
+    
+    <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'resetPassword':''}}">
+      确认
+    </button>
+
+  </view>
+</view>

+ 168 - 0
pages/ucenter/accountsecurity/mdfpassword/mdfpassword.wxss

@@ -0,0 +1,168 @@
+/* pages/ucenter/accountsecurity/mdfpassword/mdfpassword.wxss */
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+}
+
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+/* .context_input {
+  margin: 30rpx 32rpx;
+} */
+
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 90rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+
+.context_input {
+  margin-top: 70rpx;
+  margin-right: 60rpx;
+  margin-left: 60rpx;
+  margin-bottom: 20rpx;
+}
+
+.context_input .input_view {
+   box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 20rpx 0rpx;
+  height: 88rpx;
+  position: relative;
+}
+
+.context_input input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 32rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context_input .placeholder {
+  color: #999999;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.errorMsg{
+  height: 28rpx;
+  margin: 12rpx 60rpx 32rpx 60rpx;
+  font-size: 28rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: red;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.login_button {
+  width: calc(100% - 300rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  text-align: center;
+}
+
+.login_button_disable {
+  width: calc(100% - 300rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  text-align: center;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+
+.bindPhoneInfo{
+  text-align: center;
+  font-size: 32rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  min-height: 100rpx;
+  color: #C0C0C0;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.password_img {
+  width: 26rpx;
+  height: 34rpx;
+  margin: 27rpx 0rpx 27rpx 32rpx;
+  padding-right:32rpx;
+  border-right: 2rpx #999999 solid;
+}

+ 313 - 0
pages/ucenter/accountsecurity/unbindphone/unbindphone.js

@@ -0,0 +1,313 @@
+// pages/ucenter/accountsecurity/unbindphone/unbindphone.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+      userInfo: {},
+      isLogin: false,
+      phone: null,
+      errorMsg: '',
+      vcodeFlag: true,
+      vcodeTimeOut: 0,
+      vcodeTimeOutDefault: 0,
+      scene: "UN_PHONE",
+      vcodeLen:2,
+      vcodeInterval:null,
+      vcode_button_text:'获取验证码',
+      servicetel: '4009608068'
+  },
+
+  onError(e) {
+    wx.showModal({
+      title: '温馨提示',
+      content: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话4009608068,接听时段08:30-17:00。',
+      showCancel: false
+    });
+  },
+
+  inputPhone(e) {
+    this.setData({
+      phone: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  inputVerificatrCode(e) {
+    this.setData({
+      vcode: e.detail.value
+    });
+    this.checkAll();
+  },
+
+  checkAll() {
+    if (!this.checkPhoneNumber()) {
+      this.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkPhone: false,
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        checkPhone: true,
+        errorMsg: ''
+      });
+    }
+
+    if (!this.checkVcode()) {
+      this.setData({
+        errorMsg: '验证码格式不正确'
+      });
+      this.setData({
+        checkCode: false
+      });
+      return;
+    } else {
+      this.setData({
+        errorMsg: ''
+      });
+    }
+
+    if (this.data.phone && this.data.vcode) {
+      this.setData({
+        checkCode: true
+      });
+    } else {
+      this.setData({
+        checkCode: false
+      });
+    }
+  },
+
+  checkPhoneNumber() {
+    if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
+      return false;
+    }
+    return true;
+  },
+
+  checkVcode() {
+    if (this.data.vcode==undefined || this.data.vcode=="") {
+      return false;
+    }
+    if(this.data.vcode.length==this.data.vcodeLen){
+      return true;
+    }
+    return false;
+  },
+
+  getVerificateCode(){
+    let vcodeFlag = this.data.vcodeFlag;
+    let checkPhone = this.data.checkPhone;
+    let phone = this.data.phone;
+    let that = this;
+
+    if (!vcodeFlag) {
+      return;
+    }
+
+    if (!checkPhone) {
+      that.setData({
+        errorMsg: '手机号输入有误,请重新输入',
+        checkCode: false
+      });
+      return;
+    } else {
+      that.setData({
+        errorMsg: ''
+      });
+    }
+
+    this.setData({
+      vcodeTimeOut:this.data.vcodeTimeOutDefault
+    })
+
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/sendPhoneVcodeUnique',
+      data: {
+        scene: that.data.scene,
+        terminal: phone,
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+          wx.showModal({
+            title: '提示',
+            content:res.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+        }else if (res.data.code == 2) {
+          // 跳转
+          wx.showModal({
+            title: '提示',
+            content: '手机已绑定账户,请检查手机号是否填写正确或联系客服',
+            showCancel:false,
+          });
+        }else if (res.data.code == 200) {
+          wx.showToast({
+            title: '验证码已发送',
+            icon: 'success',
+            duration: 1000 //持续的时间
+          })
+          let vcodeInterval = setInterval(function () {
+            if (that.data.vcodeTimeOut <= 0) {
+              that.setData({
+                vcodeFlag: true,
+                vcode_button_text: '获取验证码'
+              })
+              clearInterval(vcodeInterval);
+            }else{
+              let str = '获取验证码'+'(' + that.data.vcodeTimeOut + 's)'
+              that.setData({
+                vcodeTimeOut:that.data.vcodeTimeOut-1,
+                vcodeFlag: false,
+                vcode_button_text: str
+              })
+            }
+          }, 1000);
+        }
+      }
+    });
+
+  },
+
+  bindPhone(e) {
+    let that = this;
+    let loginName = this.data.userInfo.loginName;
+    let { phone, vcode } = this.data;
+    log.info('[绑定手机]', '[绑定手机]', '[请求]', { phone, vcode });
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/bindPhone',
+      data: {
+        loginName,
+        phonenumber: phone,
+        vcode
+      },
+      method: 'POST',
+      success(res) {
+        if (res.data.code == 1) {
+          that.setData({
+            vcode: null,
+          });
+          wx.showModal({
+            title: '提示',
+            content:res.data.msg,
+            showCancel:false,
+            confirmColor:'#4359b5'
+          });
+          log.info('[绑定手机号]', '[绑定手机号]', '[失败code==1]', res.data);
+        } else {
+          //跳转到上一页
+          log.info('[绑定手机号]', '[绑定手机号]', '[成功返回上一个界面]', res.data);
+          wx.navigateBack();
+        }
+      },
+      fail(e){
+        getApp().showNetworkError();
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    // 页面显示
+    if (userInfo && isLogin) {
+      this.setData({
+        userInfo: userInfo,
+        isLogin: isLogin
+      });
+      if ((!userInfo.userId && userInfo.userId != 0)){
+        log.info('[首页]', '[已登陆未有用户ID跳转登录界面]');
+        let url = `/pages/login/phone_login/phone_login`;
+        wx.navigateTo({
+          url
+        });
+        return;
+      }
+    } else {
+      //未登录信息
+      this.setData({
+        userInfo: {}
+      });
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+
+    let scene = this.data.scene;
+    let that = this
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/vcodeInfo',
+      data: {
+        scene,
+      },
+      method: 'POST',
+      success(res) {
+        that.setData({
+          vcodeInfo:false,
+          vcodeTimeOut:res.data.result.expire,
+          vcodeTimeOutDefault:res.data.result.expire,
+          vcodeLen:res.data.result.len
+        })
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/ucenter/accountsecurity/unbindphone/unbindphone.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "绑定手机"
+}

+ 25 - 0
pages/ucenter/accountsecurity/unbindphone/unbindphone.wxml

@@ -0,0 +1,25 @@
+<!--pages/ucenter/accountsecurity/unbindphone/unbindphone.wxml-->
+<view class='main'>
+  <image class='main_image' src='/images/login.png'></image>
+  <view class='context'>
+    <view class='context_input'>
+      <view class='input_view'>
+        <image class='phone_img' src='/images/phone.png'></image><div class="line"></div>
+        <input placeholder='请输手机号' maxlength='11' bindinput='inputPhone' type='number' placeholder-class='placeholder'></input>
+      </view>  
+
+      <view class='input_view'>
+        <image class='phone_img' src='/images/vcode.png'></image><div class="line"></div>
+        <input placeholder='请输入验证码' bindinput='inputVerificatrCode' type='number' placeholder-class='placeholder'></input>
+        <view bindtap='{{vcodeFlag?"getVerificateCode":""}}' class='varification_button {{vcodeFlag?"getCode":"getCode_disable"}}'>{{vcode_button_text}}</view>
+      </view>  
+    </view>
+     <view class="errorMsg"><text>{{errorMsg}}</text></view>
+    
+    <button class='{{checkCode?"confirm_button":"confirm_button_disable"}}' bindtap="{{checkCode?'bindPhone':''}}">
+      确认
+    </button>
+
+  </view>
+</view>
+

+ 174 - 0
pages/ucenter/accountsecurity/unbindphone/unbindphone.wxss

@@ -0,0 +1,174 @@
+/* pages/ucenter/accountsecurity/unbindphone/unbindphone.wxss */
+.main {
+  height: 100%;
+  width: 100%;
+  position: relative;
+}
+
+.main_image {
+  height: 1334rpx;
+  width: 750rpx;
+  margin-top: -128rpx;
+}
+.logo_view{
+  margin: 0rpx 268rpx;
+}
+.login_logo1 {
+  height: 213rpx;
+  width: 214rpx;
+  margin-top: 20rpx;
+}
+.login_logo2 {
+  height: 120rpx;
+  width: 184rpx;
+  margin: 0rpx 15rpx;
+}
+.main .context {
+  height: 100%;
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  margin-top:20rpx;
+  box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+}
+
+.context_input {
+  margin-top: 70rpx;
+  margin-right: 60rpx;
+  margin-left: 60rpx;
+  margin-bottom: 20rpx;
+}
+
+.input_view .line{height:43rpx;width:2rpx;background:#999999;display: inline-block;margin:20rpx 0}
+.context_input input {
+  width: calc(100% - 122rpx);
+  display: inline-block;
+  font-size: 32rpx;
+  height: 88rppx;
+  line-height: 88rpx;
+  min-height: 88rpx;
+  padding-left: 30rpx;
+  color: #434343;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context_input .placeholder {
+  color: #999999;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.input_view{
+  box-shadow: 0rpx 0rpx 10rpx  #dedede;
+  border-radius: 10rpx;
+  margin: 20rpx 0rpx;
+  height: 88rpx;
+  position: relative;
+}
+.errorMsg{
+  height: 28rpx;
+  margin: -20rpx 30rpx 0rpx 30rpx;
+  font-size: 28rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: red;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.phone_img {
+  width: 31rpx;
+  height: 30rpx;
+  margin: 29rpx 0rpx 29rpx 30rpx;
+  padding-right:29rpx;
+}
+
+.confirm_button {
+  width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #00a8dc;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 60rpx 135rpx 0 135rpx;
+}
+.confirm_button_disable{
+   width: calc(100% - 270rpx);
+  font-size: 32rpx;
+  /* margin: 0rpx 32rpx; */
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #fff;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  background-color: #c9c9c9;
+  border-radius: 40rpx;
+  height: 80rpx;
+  border: none;
+  margin: 60rpx 135rpx 0 135rpx;
+}
+
+.login_button.button-hover {
+  background-color: #36a9a6;
+}
+
+.varification_button {
+  display: inline-block;
+  position: absolute;
+  margin-top: 15rpx;
+  padding: 0 15rpx;
+  right: 45rpx;
+  z-index:999;
+  height: 60rpx;
+  border-radius: 8rpx;
+  color:rgba(255, 255, 255, 1);
+  line-height:60rpx;
+  text-align:center;
+  font-size:24rpx;
+  font-family: 'Lucida Sans',
+    'Lucida Sans Regular',
+    'Lucida Grande',
+    'Lucida Sans Unicode',
+    Geneva,
+    Verdana,
+    sans-serif;
+ }
+
+ .getCode {
+  background:#00AADD;
+ }
+ .getCode_disable {
+  background-color: #c9c9c9;
+ }

+ 119 - 69
pages/ucenter/center/center.js

@@ -7,122 +7,161 @@ Page({
   data: {
     userInfo: {},
     isLogin: false,
+    isBindPhone:0,
     sexType: [{
       value: 1,
       text: '男'
     }, {
       value: 2,
       text: '女'
+    }, {
+      value: 3,
+      text: '保密'
     }],
     sexIndex: null,
-    phone: null,
+    carNum: null,
     email: null,
     checkPass: false,
     errorMsg: ''
   },
+
   inputSex(e) {
-    //console.log(this.data.sexType[e.detail.value]);
-    this.setData({
-      sexIndex: e.detail.value
-    });
-    this.checkAll();
-  },
-  inputPhone(e) {
     this.setData({
-      phone: e.detail.value
+      sexIndex: parseInt(e.detail.value)+1
     });
-    this.checkAll();
+    let userdata= {
+      sexIndex: e.detail.value,
+      carNum: null,
+      email: null,
+    };
+    this.bindUpdateUser(userdata);
   },
-  inputEmail(e) {
-    this.setData({
-      email: e.detail.value
+
+  inputCarNum(e){
+    let that = this;
+    wx.showModal({
+      title: '修改车牌号',
+      showCancel:true,
+      editable: true,
+      confirmColor:'#36a9a6',
+      success: function (res1) {
+        if (res1.confirm) {
+          let carNum = res1.content;
+          that.confirmCarNum(carNum);
+        }
+      }
     });
-    this.checkAll();
-  },
-  checkPhone() {
-    if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
-      return false;
-    }
-    return true;
   },
-  checkMail() {
-    if (!(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.email))) {
-      return false;
-    }
-    return true;
-  },
-  checkAll() {
-    if (this.data.userInfo.sex == null || (this.data.userInfo.sex != 1 && this.data.userInfo.sex != 2)){
-      if (!this.data.sexIndex) {
-        this.setData({
-          errorMsg: '请选择性别'
-        });
-        this.setData({
-          checkPass: false
-        });
-        return;
-      } else {
-        this.setData({
-          errorMsg: ''
-        });
-      }
-    }
-    if (!this.checkPhone()) {
-      this.setData({
-        errorMsg: '手机号输入有误,请重新输入'
-      });
-      this.setData({
-        checkPass: false
+
+  confirmCarNum(carNum) {
+    if (!this.checkCarNum(carNum)) {
+      wx.showModal({
+        title: '提示',
+        showCancel:false,
+        content: '车牌号输入有误,请重新输入',
+        confirmColor:'#36a9a6',
       });
       return;
     } else {
       this.setData({
+        carNum: carNum,
         errorMsg: ''
       });
     }
-    if (!this.checkMail()) {
-      this.setData({
-        errorMsg: '邮箱输入有误,请重新输入'
-      });
-      this.setData({
-        checkPass: false
+    let userdata= {
+      sexIndex: null,
+      carNum: carNum,
+      email: null,
+    };
+    this.bindUpdateUser(userdata);
+  },
+
+  inputEmail(e) {
+    let that = this;
+    wx.showModal({
+      title: '修改邮箱',
+      showCancel:true,
+      editable: true,
+      confirmColor:'#36a9a6',
+      success: function (res1) {
+        if (res1.confirm) {
+          let email = res1.content;
+          that.confirmEmail(email);
+        }
+      }
+    });
+  },
+
+  confirmEmail(email) {
+    if (!this.checkMail(email)) {
+      wx.showModal({
+        title: '提示',
+        showCancel:false,
+        content: '邮箱输入有误,请重新输入',
+        confirmColor:'#36a9a6',
       });
       return;
     } else {
       this.setData({
+        email: email,
         errorMsg: ''
       });
     }
-    this.setData({
-      checkPass: true
-    });
+    let userdata= {
+      sexIndex: null,
+      carNum: null,
+      email: email
+    };
+    this.bindUpdateUser(userdata);
+  },
+
+  checkMail(email) {
+    if (!(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(email))) {
+      return false;
+    }
+    return true;
   },
-  bindUpdateUser() {
+  checkCarNum(carNum){
+    if (carNum){
+      // if (!(/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(this.data.carNum))) {
+      if (!/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领].*$/.test(carNum)) {
+        return false;
+      }
+    }
+    return true;
+  },
+
+  bindUpdateUser(userdata) {
     let that = this;
+    if(this.data.isBindPhone==0){
+      let url = `/pages/bindPhone/bindPhone`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+
     let loginName = this.data.userInfo.loginName;
     let {
       sexIndex,
-      phone,
+      carNum: license_number,
       email
-    } = this.data;
+    } = userdata;
     var sex = null;
     if (sexIndex!=null){
       sex = this.data.sexType[sexIndex].value;
-    }else{
-      sex = this.data.userInfo.sex;
     }
+
     wx.request({
       url: getApp().globalData.postHeadAgreement + '/restapi/wechat/updateUser',
       data: {
         loginName,
         sex: sex,
-        phonenumber: phone,
+        license_number,
         email,
       },
       method: 'POST',
       success(res1) {
-        //console.log(res1);
-        //console.log(res1.data.code == 1);
         if (res1.data.code == 1) {
           that.setData({
             errorMsg: res1.data.msg
@@ -132,7 +171,13 @@ Page({
           //跳转到上一页
           wx.setStorageSync("userInfo", res1.data);
           wx.setStorageSync("isLogin", true);
-          wx.navigateBack();
+          let userInfo = wx.getStorageSync('userInfo');
+          that.setData({
+            userInfo: userInfo
+          });
+
+    
+          // wx.navigateBack();
           //let url = `/pages/ucenter/index/index`;
           //wx.redirectTo({
           //url
@@ -164,17 +209,22 @@ Page({
   onShow: function() {
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
+    let isBindPhone = wx.getStorageSync('isBindPhone');
 
     // 页面显示
     if (userInfo && isLogin) {
       //userInfo.flag = true;
-      //console.log(userInfo);
+      console.log(userInfo);
       this.setData({
         userInfo: userInfo,
         isLogin: isLogin,
-        phone: userInfo.phonenumber,
-        email:userInfo.email
+        isBindPhone:isBindPhone,
+        carNum: userInfo.license_number,
+        email:userInfo.email,
+        sexIndex:userInfo.sex
       });
+
+
     } else {
       //未登录信息
       this.setData({

+ 21 - 13
pages/ucenter/center/center.wxml

@@ -28,26 +28,37 @@
           <!-- <image class='man_img' src='/images/man.png'></image> -->
           <text class="input_text">性别</text>
         </view>
-        <input wx:if='{{userInfo.sex==1}}' disabled='true' type='text' placeholder-class='placeholder' value='男'></input>
+        <!-- <input wx:if='{{userInfo.sex==1}}' disabled='true' type='text' placeholder-class='placeholder' value='男'></input>
         <input wx:if='{{userInfo.sex==2}}' disabled='true' type='text' placeholder-class='placeholder' value='女'></input>
-        <picker wx:if='{{userInfo.sex==null||(userInfo.sex!=1&&userInfo.sex!=2)}}' class="picker" bindchange="inputSex" range-key="text" range="{{sexType}}">
-          <text wx:if='{{sexIndex==null}}'>请选择性别</text>
-          <text wx:if='{{sexIndex!=null}}'>{{sexType[sexIndex].text}}</text>
+        <input wx:if='{{userInfo.sex==3}}' disabled='true' type='text' placeholder-class='placeholder' value='保密'></input> -->
+        <picker class="picker" bindchange="inputSex" range-key="text" range="{{sexType}}">
+          <text wx:if='{{ sexIndex==null}}'>请选择性别</text>
+          <text wx:if='{{ sexIndex!=null}}'>{{sexType[sexIndex-1].text}}</text>
         </picker>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
       </view>
       <view class='input_view'>
         <view class="input_text_view">
-          <!-- <image class='phone_img' src='/images/phone.png'></image> -->
-          <text class="input_text">电话</text>
+          <!-- <image class='email_img' src='/images/email.png'></image> -->
+          <text class="input_text">邮箱</text>
+        </view>
+        <input disabled='true' bindtap="inputEmail" type='text' placeholder-class='placeholder' value='{{!userInfo.email?"去填写":userInfo.email}}'>
+        </input>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
         </view>
-        <input placeholder='请输入电话' maxlength='11' bindinput='inputPhone' type='number' placeholder-class='placeholder' value='{{phone}}'></input>
       </view>
       <view class='input_view'>
         <view class="input_text_view">
-          <!-- <image class='email_img' src='/images/email.png'></image> -->
-          <text class="input_text">邮箱</text>
+          <text class="input_text">车牌号</text>
+        </view>
+        <input disabled='true' bindtap="inputCarNum" type='text' placeholder-class='placeholder' value='{{!userInfo.license_number?"去填写":userInfo.license_number}}'>
+        </input>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
         </view>
-        <input placeholder='请输入邮箱' maxlength='48' bindinput='inputEmail' type='text' placeholder-class='placeholder' value='{{email}}'></input>
       </view>
     </view>
 
@@ -58,9 +69,6 @@
     <view class="errorMsg">
       <text>{{errorMsg}}</text>
     </view>
-    <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'bindUpdateUser':''}}">
-      保存
-    </button>
 
   </view>
 </view>

+ 19 - 6
pages/ucenter/center/center.wxss

@@ -94,10 +94,6 @@ text.bold {
   left: 0;
 }
 
-.context_input {
-  /* margin: 0rpx 30rpx 30rpx 42rpx; */
-}
-
 .context_input .input_view {
   padding: 0rpx 30rpx 0rpx 42rpx; 
   border-bottom: 2rpx solid #f1f1f1;
@@ -129,7 +125,7 @@ text.bold {
 }
 
 .context_input input {
-  width: calc(100% - 158rpx);
+  width: calc(100% - 180rpx);
   text-align: right;
   display: inline-block;
   font-size: 24rpx;
@@ -146,7 +142,7 @@ text.bold {
                  sans-serif;
 }
 .context_input picker {
-  width: calc(100% - 158rpx);
+  width: calc(100% - 180rpx);
   text-align: right;
   display: inline-block;
   font-size: 24rpx;
@@ -253,4 +249,21 @@ text.bold {
 
 .login_button.button-hover {
   background-color: #36a9a6;
+}
+
+.zan-ft{
+  margin-left: 10rpx;
+  width: 14rpx;
+  height: 90rppx;
+  line-height: 90rpx;
+  min-height: 90rpx;
+  display: inline-block;
+  position: absolute;
+}
+
+.zan-ft image{
+  display: inline-block;
+  width: 14rpx;
+  height: 24rpx;
+  /*transform:rotate(180deg);*/
 }

+ 18 - 5
pages/ucenter/index/index.js

@@ -11,7 +11,7 @@ Page({
     isLogin: false
   },
   tologin(e) {
-    let url = '/pages/login/login';
+    let url = '/pages/login/phone_login/phone_login';
     wx.navigateTo({
       url
     });
@@ -110,7 +110,7 @@ Page({
   },
   goCharginglog(e) {
     if (!this.data.isLogin) {
-      let url = `/pages/login/login`;
+      let url = `/pages/login/phone_login/phone_login`;
       wx.navigateTo({
         url
       });
@@ -123,7 +123,7 @@ Page({
   },
   goChargemoneylog(e) {
     if (!this.data.isLogin) {
-      let url = `/pages/login/login`;
+      let url = `/pages/login/phone_login/phone_login`;
       wx.navigateTo({
         url
       });
@@ -136,7 +136,7 @@ Page({
   },
   goPurse(e) {
     if (!this.data.isLogin) {
-      let url = `/pages/login/login`;
+      let url = `/pages/login/phone_login/phone_login`;
       wx.navigateTo({
         url
       });
@@ -165,6 +165,19 @@ Page({
       url
     });
   },
+  goAccountSecrity(e){
+    if (!this.data.isLogin) {
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+    let url = '/pages/ucenter/accountsecurity/index/index'
+    wx.navigateTo({
+      url
+    });
+  },
   goHelp(){
     // wx.downloadFile({
     //   //url: getApp().globalData.postHeadAgreement + '/restapi/wechat/updateUser',//要预览的PDF的地址
@@ -192,7 +205,7 @@ Page({
   },
   goNotice(){
     if (!this.data.isLogin) {
-      let url = `/pages/login/login`;
+      let url = `/pages/login/phone_login/phone_login`;
       wx.navigateTo({
         url
       });

+ 11 - 0
pages/ucenter/index/index.wxml

@@ -126,6 +126,17 @@
           <image src='/images/enter.png'></image>
         </view>
       </view>
+      <view class="zan-cell" hover-class="active" bindtap="goAccountSecrity">
+        <view class="zan-icon">
+          <image src='/images/column.png'></image>
+        </view>
+        <view class="zan-text">
+          <text>账户安全</text>
+        </view>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
+      </view>
       <view class="zan-cell" hover-class="active" bindtap="goHelp">
         <view class="zan-icon">
           <!-- <image src='/images/help.png'></image> -->

+ 14 - 5
pages/ucenter/purse/purse.js

@@ -9,10 +9,19 @@ Page({
     isLogin: false
   },
   chargemony(e) {
-    let url = "/pages/chargemoney/chargemoney";
-    wx.navigateTo({
-      url
-    });
+    let isBindPhone = wx.getStorageSync('isBindPhone');
+    if(isBindPhone==0){
+      let url = `/pages/bindPhone/bindPhone`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }else if(isBindPhone==1){
+      let url = "/pages/chargemoney/chargemoney";
+      wx.navigateTo({
+        url
+      });
+    }
   },
   withdrawDeposit(e) {
     let url = "/pages/outmoney/outmoney";
@@ -54,7 +63,7 @@ Page({
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
-          let url = '/pages/login/login';
+          let url = '/pages/login/phone_login/phone_login';
           wx.redirectTo({
             url,
           });

+ 7 - 1
project.config.json

@@ -43,7 +43,13 @@
       "list": [
         {
           "name": "登录",
-          "pathName": "pages/login/login",
+          "pathName": "/pages/login/phone_login/phone_login",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "登录",
+          "pathName": "/pages/login/username_login/username_login",
           "query": "",
           "scene": null
         },

+ 5 - 1
project.private.config.json

@@ -1,4 +1,8 @@
 {
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "libVersion": "2.26.1"
+  "libVersion": "2.25.3",
+  "projectname": "wechat-pilelog",
+  "setting": {
+    "compileHotReLoad": true
+  }
 }