ZhangWenQiang пре 6 година
родитељ
комит
842cfc3c29
1 измењених фајлова са 14 додато и 6 уклоњено
  1. 14 6
      pages/user-info/user-info.js

+ 14 - 6
pages/user-info/user-info.js

@@ -29,7 +29,7 @@ Page({
     sex: ["男", "女"],
     sex_index: 0,
     eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
-    eduIndex: 1,
+    eduIndex: 0,
     avatar: '',
     headImg: '',
     name: '',
@@ -49,7 +49,7 @@ Page({
     this.setData({
       avatar: `${imgServerUrl}/images/avatar/man.png`,
       endDate: new Date().getFullYear(),
-      year: '1993'
+      year: '请选择'
     })
     let phone = updataStorageData('phone')
     if (phone) {
@@ -144,10 +144,10 @@ Page({
       year,
       iphone
     } = this.data
-    if (avatar == (imgServerUrl + "/images/avatar/man.png")) {
-      showToast('请上传头像');
-      return false;
-    }
+    // if (avatar == (imgServerUrl + "/images/avatar/man.png")) {
+    //   showToast('请上传头像');
+    //   return false;
+    // }
     if (name == "") {
       showToast('请输入用户名');
       return false;
@@ -156,6 +156,14 @@ Page({
       showToast('请输入11位手机号');
       return false;
     }
+    if (this.data.year == "" || this.data.year == '请选择') {
+      showToast('请选择出生年月');
+      return false;
+    }
+    if (this.data.eduIndex == "" || this.data.eduIndex == '0') {
+      showToast('请选择您的最高学历');
+      return false;
+    }
     return true
   },