浏览代码

用户信息

zhaoxiaohai 3 年之前
父节点
当前提交
3dfa7aa01e
共有 1 个文件被更改,包括 5 次插入13 次删除
  1. 5 13
      pages/tabbar/mine/userMsg/index.js

+ 5 - 13
pages/tabbar/mine/userMsg/index.js

@@ -1,6 +1,7 @@
 let time = null;
 const _Http = getApp().globalData.http;
-const MD5 = require('../../../../utils/md5');
+const MD5 = require('../../../../utils/md5'),
+    deletMark = require("../../../../utils/deleteMark");
 Page({
     /**
      * 页面的初始数据
@@ -38,10 +39,7 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-        /*         console.log(options)
-                let auth = options.auth ? JSON.parse(options.auth) : {};
-                    auth
-                */
+        const that = this;
         this.setData({
             attinfos: JSON.parse(options.attinfos),
             "fromList1[0].value": options.name,
@@ -75,10 +73,7 @@ Page({
             title: '已发送验证码,请勿重新发送',
             icon: "none"
         });
-        if (this.data.newPhone.trim().length != 11) return wx.showToast({
-            title: '请输入正常手机号码',
-            icon: "none"
-        })
+        if (!deletMark.CheckPhoneNumber(this.data.newPhone.trim() - 0)) return;
         _Http.basic({
             "classname": "common.usercenter.usercenter",
             "method": "updateUserMsg_getPassWord",
@@ -107,10 +102,7 @@ Page({
     submit() {
         if (this.data.disabled || this.data.loading) return;
         let data = this.selectComponent("#form1").getData().returnData;
-        if (data.phonenumber.length != 11) return wx.showToast({
-            title: '请输入正常手机号码',
-            icon: "none"
-        });
+        if (!deletMark.CheckPhoneNumber(data.phonenumber.trim() - 0)) return;
         if (this.data.show && this.data.password.length == 0) return wx.showToast({
             title: '请输入短信验证码',
             icon: "none"