ssfg 4 年之前
父節點
當前提交
7e854c2722
共有 4 個文件被更改,包括 61 次插入61 次删除
  1. 51 52
      pages/collectInfo/collectInfo.js
  2. 2 1
      pages/collectInfo/collectInfo.json
  3. 3 2
      pages/collectInfo/collectInfo.wxml
  4. 5 6
      pages/index/index.js

+ 51 - 52
pages/collectInfo/collectInfo.js

@@ -740,44 +740,58 @@ Page({
                         if (e.data.idcard_number_type == 1) {
                           console.log(e.data.words_result, '我是ocr识别出来的内容')
                           if (_this.data.oldInfo[_this.data.activeIndex].name == e.data.words_result['姓名'].words) {
-                            let idNumber = 'oldInfo[' + _this.data.activeIndex + '].idNumber'
-                            let name = 'oldInfo[' + _this.data.activeIndex + '].name'
-                            let nation = 'oldInfo[' + _this.data.activeIndex + '].nation'
-                            let data = _this.data.oldInfo[_this.data.activeIndex].oldSex.map(v => {
-                              if (v.name == e.data.words_result['性别'].words) {
+                            var myDate = new Date();
+                            var month = myDate.getMonth() + 1;
+                            var day = myDate.getDate();
+                            var age = myDate.getFullYear() - e.data.words_result['公民身份号码'].words.substring(6, 10) - 1;
+                            if (e.data.words_result['公民身份号码'].words.substring(10, 12) < month || e.data.words_result['公民身份号码'].words.substring(10, 12) == month && e.data.words_result['公民身份号码'].words.substring(12, 14) <= day) {
+                              age++;
+                            }
+                            if(age >= 60){
+                              let idNumber = 'oldInfo[' + _this.data.activeIndex + '].idNumber'
+                              let name = 'oldInfo[' + _this.data.activeIndex + '].name'
+                              let nation = 'oldInfo[' + _this.data.activeIndex + '].nation'
+                              let data = _this.data.oldInfo[_this.data.activeIndex].oldSex.map(v => {
+                                if (v.name == e.data.words_result['性别'].words) {
+                                  return {
+                                    name: v.name,
+                                    checked: true
+                                  }
+                                }
                                 return {
                                   name: v.name,
-                                  checked: true
+                                  checked: false
                                 }
-                              }
-                              return {
-                                name: v.name,
-                                checked: false
-                              }
-                            })
-                            let oldSex = 'oldInfo[' + _this.data.activeIndex + '].oldSex'
-                            _this.setData({
-                              [idNumber]: e.data.words_result['公民身份号码'].words,
-                              [name]: e.data.words_result['姓名'].words,
-                              [nation]: e.data.words_result['民族'].words + '族',
-                              [oldSex]: data
-                            })
-                            _this.SubmitOldmanInfo({
-                              id: _this.data.nameArr[_this.data.activeIndex]._id,
-                              idNumber: e.data.words_result['公民身份号码'].words
-                            })
-                            _this.SubmitOldmanInfo({
-                              id: _this.data.nameArr[_this.data.activeIndex]._id,
-                              name: e.data.words_result['姓名'].words
-                            })
-                            _this.SubmitOldmanInfo({
-                              id: _this.data.nameArr[_this.data.activeIndex]._id,
-                              nation: e.data.words_result['民族'].words + '族'
-                            })
-                            _this.SubmitOldmanInfo({
-                              id: _this.data.nameArr[_this.data.activeIndex]._id,
-                              sex: e.data.words_result['性别'].words
-                            })
+                              })
+                              let oldSex = 'oldInfo[' + _this.data.activeIndex + '].oldSex'
+                              _this.setData({
+                                [idNumber]: e.data.words_result['公民身份号码'].words,
+                                [name]: e.data.words_result['姓名'].words,
+                                [nation]: e.data.words_result['民族'].words + '族',
+                                [oldSex]: data
+                              })
+                              _this.SubmitOldmanInfo({
+                                id: _this.data.nameArr[_this.data.activeIndex]._id,
+                                idNumber: e.data.words_result['公民身份号码'].words
+                              })
+                              _this.SubmitOldmanInfo({
+                                id: _this.data.nameArr[_this.data.activeIndex]._id,
+                                name: e.data.words_result['姓名'].words
+                              })
+                              _this.SubmitOldmanInfo({
+                                id: _this.data.nameArr[_this.data.activeIndex]._id,
+                                nation: e.data.words_result['民族'].words + '族'
+                              })
+                              _this.SubmitOldmanInfo({
+                                id: _this.data.nameArr[_this.data.activeIndex]._id,
+                                sex: e.data.words_result['性别'].words
+                              })
+                            }else {
+                              wx.showModal({
+                                showCancel: false,
+                                content: '当前老人不满60周岁'
+                              })
+                            }
                           } else {
                             wx.showModal({
                               showCancel: false,
@@ -897,6 +911,7 @@ Page({
       this.chooseAdress();
       this.setData({
         multiIndex: [0, 0, 0, 0, 0],
+        value: [0, 0, 0, 0, 0],
         showAdressBox1: true
       })
     }
@@ -964,7 +979,6 @@ Page({
         if (this.data.cityArr[this.data.multiIndex[2]]) {
           this.chooseAdress3();
         }
-
       },
       fail: () => {
         wx.hideLoading()
@@ -1142,51 +1156,39 @@ Page({
     })
   },
   bindChange(e) {
-    // this.setData({
-    //   adressChangeStatus:true
-    // })
+    console.log(e.detail.value)
     wx.showLoading({
       title: '加载中',
       mask: true
     })
-    console.log(e, 'eeee')
-    console.log(this.data.multiIndex, '上次的值')
     if ((e.detail.value[0] != this.data.multiIndex[0]) && this.data.provinceArr[e.detail.value[0]] && this.data.provinceArr[e.detail.value[0]].CIVILREGIONALISMID) {
       this.chooseAdress2(this.data.provinceArr[e.detail.value[0]].CIVILREGIONALISMID);
-      console.log(e.detail.value[0])
       let multiIndex=[];
       multiIndex.push(e.detail.value[0],0,0,0,0)
       this.setData({
         value: multiIndex
       })
-      console.log(multiIndex,'我是加了0之后的数组')
     } else if ((e.detail.value[1] != this.data.multiIndex[1]) && this.data.cityArr[e.detail.value[1]] && this.data.cityArr[e.detail.value[1]].CIVILREGIONALISMID) {
       this.chooseAdress3(this.data.cityArr[e.detail.value[1]].CIVILREGIONALISMID);
-      console.log(e.detail.value[0])
       let multiIndex=[];
       multiIndex.push(e.detail.value[0],e.detail.value[1],0,0,0)
       this.setData({
         value: multiIndex
       })
-      console.log(multiIndex,'我是加了0之后的数组')
     } else if ((e.detail.value[2] != this.data.multiIndex[2]) && this.data.areaArr[e.detail.value[2]] && this.data.areaArr[e.detail.value[2]].CIVILREGIONALISMID) {
       this.chooseAdress4(this.data.areaArr[e.detail.value[2]].CIVILREGIONALISMID);
-      console.log(e.detail.value[0])
       let multiIndex=[];
       multiIndex.push(e.detail.value[0],e.detail.value[1],e.detail.value[2],0,0)
       this.setData({
         value: multiIndex
       })
-      console.log(multiIndex,'我是加了0之后的数组')
     } else if ((e.detail.value[3] != this.data.multiIndex[3]) && this.data.townArr[e.detail.value[3]] && this.data.townArr[e.detail.value[3]].CIVILREGIONALISMID) {
       this.chooseAdress5(this.data.townArr[e.detail.value[3]].CIVILREGIONALISMID);
-      console.log(e.detail.value[0])
       let multiIndex=[];
       multiIndex.push(e.detail.value[0],e.detail.value[1],e.detail.value[2],e.detail.value[3],0)
       this.setData({
         value: multiIndex
       })
-      console.log(multiIndex,'我是加了0之后的数组')
     } else if ((e.detail.value[4] != this.data.multiIndex[4]) && this.data.villageArr[e.detail.value[4]] && this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMID) {
       this.setData({
         value: e.detail.value
@@ -1200,9 +1202,6 @@ Page({
       multiIndex: e.detail.value
     })
     wx.hideLoading()
-    // this.setData({
-    //   adressChangeStatus:false
-    // }) 
   },
   pickSure() {
     let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr';

+ 2 - 1
pages/collectInfo/collectInfo.json

@@ -1,4 +1,5 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "采集"
+  "navigationBarTitleText": "采集",
+  "disableScroll":true
 }

+ 3 - 2
pages/collectInfo/collectInfo.wxml

@@ -92,7 +92,7 @@
 				<view class="block"><text class="red">*</text>户籍地址
 					<view class="picker1">
 						<view wx:if="{{oldInfo[activeIndex].chooseAdressArr.length==0}}" bindtap="showAdressShow">点我选择现居地址</view>
-						<textarea style="width:450rpx;height:100rpx" disabled="true" wx:else  bindtap="showAdressShow">{{oldInfo[activeIndex].chooseAdressArr}}</textarea>
+						<view style="width:450rpx;height:100rpx" wx:else  bindtap="showAdressShow">{{oldInfo[activeIndex].chooseAdressArr}}</view>
 					</view>
 					<view class="picker_container" wx:if='{{showAdressBox}}'>
 						<view style="height:50px;width:300px">
@@ -141,7 +141,8 @@
 					</picker> -->
 					<view class="picker1">
 						<view wx:if="{{oldInfo[activeIndex].chooseAdressArr1.length==0}}" bindtap="showAdressShow1">点我选择现居地址</view>
-						<textarea style="width:450rpx;height:100rpx" disabled="true" wx:else  bindtap="showAdressShow1">{{oldInfo[activeIndex].chooseAdressArr1}}</textarea>
+							<view style="width:450rpx;height:100rpx" wx:else  bindtap="showAdressShow1">{{oldInfo[activeIndex].chooseAdressArr1}}</view>
+						<!-- <textarea style="width:420rpx;height:100rpx" disabled="true" wx:else  bindtap="showAdressShow1" value="{{oldInfo[activeIndex].chooseAdressArr1}}"></textarea> -->
 					</view>
 					<view class="picker_container" wx:if='{{showAdressBox1}}'>
 						<view style="height:50px">

+ 5 - 6
pages/index/index.js

@@ -123,16 +123,15 @@ Page({
         method: "GET",
         success: (res) => {
           if (res.data.code == 0) {
-            console.log(res);
+    
             if (res.data.data.length != 0) {
               let result = res.data.data[0].title
               this.data.msgList.push({
                 title: result
               });
-              // this.data.msgList.push({
-              //   // url: '',
-              //   title: result
-              // });
+              this.data.msgList.push({
+                title: result
+              });
               this.setData({
                 msgList: this.data.msgList
               })
@@ -149,7 +148,7 @@ Page({
         },
         success: (res) => {
           if (res.data.code == 0) {
-            console.log(res);
+            console.log(res,"111111111111111");
             if (res.data.data.length == 0) {
               this.data.msgList.push({
                 title: '暂无通知'