Ver Fonte

0914完善信息的问题

roose há 4 anos atrás
pai
commit
4d87d7ac7a
1 ficheiros alterados com 43 adições e 43 exclusões
  1. 43 43
      pages/finishInfo/finishInfo.js

+ 43 - 43
pages/finishInfo/finishInfo.js

@@ -324,54 +324,54 @@ Page({
             item.checked = true;
           }
         })
-        // 赋值问题 
-        // let jonIndex = this.data.postList.findIndex(item => {
-        //   return item.name == res.data.data.job
-        // })
-        // if (jonIndex != -1) {
-        //   this.setData({
-        //     posttext: '',
-        //     postindex: jonIndex,
-        //   })
-        // } else {
-        //   this.setData({
-        //     posttext: '请选择',
-        //   })
-        // }
-        // let incomeindex = this.data.incomeList.findIndex(item => {
-        //   return item.name == res.data.data.income
-        // })
-        // if (incomeindex != -1) {
-        //   this.setData({
-        //     incometext: '',
-        //     incomeindex: incomeindex,
-        //   })
-        // } else {
-        //   this.setData({
-        //     incometext: '请选择',
-        //   })
-        // }
-        // let educationindex = this.data.educationList.findIndex(item => {
-        //   return item.name == res.data.data.education
-        // })
-        // if (educationindex != -1) {
-        //   this.setData({
-        //     educationindextext: '',
-        //     educationindex: educationindex,
-        //   })
-        // } else {
-        //   this.setData({
-        //     educationtext: '请选择',
-        //   })
-        // }
+        //赋值问题 
+        let jonIndex = this.data.postList.findIndex(item => {
+          return item.name == res.data.data.job
+        })
+        if (jonIndex != -1) {
+          this.setData({
+            posttext: '',
+            postindex: jonIndex,
+          })
+        } else {
+          this.setData({
+            posttext: '请选择',
+          })
+        }
+        let incomeindex = this.data.incomeList.findIndex(item => {
+          return item.name == res.data.data.income
+        })
+        if (incomeindex != -1) {
+          this.setData({
+            incometext: '',
+            incomeindex: incomeindex,
+          })
+        } else {
+          this.setData({
+            incometext: '请选择',
+          })
+        }
+        let educationindex = this.data.educationList.findIndex(item => {
+          return item.name == res.data.data.education
+        })
+        if (educationindex != -1) {
+          this.setData({
+            educationindextext: '',
+            educationindex: educationindex,
+          })
+        } else {
+          this.setData({
+            educationtext: '请选择',
+          })
+        }
         this.setData({
           userName: res.data.data.userName,
           parameter: this.data.parameter,
           idCardNumber: res.data.data.idCardNumber,
           age: res.data.data.age,
-          posttext: res.data.data.job,
-          incometext: res.data.data.income,
-          educationtext: res.data.data.education,
+          // posttext: res.data.data.job,
+          // incometext: res.data.data.income,
+          // educationtext: res.data.data.education,
         })
         console.log(this.data.postList, "赋值上了么");