浏览代码

添加人脸识别

ssfg 4 年之前
父节点
当前提交
3b778fc311
共有 47 个文件被更改,包括 1287 次插入1124 次删除
  1. 5 4
      app.json
  2. 二进制
      images/add.png
  3. 二进制
      images/upload_card.png
  4. 二进制
      images/upload_me.png
  5. 二进制
      images/xy_top.png
  6. 21 67
      pages/aboutUs/aboutUs.js
  7. 3 15
      pages/aboutUs/aboutUs.wxml
  8. 11 3
      pages/aboutUs/aboutUs.wxss
  9. 50 27
      pages/adviceSubmit/adviceSubmit.js
  10. 0 75
      pages/card/card.js
  11. 0 4
      pages/card/card.json
  12. 0 48
      pages/card/card.wxml
  13. 0 84
      pages/card/card.wxss
  14. 159 89
      pages/collectInfo/collectInfo.js
  15. 2 1
      pages/collectInfo/collectInfo.wxml
  16. 135 0
      pages/faceRecognition/faceRecognition.js
  17. 4 0
      pages/faceRecognition/faceRecognition.json
  18. 11 0
      pages/faceRecognition/faceRecognition.wxml
  19. 47 0
      pages/faceRecognition/faceRecognition.wxss
  20. 189 80
      pages/finishInfo/finishInfo.js
  21. 25 10
      pages/finishInfo/finishInfo.wxml
  22. 38 15
      pages/finishInfo/finishInfo.wxss
  23. 173 320
      pages/index/index.js
  24. 1 3
      pages/index/index.wxml
  25. 47 7
      pages/login/login.js
  26. 9 1
      pages/login/login.wxml
  27. 11 0
      pages/login/login.wxss
  28. 32 14
      pages/love/love.js
  29. 1 1
      pages/paiming/paiming.wxml
  30. 47 82
      pages/personInfo/personInfo.js
  31. 4 4
      pages/personInfo/personInfo.wxml
  32. 2 1
      pages/question/question.wxml
  33. 0 12
      pages/visit/visit.js
  34. 0 4
      pages/visit/visit.json
  35. 0 0
      pages/visit/visit.wxml
  36. 0 0
      pages/visit/visit.wxss
  37. 1 1
      pages/visitFind/visitFind.json
  38. 83 96
      pages/visitandinfo/visitandinfo.js
  39. 1 1
      pages/visitandinfo/visitandinfo.wxml
  40. 66 0
      pages/xy/xy.js
  41. 3 0
      pages/xy/xy.json
  42. 18 0
      pages/xy/xy.wxml
  43. 1 0
      pages/xy/xy.wxss
  44. 2 2
      utils/photoUrl.wxs
  45. 27 30
      utils/request.js
  46. 56 21
      utils/tools.js
  47. 2 2
      utils/util.js

+ 5 - 4
app.json

@@ -1,7 +1,10 @@
 {
   "pages": [
-   
+    "pages/finishInfo/finishInfo",
     "pages/index/index",
+    "pages/faceRecognition/faceRecognition",
+    
+    "pages/xy/xy",
     "pages/visitandinfo/visitandinfo",
     "pages/aboutUs/aboutUs",
     "pages/visitList/visitList",
@@ -10,20 +13,18 @@
     "pages/visitFind/visitFind",
     "pages/love/love",
     "pages/collectInfo/collectInfo",
-    "pages/finishInfo/finishInfo",
     "pages/idCard/idCard",
     "pages/paiming/paiming",
     "pages/idCardDetail/idCardDetail",
     "pages/login/login",
     "pages/updatepassword/updatepassword",
     "pages/notice/notice",
-    "pages/card/card",
     "pages/personInfo/personInfo",
     "pages/userBook/userBook",
     "pages/adviceSubmit/adviceSubmit",
     "pages/workDailyInfo/workDailyInfo",
     "pages/question/question"
-    
+   
   ],
   "window": {
     "backgroundTextStyle": "light",

二进制
images/add.png


二进制
images/upload_card.png


二进制
images/upload_me.png


二进制
images/xy_top.png


+ 21 - 67
pages/aboutUs/aboutUs.js

@@ -1,71 +1,25 @@
-// pages/aboutUs/aboutUs.js
 Page({
-
-  /**
-   * 页面的初始数据
-   */
   data: {
-    phone: '17004319000',
-    email: ' limeng@tshe.cn'
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-  call() {
-    wx.makePhoneCall({
-      phoneNumber: this.data.phone
-    })
-  },
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
+    arr: [{
+      name: '服务电话',
+      value: '17004319000'
+    }, {
+      name: '服务邮箱',
+      value: 'limeng@tshe.cn'
+    }, {
+      name: '工作时间',
+      value: '8:00-18:00'
+    }, {
+      name: '技术支持',
+      value: '吉林省盛创科技有限公司'
+    }]
+  },
+  call(e) {
+    console.log()
+    if (e.currentTarget.dataset.idx == 0) {
+      wx.makePhoneCall({
+        phoneNumber: this.data.arr[0].value
+      })
+    }
   }
 })

+ 3 - 15
pages/aboutUs/aboutUs.wxml

@@ -7,21 +7,9 @@
 			以居家老年人为基础,村社区为依托,机构为补充的云大数据老年人服务平台,充分利用物联网、云计算、大数据、定位系统、人脸识别及SAAS服务等技术,充分有效的提升完善老年人大数据信息与服务质量,完美对接民政部的《全国农村留守老人系统》。
 		</view>
 		<view class="phone">
-			<view style="line-height:72rpx;width:600rpx;height:72rpx;border-bottom:1rpx solid #d5d9dd">
-				<view style="float:left;margin-left:50rpx">服务电话:</view>
-				<view style="float:right;margin-right:50rpx;color:#407cf3" bindtap="call">{{phone}}</view>
-			</view>
-			<view style="line-height:72rpx;width:600rpx;height:72rpx;border-bottom:1rpx solid #d5d9dd">
-				<view style="float:left;margin-left:50rpx">服务邮箱:</view>
-				<view style="float:right;margin-right:50rpx;" bindtap="call">{{email}}</view>
-			</view>
-			<view style="line-height:72rpx;width:600rpx;height:72rpx;border-bottom:1rpx solid #d5d9dd">
-				<view style="float:left;margin-left:50rpx">工作时间:</view>
-				<view style="float:right;margin-right:50rpx;" bindtap="call">8:00-18:00</view>
-			</view>
-					<view style="line-height:72rpx;width:600rpx;height:72rpx;">
-				<view style="float:left;margin-left:50rpx">技术支持:</view>
-				<view style="float:right;margin-right:50rpx;" bindtap="call">吉林省盛创科技有限公司</view>
+			<view wx:for='{{arr}}' wx:for-index="idx" wx:key='{{idx}}' style="line-height:72rpx;width:600rpx;height:72rpx;border-bottom:1rpx solid #d5d9dd">
+				<view style="float:left;margin-left:50rpx">{{item.name}}</view>
+				<view class="{{idx==0?'blue':'black'}}" data-idx='{{idx}}' bindtap="call">{{item.value}}</view>
 			</view>
 		</view>
 	</view>

+ 11 - 3
pages/aboutUs/aboutUs.wxss

@@ -1,10 +1,8 @@
-/* pages/aboutUs/aboutUs.wxss */
 .bj {
   width: 750rpx;
   height: 100vh;
   background-color: #2187f6;
 }
-
 .top {
   width: 700rpx;
   height: 355rpx;
@@ -12,7 +10,6 @@
   display: flex;
   padding-top: 50rpx;
 }
-
 .middle {
   width: 700rpx;
   height: 60vh;
@@ -55,4 +52,15 @@
   /* line-height: 80rpx; */
   color: #4d4d4d;
   font-size: 28rpx;
+}
+
+.blue {
+  float: right;
+  margin-right: 50rpx;
+  color: #407cf3
+}
+
+.black {
+  float: right;
+  margin-right: 50rpx;
 }

+ 50 - 27
pages/adviceSubmit/adviceSubmit.js

@@ -4,7 +4,8 @@ Page({
     texts: "至少需要2个字",
     min: 2, //最少字数
     max: 200, //最多字数 (根据自己需求改变) 
-    currentWordNumber: 0
+    currentWordNumber: 0,
+    value: ''
   },
   //字数限制  
   inputs: function (e) {
@@ -38,37 +39,59 @@ Page({
     console.log(this.data)
   },
   submit() {
-    if (this.data.value) {
-      wx.request({
-        url: app.globalData.publicUrl + '/feedback/add',
-        method: "POST",
-        data: {
-          appletsId: wx.getStorageSync('openId'),
-          content: this.data.value
-        },
-        success: res => {
-          console.log(res, '我提交成功了')
-          this.setData({
-            value: ''
-          })
-          wx.showToast({
-            title: '感谢您的反馈,我们会认真处理问题并尽快完善相关功能!',
-            icon: 'none',
-            duration: 3000,
-          });
-          setTimeout(function () {
-            wx.switchTab({
-              url: '../../pages/personInfo/personInfo'
-            });
-          }, 3000)
-        }
-      });
-    }else{
+    var test = this.data.value;
+    if (test.match(/^\s+$/) || test.match(/^[ ]+$/) || test.match(/^[ ]*$/) || test.match(/^\s*$/)) {
+      console.log("反馈为空")
       wx.showToast({
         title: '反馈不能为空哦',
         icon: 'none',
         duration: 3000,
       });
+      return;
     }
+    // if (test.match(/^[ ]+$/)) {
+    //   console.log("all space")
+    //   return;
+    // }
+    // if (test.match(/^[ ]*$/)) {
+    //   console.log("all space or empty")
+    //   return;
+    // }
+    // if (test.match(/^\s*$/)) {
+    //   console.log("all space or \\n or empty")
+    //   return;
+    // }
+    // if (this.data.value) {
+    wx.request({
+      url: app.globalData.publicUrl + '/feedback/add',
+      method: "POST",
+      data: {
+        appletsId: wx.getStorageSync('openId'),
+        content: this.data.value
+      },
+      success: res => {
+        console.log(res, '我提交成功了')
+        this.setData({
+          value: ''
+        })
+        wx.showToast({
+          title: '感谢您的反馈,我们会认真处理问题并尽快完善相关功能!',
+          icon: 'none',
+          duration: 3000,
+        });
+        setTimeout(function () {
+          wx.switchTab({
+            url: '../../pages/personInfo/personInfo'
+          });
+        }, 3000)
+      }
+    });
+    // } else {
+    //   wx.showToast({
+    //     title: '反馈不能为空哦',
+    //     icon: 'none',
+    //     duration: 3000,
+    //   });
+    // }
   },
 })

+ 0 - 75
pages/card/card.js

@@ -1,75 +0,0 @@
-const app = require('../../utils/util.js');
-var util = require('../../utils/md5.js')
-Page({
-  data: {
-    currentTabIndex: 0,
-    readList: [{
-        title: '重要通知',
-        content: '萨达撒多会撒娇的挥洒健康的挥洒考究的挥洒的货架上',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知222',
-        content: 'wewewe',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知222',
-        content: 'wewewe',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知222',
-        content: 'wewewe',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知222',
-        content: 'wewewe',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知',
-        content: 'skdaskjd阿斯顿撒多撒多撒多萨迪克撒旦卡萨丁',
-        time: '2020/07/08'
-      },
-      {
-        tile: '重要通知',
-        content: '所得税卡的挥洒考究的哈斯科技带回家卡萨的挥洒考究的哈斯卡接电话看手机啊都好看手机锕',
-        time: '2020/07/08'
-      },
-    ],
-    noreadList: [{
-        title: '未读通知',
-        content: '萨达撒多会撒娇的挥洒健康的挥洒考究的挥洒的货架上',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知222',
-        content: 'wewewe',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知',
-        content: 'skdaskjd阿斯顿撒多撒多撒多萨迪克撒旦卡萨丁',
-        time: '2020/07/08'
-      },
-      {
-        title: '重要通知',
-        content: '所得税卡的挥洒考究的哈斯科技带回家卡萨的挥洒考究的哈斯卡接电话看手机啊都好看手机锕',
-        time: '2020/07/08'
-      },
-    ],
-  },
-  onTabsItemTap: function (event) {
-    let index = event.currentTarget.dataset.index;
-    this.setData({
-      currentTabIndex: index
-    })
-  },
-
-  onLoad: function () {
-
-
-  },
-})

+ 0 - 4
pages/card/card.json

@@ -1,4 +0,0 @@
-{
-  "navigationBarTitleText":"通知",
-  "usingComponents": {}
-}

+ 0 - 48
pages/card/card.wxml

@@ -1,48 +0,0 @@
-	<view id='tabs'>
-		<view class='tabs-box'>
-			<block wx:for="{{['未读消息','已读消息']}}" wx:key="index">
-				<view class="tabs-item {{currentTabIndex == index ? 'selected' : '' }}" bindtap='onTabsItemTap' data-index='{{index}}'>
-					{{item}}
-				</view>
-			</block>
-		</view>
-		<view class="yuan" wx:if='{{currentTabIndex != 1}}'></view>
-		<view class='ordert-detail'>
-			<view hidden='{{currentTabIndex != 0}}'>
-				<view class="onread" wx:for='{{readList}}'>
-					<view>
-						【{{item.title}}】
-					</view>
-					<view class="title">
-						{{item.time}}
-					</view>
-					<view class="title"> {{item.content}} </view>
-					<view class="flex-box">
-						<view class="readwenzi">未读</view>
-						<view style="display: flex;">
-							<image src="/images/dui.png" style="width: 40rpx; height: 40rpx; margin-right: 10rpx;"></image>
-							<view>我知道了</view>
-						</view>
-					</view>
-				</view>
-			</view>
-			<view hidden='{{currentTabIndex != 1}}'>
-				<view class="onread" wx:for='{{readList}}'>
-					<view>
-						【{{item.title}}】
-					</view>
-					<view class="title">
-						{{item.time}}
-					</view>
-					<view class="title">{{item.content}}</view>
-					<view class="flex-box">
-						<view class="readwenzi" style="background:#dcdcdc">已读</view>
-						<view style="display: flex;  align-items: center;">
-							<image src="/images/shan.png" style="width: 50rpx; height: 50rpx; margin-right: 10rpx;"></image>
-							<view>删除</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>

+ 0 - 84
pages/card/card.wxss

@@ -1,84 +0,0 @@
-page {
-  background-color: #f9f9f7;
-}
-
-#tabs {
-  width: 90%;
-  padding: 0 20px;
-  margin: 20rpx 0 20rpx 0;
-  /* position: absolute; */
-  /* z-index: 99999999; */
-}
-
-.tabs-box {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  height: 80rpx;
-  line-height: 80rpx;
-  text-align: center;
-  /* position: fixed;
-  width: 100%;
-  height: 150rpx; */
-}
-
-.tabs-item.selected {
-  border: 1rpx solid #2087f7;
-  color: #2087f7;
-  background: #d2e7fd;
-  border-radius: 40rpx;
-}
-
-.tabs-item {
-  width: 50%;
-  color: #666;
-
-}
-
-.yuan {
-  width: 20rpx;
-  height: 20rpx;
-  border-radius: 50%;
-  background: red;
-  position: absolute;
-  top: 20rpx;
-  left: 50rpx;
-  position: absolute;
-  top: 42rpx;
-  left: 265rpx;
-
-}
-
-.onread {
-  width: 100%;
-  background: white;
-  box-sizing: border-box;
-  padding: 35rpx;
-  margin-top: 20rpx;
-}
-
-.title {
-  color: #a7a7a7;
-  font-size: 26rpx;
-  margin-top: 10rpx;
-}
-
-.readwenzi {
-  color: whitesmoke;
-  padding: 10rpx;
-  width: 48rpx;
-  font-size: 24rpx;
-  background: #2087f7;
-  border-radius: 10rpx;
-  margin-top: 10rpx;
-
-}
-
-.flex-box {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  font-size: 24rpx;
-  color: #a7a7a7;
-  
-}

+ 159 - 89
pages/collectInfo/collectInfo.js

@@ -1,4 +1,5 @@
 const util = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
 var QQMapWX = require('../../libs/qqmap-wx-jssdk.min.js');
 var isonShow;
 var isTwoOnshow;
@@ -207,7 +208,8 @@ Page({
       return;
     }
     this.formCheckCard();
-    if (this.data.oldCardNull || this.data.oldCard60 || this.data.oldCardWrong || this.data.oldCard150) {
+    // this.tab1Change4();
+    if (this.data.oldCardNull || this.data.oldCard60 || this.data.oldCardWrong || this.data.oldCard150 || this.data.oldCardhas) {
       this.setData({
         detail: 'idnumber'
       })
@@ -460,7 +462,7 @@ Page({
       this.childrenDing(0);
       if (this.childrenDing(0)) {
         this.childrenDing(1)
-        if(this.childrenDing(1)){
+        if (this.childrenDing(1)) {
           wx.showToast({
             title: '该卡片信息已填全',
             icon: 'none',
@@ -475,7 +477,7 @@ Page({
         this.childrenDing(1)
         if (this.childrenDing(1)) {
           this.childrenDing(2);
-          if(this.childrenDing(2)){
+          if (this.childrenDing(2)) {
             wx.showToast({
               title: '该卡片信息已填全',
               icon: 'none',
@@ -793,6 +795,8 @@ Page({
       success: (res) => {
         if (res.data.code == 0) {
           let name = 'oldInfo[' + this.data.activeIndex + '].name'
+          console.log(res.data.data.name)
+          console.log(this.data.addOldname)
           this.setData({
             nameArr: this.data.nameArr.concat(res.data.data),
             familyFid: res.data.data.fid,
@@ -816,6 +820,7 @@ Page({
       oldCard60: false,
       oldCard100: false,
       oldCard150: false,
+      oldCardhas: false,
       oldPhoneNull: false,
       oldisMarryName: false,
       oldisMarryPhone: false,
@@ -1319,6 +1324,7 @@ Page({
                   encoding: 'base64',
                   success: res1 => {
                     let img = 'data:image/png;base64,' + res1.data
+                    console.log(img, 'read了啥')
                     wx.request({
                       url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=' + token,
                       method: 'POST',
@@ -1331,7 +1337,7 @@ Page({
                       },
                       dataType: 'json',
                       success: (e) => {
-                        console.log(e, "看看那ocr返回了么数据呢");
+                        console.log(e, "ocr返回数据了么");
                         const app = getApp()
                         app.globalData.id = '-2'
                         // 扫描后赋值 
@@ -1397,7 +1403,7 @@ Page({
                           } else {
                             wx.showModal({
                               showCancel: false,
-                              content: '添加当前老人名字和扫描身份证名字不一致,请重新扫描'
+                              content: '与当前老人名字不一致,请重新扫描'
                             })
                           }
                         } else {
@@ -1474,17 +1480,46 @@ Page({
   },
   // 身份证号
   tab1Change4: function (e) {
+    // let number;
+    // if (e) {
+    // number = e.detail.value
     let idNumber = 'oldInfo[' + this.data.activeIndex + '].idNumber'
     this.setData({
       [idNumber]: e.detail.value
     })
-    this.formCheckCard();
-    if (!this.data.oldCardNull && !this.data.oldCard60 && !this.data.oldCardWrong && !this.data.oldCard150) {
-      this.SubmitOldmanInfo({
-        id: this.data.nameArr[this.data.activeIndex]._id,
-        idNumber: e.detail.value
-      })
-    }
+    // } else {
+    //   number = this.data.oldInfo[this.data.activeIndex].idNumber
+    // }
+    wx.request({
+      url: util.globalData.publicUrl + '/wxinfo/listByNumber',
+      method: "get",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        number: e.detail.value
+      },
+      success: (res) => {
+        if (res.data.code == 1) {
+          console.log('身份证已存在')
+          this.setData({
+            oldCardhas: true
+          })
+        } else {
+          console.log('身份证不存在')
+          this.setData({
+            oldCardhas: false
+          })
+          this.formCheckCard();
+          if (!this.data.oldCardNull && !this.data.oldCard60 && !this.data.oldCardWrong && !this.data.oldCard150 && !this.data.oldCardhas) {
+            this.SubmitOldmanInfo({
+              id: this.data.nameArr[this.data.activeIndex]._id,
+              idNumber: e.detail.value
+            })
+          }
+        }
+      }
+    })
   },
   // 联系电话
   tab1Change5: function (e) {
@@ -2665,7 +2700,6 @@ Page({
     }
   },
   goPhoto() {
-    console.log('我走')
     isTwoOnshow = true;
     wx.setStorageSync('isTwoOnshow', true)
     wx.showLoading({
@@ -2693,15 +2727,37 @@ Page({
             const app = getApp()
             app.globalData.id = '-2'
             let datas = JSON.parse(res.data)
-            let imgPath = 'oldInfo[' + this.data.activeIndex + '].imgPath'
-            let isHavePhoto = 'oldInfo[' + this.data.activeIndex + '].isHavePhoto'
-            this.setData({
-              [imgPath]: datas.data,
-              [isHavePhoto]: true,
-            })
-            this.SubmitOldmanInfo({
-              id: this.data.nameArr[this.data.activeIndex]._id,
-              photo: datas.data,
+            console.log(datas)
+            wx.request({
+              url: util.globalData.publicUrl + '/user/getPeople',
+              method: "POST",
+              header: {
+                appletsId: wx.getStorageSync('openId')
+              },
+              data: {
+                photoPath: datas.data
+              },
+              success: (res) => {
+                console.log(res, '有没有face')
+                if (res.data.code == 0) {
+                  let imgPath = 'oldInfo[' + this.data.activeIndex + '].imgPath'
+                  let isHavePhoto = 'oldInfo[' + this.data.activeIndex + '].isHavePhoto'
+                  this.setData({
+                    [imgPath]: datas.data,
+                    [isHavePhoto]: true,
+                  })
+                  this.SubmitOldmanInfo({
+                    id: this.data.nameArr[this.data.activeIndex]._id,
+                    photo: datas.data,
+                  })
+                } else {
+                  wx.showToast({
+                    title: '人脸识别不通过,请重新上传',
+                    icon: 'none',
+                    duration: 3000,
+                  })
+                }
+              }
             })
           }
         })
@@ -4413,75 +4469,61 @@ Page({
     isonShow = false;
   },
   onShow() {
-    wx.login({
-      success: (res) => {
-        if (res.code) {
-          wx.request({
-            url: util.globalData.publicUrl + '/wx/getAppletOpenId',
-            method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
-            },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: util.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        const app = getApp();
-                        if (isTwoOnshow) {
-                          isTwoOnshow = false;
-                          return;
-                        };
-                        if (isonShow) {
-                          isonShow = false;
-                          return;
-                        };
-                        this.setData({
-                          addOldname: '',
-                          currentIndex: 0
-                        })
-                        this.huixian(app.globalData.id, app.globalData.name);
-                        this.AllFalse();
-                      }
-                    } else {
-                      wx.clearStorageSync();
-                      wx.showModal({
-                        showCancel: false,
-                        content: '当前您未登录,请登录',
-                        success(res) {
-                          if (res.confirm) {
-                            wx.redirectTo({
-                              url: '/pages/login/login',
-                            })
-                          } else if (res.cancel) {
-                            console.log('用户点击取消')
-                          }
-                        }
-                      })
-                      this.setData({
-                        isTure: false,
-                      })
-                    }
-                  }
-                })
-              }
+    wx.showLoading({
+      title: '加载中',
+    })
+    tools.rzStatus().then((res) => {
+      if (res.data.code == 0) {
+        if (res.data.data) {
+          tools.finishInfo().then((res) => {
+            console.log(res.data.data.perfect, '我完善信息了吗 1代表完后 0代表未完成')
+            console.log(res.data.data.comparison, '我人脸识别过了吗 1代表完后 0代表未完成')
+            if (res.data.data.perfect == '0') {
+              wx.redirectTo({
+                url: '/pages/finishInfo/finishInfo',
+              })
+              return;
             }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+            if (res.data.data.perfect == '1' && res.data.data.comparison == '0') {
+              wx.redirectTo({
+                url: '/pages/faceRecognition/faceRecognition',
+              })
+              return;
+            }
+            const app = getApp();
+            if (isTwoOnshow) {
+              isTwoOnshow = false;
+              return;
+            };
+            if (isonShow) {
+              isonShow = false;
+              return;
+            };
+            this.setData({
+              addOldname: '',
+              currentIndex: 0
+            })
+            this.huixian(app.globalData.id, app.globalData.name);
+            this.AllFalse();
+            wx.hideLoading()
+          })
         }
+      } else {
+        wx.hideLoading()
+        wx.clearStorageSync();
+        wx.showModal({
+          showCancel: false,
+          content: '当前您未登录,请登录',
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/login/login',
+              })
+            }
+          }
+        })
       }
-    })
+    });
   },
   onHide() {
     const app = getApp()
@@ -4566,7 +4608,8 @@ Page({
       oldCardWrong: false,
       oldCard60: false,
       oldCard100: false,
-      oldCard1500: false,
+      oldCard150: false,
+      oldCardhas: false,
     })
     // 身份证号
     let idNumber = this.data.oldInfo[this.data.activeIndex].idNumber
@@ -4578,6 +4621,26 @@ Page({
       this.setData({
         oldCardNull: false
       })
+      // wx.request({
+      //   url: util.globalData.publicUrl + '/wxinfo/listByNumber',
+      //   method: "get",
+      //   header: {
+      //     appletsId: wx.getStorageSync('openId')
+      //   },
+      //   data: {
+      //     number: idNumber
+      //   },
+      //   success: (res) => {
+      //     if (res.data.code == 1) {
+      //       console.log('身份证已存在')
+      //       this.setData({
+      //         oldCardhas: true
+      //       })
+      //     } else {
+      //       console.log('身份证不存在')
+      //       this.setData({
+      //         oldCardhas: false
+      //       })
       if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idNumber)) && idNumber.length != 18) {
         this.setData({
           oldCardWrong: true
@@ -4622,8 +4685,15 @@ Page({
           })
         }
       }
+      //       }
+      //     }
+      //   })
     }
+
   },
+  // checkIdcardHas(number){
+
+  // },
   // 表单校验老人联系电话
   formCheckPhone() {
     this.setData({

+ 2 - 1
pages/collectInfo/collectInfo.wxml

@@ -102,6 +102,7 @@
 				<view wx:if="{{oldCard60}}" class="required">不可采集低于60岁老人的信息哦</view>
 				<view wx:if="{{oldCard100}}" class="required1">提示:该老人年龄大于100岁</view>
 				<view wx:if="{{oldCard150}}" class="required">信息有误,请再次核实身份证信息</view>
+				<view wx:if="{{oldCardhas}}" class="required">该老人信息已存在,请核实</view>
 				<view class="block" id="oldphone"><text class="red">*</text>联系电话<input placeholder="请填写" placeholder-style='font-size:25rpx;color: #bbbbbb;' bindblur="tab1Change5" value="{{oldInfo[activeIndex].phone}}" /></view>
 				<view wx:if="{{oldPhoneNull}}" class="required">老人联系电话不能为空哦!</view>
 				<view wx:if="{{oldPhoneNull1}}" class="required">老人联系电话格式不对哦!</view>
@@ -351,7 +352,7 @@
 					</checkbox-group>
 				</view>
 				<view wx:if="{{isoldtypeNull}}" class="required">老年人类别不能为空哦!</view>
-				<view id="oldPhone" class="name"><text class="red">*</text>老人照片</view>
+				<view id="oldPhone" class="name"><text class="red">*</text>老人清晰面部照片</view>
 				<view class="scan" wx:if="{{oldInfo[activeIndex].imgPath == ''}}" style="margin-top:20rpx" bindtap="getSelfLocation">
 					<image src="../../images/mz/upload.png" style="width:40rpx;height:40rpx;margin-top:5rpx;margin-left:30rpx"></image><text >请上传老人含面部照片</text>
 				</view>

+ 135 - 0
pages/faceRecognition/faceRecognition.js

@@ -0,0 +1,135 @@
+// pages/faceRecognition/faceRecognition.js
+const util = require('../../utils/util.js');
+Page({
+  data: {
+    photo: ''
+  },
+  uploadPhoto() {
+    wx.showLoading({
+      title: '上传中',
+    })
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['camera'],
+      success: (res) => {
+        let tempFilePaths = res.tempFilePaths
+        wx.uploadFile({
+          url: util.globalData.publicUrl + '/sys/user/upload',
+          filePath: tempFilePaths[0],
+          name: 'uploadFile',
+          formData: {
+            "user": "test",
+          },
+          header: {
+            appletsId: wx.getStorageSync('openId'),
+          },
+          success: (res) => {
+            let datas = JSON.parse(res.data)
+            this.setData({
+              photo: datas.data
+            })
+            console.log(this.data.photo)
+          }
+        })
+      },
+      complete: (e) => {
+        wx.hideLoading();
+      }
+    })
+  },
+  submit() {
+    wx.showLoading({
+      title: '上传中',
+    })
+    wx.request({
+      url: util.globalData.publicUrl + '/user/userFaceComparison',
+      method: "post",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        photoPath: this.data.photo
+      },
+      success: (res) => {
+        console.log(res)
+        if (res.data.code == 0) {
+          wx.showModal({
+            showCancel: false,
+            content: '比对成功',
+            success(res) {
+              if (res.confirm) {
+                wx.switchTab({
+                  url: '/pages/index/index',
+                })
+              }
+            }
+          })
+        }else{
+          wx.showToast({
+            title: '人脸识别失败',
+            icon: 'none',
+            duration: 2000,
+          })
+        }
+      },
+      complete:()=>{
+        wx.hideLoading();
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/faceRecognition/faceRecognition.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText":"人脸识别"
+}

+ 11 - 0
pages/faceRecognition/faceRecognition.wxml

@@ -0,0 +1,11 @@
+<wxs module="urls" src="../../utils/photoUrl.wxs"></wxs>
+<view class="p1">您还未进行人脸校验,请上传本人照片</view>
+<view class="p2">上传本人真实清晰面部照片。为了保障账户的安全,我们采用人脸识别技术来核实您本人的身份,此照片也将在您的身份卡上显示。</view>
+<view class="p3" bindtap="uploadPhoto">
+	<image wx:if="{{!photo}}" src="../../images/add.png" style="width:166rpx;height:143rpx;margin-left:67rpx;margin-top:50rpx"></image>
+	<view wx:if="{{!photo}}" style="text-align:center;color:#5caaff;margin-top:20rpx">点击上传照片</view>
+	<image style="width:300rpx;height:300rpx" wx:if="{{photo}}" src="{{urls.url(photo)}}"></image>
+</view>
+<view class="btn">
+	<view class="submit_btn" bindtap="submit">提交</view>
+</view>

+ 47 - 0
pages/faceRecognition/faceRecognition.wxss

@@ -0,0 +1,47 @@
+/* pages/faceRecognition/faceRecognition.wxss */
+.p1 {
+  text-align: center;
+  font-size: 30rpx;
+  font-weight: 800;
+  margin-top: 100rpx;
+}
+
+.p2 {
+  width: 600rpx;
+  margin-left: 75rpx;
+  text-align: center;
+  margin-top: 50rpx;
+  color: #aeaeae;
+  font-size: 26rpx;
+}
+
+.p3 {
+  width: 300rpx;
+  height: 300rpx;
+  margin-left: 225rpx;
+  margin-top: 50rpx;
+  box-shadow: 0px 0px 20rpx 0px rgba(92, 170, 255, 0.5);
+  border-radius: 20rpx;
+}
+
+.btn {
+  width: 750rpx;
+  position: fixed;
+  bottom: 0;
+  height: 100rpx;
+  box-shadow: 0px 0px 20rpx 0px rgba(228, 231, 233, 1)
+}
+
+.submit_btn {
+  width: 650rpx;
+  height: 60rpx;
+  margin-top: 20rpx;
+  margin-left: 50rpx;
+  background-color: #2087f7;
+  border-radius: 10rpx;
+  color: #fff;
+  text-align: center;
+  line-height: 60rpx;
+  font-size: 28rpx;
+  font-weight: 600;
+}

+ 189 - 80
pages/finishInfo/finishInfo.js

@@ -62,7 +62,6 @@ Page({
         name: '2万元以上'
       },
     ],
-
     educationList: [{
         name: '小学'
       },
@@ -83,8 +82,96 @@ Page({
       },
     ],
   },
+  uploadIdcard() {
+    wx.showLoading({
+      title: '加载中',
+    })
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['camera'],
+      success: (res) => {
+        console.log(res, '图片的临时路径')
+        let tempFilePaths = res.tempFilePaths[0]
+        this.goOcr(tempFilePaths)
+      },
+      fail: () => {
+        wx.hideLoading();
+      }
+      // complete: (e) => {
+      //   wx.hideLoading();
+      // }
+    })
+  },
+  uploadIdimg() {
+    wx.showLoading({
+      title: '加载中',
+    })
+    wx.chooseImage({
+      count: 1,
+      sizeType: ['compressed'],
+      sourceType: ['camera'],
+      success: (res) => {
+        console.log(res, '图片的临时路径')
+        let tempFilePaths = res.tempFilePaths[0]
+        wx.uploadFile({
+          url: app.globalData.publicUrl + '/sys/user/upload',
+          filePath: tempFilePaths,
+          name: 'uploadFile',
+          formData: {
+            "user": "test",
+          },
+          header: {
+            appletsId: wx.getStorageSync('openId'),
+          },
+          success: (res) => {
+            console.log(res)
+            let datas = JSON.parse(res.data)
+            console.log(datas.data)
+            this.goFace(datas.data)
+          }
+        })
+      },
+      complete: (e) => {
+        wx.hideLoading();
+      }
+    })
+  },
+  goFace(file) {
+    wx.request({
+      url: app.globalData.publicUrl + '/user/getPeople',
+      method: "POST",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        photoPath: file
+      },
+      success: (res) => {
+        wx.hideLoading();
+        console.log(res, '有没有face')
+        if (res.data.code == 0) {
+          this.setData({
+            myPhoto: file
+          })
+        } else {
+          wx.showToast({
+            title: '人脸识别不通过,请重新上传',
+            icon: 'none',
+            duration: 3000,
+          })
+        }
+      },
+      fail: () => {
+        wx.hideLoading();
+      }
+      // complete: (e) => {
+      //   wx.hideLoading();
+      // }
+    })
+  },
   // 百度身份证OCR接口 首先去后台获得token
-  goOcr() {
+  goOcr(file) {
     wx.request({
       url: app.globalData.publicUrl + '/applet/getToken',
       method: "GET",
@@ -92,96 +179,100 @@ Page({
         appletsId: wx.getStorageSync('openId')
       },
       success: (res) => {
-        console.log(res.data, "0000");
         if (res.data.data.status == 200) {
           let token = res.data.data.token;
           if (token) {
-            wx.showLoading({
-              title: '加载中',
-            })
             var _this = this;
-            wx.chooseImage({
-              count: 1, // 默认9
-              sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
-              sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
-              success: function (res) {
-                wx.showLoading({
-                  title: '加载中',
-                })
-                // 拿文件转换base64
-                wx.getFileSystemManager().readFile({
-                  filePath: res.tempFilePaths[0],
-                  encoding: 'base64',
-                  success: res1 => {
-                    //返回临时文件路径
-                    console.log('读取本地文件basema ', res1.data)
-                    let img = 'data:image/png;base64,' + res1.data
-                    wx.request({
-                      url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=' + token,
-                      method: 'POST',
-                      header: {
-                        'content-type': 'application/x-www-form-urlencoded'
-                      },
-                      data: {
-                        id_card_side: 'front',
-                        image: img
-                      },
-                      dataType: 'json',
-                      success: (e) => {
-                        // 扫描后赋值 
-                        if (e.data.idcard_number_type == 1) {
-                          let result = e.data.words_result
-                          console.log(result, "00000000");
-                          _this.data.parameter.forEach(item => {
-                            if (item.name == result['性别'].words) {
-                              item.checked = true;
-                            }
-                          })
-                          var myDate = new Date();
-                          var tYear = myDate.getFullYear();
-                          let aa = parseInt(result['公民身份号码'].words.slice(6, 10));
-                          if (_this.data.userName == result['姓名'].words) {
-                            _this.setData({
-                              userName: result['姓名'].words,
-                              idCardNumber: result['公民身份号码'].words,
-                              parameter: _this.data.parameter,
-                              age: tYear - aa
-                            })
-                          } else {
-                            wx.showModal({
-                              showCancel: false,
-                              content: '登录巡访员名字和扫描身份证名字不一致,请重新扫描'
+            wx.getFileSystemManager().readFile({
+              filePath: file,
+              encoding: 'base64',
+              success: res1 => {
+                console.log('读取本地文件basema ', 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,
+                  method: 'POST',
+                  header: {
+                    'content-type': 'application/x-www-form-urlencoded'
+                  },
+                  data: {
+                    id_card_side: 'front',
+                    image: img
+                  },
+                  dataType: 'json',
+                  success: (e) => {
+                    // 扫描后赋值 
+                    if (e.data.idcard_number_type == 1) {
+                      let result = e.data.words_result
+                      console.log(result, "00000000");
+                      _this.data.parameter.forEach(item => {
+                        if (item.name == result['性别'].words) {
+                          item.checked = true;
+                        }
+                      })
+                      var myDate = new Date();
+                      var tYear = myDate.getFullYear();
+                      let aa = parseInt(result['公民身份号码'].words.slice(6, 10));
+                      // _this.data.userName
+                      if (_this.data.userName == result['姓名'].words) {
+                        _this.setData({
+                          userName: result['姓名'].words,
+                          idCardNumber: result['公民身份号码'].words,
+                          parameter: _this.data.parameter,
+                          age: tYear - aa
+                        })
+                        wx.uploadFile({
+                          url: app.globalData.publicUrl + '/sys/user/upload',
+                          filePath: file,
+                          name: 'uploadFile',
+                          formData: {
+                            "user": "test",
+                          },
+                          header: {
+                            appletsId: wx.getStorageSync('openId'),
+                          },
+                          success: (res) => {
+                            console.log(res)
+                            let datas = JSON.parse(res.data)
+                            console.log(datas.data)
+                            this.setData({
+                              idPhoto: datas.data
                             })
+                            // this.goOcr(datas.data)
                           }
-                        } else {
-                          wx.showToast({
-                            title: "身份证OCR识别失败",
-                            icon: 'none',
-                            duration: 2000,
-                          })
-                        }
-                      },
-                      complete: (e) => {
-                        wx.hideLoading();
+                        })
+                      } else {
+                        wx.showModal({
+                          showCancel: false,
+                          content: '扫描证件信息与后台录入姓名不一致'
+                        })
                       }
-                    })
+                    } else {
+                      wx.showToast({
+                        title: "身份证OCR识别失败",
+                        icon: 'none',
+                        duration: 2000,
+                      })
+                    }
                   },
-                  // 错误信息
-                  fail: console.error
+                  // complete: (e) => {
+                  //   wx.hideLoading();
+                  // }
                 })
               },
-              fail: function () {
-                wx.hideLoading();
-              }
-
+              // 错误信息
+              fail: console.error
             })
           } else {
+            // wx.hideLoading();
             wx.showToast({
               title: '身份证识别失败,token失效',
               icon: 'none',
               duration: 2000,
             })
           }
+        } else {
+          wx.hideLoading()
         }
       },
     })
@@ -215,7 +306,6 @@ Page({
       educationtext: '',
     })
   },
-
   initValidate() {
     const rules = {
       userName: {
@@ -240,8 +330,14 @@ Page({
       education: {
         required: true,
       },
-
-
+      idCardPicPath: {
+        required: true,
+      },
+      headPicPath: {
+        required: true,
+      }
+      // params.idCardPicPath = this.data.idPhoto
+      // params.headPicPath = this.data.myPhoto
     };
     const messages = {
       userName: {
@@ -266,6 +362,12 @@ Page({
       education: {
         required: '请输入您的学历',
       },
+      idCardPicPath: {
+        required: '请上传您的身份证照片',
+      },
+      headPicPath: {
+        required: '请上传您本人的照片',
+      },
     };
     // 创建实例对象
     this.WxValidate = new WxValidate(rules, messages)
@@ -278,9 +380,13 @@ Page({
     })
   },
   formSubmit(e) {
-    console.log(e.detail, "daying");
+    // console.log(e.detail, "表单的内容");
     /***4-3(表单提交校验)*/
     const params = e.detail.value
+    params.idCardPicPath = this.data.idPhoto
+    params.headPicPath = this.data.myPhoto
+    params.IsPerfect = '1'
+    console.log(params, '表单的内容')
     if (!this.WxValidate.checkForm(params)) {
       const error = this.WxValidate.errorList[0]
       this.showModal(error)
@@ -306,8 +412,11 @@ Page({
             showCancel: false,
             content: '提交成功',
             success() {
-              wx.switchTab({
-                url: '/pages/index/index',
+              // wx.switchTab({
+              //   url: '/pages/index/index',
+              // })
+              wx.reLaunch({
+                url: '/pages/faceRecognition/faceRecognition',
               })
             }
           })

+ 25 - 10
pages/finishInfo/finishInfo.wxml

@@ -1,10 +1,24 @@
+<wxs module="urls" src="../../utils/photoUrl.wxs"></wxs>
 <image src="/images/wanshan.png" style="width: 100%; height: 300rpx;"></image>
 <view class="home">
-	<view class="title" bindtap="goOcr">
+	<!-- <view class="title" bindtap="goOcr">
 		<image src="/images/saoma.png" style="width: 40rpx; height: 40rpx;"></image>
 		<view class="saoma">
 			扫描身份证上传基本信息
 		</view>
+	</view> -->
+	<!-- <view class="title" bindtap="uploadIdcard">
+		<image src="/images/saoma.png" style="width: 40rpx; height: 40rpx;"></image>
+		<view class="saoma">
+			身份证上传
+		</view>
+	</view> -->
+	<view class="photo_box">
+		<image wx:if='{{!idPhoto}}' src="../../images/upload_card.png" style="height:224rpx;width:315rpx;float:left" bindtap="uploadIdcard"></image>
+		<image wx:if='{{idPhoto}}' src="{{urls.url(idPhoto)}}" style="height:224rpx;width:315rpx;float:left" bindtap="uploadIdcard"></image>
+		<image  wx:if='{{!myPhoto}}' src="../../images/upload_me.png" style="height:224rpx;width:253rpx;float:right" bindtap="uploadIdimg"></image>
+		<image  wx:if='{{myPhoto}}' src="{{urls.url(myPhoto)}}" style="height:224rpx;width:253rpx;float:right" bindtap="uploadIdimg"></image>
+		<!-- <image src="../../images/upload_me.png" style="height:224rpx;width:253rpx;float:right"></image> -->
 	</view>
 	<form bindsubmit="formSubmit">
 		<view class="box">
@@ -12,14 +26,14 @@
 				<view class="shu"></view>
 				<view class="small-box">姓名</view>
 			</view>
-			<input name='userName' value="{{userName}}" class="weui-input" placeholder="请输入" />
+			<input disabled="{{true}}" name='userName' value="{{userName}}" class="weui-input" placeholder="请输入" />
 			<view class="flex-box">
 				<view class="shu"></view>
 				<view class="small-box">性别</view>
 			</view>
-			<radio-group name="sex">
+			<radio-group name="sex" style='margin-left:30rpx'>
 				<label wx:for="{{parameter}}">
-					<radio checked="{{item.checked}}" color='#009FE9' value="{{ item.name }}">{{item.name}}</radio>
+					<radio disabled="{{true}}" checked="{{item.checked}}" color='#009FE9' value="{{ item.name }}">{{item.name}}</radio>
 				</label>
 			</radio-group>
 			<view class="flex-box">
@@ -31,35 +45,36 @@
 				<view class="shu"></view>
 				<view class="small-box">年龄</view>
 			</view>
-			<input name='age' disabled="{{true}}" value="{{age}}" class="weui-input" placeholder="系统计算" />
+			<input name='age' disabled="{{true}}" value="{{age}}" class="weui-input" placeholder="录入身份证照片后系统计算" />
 			<view class="flex-box">
 				<view class="shu"></view>
 				<view class="small-box">职务</view>
 			</view>
-			<picker bindchange="postListChange" name="job" value="{{postList[postindex].name}}" range-key="{{'name'}}" range="{{postList}}">
+			<picker style="position:relative" bindchange="postListChange" name="job" value="{{postList[postindex].name}}" range-key="{{'name'}}" range="{{postList}}">
 				<view class="picker">
 					{{postList[postindex].name}} <text class="wenzi">{{posttext}}</text>
 				</view>
+					<van-icon name="arrow-down" style="position:absolute;right:20rpx;top:10rpx;color:#bbbbbb" />
 			</picker>
 			<view class="flex-box">
 				<view class="shu"></view>
 				<view class="small-box">收入</view>
 			</view>
-			<picker bindchange="incomeListChange" name="income" value="{{incomeList[incomeindex].name}}" range-key="{{'name'}}" range="{{incomeList}}">
+			<picker style="position:relative" bindchange="incomeListChange" name="income" value="{{incomeList[incomeindex].name}}" range-key="{{'name'}}" range="{{incomeList}}">
 				<view class="picker">
 					{{incomeList[incomeindex].name}} <text class="wenzi">{{incometext}}</text>
 				</view>
+				<van-icon name="arrow-down" style="position:absolute;right:20rpx;top:10rpx;color:#bbbbbb" />
 			</picker>
 			<view class="flex-box">
 				<view class="shu"></view>
 				<view class="small-box">学历</view>
-
 			</view>
-
-			<picker bindchange="educationListChange" name="education" value="{{educationList[educationindex].name}}" range-key="{{'name'}}" range="{{educationList}}">
+			<picker style="position:relative" bindchange="educationListChange" name="education" value="{{educationList[educationindex].name}}" range-key="{{'name'}}" range="{{educationList}}">
 				<view class="picker">
 					{{educationList[educationindex].name}} <text class="wenzi">{{educationtext}}</text>
 				</view>
+				<van-icon name="arrow-down" style="position:absolute;right:20rpx;top:10rpx;color:#bbbbbb" />
 			</picker>
 			<view class="register">
 				<button formType="submit">提交完成</button>

+ 38 - 15
pages/finishInfo/finishInfo.wxss

@@ -1,9 +1,16 @@
-.title {
+.photo_box{
+  width: 625rpx;
+  height: 225rpx;
+  /* border: 1px solid red; */
+  margin-top: 30rpx;
+  margin-left: 30rpx;
+}
+/* .title {
   width: 90%;
   height: 55rpx;
   background: rgba(31, 135, 247, 0.2);
   border: 1px solid rgba(31, 135, 247, 1);
-  border-radius: 5px;
+  border-radius: 2px;
   margin: 0 auto;
   display: flex;
   align-items: center;
@@ -11,36 +18,32 @@
   color: rgba(31, 135, 247, 1);
   font-size: 28rpx;
   margin-top: 40rpx;
-}
-
-.saoma {
+} */
+/* .saoma {
   margin-left: 20rpx;
-}
-
+} */
 .box {
   width: 90%;
   margin: 0 auto;
   margin-top: 50rpx;
 }
-
 .flex-box {
   display: flex;
   margin-top: 40rpx;
   margin-bottom: 20rpx;
 }
-
 .small-box {
   width: 180rpx;
   margin-left: 20rpx;
+  font-weight: 600;
+  font-size: 28rpx;
 }
-
 input {
   border-radius: 5px;
   width: 100%;
   border-bottom: 1rpx solid #F2F2F2;
   padding-bottom: 10rpx;
 }
-
 button:not([size='mini']) {
   width: 100% !important;
   margin-left: auto;
@@ -49,17 +52,15 @@ button:not([size='mini']) {
   background: #1989FA;
   font-size: 28rpx;
   border-radius: 50rpx;
-
 }
-
 .register {
   margin-top: 100rpx;
 }
-
 .picker {
   border-bottom: 1rpx solid #F2F2F2;
   border-radius: 5px;
   width: 100%;
+  padding-bottom: 15rpx;
 }
 
 radio-group  label:last-child {
@@ -87,6 +88,28 @@ radio-group  label:last-child {
   height: 36rpx;
   width: 14rpx;
   background: #2087F7;
-  border-radius: 4px;
+  border-radius: 1px;
 
+}
+radio .wx-radio-input{ 
+  height: 30rpx; 
+  width: 30rpx;
+  border-radius: 50%;
+  background: transparent;
+}
+/* 选中后的 背景样式 */
+radio .wx-radio-input.wx-radio-input-checked{
+ border: none;
+}
+/* 选中后的 对勾样式 */
+radio .wx-radio-input.wx-radio-input-checked::before{
+ border-radius: 50%;
+ width: 36rpx; 
+ height: 36rpx;
+ line-height: 36rpx;
+ text-align: center;
+ font-size:36rpx; 
+ color:#fff;
+ background: #2087f7;
+ border: 6rpx solid #2087f7;
 }

+ 173 - 320
pages/index/index.js

@@ -1,19 +1,17 @@
 const app = require('../../utils/util.js');
 const tools = require('../../utils/tools.js');
+const request = require('../../utils/request.js');
 Page({
   data: {
     // 轮播
     backgrounds: [{
-        "pic": "/images/banner1.png",
-        // link:'../aboutme/index',
+        "pic": "/images/banner1.png"
       },
       {
-        "pic": "/images/banner2.png",
-        // link:'../aboutme/index',
+        "pic": "/images/banner2.png"
       },
       {
-        "pic": "/images/banner3.png",
-        // link:'../aboutme/index',
+        "pic": "/images/banner3.png"
       },
     ],
     indicatorDots: true,
@@ -29,7 +27,7 @@ Page({
       url: '/pages/userBook/userBook',
     })
   },
-  goXunfang() {
+  goChildren() {
     if (!wx.getStorageSync('openId')) {
       wx.login({
         success: res => {
@@ -42,9 +40,8 @@ Page({
               code: res.code
             },
             success: res => {
-              console.log("用户的openid:" + res.data.data.openid);
               wx.setStorageSync('openId', res.data.data.openid)
-              this.isBInd(res.data.data.openid);
+              this.isBInd();
             }
           });
         }
@@ -52,213 +49,156 @@ Page({
     } else {
       this.isBInd();
     }
-    console.log(wx.getStorageSync('openId'))
   },
-  // 判断是否绑定
+  // 判断子女是否绑定老人
   isBInd() {
     let id = wx.getStorageSync('openId');
-    wx.request({
-      url: app.globalData.publicUrl + '/wxinfo/visitIsExist',
-      method: "GET",
-      data: {
-        openId: id
-        // appletId: id
-      },
-      success: res => {
-        if (res.data.code == 1) {
-          console.log("用户没绑定", res);
-          wx.navigateTo({
-            url: '/pages/visitFind/visitFind',
-          })
-        } else if (res.data.code == 0) {
-          console.log("用户已经绑定了", res);
-          wx.navigateTo({
-            url: '/pages/bindOld/bindOld',
-          })
-        } else {
-          wx.showModal({
-            showCancel: false,
-            content: res.data.message,
-          })
-        }
+    request.request('/wxinfo/visitIsExist', {
+      openId: id
+    }, 'GET').then((res) => {
+      console.log(res)
+      if (res.data.code == 1) {
+        wx.navigateTo({
+          url: '/pages/visitFind/visitFind',
+        })
+      } else if (res.data.code == 0) {
+        wx.navigateTo({
+          url: '/pages/bindOld/bindOld',
+        })
+      } else {
+        wx.showModal({
+          showCancel: false,
+          content: res.data.message,
+        })
       }
-    });
+    })
   },
   goTongzhi() {
-    wx.login({
-      success: (res) => {
-        if (res.code) {
-          wx.request({
-            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
-            method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
-            },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: app.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        wx.navigateTo({
-                          url: '/pages/notice/notice',
-                        })
-                      }
-                    } else {
-                      wx.redirectTo({
-                        url: '/pages/login/login',
-                      })
-                    }
-                  }
-                })
-              }
-            }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+    tools.rzStatus().then((res) => {
+      if (res.data.code == 0) {
+        if (res.data.data) {
+          wx.navigateTo({
+            url: '/pages/notice/notice',
+          })
         }
+      } else {
+        wx.clearStorageSync();
+        wx.showModal({
+          showCancel: false,
+          content: '当前您未登录,请登录',
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/login/login',
+              })
+            }
+          }
+        })
       }
     })
-    // if (wx.getStorageSync('user') == '') {
-    //   wx.redirectTo({
-    //     url: '/pages/login/login',
-    //   })
-    // } else {
-    //   wx.navigateTo({
-    //     url: '/pages/notice/notice',
-    //   })
-    // }
   },
   goPaiming() {
-    wx.login({
-      success: (res) => {
-        if (res.code) {
-          wx.request({
-            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
-            method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
-            },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: app.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        wx.navigateTo({
-                          url: '/pages/paiming/paiming',
-                        })
-                      }
-                    } else {
-                      wx.redirectTo({
-                        url: '/pages/login/login',
-                      })
-                    }
-                  }
-                })
-              }
+    tools.rzStatus().then((res) => {
+      if (res.data.code == 0) {
+        if (res.data.data) {
+          tools.finishInfo().then((res) => {
+            console.log(res.data.data.perfect, '我完善信息了吗 1代表完后 0代表未完成')
+            console.log(res.data.data.comparison, '我人脸识别过了吗 1代表完后 0代表未完成')
+            if (res.data.data.perfect == '0') {
+              wx.redirectTo({
+                url: '/pages/finishInfo/finishInfo',
+              })
+              return;
             }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+            if (res.data.data.perfect == '1' && res.data.data.comparison == '0') {
+              wx.redirectTo({
+                url: '/pages/faceRecognition/faceRecognition',
+              })
+              return;
+            }
+            wx.navigateTo({
+              url: '/pages/paiming/paiming',
+            })
+          })
         }
+      } else {
+        wx.clearStorageSync();
+        wx.showModal({
+          showCancel: false,
+          content: '当前您未登录,请登录',
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/login/login',
+              })
+            }
+          }
+        })
       }
     })
   },
   goSaoMa() {
-    wx.login({
-      success: (res) => {
-        if (res.code) {
-          wx.request({
-            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
-            method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
-            },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: app.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        wx.scanCode({
-                          onlyFromCamera: true,
-                          success: (res) => {
-                            console.log(res, "扫码成功");
-                            let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
-                            wx.navigateTo({
-                              url: '/pages/love/love?id=' + length,
-                            })
-                          },
-                          fail: (res) => {
-                            console.log(res, "扫码失败");
-                            wx.showToast({
-                              title: '扫码失败',
-                              icon: 'none',
-                              duration: 2000,
-                            })
-                          }
-                        })
-                      }
-                    } else {
-                      wx.redirectTo({
-                        url: '/pages/login/login',
-                      })
-                    }
-                  }
+    tools.rzStatus().then((res) => {
+      if (res.data.code == 0) {
+        if (res.data.data) {
+          tools.finishInfo().then((res) => {
+            console.log(res.data.data.perfect, '我完善信息了吗 1代表完后 0代表未完成')
+            console.log(res.data.data.comparison, '我人脸识别过了吗 1代表完后 0代表未完成')
+            if (res.data.data.perfect == '0') {
+              wx.redirectTo({
+                url: '/pages/finishInfo/finishInfo',
+              })
+              return;
+            }
+            if (res.data.data.perfect == '1' && res.data.data.comparison == '0') {
+              wx.redirectTo({
+                url: '/pages/faceRecognition/faceRecognition',
+              })
+              return;
+            }
+            wx.scanCode({
+              onlyFromCamera: true,
+              success: (res) => {
+                let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
+                wx.navigateTo({
+                  url: '/pages/love/love?id=' + length,
+                })
+              },
+              fail: () => {
+                wx.showToast({
+                  title: '扫码失败',
+                  icon: 'none',
+                  duration: 2000,
                 })
               }
-            }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+            })
+          })
         }
+      } else {
+        wx.clearStorageSync();
+        wx.showModal({
+          showCancel: false,
+          content: '当前您未登录,请登录',
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/login/login',
+              })
+            }
+          }
+        })
       }
     })
   },
   depts() {
-    console.log("1111111111111111111111111111");
-    wx.request({
-      url: app.globalData.publicUrl + '/applet/homeStatistics',
-      method: "GET",
-      data: {
-        appletsId: wx.getStorageSync('openId')
-      },
-      success: (res) => {
-        console.log("resrrrrrrrrrrrrrrrrrrrrrrr", res);
-
-        if (res.data.code == 0) {
-          this.setData({
-            number: res.data.data
-          })
-        }
+    request.request('/applet/homeStatistics', {
+      appletsId: wx.getStorageSync('openId')
+    }, 'GET').then((res) => {
+      console.log(res)
+      if (res.data.code == 0) {
+        this.setData({
+          number: res.data.data
+        })
       }
     })
   },
@@ -266,140 +206,53 @@ Page({
     this.setData({
       msgList: []
     })
-    wx.login({
-      success: (res) => {
-        if (res.code) {
-          wx.request({
-            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
-            method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
-            },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: app.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        wx.request({
-                          url: app.globalData.publicUrl + '/appletNotice/listForAppletsFirst',
-                          method: "GET",
-                          header: {
-                            appletsId: wx.getStorageSync('openId')
-                          },
-                          success: (res) => {
-                            if (res.data.code == 0) {
-                              if (res.data.data.length == 0) {
-                                this.data.msgList.push({
-                                  title: '暂无通知'
-                                });
-                                this.setData({
-                                  msgList: this.data.msgList
-                                })
-                              } else {
-                                let result = res.data.data.title;
-                                this.data.msgList.push({
-                                  title: result
-                                });
-                                this.setData({
-                                  msgList: this.data.msgList
-                                })
-                              }
-                            }
-                          }
-                        })
-                      }
-                    } else {
-                      wx.request({
-                        url: app.globalData.publicUrl + '/welcomeMessage/list',
-                        method: "GET",
-                        success: (res) => {
-                          if (res.data.code == 0) {
-                            if (res.data.data.length != 0) {
-                              let result = res.data.data[0].title
-                              this.data.msgList.push({
-                                title: result
-                              });
-                              this.data.msgList.push({
-                                title: result
-                              });
-                              this.setData({
-                                msgList: this.data.msgList
-                              })
-                            }
-                          }
-                        }
-                      })
-                    }
-                  }
+    tools.rzStatus().then((res) => {
+      console.log(res)
+      if (res.data.code == 0) {
+        if (res.data.data) {
+          request.request('/appletNotice/listForAppletsFirst', {
+            appletsId: wx.getStorageSync('openId')
+          }, 'GET').then((res) => {
+            console.log(res)
+            if (res.data.code == 0) {
+              if (res.data.data.length == 0) {
+                this.data.msgList.push({
+                  title: '暂无通知'
+                });
+                this.setData({
+                  msgList: this.data.msgList
+                })
+              } else {
+                let result = res.data.data.title;
+                this.data.msgList.push({
+                  title: result
+                });
+                this.setData({
+                  msgList: this.data.msgList
                 })
               }
             }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+          })
         }
+      } else {
+        request.request('/welcomeMessage/list', {}, 'GET').then((res) => {
+          if (res.data.code == 0) {
+            if (res.data.data.length != 0) {
+              let result = res.data.data[0].title
+              this.data.msgList.push({
+                title: result
+              });
+              this.data.msgList.push({
+                title: result
+              });
+              this.setData({
+                msgList: this.data.msgList
+              })
+            }
+          }
+        })
       }
     })
-    // if (wx.getStorageSync('user') == '') {
-    //   wx.request({
-    //     url: app.globalData.publicUrl + '/welcomeMessage/list',
-    //     method: "GET",
-    //     success: (res) => {
-    //       if (res.data.code == 0) {
-    //         if (res.data.data.length != 0) {
-    //           let result = res.data.data[0].title
-    //           this.data.msgList.push({
-    //             title: result
-    //           });
-    //           this.data.msgList.push({
-    //             title: result
-    //           });
-    //           this.setData({
-    //             msgList: this.data.msgList
-    //           })
-    //         }
-    //       }
-    //     }
-    //   })
-    // } else {
-    //   wx.request({
-    //     url: app.globalData.publicUrl + '/appletNotice/listForAppletsFirst',
-    //     method: "GET",
-    //     header: {
-    //       appletsId: wx.getStorageSync('openId')
-    //     },
-    //     success: (res) => {
-    //       if (res.data.code == 0) {
-    //         if (res.data.data.length == 0) {
-    //           this.data.msgList.push({
-    //             title: '暂无通知'
-    //           });
-    //           this.setData({
-    //             msgList: this.data.msgList
-    //           })
-    //         } else {
-    //           let result = res.data.data.title;
-    //           this.data.msgList.push({
-    //             title: result
-    //           });
-    //           this.setData({
-    //             msgList: this.data.msgList
-    //           })
-    //         }
-    //       }
-    //     }
-    //   })
-    // }
   },
   onShow() {
     this.depts();

+ 1 - 3
pages/index/index.wxml

@@ -51,11 +51,9 @@
 				<view class="top4-smalltitle">使用教程</view>
 			</view>
 		</view>
-		<view class="top4-box" bindtap="goXunfang">
+		<view class="top4-box" bindtap="goChildren">
 			<image src="/images/indexicon5.png" style="width: 120rpx;height: 120rpx;margin-top: 10rpx;"></image>
 			<view class="top4-box1">
-				<!-- <view class="top4-title">巡访信息</view>
-				<view class="top4-smalltitle">巡访信息</view> -->
 				<view class="top4-title">子女查询</view>
 				<view class="top4-smalltitle">一键绑定</view>
 			</view>

+ 47 - 7
pages/login/login.js

@@ -1,11 +1,26 @@
 const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
 var util = require('../../utils/md5.js')
 import Notify from '../../miniprogram_npm/vant-weapp/notify/notify';
 //import Dialog from '../../miniprogram_npm/vant-weapp/dialog/dialog';
 Page({
   data: {
     defaultType1: true,
-    passwordType1: true
+    passwordType1: true,
+    xyAgree: false
+  },
+  change(e) {
+    console.log(e)
+    if (e.detail.value.length != 0) {
+      this.setData({
+        xyAgree: true
+      })
+    } else {
+      this.setData({
+        xyAgree: false
+      })
+    }
+    console.log(this.data.xyAgree)
   },
   eyeStatus1() {
     if (this.data.defaultType1) {
@@ -25,6 +40,14 @@ Page({
     var password = e.detail.value.pwd;
     if (e.detail.value.name) {
       if (e.detail.value.pwd) {
+        if (!this.data.xyAgree) {
+          wx.showToast({
+            title: '仔细阅读协议并勾选',
+            icon: 'none',
+            duration: 3000,
+          })
+          return
+        }
         wx.showLoading({
           title: '加载中',
         })
@@ -43,9 +66,21 @@ Page({
                 type: 'success',
                 message: '登录成功'
               });
+              // wx.clearStorageSync();
               wx.setStorageSync('user', 'user');
-              wx.switchTab({
-                url: '/pages/index/index',
+              tools.finishInfo().then((res) => {
+                console.log(res.data.data.perfect, '我完善信息了吗 1代表完后 0代表未完成')
+                console.log(res.data.data.comparison, '我人脸识别过了吗 1代表完后 0代表未完成')
+                if (res.data.data.perfect == '0') {
+                  wx.redirectTo({
+                    url: '/pages/finishInfo/finishInfo',
+                  })
+                }
+                if (res.data.data.perfect == '1' && res.data.data.comparison == '0') {
+                  wx.redirectTo({
+                    url: '/pages/faceRecognition/faceRecognition',
+                  })
+                }
               })
             } else {
               Notify({
@@ -54,7 +89,7 @@ Page({
               });
             }
           },
-          complete:(res) => {
+          complete: (res) => {
             wx.hideLoading()
           }
         })
@@ -73,12 +108,17 @@ Page({
       })
     }
   },
+  goXy() {
+    wx.navigateTo({
+      url: '/pages/xy/xy',
+    })
+  },
   goHome() {
     wx.switchTab({
       url: '/pages/index/index',
     })
   },
-  onShow(){
+  onShow() {
     wx.login({
       success: res => {
         // 获取到用户的 code 之后:res.code
@@ -91,8 +131,8 @@ Page({
           url: app.globalData.publicUrl + '/wx/getAppletOpenId',
           method: "GET",
           data: {
-            cid :'applet',
-            code :res.code
+            cid: 'applet',
+            code: res.code
           },
           success: res => {
             // 获取到用户的 openid

+ 9 - 1
pages/login/login.wxml

@@ -14,11 +14,19 @@
 				<input name='pwd' class="weui-input" password='{{passwordType1}}' placeholder="请输入密码" />
 				<image src='{{defaultType1? "/images/eye_close.png": "/images/eye_open.png"}}' class='eye-image' bindtap='eyeStatus1'></image>
 			</view>
+			<view style="display:flex;">
+				<checkbox-group bindchange="change">
+					<label class="checkbox">
+						<checkbox value="cb" />
+					</label>
+				</checkbox-group>
+				<view style="font-size:26rpx;margin-top:15rpx">已阅读并同意<text style="color:#1989FA"  bindtap="goXy">《用户服务及授权协议》</text></view>
+			</view>
 			<view class="register">
 				<button formType="submit">登录并绑定微信号</button>
 			</view>
 			<view class="register" style=" margin-top: 20rpx;">
-				<button bindtap="goHome" >返回首页</button>
+				<button bindtap="goHome">返回首页</button>
 			</view>
 		</view>
 	</form>

+ 11 - 0
pages/login/login.wxss

@@ -40,4 +40,15 @@ button:not([size='mini']) {
   color: white;
   background: #1989FA;
   font-size: 28rpx;
+}
+.checkbox checkbox{
+  margin-top:10rpx
+}
+.checkbox checkbox .wx-checkbox-input {
+  width: 30rpx;
+  height: 30rpx;
+}
+.checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked {
+  background-color: #2087f7;
+  color: #fff;
 }

+ 32 - 14
pages/love/love.js

@@ -62,27 +62,45 @@ Page({
           },
           header: {
             appletsId: wx.getStorageSync('openId'),
-
           },
           success: (res) => {
             console.log(JSON.parse(res.data), "45454545");
             let datas = JSON.parse(res.data)
-            if (datas.code == 0) {
-              if (this.data.imgPath.length < 3) {
-                this.data.imgPath.push(datas.data)
-                this.setData({
-                  imgPath: this.data.imgPath
-                })
-                console.log(this.data.imgPath, "打印下招聘的路径锕");
-
-                this.data.visitPhoto = this.data.imgPath.join(',')
-                if (this.data.imgPath.length == 2) {
-                  this.setData({
-                    isTrue: false
+            wx.request({
+              url: app.globalData.publicUrl + '/user/getPeople',
+              method: "POST",
+              header: {
+                appletsId: wx.getStorageSync('openId')
+              },
+              data: {
+                photoPath: datas.data
+              },
+              success: (res) => {
+                console.log(res, '有没有face')
+                if (res.data.code == 0) {
+                  if (datas.code == 0) {
+                    if (this.data.imgPath.length < 3) {
+                      this.data.imgPath.push(datas.data)
+                      this.setData({
+                        imgPath: this.data.imgPath
+                      })
+                      this.data.visitPhoto = this.data.imgPath.join(',')
+                      if (this.data.imgPath.length == 2) {
+                        this.setData({
+                          isTrue: false
+                        })
+                      }
+                    }
+                  }
+                } else {
+                  wx.showToast({
+                    title: '人脸识别不通过,请重新上传',
+                    icon: 'none',
+                    duration: 3000,
                   })
                 }
               }
-            }
+            })
           }
         })
       }

+ 1 - 1
pages/paiming/paiming.wxml

@@ -12,7 +12,7 @@
 			</view>
 			<view class="wenzi">累计积分</view>
 			<view class="btn">当前全省排第<text class="shuzi">{{list.order}}</text>名</view>
-			<view class="btn1">积分兑换</view>
+			<!-- <view class="btn1">积分兑换</view> -->
 		</view>
 		<view class="white-box">
 			<van-tabs active="{{ active }}" bind:change="onChange" color="#2087F7">

+ 47 - 82
pages/personInfo/personInfo.js

@@ -1,8 +1,8 @@
 const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
 Page({
   data: {
-    info: {},
-    isTure: false,
+    info: {}
   },
   wanshan() {
     wx.navigateTo({
@@ -10,15 +10,18 @@ Page({
     })
   },
   shenfen() {
-    if (this.data.info.headPicPath) {
-      wx.navigateTo({
-        url: '/pages/idCardDetail/idCardDetail',
-      })
-    } else {
-      wx.navigateTo({
-        url: '/pages/idCard/idCard',
-      })
-    }
+    wx.navigateTo({
+      url: '/pages/idCardDetail/idCardDetail',
+    })
+    // if (this.data.info.headPicPath) {
+    //   wx.navigateTo({
+    //     url: '/pages/idCardDetail/idCardDetail',
+    //   })
+    // } else {
+    //   wx.navigateTo({
+    //     url: '/pages/idCard/idCard',
+    //   })
+    // }
   },
   xiugai() {
     wx.navigateTo({
@@ -46,9 +49,6 @@ Page({
             mask: true,
             title: '退出中',
           })
-          this.setData({
-            isTure: false
-          })
           wx.request({
             url: app.globalData.publicUrl + '/applet/unbind',
             method: "GET",
@@ -79,86 +79,51 @@ Page({
     })
 
   },
-  oftenAnswer(){
+  oftenAnswer() {
     wx.navigateTo({
       url: '/pages/question/question',
     })
   },
   onShow() {
-    wx.login({
-      success: (res) => {
-        if (res.code) {
+    tools.rzStatus().then((res) => {
+      if (res.data.code == 0) {
+        if (res.data.data) {
           wx.request({
-            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
+            url: app.globalData.publicUrl + '/applet/findUserInfo',
             method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
+            header: {
+              appletsId: wx.getStorageSync('openId')
             },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: app.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        // wx.setStorageSync('user', 'user');
-                        this.setData({
-                          isTure: true,
-                        })
-                        wx.request({
-                          url: app.globalData.publicUrl + '/applet/findUserInfo',
-                          method: "GET",
-                          header: {
-                            appletsId: wx.getStorageSync('openId')
-                          },
-                          success: (res) => {
-                            console.log(res, "000");
-                            this.setData({
-                              info: res.data.data
-                            })
-                          }
-                        })
-                      }
-                    } else {
-                      wx.clearStorageSync();
-                      wx.showModal({
-                        showCancel: false,
-                        content: '当前您未登录,请登录',
-                        success(res) {
-                          if (res.confirm) {
-                            wx.redirectTo({
-                              url: '/pages/login/login',
-                            })
-                          } else if (res.cancel) {
-                            console.log('用户点击取消')
-                          }
-                        }
-                      })
-                      this.setData({
-                        isTure: false,
-                      })
-                    }
-                  }
-                })
-              }
+            success: (res) => {
+              this.setData({
+                info: res.data.data
+              })
             }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+          })
+          tools.finishInfo().then((res) => {
+            console.log(res.data.data.perfect, '我完善信息了吗 1代表完后 0代表未完成')
+            console.log(res.data.data.comparison, '我人脸识别过了吗 1代表完后 0代表未完成')
+            this.setData({
+              perfect: res.data.data.perfect,
+              comparison: res.data.data.comparison
+            })
+          })
         }
+      } else {
+        wx.clearStorageSync();
+        wx.showModal({
+          showCancel: false,
+          content: '当前您未登录,请登录',
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/login/login',
+              })
+            }
+          }
+        })
       }
     })
-  },
-  onLoad() {
-
   },
   onHide() {
     this.setData({

+ 4 - 4
pages/personInfo/personInfo.wxml

@@ -1,4 +1,3 @@
-<!--  wx:if='{{isTure}}' -->
 <view>
 	<image src="/images/mybj.png" style="width: 100%; height: 350rpx;"></image>
 	<view class="personxx">
@@ -13,14 +12,15 @@
 			账号:{{info.loginName}}
 		</view>
 	</view>
-	<view class="title" bindtap="wanshan">
+	<!-- wx:if="{{perfect=='0'}}" -->
+	<view class="title" bindtap="wanshan" wx:if="{{perfect=='0'}}">
 		<view class="small-title">
 			<image src="/images/person1.png" style="width: 60rpx; height: 60rpx;"></image>
 			<view class="small-zi">完善资料</view>
 		</view>
 		<view class="jiantou">></view>
 	</view>
-	<view class="title" bindtap="shenfen">
+	<view class="title" bindtap="shenfen" wx:if="{{perfect=='1'}}">
 		<view class="small-title">
 			<image src="/images/person2.png" style="width: 60rpx; height: 60rpx;"></image>
 			<view class="small-zi">身份卡</view>
@@ -41,7 +41,7 @@
 		</view>
 		<view class="jiantou">></view>
 	</view>
-		<view class="title" bindtap="oftenAnswer">
+	<view class="title" bindtap="oftenAnswer">
 		<view class="small-title">
 			<image src="/images/question.png" style="width: 60rpx; height: 60rpx;"></image>
 			<view class="small-zi">常见问题</view>

+ 2 - 1
pages/question/question.wxml

@@ -27,7 +27,8 @@
 			请保持网络状态良好,此次更新增加人脸识别功能,请上传老人清晰面部照片。
 		</van-collapse-item>
 			<van-collapse-item title="其他问题?" name="7">
-			请联系工作人员详细说明 电话:17004319000
+			<view>其他问题可能由于微信版本较旧,请更新微信最新版本。</view>
+			<view>或者联系工作人员详细说明 电话:17004319000</view>
 		</van-collapse-item>
 	</van-collapse>
 </view>

+ 0 - 12
pages/visit/visit.js

@@ -1,12 +0,0 @@
-const app = require('../../utils/util.js');
-var util = require('../../utils/md5.js')
-Page({
-  data: {
-   
-  },
- 
-  onLoad: function () {
-   
- 
-  },
-})

+ 0 - 4
pages/visit/visit.json

@@ -1,4 +0,0 @@
-{
-  "navigationBarTitleText":"巡访",
-  "usingComponents": {}
-}

+ 0 - 0
pages/visit/visit.wxml


+ 0 - 0
pages/visit/visit.wxss


+ 1 - 1
pages/visitFind/visitFind.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText":"巡访查询"
+  "navigationBarTitleText":"子女查询"
 }

+ 83 - 96
pages/visitandinfo/visitandinfo.js

@@ -1,4 +1,5 @@
 const app = require('../../utils/util.js');
+const tools = require('../../utils/tools.js');
 Page({
   data: {
     logs: [],
@@ -265,7 +266,7 @@ Page({
   },
   computeScrollViewHeight() {
     this.setData({
-      scrollHeight: wx.getSystemInfoSync().windowHeight * 2 - 103 - wx.getSystemInfoSync().screenHeight + wx.getSystemInfoSync().statusBarHeight
+      scrollHeight: wx.getSystemInfoSync().windowHeight * 2 - 115 - wx.getSystemInfoSync().screenHeight + wx.getSystemInfoSync().statusBarHeight
     })
   },
   computeScrollViewHeight1() {
@@ -274,103 +275,89 @@ Page({
     })
   },
   onShow() {
-    wx.login({
-      success: (res) => {
-        if (res.code) {
-          wx.request({
-            url: app.globalData.publicUrl + '/wx/getAppletOpenId',
-            method: "GET",
-            data: {
-              cid: 'applet',
-              code: res.code
-            },
-            success: res => {
-              // 获取到用户的 openid
-              if (res.data.status == 200) {
-                wx.setStorageSync('openId', res.data.data.openid)
-                wx.request({
-                  url: app.globalData.publicUrl + '/applet/isExist',
-                  method: "GET",
-                  data: {
-                    appletsId: wx.getStorageSync('openId')
-                  },
-                  success: (res) => {
-                    console.log('app登录是否绑定的', res.data.code);
-                    if (res.data.code == 0) {
-                      if (res.data.data) {
-                        this.setData({
-                          isAllTrue: false,
-                          select_all: false,
-                          isTrue: true,
-                        })
-                        if (this.data.isTrue) {
-                          this.computeScrollViewHeight();
-                          this.computeScrollViewHeight1();
-                        }
-                        this.oldInfo();
-                        this.visitInfo();
-                        switch (this.data.number) {
-                          case 0:
-                            this.openIdInfo();
-                            break;
-                          case 1:
-                            this.openIdInfo({
-                              status: "1"
-                            });
-                            break;
-                          case 2:
-                            this.openIdInfo({
-                              status: "0"
-                            });
-                            break;
-                          case 3:
-                            this.openIdInfo({
-                              status: "2"
-                            });
-                            break;
-                          case 4:
-                            this.openIdInfo({
-                              status: "3"
-                            });
-                            break;
-                          case 5:
-                            this.openIdInfo({
-                              status: "4"
-                            });
-                            break;
-                          default:
-                            this.openIdInfo();
-                            break;
-                        }
-                        this.visitInfo();
-                      }
-                    } else {
-                      wx.clearStorageSync();
-                      wx.showModal({
-                        showCancel: false,
-                        content: '当前您未登录,请登录',
-                        success(res) {
-                          if (res.confirm) {
-                            wx.redirectTo({
-                              url: '/pages/login/login',
-                            })
-                          } else if (res.cancel) {
-                            console.log('用户点击取消')
-                          }
-                        }
-                      })
-                      this.setData({
-                        isTure: false,
-                      })
-                    }
-                  }
-                })
-              }
+    wx.showLoading({
+      title: '加载中',
+    })
+    tools.rzStatus().then((res) => {
+      if (res.data.code == 0) {
+        if (res.data.data) {
+          tools.finishInfo().then((res) => {
+            console.log(res.data.data.perfect, '我完善信息了吗 1代表完后 0代表未完成')
+            console.log(res.data.data.comparison, '我人脸识别过了吗 1代表完后 0代表未完成')
+            if (res.data.data.perfect == '0') {
+              wx.redirectTo({
+                url: '/pages/finishInfo/finishInfo',
+              })
+              return;
             }
-          });
-        } else {
-          console.log('获取用户登录态失败!' + res.errMsg);
+            if (res.data.data.perfect == '1' && res.data.data.comparison == '0') {
+              wx.redirectTo({
+                url: '/pages/faceRecognition/faceRecognition',
+              })
+              return;
+            }
+            this.setData({
+              isAllTrue: false,
+              select_all: false,
+              isTrue: true,
+            })
+            if (this.data.isTrue) {
+              this.computeScrollViewHeight();
+              this.computeScrollViewHeight1();
+            }
+            this.oldInfo();
+            this.visitInfo();
+            switch (this.data.number) {
+              case 0:
+                this.openIdInfo();
+                break;
+              case 1:
+                this.openIdInfo({
+                  status: "1"
+                });
+                break;
+              case 2:
+                this.openIdInfo({
+                  status: "0"
+                });
+                break;
+              case 3:
+                this.openIdInfo({
+                  status: "2"
+                });
+                break;
+              case 4:
+                this.openIdInfo({
+                  status: "3"
+                });
+                break;
+              case 5:
+                this.openIdInfo({
+                  status: "4"
+                });
+                break;
+              default:
+                this.openIdInfo();
+                break;
+            }
+            this.visitInfo();
+            wx.hideLoading()
+          })
         }
+      } else {
+        wx.hideLoading()
+        wx.clearStorageSync();
+        wx.showModal({
+          showCancel: false,
+          content: '当前您未登录,请登录',
+          success(res) {
+            if (res.confirm) {
+              wx.redirectTo({
+                url: '/pages/login/login',
+              })
+            }
+          }
+        })
       }
     })
   },

+ 1 - 1
pages/visitandinfo/visitandinfo.wxml

@@ -18,7 +18,7 @@
 		</view>
 		<scroll-view enable-back-to-top='true' id="scroll" scroll-y="true" style='height: {{scrollHeight + "px"}};width:700rpx;margin-left:25rpx;font-size:28rpx'>
 			<checkbox-group bindchange="checkboxChange">
-				<view wx:for="{{listData}}" class="checkbox_border">
+				<view wx:for="{{listData}}"  wx:key="idNumber" class="checkbox_border">
 					<view style="width:670rpx;margin-left:15rpx;height:60rpx;margin-top:20rpx;border-bottom:1px solid #f4f4f4">
 						<checkbox style="float:left;margin-left:20rpx" disabled="{{item.status == '3'}}" value="{{item._id}}" checked="{{item.checked}}" />
 						<view style="width:580rpx;height:60rpx;float:right" value="{{item.text}}" bindtap="cellClick" data-infos='{{item}}'>

+ 66 - 0
pages/xy/xy.js

@@ -0,0 +1,66 @@
+// pages/xy/xy.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/xy/xy.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "用户协议"}

+ 18 - 0
pages/xy/xy.wxml

@@ -0,0 +1,18 @@
+<image src='../../images/xy_top.png' style='width:550rpx;height:380rpx;margin-left:100rpx'></image>
+<view style="width:650rpx;margin-left:50rpx;font-size:26rpx">
+	<view style="font-weight:600;font-size:28rpx;margin-bottom:20rpx">1.用户使用须知</view>
+	<view>居家老年人巡访关爱信息平台有权根据互联网的发展和中华人民共和国有关法律、法规的变化,不断完善和修改本服务条款。保留随时修改本服务条款或中断网络服务而不需事先通知用户的权利。</view>
+	<view style="font-weight:600;font-size:28rpx;margin-bottom:20rpx;margin-top:20rpx">2.用户同意</view>
+	<view>(1) 在登录平台,按照系统提示提供详尽、准确的个人资料信息;</view>
+	<view>(2) 所有用户提供的个人信息将视为准确地表示了用户的身份;</view>
+	<view>(3)用户对本人的个人资料如有更正、替换等需求时,请联系上级村/社区管理员进行修改;</view>
+	<view>(4)确保手机登录信息与认证身份信息相符,否则造成一定后果,此账号认证巡访员自行承担。</view>
+	<view style="font-weight:600;font-size:28rpx;margin-bottom:20rpx;margin-top:20rpx">3.用户隐私</view>
+	<view>尊重用户个人隐私。未经用户授权,不得公开、编辑或透露其个人资料,除非基于下述原因:</view>
+	<view>(1) 根据中华人民共和国法律或行政法规、规章的要求;</view>
+	<view>(2) 根据中华人民共和国国家安全机构、公安部门及其他权力机构的要求,或根据相应的法律程序的要求;</view>
+	<view>(3) 在紧急情况下竭力维护用户个人、其它社会个体和公众的安全;</view>
+	<view>(4) 符合其他相关政府法规的要求。</view>
+	<view style="font-weight:600;font-size:28rpx;margin-bottom:20rpx;margin-top:20rpx">4.法律适用</view>
+	<view style="margin-bottom:100rpx">用户和居家老年人巡访关爱信息系统一致同意本服务条款受中华人民共和国法律的管辖,并服从中华人民共和国有关级别和地域管辖的规定。如本服务条款与中华人民共和国法律相抵触,则以法律规定为准,其它条款的合法性、有效性及对用户的约束力不受影响。</view>
+</view>

+ 1 - 0
pages/xy/xy.wxss

@@ -0,0 +1 @@
+/* pages/xy/xy.wxss */

+ 2 - 2
utils/photoUrl.wxs

@@ -1,6 +1,6 @@
 var url = function (val) {
-   return  'https://info.windd.cn/collection' + val
-  //  return  'https://info.windd.cn/test' + val
+  //  return  'https://info.windd.cn/collection' + val
+   return  'https://info.windd.cn/test' + val
   // return 'http://10.16.4.7:7001' + val
 }
 module.exports = {

+ 27 - 30
utils/request.js

@@ -1,31 +1,28 @@
-// const imageUrl = 'https://jlxwjr.jljrkg.com';
-// const baseUrl = 'https://ccss.windd.cn';
-module.exports = {
-    imageUrl,
-    query({url, data, method = 'GET'}) {
-        return new Promise((resolve, reject) => {
-            wx.request({
-                url: `${baseUrl}/${url}`,
-                data: data,
-                method: method,
-                timeout: 5000,
-                header: {'content-type': 'application/json'},
-                dataType: 'json',
-                success: resolve,
-                fail: reject,
-            });
-        });
-    },
-    fetch({url, id}) {
-        return new Promise((resolve, reject) => {
-            wx.request({
-                url: `${baseUrl}/${url}/${id}`,
-                method: 'GET',
-                header: {'content-type': 'application/json'},
-                dataType: 'json',
-                success: resolve,
-                fail: reject,
-            });
+const app = require('../utils/util.js');
+const request = (url, data = {}, type = 'GET') => {
+  return new Promise((resolve, reject) => {
+    wx.request({
+      url: `${app.globalData.publicUrl}${url}`,
+      method: type,
+      data,
+      success({
+        data
+      }) {
+        resolve({
+          status: 0,
+          data,
+          msg: 'request请求成功获取到数据'
         });
-    },
-}
+      },
+      fail() {
+        reject({
+          status: 1,
+          msg: 'request请求失败'
+        })
+      }
+    });
+  });
+};
+module.exports = {
+  request
+}

+ 56 - 21
utils/tools.js

@@ -1,28 +1,63 @@
-const app = require('../utils/util.js');
-const request = (url, data = {}, type = 'GET') => {
+const util = require('../utils/util.js');
+// 登录状态
+const rzStatus = () => {
+  return new Promise((resolve, reject) => {
+    wx.login({
+      success: (res) => {
+        if (res.code) {
+          wx.request({
+            url: util.globalData.publicUrl + '/wx/getAppletOpenId',
+            method: "GET",
+            data: {
+              cid: 'applet',
+              code: res.code
+            },
+            success: res => {
+              if (res.data.status == 200) {
+                wx.setStorageSync('openId', res.data.data.openid)
+                wx.request({
+                  url: util.globalData.publicUrl + '/applet/isExist',
+                  method: "GET",
+                  data: {
+                    appletsId: wx.getStorageSync('openId')
+                  },
+                  success: (res) => {
+                    console.log('是否绑定', res.data.code);
+                    resolve(res);
+                  },
+                  fail: (res) => {
+                    reject(res)
+                  }
+                })
+              }
+            }
+          });
+        } else {
+          console.log('获取用户登录态失败!' + res.errMsg);
+        }
+      }
+    })
+  })
+};
+const finishInfo = () => {
   return new Promise((resolve, reject) => {
     wx.request({
-      url: `${app.globalData.publicUrl}${url}`,
-      method: type,
-      data,
-      success({
-        data
-      }) {
-        resolve({
-          status: 0,
-          data,
-          msg: 'request请求成功获取到数据'
-        });
+      url: util.globalData.publicUrl + '/user/isPerfect',
+      method: "GET",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      success: (res) => {
+        console.log(res.data)
+        resolve(res)
       },
-      fail(error) {
-        reject({
-          status: 1,
-          msg: 'request请求失败'
-        })
+      fail: (re) => {
+        reject(re)
       }
-    });
-  });
+    })
+  })
 };
 module.exports = {
-  request
+  rzStatus,
+  finishInfo
 }

+ 2 - 2
utils/util.js

@@ -1,6 +1,6 @@
 const globalData = {
-   publicUrl: 'https://info.windd.cn/collection',//正式
-  // publicUrl: 'https://info.windd.cn/test',//测试
+  //  publicUrl: 'https://info.windd.cn/collection',//正式
+  publicUrl: 'https://info.windd.cn/test',//测试
   // publicUrl:'http://10.16.4.7:7001'//立秋
 };
 module.exports = {