浏览代码

0831修改

ssfg 4 年之前
父节点
当前提交
113d409789
共有 4 个文件被更改,包括 136 次插入41 次删除
  1. 2 2
      app.json
  2. 126 31
      pages/collectInfo/collectInfo.js
  3. 7 7
      pages/collectInfo/collectInfo.wxml
  4. 1 1
      project.config.json

+ 2 - 2
app.json

@@ -1,5 +1,6 @@
 {
   "pages": [
+    "pages/collectInfo/collectInfo",
     "pages/index/index",
     "pages/visitandinfo/visitandinfo",
     "pages/finishInfo/finishInfo",
@@ -11,8 +12,7 @@
     "pages/updatepassword/updatepassword",
     "pages/notice/notice",
     "pages/card/card",
-    "pages/personInfo/personInfo",
-    "pages/collectInfo/collectInfo"
+    "pages/personInfo/personInfo"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 126 - 31
pages/collectInfo/collectInfo.js

@@ -29,7 +29,7 @@ Page({
       }
     ],
     nameArr: [],
-    // tab1
+    // tab1老人信息
     oldInfo: [{
       name: '',
       oldSex: [{
@@ -39,7 +39,32 @@ Page({
       }],
       nation: '', //民族
       idNumber: '', //身份证号
-      phone:''
+      phone: '',
+      oldMarry: [{
+        name: "未婚"
+      }, {
+        name: "已婚"
+      }, {
+        name: "离异"
+      }, {
+        name: "丧偶"
+      }],
+      partnerName: '',
+      partnerIdNumber: '',
+      healthAyy: [{
+        name: "健康",
+        disabled: false
+      }, {
+        name: "残疾",
+        disabled: false
+      }, {
+        name: "患重特大疾病",
+        disabled: false
+      }, {
+        name: "老年人慢性病",
+        disabled: false
+      }],
+      ableStatus: ["完全自理", "半失能(部分自理)", "完全失能"],
     }],
     mzArr: ["汉族", "壮族", "满族", "回族", "苗族", "维吾尔族", "土家族", "彝族", "蒙古族", "藏族", "布依族", "侗族", "瑶族", "朝鲜族", "白族", "哈尼族",
       "哈萨克族", "黎族", "傣族", "畲族", "傈僳族", "仡佬族", "东乡族", "高山族", "拉祜族", "水族", "佤族", "纳西族", "羌族", "土族", "仫佬族", "锡伯族",
@@ -48,22 +73,22 @@ Page({
     ],
     // name: '', //老人姓名
     chooseAdressArr: [],
-    oldMarry: [
-      "未婚", "已婚", "离异", "丧偶"
-    ],
-    healthAyy: [{
-      name: "健康",
-      disabled: false
-    }, {
-      name: "残疾",
-      disabled: false
-    }, {
-      name: "患重特大疾病",
-      disabled: false
-    }, {
-      name: "老年人慢性病",
-      disabled: false
-    }],
+    // oldMarry: [
+    //   "未婚", "已婚", "离异", "丧偶"
+    // ],
+    // healthAyy: [{
+    //   name: "健康",
+    //   disabled: false
+    // }, {
+    //   name: "残疾",
+    //   disabled: false
+    // }, {
+    //   name: "患重特大疾病",
+    //   disabled: false
+    // }, {
+    //   name: "老年人慢性病",
+    //   disabled: false
+    // }],
     disabilityAyy: [
       "视力残疾", "听力残疾", "言语残疾", "肢体残疾", "智力残疾", "精神残疾", "多重残疾"
     ],
@@ -71,7 +96,7 @@ Page({
       "重大器官类疾病", "心脑血管类疾病", "神经与代谢类疾病", "肢体与病毒类疾病", "恶性肿瘤"
     ],
     disableLeval: ["一级", "二级", "三级", "四级"],
-    ableStatus: ["完全自理", "半失能(部分自理)", "完全失能"],
+    // ableStatus: ["完全自理", "半失能(部分自理)", "完全失能"],
     moneyStatus: ["建档立卡贫困户", "一般家庭", "低保", "特困供养人员"],
     moneyFromAyy: ["家庭经营性收入", "工资性收入", "转移性收入", "财产性收入", "其它"],
     payMoney: ["5000元以下", "5000-10000元", "10000元以上"],
@@ -402,8 +427,34 @@ Page({
               name: '女'
             }],
             nation: '',
-            idNumber: ''
+            idNumber: '',
+            phone: '',
+            oldMarry: [{
+              name: "未婚"
+            }, {
+              name: "已婚"
+            }, {
+              name: "离异"
+            }, {
+              name: "丧偶"
+            }],
+            partnerName: '',
+            partnerIdNumber: '',
+            healthAyy: [{
+              name: "健康",
+              disabled: false
+            }, {
+              name: "残疾",
+              disabled: false
+            }, {
+              name: "患重特大疾病",
+              disabled: false
+            }, {
+              name: "老年人慢性病",
+              disabled: false
+            }],
           })
+          console.log(this.data.oldInfo)
           this.setData({
             currentActiveIndex: this.data.nameArr.concat(res.data.data).length - 1,
             nameArr: this.data.nameArr.concat(res.data.data),
@@ -589,6 +640,7 @@ Page({
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      sex: e.detail.value
     })
   },
   // 民族选择
@@ -677,6 +729,25 @@ Page({
         oldisMarryPhone: false
       })
     }
+    let data = this.data.oldInfo[this.data.currentActiveIndex].oldMarry.map(v => {
+      if (v.name == e.detail.value) {
+        console.log("我选了")
+        return {
+          name: v.name,
+          checked: true
+        }
+      }
+      return {
+        name: v.name,
+        checked: false
+      }
+    })
+    console.log(data)
+    let oldMarry = 'oldInfo[' + this.data.currentActiveIndex + '].oldMarry'
+    this.setData({
+      [oldMarry]: data
+    })
+    console.log(this.data.oldInfo)
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
       partnerState: e.detail.value
@@ -694,6 +765,10 @@ Page({
         oldisMarryName: false
       })
     }
+    let partnerName = 'oldInfo[' + this.data.currentActiveIndex + '].partnerName'
+    this.setData({
+      [partnerName]: e.detail.value
+    })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
       partnerName: e.detail.value
@@ -717,8 +792,10 @@ Page({
       })
       return
     } else {
+      let partnerIdNumber = 'oldInfo[' + this.data.currentActiveIndex + '].partnerIdNumber'
       this.setData({
-        oldisMarryPhoneGs: false
+        oldisMarryPhoneGs: false,
+        [partnerIdNumber]: e.detail.value
       })
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.currentActiveIndex]._id,
@@ -729,7 +806,7 @@ Page({
   //老人健康状况
   tab1Change9: function (e) {
     console.log(e.detail.value)
-    const items = this.data.healthAyy
+    const items = this.data.oldInfo[this.data.currentActiveIndex].healthAyy
     const values = e.detail.value
     for (let i = 0, lenI = items.length; i < lenI; ++i) {
       items[i].checked = false
@@ -740,16 +817,17 @@ Page({
         }
       }
     }
+    let healthAyy = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy'
     this.setData({
-      healthAyy: items
-    })
-    console.log(this.data.healthAyy)
-    let revise1 = "healthAyy[1].disabled";
-    let revise2 = "healthAyy[2].disabled";
-    let revise3 = "healthAyy[3].disabled";
-    let rev1 = "healthAyy[1].checked";
-    let rev2 = "healthAyy[2].checked";
-    let rev3 = "healthAyy[3].checked";
+      [healthAyy]: items
+    })
+    console.log(this.data.oldInfo)
+    let revise1 = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy[1].disabled'
+    let revise2 = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy[2].disabled'
+    let revise3 = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy[3].disabled'
+    let rev1 = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy[1].checked'
+    let rev2 = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy[2].checked'
+    let rev3 = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy[3].checked'
     if (e.detail.value.length == 0) {
       this.setData({
         oldHealth1: true,
@@ -808,6 +886,23 @@ Page({
         issickTypeNull: false
       })
     }
+    // let data = this.data.oldInfo[this.data.currentActiveIndex].healthAyy.map(v => {
+    //   if (e.detail.value.indexOf(v.name) >= 0) {
+    //     return {
+    //       name: v.name,
+    //       checked: true
+    //     }
+    //   }
+    //   return {
+    //     name: v.name,
+    //     checked: false
+    //   }
+    // })
+    // let healthAyy = 'oldInfo[' + this.data.currentActiveIndex + '].healthAyy'
+    // console.log(healthAyy)
+    // this.setData({
+    //   [healthAyy]: data
+    // })
     if (index < 0 && e.detail.value.length != 0) {
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.currentActiveIndex]._id,

+ 7 - 7
pages/collectInfo/collectInfo.wxml

@@ -127,20 +127,20 @@
 				<view class="block">
 					<view class="name"><text class="red">*</text>婚姻及配偶情况</view>
 					<radio-group bindchange="tab1Change8">
-						<label wx:for="{{oldMarry}}" wx:key="{{item}}">
-							<radio value="{{item}}" color="#fff" />{{item}}
+						<label wx:for="{{oldInfo[currentActiveIndex].oldMarry}}" wx:key="{{item.name}}">
+							<radio value="{{item.name}}" checked="{{item.checked}}" color="#fff" />{{item.name}}
 						</label>
 					</radio-group>
 				</view>
-				<view wx:if="{{oldisMarry}}" class="block"><text class="red">*</text>配偶姓名<input bindblur="tab1Change8_1" placeholder="请填写配偶姓名" name="name" /></view>
+				<view wx:if="{{oldInfo[currentActiveIndex].oldMarry[1].checked}}" class="block"><text class="red">*</text>配偶姓名<input bindblur="tab1Change8_1" placeholder="请填写配偶姓名" value="{{oldInfo[currentActiveIndex].partnerName}}" /></view>
 				<view wx:if="{{oldisMarryName}}" class="required">配偶姓名不能为空哦!</view>
-				<view wx:if="{{oldisMarry}}" class="block"><text class="red">*</text>配偶身份证号<input bindblur="tab1Change8_2" placeholder="请填写配偶联系电话" name="name" /></view>
+				<view wx:if="{{oldInfo[currentActiveIndex].oldMarry[1].checked}}" class="block"><text class="red">*</text>配偶身份证号<input bindblur="tab1Change8_2" placeholder="请填写配偶联系电话" value="{{oldInfo[currentActiveIndex].partnerIdNumber}}" /></view>
 				<view wx:if="{{oldisMarryPhone}}" class="required">配偶身份证号不能为空哦!</view>
 				<view wx:if="{{oldisMarryPhoneGs}}" class="required">配偶身份证号格式不对哦!</view>
 				<view class="block">
 					<view class="name"><text class="red">*</text>健康状况</view>
 					<checkbox-group bindchange="tab1Change9">
-						<label wx:for="{{healthAyy}}" wx:key="{{item.name}}">
+						<label wx:for="{{oldInfo[currentActiveIndex].healthAyy}}" wx:key="{{item.name}}">
 							<checkbox value="{{item.name}}" color="#fff" disabled="{{item.disabled}}" checked="{{item.checked}}" />{{item.name}}
 						</label>
 					</checkbox-group>
@@ -173,9 +173,9 @@
 				</view>
 				<view wx:if="{{issickTypeNull}}" class="required">重特大疾病类别类别不能为空哦!</view>
 				<view class="name"><text class="red">*</text>老年人能力情况</view>
-				<picker bindchange="tab1Change12" value="{{ableStatus[ableIndex]}}" range="{{ableStatus}}">
+				<picker bindchange="tab1Change12" value="{{this.data.oldInfo[this.data.currentActiveIndex].ableStatus[ableIndex]}}" range="{{ableStatus}}">
 					<view class="picker">
-						{{ableStatus[ableIndex]}}
+						{{this.data.oldInfo[this.data.currentActiveIndex].ableStatu[ableIndex]}}
 					</view>
 				</picker>
 				<view class="name"><text class="red">*</text>生活经济情况</view>

+ 1 - 1
project.config.json

@@ -22,7 +22,7 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useCompilerModule": false,
+		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",