YY пре 3 година
родитељ
комит
17f3e82250
2 измењених фајлова са 8 додато и 18 уклоњено
  1. 7 13
      pages/information/index.js
  2. 1 5
      pages/information/index.wxml

+ 7 - 13
pages/information/index.js

@@ -14,6 +14,13 @@ Page({
         gender: [{ id: '0', name: '男' }, { id: 1, name: '女' },],
         gender: [{ id: '0', name: '男' }, { id: 1, name: '女' },],
         index: 0,
         index: 0,
     },
     },
+    //验证必填项
+    initValidate() {
+        const rules = { phone: { required: true, tel: true }, }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { phone: { required: '请输入手机号' }, };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
     back: function () {
     back: function () {
         wx.navigateBack({ url: '/pages/me/index' })
         wx.navigateBack({ url: '/pages/me/index' })
     },
     },
@@ -48,9 +55,6 @@ Page({
         } else {
         } else {
             value.icon = this.data.fileList;
             value.icon = this.data.fileList;
             value.id = this.data.form.id;
             value.id = this.data.form.id;
-            value.status = this.data.form.status;
-            value.type = this.data.form.type;
-            value.gender = this.data.form.gender;
             wx.request({
             wx.request({
                 url: `${app.globalData.publicUrl}/courtAdmin/api/user/${value.id}`, //接口地址
                 url: `${app.globalData.publicUrl}/courtAdmin/api/user/${value.id}`, //接口地址
                 method: "post",
                 method: "post",
@@ -84,14 +88,6 @@ Page({
         this.searchHeight();
         this.searchHeight();
         // 监听用户是否登录
         // 监听用户是否登录
         this.watchLogin();
         this.watchLogin();
-
-    },
-    //验证必填项
-    initValidate() {
-        const rules = { phone: { required: true, tel: true }, }
-        // 验证字段的提示信息,若不传则调用默认的信息
-        const messages = { phone: { required: '请输入手机号' }, };
-        this.WxValidate = new WxValidate(rules, messages)
     },
     },
     // 计算高度
     // 计算高度
     searchHeight: function () {
     searchHeight: function () {
@@ -130,8 +126,6 @@ Page({
             }
             }
         })
         })
     },
     },
-
-
     /**
     /**
      * 生命周期函数--监听页面初次渲染完成
      * 生命周期函数--监听页面初次渲染完成
      */
      */

+ 1 - 5
pages/information/index.wxml

@@ -16,13 +16,9 @@
                 </view>
                 </view>
                 <view class="one">
                 <view class="one">
                     <view class="text">性别</view>
                     <view class="text">性别</view>
-                    <picker name="gender" mode="selector" bindchange="bindPickerChange" range-key="name" range="{{gender}}">
+                    <picker name="gender" mode="selector" bindchange="bindPickerChange" range-key="name" value="{{form.gender}}" range="{{gender}}">
                         <view class="input">{{form.gender}}</view>
                         <view class="input">{{form.gender}}</view>
                     </picker>
                     </picker>
-                    <!-- <picker class="picker" mode="selector" bindchange="typeChange" name="type" range-key="value" range="{{typeList}}">
-                        <view class="weui-select">{{form.type_name||'用户类别'}}</view>
-                    </picker> -->
-
                 </view>
                 </view>
                 <view class="one">
                 <view class="one">
                     <view class="text">岗位</view>
                     <view class="text">岗位</view>