ssfg пре 4 година
родитељ
комит
97e02c7539
4 измењених фајлова са 515 додато и 144 уклоњено
  1. 459 87
      pages/collectInfo/collectInfo.js
  2. 55 55
      pages/collectInfo/collectInfo.wxml
  3. 0 1
      pages/idCard/idCard.js
  4. 1 1
      project.config.json

+ 459 - 87
pages/collectInfo/collectInfo.js

@@ -28,35 +28,41 @@ Page({
         name: '女',
       }
     ],
+    nameArr: [],
+    // tab1
+    oldInfo: [{
+      name: '',
+      oldSex: [{
+        name: '男'
+      }, {
+        name: '女'
+      }],
+      nation: '', //民族
+      idNumber: '', //身份证号
+      phone:''
+    }],
     mzArr: ["汉族", "壮族", "满族", "回族", "苗族", "维吾尔族", "土家族", "彝族", "蒙古族", "藏族", "布依族", "侗族", "瑶族", "朝鲜族", "白族", "哈尼族",
       "哈萨克族", "黎族", "傣族", "畲族", "傈僳族", "仡佬族", "东乡族", "高山族", "拉祜族", "水族", "佤族", "纳西族", "羌族", "土族", "仫佬族", "锡伯族",
       "柯尔克孜族", "达斡尔族", "景颇族", "毛南族", "撒拉族", "布朗族", "塔吉克族", "阿昌族", "普米族", "鄂温克族", "怒族", "京族", "基诺族", "德昂族", "保安族",
       "俄罗斯族", "裕固族", "乌孜别克族", "门巴族", "鄂伦春族", "独龙族", "塔塔尔族", "赫哲族", "珞巴族"
     ],
-    nameArr: [],
-    // tab1
-    name: '', //老人姓名
+    // name: '', //老人姓名
     chooseAdressArr: [],
-    oldSex: ['男', '女'],
     oldMarry: [
       "未婚", "已婚", "离异", "丧偶"
     ],
     healthAyy: [{
       name: "健康",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "残疾",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "患重特大疾病",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "老年人慢性病",
-      disabled: false,
-      // checked: false
+      disabled: false
     }],
     disabilityAyy: [
       "视力残疾", "听力残疾", "言语残疾", "肢体残疾", "智力残疾", "精神残疾", "多重残疾"
@@ -75,50 +81,39 @@ Page({
     loneArr: ["是", "否"],
     liveStatus: [{
       name: "无人陪伴居住",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "配偶",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "近亲属",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "未成年孙子女",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "其他情形",
-      disabled: false,
-      // checked: false
+      disabled: false
     }],
 
     oftenMan: [{
       name: "无人照料",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "近亲属",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "配偶",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "邻里互助",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "购买养老服务",
-      disabled: false,
-      // checked: false
+      disabled: false
     }, {
       name: "其他人员",
-      disabled: false,
-      // checked: false
+      disabled: false
     }],
     lookafterSex: ["男", "女"],
     loveRequire: ["生活照料", "生产帮助", "精神慰藉", "医疗保健", "权益维护", "安全监护", "文化娱乐", "紧急救助", "其它"],
@@ -157,7 +152,39 @@ Page({
       '0个', '1个', '2个', '3个', '3个以上'
     ],
     childInfo: [],
+    ischildName: [false, false, false],
+    childSexArr: ['男', '女'],
+    ischildPhone: [false, false, false],
+    childIsout: ['是', '否'],
+    showchildOut: [false, false, false],
+    ischildOutReason: [false, false, false],
+    region0: [
+      ['', '', ''],
+      ['', '', ''],
+      ['', '', '']
+    ],
+    childLeaveDate: ['', '', ''],
+    childIsMArry: ['是', '否'],
+    ischildMarry: [false, false, false],
+    ischildMarryName: [false, false, false],
+    ischildMarryPhone: [false, false, false],
+    childTfTimes: ['0次', '1次', '2次及以上'],
     //  tab3
+    otherInfo: {
+      name: '', // 其他赡养人姓名,
+      sex: '', //其他赡养人性别
+      phone: '', //其他赡养人电话,
+      relation: '', //与被赡养人关系 如果选了其他也是必填 单选
+      relationExt: '', //与被赡养人关系--其他
+      isHasGoOut: '', //是否外出
+      outgoingCause: '', //外出原因
+      outgoingplace: '', // 外出地点
+      outgoingTime: '', // 最后一次离家时间
+      isHasPartner: '', //是否有配偶  当是的时候  子女配偶姓名 子女配偶电话 必填   0:是  1:否
+      name2: '',
+      phone2: '',
+      visit: '', //平均一年探望次数
+    },
     othersyrArr: ['是', '否'],
     othersyrSexArr: ['男', '女'],
     othersyrRelation: [
@@ -165,12 +192,18 @@ Page({
     ],
     othersyrIsout: ['是', '否'],
     region: ['', '', ''],
-    customItem: '其它',
+    // customItem: '其它',
     othersyrIsMarry: ['是', '否'],
     othersyrTfTimes: [
       '0次', '1次', '2次及以上'
     ],
     // tab4
+    regularsInfo: {
+      visitMode: '', //巡访方式 如果选了其他也是必填 多选
+      visitModeExt: '', //巡访方式--其它
+      visitCount: '', //巡访频次, 如果选了其他也是必填 单选
+      visitCountExt: '', //巡访频次--其它
+    },
     visitWays: [{
       name: '电话问候'
     }, {
@@ -222,6 +255,59 @@ Page({
     this.setData({
       currentActiveIndex: e.currentTarget.dataset.index,
     })
+    wx.request({
+      url: util.globalData.publicUrl + '/wxinfo/one',
+      method: "get",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        id: e.currentTarget.dataset.item._id
+      },
+      success: (res) => {
+        if (res.data.code == 0) {
+          // this.setData({
+          //   name: res.data.data.name
+          // })
+          // // 判断性别有没有
+          // if (res.data.data.sex) {
+          //   this.setData({
+          //     oldSex: [{
+          //       name: '男',
+          //       checked: false
+          //     }, {
+          //       name: '女',
+          //       checked: false
+          //     }]
+          //   })
+          //   let sexIndex = this.data.oldSex.findIndex(v => v.name == res.data.data.sex)
+          //   this.data.oldSex[sexIndex].checked = "true"
+          //   this.setData({
+          //     oldSex: this.data.oldSex
+          //   })
+          // } else {
+          //   this.setData({
+          //     oldSex: [{
+          //       name: '男',
+          //       checked: false
+          //     }, {
+          //       name: '女',
+          //       checked: false
+          //     }]
+          //   })
+          // }
+          // if (res.data.data.idNumber) {
+          //   this.setData({
+          //     idNumber: res.data.data.idNumber
+          //   })
+          // } else {
+          //   this.setData({
+          //     idNumber: ''
+          //   })
+          // }
+        }
+      }
+    })
   },
   sure() {
     let han = /^[\u4e00-\u9fa5]+$/;
@@ -260,10 +346,11 @@ Page({
       },
       success: (res) => {
         if (res.data.code == 0) {
+          let name = 'oldInfo[' + this.data.currentActiveIndex + '].name'
           this.setData({
             nameArr: this.data.nameArr.concat(res.data.data),
             familyFid: res.data.data.fid,
-            name: res.data.data.name
+            [name]: this.data.addOldname
           })
         }
       }
@@ -307,12 +394,21 @@ Page({
       },
       success: (res) => {
         if (res.data.code == 0) {
+          this.data.oldInfo.push({
+            name: this.data.addOldname1,
+            oldSex: [{
+              name: '男'
+            }, {
+              name: '女'
+            }],
+            nation: '',
+            idNumber: ''
+          })
           this.setData({
             currentActiveIndex: this.data.nameArr.concat(res.data.data).length - 1,
-            nameArr: this.data.nameArr.concat(res.data.data)
+            nameArr: this.data.nameArr.concat(res.data.data),
+            oldInfo: this.data.oldInfo
           })
-          console.log(this.data.nameArr, '我是添加了一个人之后的数组')
-          console.log(this.data.currentActiveIndex, '我是活跃的当前索引')
         }
       }
     })
@@ -475,17 +571,32 @@ Page({
   },
   // 性别单选
   tab1Change2(e) {
-    console.log(e.detail.value)
+    let data = this.data.oldInfo[this.data.currentActiveIndex].oldSex.map(v => {
+      if (v.name == e.detail.value) {
+        return {
+          name: v.name,
+          checked: true
+        }
+      }
+      return {
+        name: v.name,
+        checked: false
+      }
+    })
+    let oldSex = 'oldInfo[' + this.data.currentActiveIndex + '].oldSex'
+    this.setData({
+      [oldSex]: data
+    })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
-      sex: e.detail.value
     })
   },
   // 民族选择
   tab1Change3: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
+    let nation = 'oldInfo[' + this.data.currentActiveIndex + '].nation'
     this.setData({
-      mzIndex: e.detail.value
+      [nation]: this.data.mzArr[e.detail.value]
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
@@ -515,6 +626,10 @@ Page({
       this.setData({
         oldCard1: false
       })
+      let idNumber = 'oldInfo[' + this.data.currentActiveIndex + '].idNumber'
+      this.setData({
+        [idNumber]: e.detail.value
+      })
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.currentActiveIndex]._id,
         idNumber: e.detail.value
@@ -1385,22 +1500,184 @@ Page({
   },
   // 子女姓名
   tab2Change2: function (e) {
-    console.log(e)
-    console.log(this.data.childforTimes)
-    console.log(this.data.childInfo, '111111111')
+    let val = 'ischildName[' + e.currentTarget.dataset.index + ']';
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].name';
+    if (e.detail.value == '' || e.detail.value == null) {
+      this.setData({
+        [val]: true
+      })
+    } else {
+      this.setData({
+        [val]: false,
+        [child]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        childInfo: JSON.stringify(this.data.childInfo)
+      })
+    }
+  },
+  // 子女性别
+  tab2Change3: function (e) {
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].sex';
     this.setData({
-      'childInfo[0].name': e.detail.value
+      [child]: e.detail.value
     })
-    console.log(this.data.childInfo, '000000000000')
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
       childInfo: JSON.stringify(this.data.childInfo)
     })
   },
-  // 子女性别
-  tab2Change3: function (e) {
+  // 子女联系电话
+  tab2Change4: function (e) {
+    let val = 'ischildPhone[' + e.currentTarget.dataset.index + ']';
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].phone';
+    if (e.detail.value == null || e.detail.value == '') {
+      this.setData({
+        [val]: true
+      })
+    } else {
+      this.setData({
+        [val]: false,
+        [child]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        childInfo: JSON.stringify(this.data.childInfo)
+      })
+    }
+  },
+  // 子女是否外出
+  tab2Change5: function (e) {
+    console.log(e.detail.value)
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].isHasGoOut';
+    let out = 'showchildOut[' + e.currentTarget.dataset.index + ']';
+    this.setData({
+      [child]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      childInfo: JSON.stringify(this.data.childInfo)
+    })
+    if (e.detail.value == '是') {
+      this.setData({
+        [out]: true
+      })
+    } else {
+      this.setData({
+        [out]: false
+      })
+    }
+  },
+  //外出原因
+  tab2Change6: function (e) {
+    let val = 'ischildOutReason[' + e.currentTarget.dataset.index + ']';
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].outgoingCause';
+    if (e.detail.value == null || e.detail.value == '') {
+      this.setData({
+        [val]: true
+      })
+    } else {
+      this.setData({
+        [val]: false,
+        [child]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        childInfo: JSON.stringify(this.data.childInfo)
+      })
+    }
+  },
+  // 外出地点
+  tab2Change7: function (e) {
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].outgoingplace';
+    let re = 'region0[' + e.currentTarget.dataset.index + ']';
+    this.setData({
+      [re]: e.detail.value,
+      [child]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      childInfo: JSON.stringify(this.data.childInfo)
+    })
+  },
+  // 最后一次离家时间
+  tab2Change8: function (e) {
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].outgoingTime';
+    let re = 'childLeaveDate[' + e.currentTarget.dataset.index + ']';
+    this.setData({
+      [re]: e.detail.value,
+      [child]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      childInfo: JSON.stringify(this.data.childInfo)
+    })
+  },
+  // 是否有配偶
+  tab2Change9: function (e) {
+    console.log(e.detail.value)
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].isHasPartner';
+    let out = 'ischildMarry[' + e.currentTarget.dataset.index + ']';
+    if (e.detail.value == '是') {
+      this.setData({
+        [out]: true,
+        [child]: e.detail.value
+      })
+    } else {
+      this.setData({
+        [out]: false,
+        [child]: e.detail.value
+      })
+    }
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      childInfo: JSON.stringify(this.data.childInfo)
+    })
+  },
+  // 配偶姓名
+  tab2Change10: function (e) {
+    let val = 'ischildMarryName[' + e.currentTarget.dataset.index + ']';
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].name2';
+    if (e.detail.value == null || e.detail.value == '') {
+      this.setData({
+        [val]: true
+      })
+    } else {
+      this.setData({
+        [val]: false,
+        [child]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        childInfo: JSON.stringify(this.data.childInfo)
+      })
+    }
+  },
+  // 配偶联系电话
+  tab2Change11: function (e) {
+    let val = 'ischildMarryPhone[' + e.currentTarget.dataset.index + ']';
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].phone2';
+    if (e.detail.value == null || e.detail.value == '') {
+      this.setData({
+        [val]: true
+      })
+    } else {
+      this.setData({
+        [val]: false,
+        [child]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        childInfo: JSON.stringify(this.data.childInfo)
+      })
+    }
+  },
+  // 一年探望次数
+  tab2Change12: function (e) {
+    let child = 'childInfo[' + e.currentTarget.dataset.index + '].visit';
     this.setData({
-      'childInfo.sex': e.detail.value
+      [child]: e.detail.value
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.currentActiveIndex]._id,
@@ -1410,34 +1687,54 @@ Page({
   // tab3是否有赡养人状态改变
   tab3Change1: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
-    this.setData({
-      syrIndex: e.detail.value
-    })
     if (e.detail.value == 0) {
       this.setData({
-        isHaveOther: true
+        isHaveOther: true,
+        syrIndex: e.detail.value
       })
     } else {
       this.setData({
-        isHaveOther: false
+        isHaveOther: false,
+        syrIndex: e.detail.value
       })
     }
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      isHasOther: this.data.othersyrArr[e.detail.value]
+    })
+  },
+  // 其他赡养人性别
+  tab2Change3: function (e) {
+    let info = 'otherInfo.sex';
+    this.setData({
+      [info]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
+    })
   },
   // 其他赡养人姓名
   tab3Change2: function (e) {
-    console.log(e.detail.value)
+    let info = 'otherInfo.name';
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isothersyrName: true
       })
     } else {
       this.setData({
-        isothersyrName: false
+        isothersyrName: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        otherInfo: JSON.stringify(this.data.otherInfo)
       })
     }
   },
   // 其他赡养人电话
   tab3Change4: function (e) {
+    let info = 'otherInfo.phone';
     console.log(e.detail.value)
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
@@ -1445,14 +1742,21 @@ Page({
       })
     } else {
       this.setData({
-        isothersyrPhone: false
+        isothersyrPhone: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        otherInfo: JSON.stringify(this.data.otherInfo)
       })
     }
   },
   // 与被赡养人关系状态改变
   tab3Change5: function (e) {
+    let info = 'otherInfo.relation';
     this.setData({
-      othersyrRelationIndex: e.detail.value
+      othersyrRelationIndex: e.detail.value,
+      [info]: this.data.othersyrRelation[e.detail.value]
     })
     if (e.detail.value == 3) {
       this.setData({
@@ -1463,24 +1767,36 @@ Page({
         syrRelationQT: false
       })
     }
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
+    })
   },
   // 输选择其他时入与被赡养人其他关系
   tab3Change6: function (e) {
+    let info = 'otherInfo.relationExt';
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isothersyRelation: true
       })
     } else {
       this.setData({
-        isothersyRelation: false
+        isothersyRelation: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        otherInfo: JSON.stringify(this.data.otherInfo)
       })
     }
   },
-  // 是否外出状态改变
+  // 是否外出
   tab3Change7: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
+    let info = 'otherInfo.isHasGoOut';
     this.setData({
-      othersyrIsoutIndex: e.detail.value
+      othersyrIsoutIndex: e.detail.value,
+      [info]: this.data.othersyrIsout[e.detail.value]
     })
     if (e.detail.value == 0) {
       this.setData({
@@ -1491,38 +1807,62 @@ Page({
         showothersyrOut: false
       })
     }
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
+    })
   },
   // 外出原因
   tab3Change8: function (e) {
+    let info = 'otherInfo.outgoingCause';
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isOutReason: true
       })
     } else {
       this.setData({
-        isOutReason: false
+        isOutReason: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        otherInfo: JSON.stringify(this.data.otherInfo)
       })
     }
   },
   // 外出地点改变
   tab3Change9: function (e) {
+    let info = 'otherInfo.outgoingplace';
     console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({
-      region: e.detail.value
+      region: e.detail.value,
+      [info]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
     })
   },
   //最后一次离家时间
   tab3Change10: function (e) {
+    let info = 'otherInfo.outgoingTime';
     console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({
-      date: e.detail.value
+      date: e.detail.value,
+      [info]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
     })
   },
   //是否有配偶
   tab3Change11: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
+    let info = 'otherInfo.isHasPartner';
     this.setData({
-      othersyrIsMarryIndex: e.detail.value
+      othersyrIsMarryIndex: e.detail.value,
+      [info]: this.data.othersyrIsMarry[e.detail.value]
     })
     if (e.detail.value == 0) {
       this.setData({
@@ -1533,40 +1873,63 @@ Page({
         isMarry: false
       })
     }
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
+    })
   },
   // 配偶姓名
   tab3Change12: function (e) {
+    let info = 'otherInfo.name2';
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isMarryName: true
       })
     } else {
       this.setData({
-        isMarryName: false
+        isMarryName: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        otherInfo: JSON.stringify(this.data.otherInfo)
       })
     }
   },
   // 配偶电话
   tab3Change13: function (e) {
+    let info = 'otherInfo.phone2';
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isMarryPhone: true
       })
     } else {
       this.setData({
-        isMarryPhone: false
+        isMarryPhone: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        otherInfo: JSON.stringify(this.data.otherInfo)
       })
     }
   },
   //平均一年探望次数
   tab3Change14: function (e) {
+    let info = 'otherInfo.visit';
     console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({
-      othersyrTfTimesIndex: e.detail.value
+      othersyrTfTimesIndex: e.detail.value,
+      [info]: this.data.othersyrTfTimes[e.detail.value]
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      otherInfo: JSON.stringify(this.data.otherInfo)
     })
   },
-  // tab4巡访方式状态改变
+  // tab4巡访方式
   tab4Change1(e) {
+    let info = 'regularsInfo.visitMode'
     let index = e.detail.value.indexOf('其它')
     if (e.detail.value.length == 0) {
       this.setData({
@@ -1574,7 +1937,12 @@ Page({
       })
     } else {
       this.setData({
-        isnull1: false
+        isnull1: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        regularsInfo: JSON.stringify(this.data.regularsInfo)
       })
     }
     if (index >= 0) {
@@ -1587,35 +1955,36 @@ Page({
         isVisitwaysnull: false
       })
     }
-    const items = this.data.visitWays
-    for (let i = 0, len = items.length; i < len; ++i) {
-      items[i].checked = items[i].value === e.detail.value
-    }
-    this.setData({
-      visitWays: items
-    })
   },
   tab4Change2(e) {
+    let info = 'regularsInfo.visitModeExt'
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isVisitwaysnull: true
       })
     } else {
       this.setData({
-        isVisitwaysnull: false
+        isVisitwaysnull: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        regularsInfo: JSON.stringify(this.data.regularsInfo)
       })
     }
   },
   // tab4巡访频次状态改变
   tab4Change3(e) {
     console.log(e.detail.value)
+    let info = 'regularsInfo.visitCount'
     if (e.detail.value.length == 0) {
       this.setData({
         isnull2: true
       })
     } else {
       this.setData({
-        isnull2: false
+        isnull2: false,
+        [info]: e.detail.value
       })
     }
     if (e.detail.value == '其它') {
@@ -1628,22 +1997,25 @@ Page({
         isVisittimesnull: false
       })
     }
-    const items = this.data.visitTimes
-    for (let i = 0, len = items.length; i < len; ++i) {
-      items[i].checked = items[i].value === e.detail.value
-    }
-    this.setData({
-      visitTimes: items
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.currentActiveIndex]._id,
+      regularsInfo: JSON.stringify(this.data.regularsInfo)
     })
   },
   tab4change4(e) {
+    let info = 'regularsInfo.visitCountExt'
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
         isVisittimesnull: true
       })
     } else {
       this.setData({
-        isVisittimesnull: false
+        isVisittimesnull: false,
+        [info]: e.detail.value
+      })
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.currentActiveIndex]._id,
+        regularsInfo: JSON.stringify(this.data.regularsInfo)
       })
     }
   },

+ 55 - 55
pages/collectInfo/collectInfo.wxml

@@ -3,7 +3,7 @@
 	<view class="writeOldmanName" wx:if="{{showBj}}">
 		<view class="OldmanName_box">
 			<view class="oldmanname">请输入老人姓名</view>
-			<input auto-focus style="margin-left:50rpx;margin-top:30rpx;border:1px solid #279bff" bindinput="addOldName" value="{{addOldname}}" placeholder="请填写老人姓名" />
+			<input auto-focus style="margin-left:50rpx;margin-top:30rpx;border:1px solid #279bff" bindblur="addOldName" value="{{addOldname}}" placeholder="请填写老人姓名" />
 			<view class="btn_box">
 				<view class="sure" bindtap="sure">确定</view>
 				<view class="esc" bindtap="qx">取消</view>
@@ -13,7 +13,7 @@
 	<view class="writeOldmanName" wx:if="{{showBj1}}">
 		<view class="OldmanName_box">
 			<view class="oldmanname">请输入老人姓名</view>
-			<input auto-focus style="margin-left:50rpx;margin-top:30rpx;border:1px solid #279bff" bindinput="addOldName1" value="{{addOldname1}}" placeholder="请填写老人姓名" />
+			<input auto-focus style="margin-left:50rpx;margin-top:30rpx;border:1px solid #279bff" bindblur="addOldName1" value="{{addOldname1}}" placeholder="请填写老人姓名" />
 			<view class="btn_box">
 				<view class="sure" bindtap="sure1">确定</view>
 				<view class="esc" bindtap="qx1">取消</view>
@@ -77,8 +77,8 @@
 	<view class="right">
 		<view class="name_box">
 			<view class="name_smallName">
-				<view class="{{currentActiveIndex==index?'unsinglename':'singlename'}}" wx:for="{{nameArr}}" wx:key="{{item}}" >
-					<view style="line-height:50rpx" data-index="{{index}}" bindtap="switchNameTab">{{item.name}}</view>
+				<view class="{{currentActiveIndex==index?'unsinglename':'singlename'}}" wx:for="{{nameArr}}" wx:key="{{item}}">
+					<view style="line-height:50rpx" data-item="{{item}}" data-index="{{index}}" bindtap="switchNameTab">{{item.name}}</view>
 					<van-icon bindtap="deleteName" data-item="{{item}}" data-index="{{index}}" name="close" style="margin-left:25rpx;" />
 				</view>
 			</view>
@@ -87,42 +87,42 @@
 			</view>
 		</view>
 		<view class="form_box">
-			<view wx:if="{{currentIndex==0}}" bindtap="goOcr">
-				<view class="scan">
+			<view wx:if="{{currentIndex==0}}">
+				<view class="scan" bindtap="goOcr">
 					<van-icon name="photograph" color="#2087f7" size="30rpx" style="margin-left:20rpx" />
 					<!-- <image src="../../images/mz/upload.png" style="width:40rpx;height:40rpx;margin-top:5rpx;margin-left:20rpx"></image>-->
 					<text>可拍身份证照片上传基本信息</text>
 				</view>
-				<view class="block"><text class="red">*</text>姓名<input bindblur="tab1Change1" placeholder="请填写老人姓名" value="{{name}}" /></view>
+				<view class="block"><text class="red">*</text>姓名<input bindblur="tab1Change1" placeholder="请填写老人姓名" value="{{oldInfo[currentActiveIndex].name}}" /></view>
 				<view wx:if="{{oldName}}" class="required">老人姓名不能为空哦!</view>
 				<view class="block">
 					<view class="name"><text class="red">*</text>性别</view>
 					<radio-group bindchange="tab1Change2">
-						<label wx:for="{{oldSex}}" wx:key="{{item}}">
-							<radio value="{{item}}" color="#fff" />{{item}}
+						<label wx:for="{{oldInfo[currentActiveIndex].oldSex}}" wx:key="{{item.name}}">
+							<radio value="{{item.name}}" checked="{{item.checked}}" color="#fff" />{{item.name}}
 						</label>
 					</radio-group>
 				</view>
 				<view class="name"><text class="red">*</text>民族</view>
-				<picker bindchange="tab1Change3" value="{{mzArr[mzIndex]}}" range="{{mzArr}}">
+				<picker bindchange="tab1Change3" value="{{oldInfo[currentActiveIndex].nation}}" range="{{mzArr}}">
 					<view class="picker">
-						{{mzArr[mzIndex]}}
+						{{oldInfo[currentActiveIndex].nation}}
 					</view>
 				</picker>
-				<view class="block"><text class="red">*</text>身份证号<input bindblur="tab1Change4" placeholder="请填写老人身份证号" name="name" /></view>
+				<view class="block"><text class="red">*</text>身份证号<input bindblur="tab1Change4" placeholder="请填写老人身份证号" value="{{oldInfo[currentActiveIndex].idNumber}}" /></view>
 				<view wx:if="{{oldCard}}" class="required">老人身份证号不能为空哦!</view>
 				<view wx:if="{{oldCard1}}" class="required">老人身份证号格式不对哦!</view>
-				<view class="block"><text class="red">*</text>联系电话<input bindblur="tab1Change5" placeholder="请填写联系电话" name="name" /></view>
+				<view class="block"><text class="red">*</text>联系电话<input bindblur="tab1Change5" placeholder="请填写联系电话" value="{{oldInfo[currentActiveIndex].phone}}" /></view>
 				<view wx:if="{{oldPhone}}" class="required">老人联系电话不能为空哦!</view>
 				<view wx:if="{{oldPhone1}}" class="required">老人联系电话格式不对哦!</view>
 				<view class="block"><text class="red">*</text>户籍地址
 					<view class="otherinput" bindtap="chooseAdress">点击选择户籍地址</view>
-					<input bindinput="tab1Change6" placeholder="请填写补充户籍地址" name="name" />
+					<input bindblur="tab1Change6" placeholder="请填写补充户籍地址" name="name" />
 				</view>
 				<checkbox value="cb" color="#fff" style="margin-top:20rpx" />现居地址与户籍地址一致
 				<view class="block"><text class="red">*</text>现居地址
 					<view class="otherinput">点击选择现居地址</view>
-					<input bindinput="tab1Change7" placeholder="请填写补充现居地址" name="name" />
+					<input bindblur="tab1Change7" placeholder="请填写补充现居地址" name="name" />
 				</view>
 				<view class="block">
 					<view class="name"><text class="red">*</text>婚姻及配偶情况</view>
@@ -291,60 +291,60 @@
 					</view>
 				</picker>
 				<!-- <view style="margin-top:30rpx;font-weight:900">第1个子女信息</view> -->
-				<view wx:for="{{childforTimes}}" wx:for-index="idx" >
+				<view wx:for="{{childforTimes}}" wx:for-index="idx">
 					<van-divider contentPosition="center">第{{idx+1}}个子女信息</van-divider>
 					<view class="block"><text class="red">*</text>子女姓名<input data-index="{{idx}}" bindblur="tab2Change2" placeholder="子女姓名" name="name" /></view>
-					<view wx:if="{{isothersyrName}}" class="required">子女姓名不能为空哦!</view>
+					<view wx:if="{{ischildName[idx]}}" class="required">子女姓名不能为空哦!</view>
 					<view class="block">
 						<view class="name"><text class="red">*</text>子女性别</view>
-						<radio-group bindchange="tab2Change3">
-							<label wx:for="{{othersyrSexArr}}" wx:key="{{item}}">
+						<radio-group data-index="{{idx}}" bindchange="tab2Change3">
+							<label wx:for="{{childSexArr}}" wx:key="{{item}}">
 								<radio value="{{item}}" color="#fff" />{{item}}
 							</label>
 						</radio-group>
 					</view>
-					<view class="block"><text class="red">*</text>子女联系电话<input bindinput="tab3Change4" placeholder="请填写常用联系电话" name="name" /></view>
-					<view wx:if="{{isothersyrPhone}}" class="required">子女联系电话不能为空哦!</view>
+					<view class="block"><text class="red">*</text>子女联系电话<input data-index="{{idx}}" bindblur="tab2Change4" placeholder="请填写常用联系电话" name="name" /></view>
+					<view wx:if="{{ischildPhone[idx]}}" class="required">子女联系电话不能为空哦!</view>
 					<view class="name"><text class="red">*</text>是否外出</view>
-					<picker bindchange="tab3Change7" value="{{othersyrIsout[othersyrIsoutIndex]}}" range="{{othersyrIsout}}">
-						<view class="picker">
-							{{othersyrIsout[othersyrIsoutIndex]}}
-						</view>
-					</picker>
-					<view wx:if="{{showothersyrOut}}">
-						<view class="block"><text class="red">*</text>外出原因<input bindinput="tab3Change8" placeholder="请填写外出原因" name="name" /></view>
-						<view wx:if="{{isOutReason}}" class="required">外出原因不能为空哦!</view>
+					<radio-group data-index="{{idx}}" bindchange="tab2Change5">
+						<label wx:for="{{childIsout}}" wx:key="{{item}}">
+							<radio value="{{item}}" color="#fff" />{{item}}
+						</label>
+					</radio-group>
+					<view wx:if="{{showchildOut[idx]}}">
+						<view class="block"><text class="red">*</text>外出原因<input data-index="{{idx}}" bindblur="tab2Change6" placeholder="请填写外出原因" name="name" /></view>
+						<view wx:if="{{ischildOutReason[idx]}}" class="required">外出原因不能为空哦!</view>
 						<view class="block"><text class="red">*</text>外出地点
-							<picker mode="region" bindchange="tab3Change9" value="{{region}}" custom-item="{{customItem}}">
+							<picker mode="region" data-index="{{idx}}" bindchange="tab2Change7" value="{{region0[idx]}}">
 								<view class="picker">
-									{{region[0]}} {{region[1]}} {{region[2]}}
+									{{region0[idx][0]}} {{region0[idx][1]}} {{region0[idx][2]}}
 								</view>
 							</picker>
 						</view>
 						<view class="block"><text class="red">*</text>最后一次离家时间
-							<picker mode="date" bindchange="tab3Change10" value="{{date}}" fields="month">
+							<picker mode="date" data-index="{{idx}}" bindchange="tab2Change8" value="{{childLeaveDate[idx]}}" fields="month">
 								<view class="picker">
-									{{date}}
+									{{childLeaveDate[idx]}}
 								</view>
 							</picker>
 						</view>
 					</view>
 					<view class="name"><text class="red">*</text>是否有配偶</view>
-					<picker bindchange="tab3Change11" value="{{othersyrIsMarry[othersyrIsMarryIndex]}}" range="{{othersyrIsMarry}}">
-						<view class="picker">
-							{{othersyrIsMarry[othersyrIsMarryIndex]}}
-						</view>
-					</picker>
-					<view wx:if="{{isMarry}}" class="block"><text class="red">*</text>配偶姓名<input bindinput="tab3Change12" placeholder="请填写配偶姓名" name="name" /></view>
-					<view wx:if="{{isMarryName}}" class="required">配偶姓名不能为空哦!</view>
-					<view wx:if="{{isMarry}}" class="block"><text class="red">*</text>配偶联系电话<input bindinput="tab3Change13" placeholder="请填写配偶联系电话" name="name" /></view>
-					<view wx:if="{{isMarryPhone}}" class="required">配偶联系电话不能为空哦!</view>
+					<radio-group data-index="{{idx}}" bindchange="tab2Change9">
+						<label wx:for="{{childIsMArry}}" wx:key="{{item}}">
+							<radio value="{{item}}" color="#fff" />{{item}}
+						</label>
+					</radio-group>
+					<view wx:if="{{ischildMarry[idx]}}" class="block"><text class="red">*</text>配偶姓名<input data-index="{{idx}}" bindblur="tab2Change10" placeholder="请填写配偶姓名" name="name" /></view>
+					<view wx:if="{{ischildMarryName[idx]}}" class="required">配偶姓名不能为空哦!</view>
+					<view wx:if="{{ischildMarry[idx]}}" class="block"><text class="red">*</text>配偶联系电话<input data-index="{{idx}}" bindblur="tab2Change11" placeholder="请填写配偶联系电话" name="name" /></view>
+					<view wx:if="{{ischildMarryPhone[idx]}}" class="required">配偶联系电话不能为空哦!</view>
 					<view class="name"><text class="red">*</text>平均一年探望次数</view>
-					<picker bindchange="tab3Change14" value="{{othersyrTfTimes[othersyrTfTimesIndex]}}" range="{{othersyrTfTimes}}">
-						<view class="picker">
-							{{othersyrTfTimes[othersyrTfTimesIndex]}}
-						</view>
-					</picker>
+					<radio-group data-index="{{idx}}" bindchange="tab2Change12">
+						<label wx:for="{{childTfTimes}}" wx:key="{{item}}">
+							<radio value="{{item}}" color="#fff" />{{item}}
+						</label>
+					</radio-group>
 				</view>
 			</view>
 			<!-- 第三个tab其他赡养义务人信息 -->
@@ -356,7 +356,7 @@
 					</view>
 				</picker>
 				<view wx:if="{{isHaveOther}}">
-					<view class="block"><text class="red">*</text>其他赡养人姓名<input bindinput="tab3Change2" placeholder="请填写其他赡养人姓名" name="name" /></view>
+					<view class="block"><text class="red">*</text>其他赡养人姓名<input bindblur="tab3Change2" placeholder="请填写其他赡养人姓名" name="name" /></view>
 					<view wx:if="{{isothersyrName}}" class="required">其他赡养人姓名不能为空哦!</view>
 					<view class="block">
 						<view class="name"><text class="red">*</text>其他赡养人性别</view>
@@ -366,7 +366,7 @@
 							</label>
 						</radio-group>
 					</view>
-					<view class="block"><text class="red">*</text>其他赡养人电话<input bindinput="tab3Change4" placeholder="请填写常用联系电话" name="name" /></view>
+					<view class="block"><text class="red">*</text>其他赡养人电话<input bindblur="tab3Change4" placeholder="请填写常用联系电话" name="name" /></view>
 					<view wx:if="{{isothersyrPhone}}" class="required">其他赡养人电话不能为空哦!</view>
 					<view class="name"><text class="red">*</text>与被赡养人关系</view>
 					<picker bindchange="tab3Change5" value="{{othersyrRelation[othersyrRelationIndex]}}" range="{{othersyrRelation}}">
@@ -374,7 +374,7 @@
 							{{othersyrRelation[othersyrRelationIndex]}}
 						</view>
 					</picker>
-					<view class="block" wx:if="{{syrRelationQT}}"><text class="red">*</text>与被赡养人其他关系<input bindinput="tab3Change6" placeholder="请填写与被赡养人其他关系" name="name" /></view>
+					<view class="block" wx:if="{{syrRelationQT}}"><text class="red">*</text>与被赡养人其他关系<input bindblur="tab3Change6" placeholder="请填写与被赡养人其他关系" name="name" /></view>
 					<view wx:if="{{isothersyRelation}}" class="required">与被赡养人其他关系不能为空哦!</view>
 					<view class="name"><text class="red">*</text>是否外出</view>
 					<picker bindchange="tab3Change7" value="{{othersyrIsout[othersyrIsoutIndex]}}" range="{{othersyrIsout}}">
@@ -383,7 +383,7 @@
 						</view>
 					</picker>
 					<view wx:if="{{showothersyrOut}}">
-						<view class="block"><text class="red">*</text>外出原因<input bindinput="tab3Change8" placeholder="请填写外出原因" name="name" /></view>
+						<view class="block"><text class="red">*</text>外出原因<input bindblur="tab3Change8" placeholder="请填写外出原因" name="name" /></view>
 						<view wx:if="{{isOutReason}}" class="required">外出原因不能为空哦!</view>
 						<view class="block"><text class="red">*</text>外出地点
 							<picker mode="region" bindchange="tab3Change9" value="{{region}}" custom-item="{{customItem}}">
@@ -406,9 +406,9 @@
 							{{othersyrIsMarry[othersyrIsMarryIndex]}}
 						</view>
 					</picker>
-					<view wx:if="{{isMarry}}" class="block"><text class="red">*</text>配偶姓名<input bindinput="tab3Change12" placeholder="请填写配偶姓名" name="name" /></view>
+					<view wx:if="{{isMarry}}" class="block"><text class="red">*</text>配偶姓名<input bindblur="tab3Change12" placeholder="请填写配偶姓名" name="name" /></view>
 					<view wx:if="{{isMarryName}}" class="required">配偶姓名不能为空哦!</view>
-					<view wx:if="{{isMarry}}" class="block"><text class="red">*</text>配偶联系电话<input bindinput="tab3Change13" placeholder="请填写配偶联系电话" name="name" /></view>
+					<view wx:if="{{isMarry}}" class="block"><text class="red">*</text>配偶联系电话<input bindblur="tab3Change13" placeholder="请填写配偶联系电话" name="name" /></view>
 					<view wx:if="{{isMarryPhone}}" class="required">配偶联系电话不能为空哦!</view>
 					<view class="name"><text class="red">*</text>平均一年探望次数</view>
 					<picker bindchange="tab3Change14" value="{{othersyrTfTimes[othersyrTfTimesIndex]}}" range="{{othersyrTfTimes}}">
@@ -429,7 +429,7 @@
 					</checkbox-group>
 				</view>
 				<view wx:if="{{isnull1}}" class="required">巡访方式不能为空哦!</view>
-				<input wx:if="{{isVisitways}}" placeholder="请填写其它内容" bindinput="tab4Change2" name="name" class="otherinput" />
+				<input wx:if="{{isVisitways}}" placeholder="请填写其它内容" bindblur="tab4Change2" name="name" class="otherinput" />
 				<view wx:if="{{isVisitwaysnull}}" class="required">其它巡访方式不能为空哦!</view>
 				<view class="block">
 					<view class="name"><text class="red">*</text>巡访频次</view>
@@ -440,7 +440,7 @@
 					</radio-group>
 				</view>
 				<view wx:if="{{isnull2}}" class="required">巡访频次不能为空哦!</view>
-				<input wx:if="{{isVisittimes}}" placeholder="请填写其它内容" bindinput="tab4change4" name="name" class="otherinput" />
+				<input wx:if="{{isVisittimes}}" placeholder="请填写其它内容" bindblur="tab4change4" name="name" class="otherinput" />
 				<view wx:if="{{isVisittimesnull}}" class="required">其它巡访频次不能为空哦!</view>
 			</view>
 		</view>

+ 0 - 1
pages/idCard/idCard.js

@@ -87,7 +87,6 @@ Page({
       isTrue: true,
       imgPath: '',
     })
-
   },
 
   onLoad: function () {},

+ 1 - 1
project.config.json

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