Просмотр исходного кода

五级联动

# Conflicts:
#	pages/collectInfo/collectInfo.js
#	pages/collectInfo/collectInfo.wxml
ssfg 4 лет назад
Родитель
Сommit
016ed319ad

+ 86 - 0
app.js

@@ -5,6 +5,7 @@ App({
     name: null,
   },
   onLaunch(options) {
+    console.log("onLaunchonLaunchonLaunchonLaunchonLaunchonLaunchonLaunchonLaunchonLaunchonLaunchonLaunchonLaunch");
     // if (wx.getStorageSync('openId')) {
     //   wx.request({
     //     url: 'http://info.windd.cn:8080/test/applet/isExist',
@@ -24,7 +25,44 @@ App({
     // } else {
 
     // }
+    // wx.login({
+    //   success: res => {
+    //     // 获取到用户的 code 之后:res.code
+    //     console.log("用户的code:" + res.code);
+    //     const appid = "wx1c015df104db7030"
+    //     const secret = "d1956c1b5d3601657c98b0dc80a006f7"
+    //     let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' + res.code + '&grant_type=authorization_code';
+    //     wx.request({
+    //       // 自行补上自己的 APPID 和 SECRET
+    //       url: url,
+    //       success: res => {
+    //         // 获取到用户的 openid
+    //         console.log("用户的openid:" + res.data.openid);
+    //         wx.setStorageSync('openId', res.data.openid)
+
+    //         wx.request({
+    //           url: 'http://info.windd.cn:8080/test/applet/isExist',
+    //           method: "GET",
+    //           data: {
+    //             appletsId: wx.getStorageSync('openId')
+    //           },
+    //           success: (res) => {
+    //             console.log(res, "apppppppppppppppppppppppppp");
+    //             if (res.data.code == 0) {
+    //               if(res.data.data){
+    //                 wx.setStorageSync('user', 'user');
+    //               }
+    //             }
+
+    //           }
+    //         })
+    //       }
+    //     });
+    //   }
+    // });
+
   },
+ 
   onShow(options) {
     // Do something when show.
   },
@@ -34,4 +72,52 @@ App({
   onError(msg) {
     console.log(msg)
   },
+  getAuthKey: function () {  
+    var that = this;  
+    return new Promise(function (resolve, reject) {  
+        // 调用登录接口  
+        wx.login({  
+          success: function (res) {  
+            if (res.code) {  
+              console.log("用户的code:" + res.code);
+              const appid = "wx1c015df104db7030"
+              const secret = "d1956c1b5d3601657c98b0dc80a006f7"
+              let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' + res.code + '&grant_type=authorization_code';
+              wx.request({
+                // 自行补上自己的 APPID 和 SECRET
+                url: url,
+                success: res => {
+                  // 获取到用户的 openid
+                  console.log("用户的openid:" + res.data.openid);
+                  wx.setStorageSync('openId', res.data.openid)
+                  wx.request({
+                    url: 'http://info.windd.cn:8080/test/applet/isExist',
+                    method: "GET",
+                    data: {
+                      appletsId: wx.getStorageSync('openId')
+                    },
+                    success: (res) => {
+                      console.log(res, "apppppppppppppppppppppppppp");
+                      if (res.data.code == 0) {
+                        if(res.data.data){
+                          wx.setStorageSync('user', 'user');
+                        }
+                        resolve(res);  
+                      }
+                    }
+                  })
+                }
+              });
+            } else {  
+              console.log('获取用户登录态失败!' + res.errMsg);  
+              var res = {  
+                status: 300,  
+                data: '错误'  
+              }  
+              reject('error');  
+            }    
+          }  
+        })  
+    });  
+  },  
 })

+ 287 - 81
pages/collectInfo/collectInfo.js

@@ -719,6 +719,7 @@ Page({
       })
       return false
     }
+    
     if (!han.test(this.data.addOldname)) {
       wx.showModal({
         showCancel: false,
@@ -1156,11 +1157,15 @@ Page({
                 this.data.oldInfo.splice(index, 1)
                 this.data.otherInfo.splice(index, 1)
                 this.data.childInfo.splice(index, 1)
+                this.data.regularsInfo.splice(index, 1)
+                this.data.regularsInfos.splice(index, 1)
                 this.setData({
                   oldInfo: this.data.oldInfo,
                   nameArr: this.data.nameArr,
                   otherInfo: this.data.otherInfo,
                   childInfo: this.data.childInfo,
+                  regularsInfo: this.data.regularsInfo,
+                  regularsInfos: this.data.regularsInfos,
                 })
 
                 if ((this.data.activeIndex == index && this.data.activeIndex > 0) || (this.data.activeIndex > index && this.data.activeIndex > 0)) {
@@ -1283,18 +1288,27 @@ Page({
                               sex: e.data.words_result['性别'].words
                             })
                           } else {
-                            wx.showToast({
-                              title: "添加当前老人名字和扫描身份证名字不一致,请重新扫描",
-                              icon: 'none',
-                              duration: 2000,
+                            console.log("姓名不一样的");
+                            // wx.showToast({
+                            //   title: "添加当前老人名字和扫描身份证名字不一致,请重新扫描",
+                            //   icon: 'none',
+                            //   duration: 2000,
+                            // })
+                            wx.showModal({
+                              showCancel: false,
+                              content: '添加当前老人名字和扫描身份证名字不一致,请重新扫描'
                             })
                           }
                         } else {
-                          wx.showToast({
-                            title: "身份证OCR识别失败",
-                            icon: 'none',
-                            duration: 2000,
+                          wx.showModal({
+                            showCancel: false,
+                            content: '身份证OCR识别失败'
                           })
+                          // wx.showToast({
+                          //   title: "身份证OCR识别失败",
+                          //   icon: 'none',
+                          //   duration: 2000,
+                          // })
                         }
                       },
                       complete: (e) => {
@@ -1335,10 +1349,27 @@ Page({
       return
     } else {
       console.log(this.data.nameArr)
+      let han = /^[\u4e00-\u9fa5]+$/;
+      if (!han.test(e.detail.value )) {
+        wx.showModal({
+          showCancel: false,
+          content: '您输入的内容不是汉字哦'
+        })
+        return false;
+      };
+      if (e.detail.value .length < 2) {
+        wx.showModal({
+          showCancel: false,
+          content: '老人姓名不可以少于两个字哦'
+        })
+        return false
+      }
       let name = 'nameArr[' + this.data.activeIndex + '].name'
+      let oldName = 'oldInfo[' + this.data.activeIndex + '].name'
       this.setData({
         oldName: false,
-        [name]: e.detail.value
+        [name]: e.detail.value,
+        [oldName]: e.detail.value
       })
       console.log(this.data.nameArr)
     }
@@ -1487,13 +1518,47 @@ Page({
     console.log(e.detail.value)
     let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
     let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
-    console.log(this.data.oldInfo[this.data.activeIndex].nativePlaceExt, "打印下这个");
+    let address = 'oldInfo[' + this.data.activeIndex + '].address'
+
+    const items = this.data.oldInfo[this.data.activeIndex].isSameWithAddress
+    const values = e.detail.value
+    for (let i = 0, lenI = items.length; i < lenI; ++i) {
+      items[i].checked = false
+      for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
+        if (items[i].name === values[j]) {
+          items[i].checked = true
+          break
+        }
+      }
+    }
+    let isSameWithAddress = 'oldInfo[' + this.data.activeIndex + '].isSameWithAddress'
+    this.setData({
+      [isSameWithAddress]: items
+    })
+
+
 
+    console.log(this.data.oldInfo[this.data.activeIndex].nativePlaceExt, "打印下这个");
     if (e.detail.value[0] == '现居地址与户籍地址一致') {
+      if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
+        let nativePlaceId = '';
+        let nativePlace = '';
+        for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr) {
+          nativePlace += value.CIVILREGIONALISMNAME + '/'
+          nativePlaceId += value.CIVILREGIONALISMID + ','
+          console.log(value, "打印下");
+        }
+        this.SubmitOldmanInfo({
+          id: this.data.nameArr[this.data.activeIndex]._id,
+          address: nativePlace.substring(0, nativePlace.length - 1),
+          addressId: nativePlaceId.substring(0, nativePlaceId.length - 1),
+        })
+      }
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.activeIndex]._id,
         isSameWithAddress: '是',
         addressExt: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
+
       })
       this.setData({
         [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
@@ -1506,7 +1571,11 @@ Page({
         addressExt: '',
       })
       this.setData({
+<<<<<<< HEAD
         [Info]: '',
+=======
+        [Info]: [],
+>>>>>>> 4d87d7ac7ab7af3fd116baec7275859e5585ddfb
         [Infos]: '',
       })
       console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
@@ -2235,6 +2304,17 @@ Page({
       })
     }
   },
+  tab1Change24_1:function(e){
+    let Info = 'oldInfo[' + this.data.activeIndex + '].demandExt'
+    this.setData({
+      [Info]: e.detail.value
+    })
+    this.SubmitOldmanInfo({
+      id: this.data.nameArr[this.data.activeIndex]._id,
+      demandExt: e.detail.value
+    })
+   
+  },
   tab1change25: function (e) {
     if (e.detail.value == null || e.detail.value == '') {
       this.setData({
@@ -2270,31 +2350,30 @@ Page({
     let revise2 = "oldInfo[" + this.data.activeIndex + "].oldType[1].disable";
     let revise3 = "oldInfo[" + this.data.activeIndex + "].oldType[2].disable";
     let revise4 = "oldInfo[" + this.data.activeIndex + "].oldType[3].disable";
-    let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[4].checked";
+    let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[3].checked";
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
       oldType: JSON.stringify(e.detail.value)
     })
-    if (index1 >= 0) {
-      this.setData({
-        [revise2]: true,
-        [revise3]: true,
-        [revise4]: true,
-        [revise5]: true
-      })
-      return false;
-    } else {
-      console.log("反選的");
-
-      this.setData({
-        // [revise1]: false,
-        [revise2]: false,
-        [revise3]: false,
-        [revise4]: false,
-        [revise5]: false
-      })
-      index4 = -1;
-    }
+    // if (index1 >= 0) {
+    //   this.setData({
+    //     [revise2]: true,
+    //     [revise3]: true,
+    //     [revise4]: true,
+    //     [revise5]: true
+    //   })
+    //   return false;
+    // } else {
+    //   console.log("反選的");
+    //   this.setData({
+    //     // [revise1]: false,
+    //     [revise2]: false,
+    //     [revise3]: false,
+    //     [revise4]: false,
+    //     [revise5]: false
+    //   })
+    //   index4 = -1;
+    // }
     if (index2 >= 0) {
       this.setData({
         [revise1]: true,
@@ -2323,19 +2402,43 @@ Page({
         [revise4]: false
       })
     }
-    if (index4 >= 0) {
-
+    // if (index4 >= 0) {
+    //   this.setData({
+    //     [revise1]: true,
+    //     [revise2]: true,
+    //     [revise3]: true
+    //   })
+    //   return false;
+    // } else {
+    //   this.setData({
+    //     [revise1]: false,
+    //     [revise2]: false,
+    //     [revise3]: false
+    //   })
+    // }
+    if (index1 >= 0) {
       this.setData({
-        [revise1]: true,
         [revise2]: true,
-        [revise3]: true
+        [revise3]: true,
+        [revise4]: true,
+        [revise5]: true
       })
       return false;
-    } else {
+    } else if(index4 >= 0){
       this.setData({
         [revise1]: false,
         [revise2]: false,
-        [revise3]: false
+        [revise3]: false,
+        [revise4]: false,
+        [revise5]: true
+      })
+    }else {
+      this.setData({
+        [revise1]: false,
+        [revise2]: false,
+        [revise3]: false,
+        [revise4]: false,
+       
       })
     }
 
@@ -2416,6 +2519,10 @@ Page({
       this.setData({
         [Info]: []
       })
+      // this.SubmitOldmanInfo({
+      //   id: this.data.nameArr[this.data.activeIndex]._id,
+      //   childInfo:JSON.stringify([]),
+      // })
     } else if (e.detail.value == 1) {
       this.setData({
         [Info]: [{
@@ -2503,16 +2610,31 @@ Page({
     }
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
-      childrenNum: e.detail.value
+      childrenNum: e.detail.value,
+      childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
       // childrenNum: this.data.childNums[e.detail.value].substring(0, 1)
     })
   },
   // 子女姓名
   tab2Change2: function (e) {
+    let han = /^[\u4e00-\u9fa5]+$/;
+    if (!han.test(e.detail.value )) {
+      wx.showModal({
+        showCancel: false,
+        content: '您输入的内容不是汉字哦'
+      })
+      return false;
+    };
+    if (e.detail.value .length < 2) {
+      wx.showModal({
+        showCancel: false,
+        content: '赡养人姓名不可以少于两个字哦'
+      })
+      return false
+    }
     let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name';
     console.log(this.data.childInfo[this.data.activeIndex].Info, "多个数字的问题");
     console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info));
-
     this.setData({
       [child]: e.detail.value
     })
@@ -2643,6 +2765,7 @@ Page({
   tab3Change1: function (e) {
     // 否是1
     console.log(e.detail.value, "1111111");
+
     let isHasOther = 'otherInfo[' + this.data.activeIndex + '].isHasOther'
     if (e.detail.value == '0') {
       this.setData({
@@ -2669,6 +2792,21 @@ Page({
   },
   // 其他赡养人姓名
   tab3Change2: function (e) {
+    let han = /^[\u4e00-\u9fa5]+$/;
+    if (!han.test(e.detail.value )) {
+      wx.showModal({
+        showCancel: false,
+        content: '您输入的内容不是汉字哦'
+      })
+      return false;
+    };
+    if (e.detail.value .length < 2) {
+      wx.showModal({
+        showCancel: false,
+        content: '赡养人姓名不可以少于两个字哦'
+      })
+      return false
+    }
     let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name'
     this.setData({
       [Info]: e.detail.value,
@@ -2845,7 +2983,7 @@ Page({
     let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
     this.setData({
       [visitMode]: items,
-      [visitMode1]: e.detail.value
+      [visitMode1]:JSON.stringify( e.detail.value)
     })
     console.log(this.data.regularsInfo, "我是?????????????");
 
@@ -2858,9 +2996,17 @@ Page({
   tab4Change2: function (e) {
     let Info = 'regularsInfos[' + this.data.activeIndex + '].visitModeExt'
     let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitModeExt'
+    let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
+    let arrs = [];
+    this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
+      if (item.checked) {
+        arrs.push(item.name)
+      }
+    })
     this.setData({
       [Info]: e.detail.value,
-      [Info1]: e.detail.value
+      [Info1]: e.detail.value,
+      [visitMode1]: JSON.stringify(arrs),
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
@@ -2883,9 +3029,17 @@ Page({
     })
     let visitCount = 'regularsInfos[' + this.data.activeIndex + '].visitCount'
     let visitCount1 = 'regularsInfo[' + this.data.activeIndex + '].visitCount'
+    let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
+    let arrs = [];
+    this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
+      if (item.checked) {
+        arrs.push(item.name)
+      }
+    })
     this.setData({
       [visitCount]: data,
-      [visitCount1]: e.detail.value
+      [visitCount1]: e.detail.value,
+      [visitMode1]: JSON.stringify(arrs),
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
@@ -2896,9 +3050,17 @@ Page({
   tab4change4: function (e) {
     let Info = 'regularsInfos[' + this.data.activeIndex + '].visitCountExt'
     let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitCountExt'
+    let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
+    let arrs = [];
+    this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
+      if (item.checked) {
+        arrs.push(item.name)
+      }
+    })
     this.setData({
       [Info]: e.detail.value,
-      [Info1]: e.detail.value
+      [Info1]: e.detail.value,
+      [visitMode1]: JSON.stringify(arrs),
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
@@ -3306,8 +3468,17 @@ Page({
             }, {
               name: "多重残疾"
             }];
-
-
+            let sickType =  [{
+              name: "重大器官类疾病"
+            }, {
+              name: "心脑血管类疾病"
+            }, {
+              name: "神经与代谢类疾病"
+            }, {
+              name: "肢体与病毒类疾病"
+            }, {
+              name: "恶性肿瘤"
+            }];
             let moneyFromAyy = [{
               name: "家庭经营性收入"
             }, {
@@ -3532,13 +3703,16 @@ Page({
                 }
               })
             })
-            // isSameWithAddress
-
-            // else if (item.isSameWithAddress == '否') {
-
-            // } else {
-
-            // }
+           if(item.majorDiseases[0]){
+             let patorl = this.removeExcess(item.majorDiseases[0]);
+             sickType.forEach(items => {
+              patorl.forEach(itemss => {
+                if (items.name == itemss) {
+                  items.checked = true;
+                }
+              })
+            })
+           }
             loveRequire.forEach(itemss => {
               item.demand.forEach(item => {
                 if (itemss.name == item) {
@@ -3562,6 +3736,8 @@ Page({
                   item.checked = true;
                 })
                 chooseAdressArr1 = chooseAdressArr;
+              }else {
+                chooseAdressArr1 = [];
               }
             }
             let addressExts = '';
@@ -3584,6 +3760,7 @@ Page({
 
             return {
               ...item,
+              sickType:sickType,
               oldSex: oldSex.map(items => {
                 if (items.name == item.sex) {
                   return {
@@ -3651,7 +3828,7 @@ Page({
           })
           let def = datass.map(item => {
             console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
-            let sex = [{
+            let sexs = [{
                 name: '男',
                 checked: false
               },
@@ -3672,7 +3849,7 @@ Page({
             let outgoingplace = ''
             let phone2 = ''
             let name2 = ''
-
+            let sex = '';
             let visit = '';
             if (item.otherInfo) {
               let partol = this.removeExcess(item.otherInfo);
@@ -3681,9 +3858,10 @@ Page({
                 name = partol.name
               }
               if (partol.sex) {
-                sex.forEach(items => {
+                sexs.forEach(items => {
                   if (items.name == partol.sex) {
                     items.checked = true;
+                    sex =  partol.sex ;
                   }
                 })
               }
@@ -3749,7 +3927,8 @@ Page({
                 visit: visit,
                 name2: name2,
                 phone2: phone2,
-                othersyrSexArr: sex
+                othersyrSexArr: sexs,
+                sex :sex ,
               }
 
             }
@@ -3848,9 +4027,10 @@ Page({
             ];
             if (item.regularsInfo) {
               let partol = this.removeExcess(item.regularsInfo);
+              let partols = this.removeExcess(partol.visitMode);
               if (partol.visitMode) {
                 visitMode.forEach(items => {
-                  partol.visitMode.forEach(itemss => {
+                  partols.forEach(itemss => {
                     if (items.name == itemss) {
                       items.checked = true;
                     }
@@ -3882,12 +4062,14 @@ Page({
           let mmm = datass.map(item => {
             if (item.regularsInfo) {
               let partol = this.removeExcess(item.regularsInfo);
+              let partols = this.removeExcess(partol.visitMode);
               console.log(partol, "111111111111111111111");
+              console.log(partols, "99999999999999999999");
               return {
                 visitCount: partol.visitCount,
                 visitCountExt: partol.visitCountExt,
-                visitMode: partol.visitCouvisitModepartolnt,
-                visitModeExt: partol.visivisitModeExttCount,
+                visitMode: partols,
+                visitModeExt: partol.visitModeExt,
               }
             }
           })
@@ -4222,24 +4404,28 @@ Page({
   },
   onShow() {
     console.log("Onshow。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。");
-    console.log(isTwoOnshow, "1111111111111");
-    console.log(this.data.nameArr.length, "namearr长度");
-    const app = getApp();
-    if (isTwoOnshow) {
-      isTwoOnshow = false;
-      return;
-    };
-    if (isonShow) {
-      isonShow = false;
-      return;
-    };
-
-    this.setData({
-      addOldname: '',
-      currentIndex: 0
-    })
-    console.log(app.globalData.id, "传参的一户的值");
-    this.huixian(app.globalData.id, app.globalData.name);
+    if (wx.getStorageSync('user') == '') {
+      wx.redirectTo({
+        url: '/pages/login/login',
+      })
+    }else {
+      const app = getApp();
+      if (isTwoOnshow) {
+        isTwoOnshow = false;
+        return;
+      };
+      if (isonShow) {
+        isonShow = false;
+        return;
+      };
+  
+      this.setData({
+        addOldname: '',
+        currentIndex: 0
+      })
+      console.log(app.globalData.id, "传参的一户的值");
+      this.huixian(app.globalData.id, app.globalData.name);
+    }
   },
   onHide() {
     const app = getApp()
@@ -4301,8 +4487,22 @@ Page({
     });
   },
   onLoad(value) {
+<<<<<<< HEAD
     this.huixian1(value.id, value.name);
     this.chooseAdress();
+=======
+    console.log(wx.getStorageSync('user'), "打印");
+    if (wx.getStorageSync('user') == '') {
+      wx.redirectTo({
+        url: '/pages/login/login',
+      })
+    }else {
+      console.log(value, "onLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoad");
+      this.huixian1(value.id, value.name);
+    }
+   
+    // this.getSelfLocation();
+>>>>>>> 4d87d7ac7ab7af3fd116baec7275859e5585ddfb
   },
   huixian1(id, name) {
     if (id) {
@@ -4943,10 +5143,10 @@ Page({
             ];
             if (item.regularsInfo) {
               let partol = this.removeExcess(item.regularsInfo);
-              console.log(partol, "777777777777777777777");
+              let partols = this.removeExcess(partol.visitMode);
               if (partol.visitMode) {
                 visitMode.forEach(items => {
-                  partol.visitMode.forEach(itemss => {
+                  partols.forEach(itemss => {
                     if (items.name == itemss) {
                       items.checked = true;
                     }
@@ -4978,11 +5178,17 @@ Page({
           let mmm = datass.map(item => {
             if (item.regularsInfo) {
               let partol = this.removeExcess(item.regularsInfo);
+<<<<<<< HEAD
+=======
+              let partols = this.removeExcess(partol.visitMode);
+              console.log(partol, "111111111111111111111");
+              console.log(partols, "99999999999999999999");
+>>>>>>> 4d87d7ac7ab7af3fd116baec7275859e5585ddfb
               return {
                 visitCount: partol.visitCount,
                 visitCountExt: partol.visitCountExt,
-                visitMode: partol.visitCouvisitModepartolnt,
-                visitModeExt: partol.visivisitModeExttCount,
+                visitMode: partols,
+                visitModeExt: partol.visitModeExt,
               }
             }
           })

Разница между файлами не показана из-за своего большого размера
+ 13 - 1
pages/collectInfo/collectInfo.wxml


+ 44 - 44
pages/finishInfo/finishInfo.js

@@ -312,7 +312,7 @@ Page({
   //获得当前登陆人的信息
   userInfo() {
     wx.request({
-      url: app.globalData.publicUrl + '/sys/login/session',
+      url: app.globalData.publicUrl + '/applet/findUserInfo',
       method: "GET",
       header: {
         appletsId: wx.getStorageSync('openId')
@@ -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, "赋值上了么");
 

+ 1 - 1
pages/idCardDetail/idCardDetail.js

@@ -6,7 +6,7 @@ Page({
   },
   onLoad: function () {
     wx.request({
-      url: app.globalData.publicUrl + '/sys/login/session',
+      url: app.globalData.publicUrl + '/applet/findUserInfo',
       method: "GET",
       header: {
         appletsId: wx.getStorageSync('openId')

+ 33 - 8
pages/index/index.js

@@ -55,9 +55,15 @@ Page({
     }
   },
   goPaiming() {
-    wx.navigateTo({
-      url: '/pages/paiming/paiming',
-    })
+    if (wx.getStorageSync('user') == '') {
+      wx.redirectTo({
+        url: '/pages/login/login',
+      })
+    } else {
+      wx.navigateTo({
+        url: '/pages/paiming/paiming',
+      })
+    }
   },
   goSaoMa() {
     console.log("扫阿");
@@ -82,8 +88,8 @@ Page({
     })
   },
   depts() {
-    console.log(wx.getStorageSync('openId'), "openid的问题");
-
+    console.log("打印走了么的接口呢");
+    console.log(wx.getStorageSync('openId'));
     wx.request({
       url: app.globalData.publicUrl + '/applet/homeStatistics',
       method: "GET",
@@ -100,6 +106,8 @@ Page({
     })
   },
   welcomeMessage() {
+    console.log("welcomeMessage");
+    console.log(wx.getStorageSync('openId'));
     this.setData({
       msgList: []
     })
@@ -168,11 +176,28 @@ Page({
     }
 
   },
-  onLoad() {
-    this.depts();
-  },
+  // onLoad() {
+  //   console.log("onloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonload");
+  //   this.depts();
+  // },
+
+  
   onShow() {
+    console.log("onshowssshshshhshshshss");
     this.depts();
     this.welcomeMessage();
+    
+  },
+  onLoad: function () {
+    console.log("onload11111111111111111111111");
+    var that = this;
+    const apps = getApp()
+    apps.getAuthKey().then(function (res) {
+      that.depts();
+    })
+    console.log("onload12222222222222222222222222222221");
+
   }
+
+  
 })

+ 2 - 1
pages/personInfo/personInfo.js

@@ -66,8 +66,9 @@ Page({
         url: '/pages/login/login',
       })
     }
+
     wx.request({
-      url: app.globalData.publicUrl + '/sys/login/session',
+      url: app.globalData.publicUrl + '/applet/findUserInfo',
       method: "GET",
       header: {
         appletsId: wx.getStorageSync('openId')

+ 1 - 1
pages/updatepassword/updatepassword.js

@@ -120,7 +120,7 @@ Page({
   },
   onLoad: function () {
     wx.request({
-      url: app.globalData.publicUrl + '/sys/login/session',
+      url: app.globalData.publicUrl + '/applet/findUserInfo',
       method: "GET",
       header: {
         appletsId: wx.getStorageSync('openId')

+ 11 - 0
utils/service.js

@@ -3,6 +3,17 @@
  */
 import {get, post, put, del} from './network';
 
+// import {
+//   getBing
+// } from "../../utils/service.js";
+// getBing({
+//   name:'7778880105007',
+//   pwd: 'e10adc3949ba59abbe56e057f20f883e',
+//   appletsId: 'oqqAL4wZlDm8UYJFjdJljt - BoFvw'
+// })
+// .then(data => {
+//   console.log(data, "000000")
+// })
 /**
  * 服务器根域名
  * 试玩更多接口看这里