roose 4 lat temu
rodzic
commit
5e36526421
1 zmienionych plików z 13 dodań i 9 usunięć
  1. 13 9
      pages/collectInfo/collectInfo.js

+ 13 - 9
pages/collectInfo/collectInfo.js

@@ -728,6 +728,7 @@ Page({
                   filePath: res.tempFilePaths[0],
                   encoding: 'base64',
                   success: res1 => {
+                  
                     let img = 'data:image/png;base64,' + res1.data
                     wx.request({
                       url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=' + token,
@@ -742,11 +743,13 @@ Page({
                       dataType: 'json',
                       success: (e) => {
                         console.log(e, "看看那ocr返回了么数据呢");
+                        const app = getApp()
+                        app.globalData.id = '-2'
                         // 扫描后赋值 
-                        _this.setData({
-                          showBj: false,
-                          fid: _this.data.familyFid
-                        })
+                        // _this.setData({
+                        //   showBj: false,
+                        //   fid: _this.data.familyFid
+                        // })
                         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) {
@@ -757,7 +760,7 @@ Page({
                             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) {
+                            if (age >= 30) {
                               let idNumber = 'oldInfo[' + _this.data.activeIndex + '].idNumber'
                               let name = 'oldInfo[' + _this.data.activeIndex + '].name'
                               let nation = 'oldInfo[' + _this.data.activeIndex + '].nation'
@@ -825,12 +828,10 @@ Page({
                 })
               },
               fail: function () {
-                wx.hideLoading();
+             
               },
               complete: function () {
-                _this.setData({
-                  showBj: false,
-                })
+                wx.hideLoading();
               }
             })
           } else {
@@ -3836,8 +3837,10 @@ Page({
   },
   onHide() {
     const app = getApp()
+    console.log("初始",app.globalData.id)
     if (app.globalData.id != -1) {
       app.globalData.id = ''
+      console.log("id不等于-1")
     }
     app.globalData.name = ''
     this.setData({
@@ -3845,6 +3848,7 @@ Page({
       showAdressBox: false,
       showAdressBox1: false
     })
+    console.log("最终隐藏id",app.globalData.id)
   },
   //获取位置
   getSelfLocation: function () {