ssfg 4 years ago
parent
commit
c90c57a0d7

+ 19 - 28
pages/collectInfo/collectInfo.js

@@ -2125,7 +2125,6 @@ Page({
   },
   goPhoto() {
     console.log('我走')
-    let that = this;
     isTwoOnshow = true;
     wx.setStorageSync('isTwoOnshow', true)
     wx.showLoading({
@@ -2135,7 +2134,7 @@ Page({
       count: 1,
       sizeType: ['compressed'],
       sourceType: ['camera'],
-      success: function (res) {
+      success:  (res) =>{
         const app = getApp()
         app.globalData.id = '-1'
         let tempFilePaths = res.tempFilePaths
@@ -2149,19 +2148,18 @@ Page({
           header: {
             appletsId: wx.getStorageSync('openId'),
           },
-          success: function (res) {
+          success:  (res)=> {
             const app = getApp()
             app.globalData.id = '-2'
             let datas = JSON.parse(res.data)
-            let imgPath = 'oldInfo[' + that.data.activeIndex + '].imgPath'
-            let isHavePhoto = 'oldInfo[' + that.data.activeIndex + '].isHavePhoto'
-            that.setData({
+            let imgPath = 'oldInfo[' + this.data.activeIndex + '].imgPath'
+            let isHavePhoto = 'oldInfo[' + this.data.activeIndex + '].isHavePhoto'
+            this.setData({
               [imgPath]: datas.data,
               [isHavePhoto]: true,
             })
-            // that.getSelfLocation();
-            that.SubmitOldmanInfo({
-              id: that.data.nameArr[that.data.activeIndex]._id,
+            this.SubmitOldmanInfo({
+              id: this.data.nameArr[this.data.activeIndex]._id,
               photo: datas.data,
             })
           }
@@ -3152,7 +3150,6 @@ Page({
         familyFid: id,
         color: 'transparent',
       })
-      var that = this;
       wx.request({
         url: util.globalData.publicUrl + '/wxinfo/listByFid',
         method: "GET",
@@ -3165,7 +3162,7 @@ Page({
         success: (res) => {
           wx.hideLoading()
           console.log(res.data.data, "单查赋值锕")
-          that.setData({
+          this.setData({
             oldInfo: res.data.data
           })
           let datass = res.data.data;
@@ -3177,10 +3174,10 @@ Page({
           });
           datass.splice(fristIndex, 1);
           datass.unshift(fristArray[0]);
-          that.setData({
+          this.setData({
             nameArr: datass
           })
-          console.log(that.data.regularsInfo, "赋值是么");
+          console.log(this.data.regularsInfo, "赋值是么");
           let oldSex = [{
               name: '男',
               checked: false
@@ -3831,18 +3828,13 @@ Page({
               }
             }
           })
-          that.setData({
+          this.setData({
             oldInfo: abc,
             otherInfo: def,
             childInfo: ghi,
             regularsInfos: zzz,
             regularsInfo: mmm,
           })
-          console.log(that.data.oldInfo, "老人的返现数组")
-          console.log(that.data.otherInfo, "其他的返现数组")
-          console.log(that.data.childInfo, "孩子的返现数组")
-          console.log(that.data.regularsInfos, "q巡访的返现数组")
-          console.log(that.data.regularsInfo, "巡访传值的返回")
         }
       })
     }
@@ -3920,11 +3912,10 @@ Page({
     var qqmapsdk = new QQMapWX({
       key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
     });
-    var that = this; //用户授权过可以直接获取位置
     wx.getLocation({
       //type: 'wgs84',
       type: 'gcj02',
-      success: function (res) {
+      success:  (res) =>{
         console.log(res, "00我调用位置接口成功了");
         // 返回当前定位的经纬度
         var latitude = parseFloat(res.latitude).toFixed(5);
@@ -3934,18 +3925,18 @@ Page({
             latitude: res.latitude,
             longitude: res.longitude
           },
-          success: function (res) {
-            let photoAndLocation = 'oldInfo[' + that.data.activeIndex + '].photoAndLocation'
+          success:  (res)=> {
+            let photoAndLocation = 'oldInfo[' + this.data.activeIndex + '].photoAndLocation'
             let gps = longitude + '/' + latitude + '/' + res.result.address
-            that.setData({
+            this.setData({
               [photoAndLocation]: gps
             })
-            console.log(that.data.nameArr[that.data.activeIndex], "定位的问题");
-            that.SubmitOldmanInfo({
-              id: that.data.nameArr[that.data.activeIndex]._id,
+            console.log(this.data.nameArr[this.data.activeIndex], "定位的问题");
+            this.SubmitOldmanInfo({
+              id: this.data.nameArr[this.data.activeIndex]._id,
               photoAndLocation: gps
             })
-            that.goPhoto();
+            this.goPhoto();
           },
           fail: function (res) {
             console.log('获取当前地址失败');

+ 4 - 5
pages/idCard/idCard.js

@@ -25,19 +25,18 @@ Page({
       })
     } else {
       wx.showToast({
-        title: "请上传照片",
+        title: "请点击相机上传照片",
         icon: 'none',
         duration: 2000,
       })
     }
   },
   goPhoto() {
-    var that = this;
     wx.chooseImage({
       count: 1,
       sizeType: ['compressed'],
       sourceType: ['camera'],
-      success: function (res) {
+      success: (res) => {
         var tempFilePaths = res.tempFilePaths
         wx.uploadFile({
           url: app.globalData.publicUrl + '/sys/user/upload',
@@ -49,11 +48,11 @@ Page({
           header: {
             appletsId: wx.getStorageSync('openId'),
           },
-          success: function (res) {
+          success: (res) => {
             console.log(JSON.parse(res.data), "45454545");
             let datas = JSON.parse(res.data)
             if (datas.code == 0) {
-              that.setData({
+              this.setData({
                 imgPath: datas.data,
                 isTrue: false
               })

+ 1 - 1
pages/idCard/idCard.json

@@ -1,4 +1,4 @@
 {
-  "navigationBarTitleText":"上传照片",
+  "navigationBarTitleText":"身份卡",
   "usingComponents": {}
 }

+ 1 - 1
pages/idCard/idCard.wxml

@@ -1,6 +1,6 @@
 <wxs module="urls" src="../../utils/photoUrl.wxs"></wxs>
 <view class="home">
-	<view class="title1">上传本人真实照片</view>
+	<view class="title1">点击下方相机上传本人照片</view>
 	<view class="title2">生成专属身份卡</view>
 	<image wx:if="{{isTrue}}" src="/images/caream.png" style="width:350rpx;height:350rpx" bindtap="goPhoto"></image>
 	<image wx:else class="image" style="width:350rpx;height:350rpx" src="{{urls.url(imgPath)}}" mode='scaleToFill' bindtap="previewImg"></image>

+ 2 - 4
pages/idCardDetail/idCardDetail.js

@@ -26,13 +26,11 @@ Page({
         wx.hideLoading();
       }
     })
-    var that = this;
     var time = time;
-    setInterval(function () {
-      that.setData({
+    setInterval(() => {
+      this.setData({
         time: formateTime.setNowTimes(new Date())
       });
     }, 1000);
-    
   },
 })

+ 3 - 14
pages/index/index.js

@@ -126,7 +126,7 @@ Page({
       url: app.globalData.publicUrl + '/wxinfo/visitIsExist',
       method: "GET",
       data: {
-        openId:id
+        openId: id
         // appletId: id
       },
       success: res => {
@@ -273,25 +273,14 @@ Page({
       })
     }
   },
-  // onLoad() {
-  //   console.log("onloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonloadonload");
-  //   this.depts();
-  // },
   onShow() {
     this.depts();
     this.welcomeMessage();
-
   },
   onLoad: function () {
-    console.log("主页load11111");
-
-    var that = this;
     const apps = getApp()
-    apps.getAuthKey().then(function (res) {
-      that.depts();
+    apps.getAuthKey().then(() => {
+      this.depts();
     })
-    console.log("主页load2222222222222222");
   }
-
-
 })

+ 1 - 10
pages/login/login.js

@@ -72,20 +72,13 @@ Page({
         duration: 2000,
       })
     }
-
-
   },
   goHome() {
     wx.switchTab({
       url: '/pages/index/index',
     })
-  },
-  onLoad: function () {
-
   },
   onShow(){
-    console.log("登录onshow000000")
-    var that = this;
     wx.login({
       success: res => {
         // 获取到用户的 code 之后:res.code
@@ -111,9 +104,7 @@ Page({
               data: {
                 appletsId: wx.getStorageSync('openId')
               },
-              success: (res) => {
-
-              }
+              success: () => {}
             })
           }
         });

+ 17 - 19
pages/love/love.js

@@ -47,12 +47,11 @@ Page({
   },
   // 选择照片上传并后台接口
   zhaopian() {
-    var that = this;
     wx.chooseImage({
       count: 1,
       sizeType: ['compressed'],
       sourceType: ['camera'],
-      success: function (res) {
+      success: (res) => {
         var tempFilePaths = res.tempFilePaths
         wx.uploadFile({
           url: app.globalData.publicUrl + '/sys/user/upload',
@@ -65,20 +64,20 @@ Page({
             appletsId: wx.getStorageSync('openId'),
 
           },
-          success: function (res) {
+          success: (res) => {
             console.log(JSON.parse(res.data), "45454545");
             let datas = JSON.parse(res.data)
             if (datas.code == 0) {
-              if (that.data.imgPath.length < 3) {
-                that.data.imgPath.push(datas.data)
-                that.setData({
-                  imgPath: that.data.imgPath
+              if (this.data.imgPath.length < 3) {
+                this.data.imgPath.push(datas.data)
+                this.setData({
+                  imgPath: this.data.imgPath
                 })
-                console.log(that.data.imgPath, "打印下招聘的路径锕");
+                console.log(this.data.imgPath, "打印下招聘的路径锕");
 
-                that.data.visitPhoto = that.data.imgPath.join(',')
-                if (that.data.imgPath.length == 2) {
-                  that.setData({
+                this.data.visitPhoto = this.data.imgPath.join(',')
+                if (this.data.imgPath.length == 2) {
+                  this.setData({
                     isTrue: false
                   })
                 }
@@ -233,16 +232,15 @@ Page({
     var qqmapsdk = new QQMapWX({
       key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
     });
-    var that = this; //用户授权过可以直接获取位置
     wx.getLocation({
       //type: 'wgs84',
       type: 'gcj02',
-      success: function (res) {
+      success: (res) => {
         console.log(res, "0000000");
         // 返回当前定位的经纬度
         var latitude = parseFloat(res.latitude).toFixed(5);
         var longitude = parseFloat(res.longitude).toFixed(5);
-        that.setData({
+        this.setData({
           lng: longitude, //经度
           lat: latitude, //纬度        
         });
@@ -256,7 +254,7 @@ Page({
             latitude: latitude,
             longitude: longitude
           }],
-          success: function (res) {
+          success: (res) => {
             console.log(res.result.elements[0].distance, "距离的");
             if (res.result.elements[0].distance > 1000) {
               wx.showModal({
@@ -276,10 +274,10 @@ Page({
             latitude: res.latitude,
             longitude: res.longitude
           },
-          success: function (res) {
+          success: (res) => {
             //获取当前地址成功
             console.log(res, "为是都是都是");
-            that.setData({
+            this.setData({
               visitLocation: res.result.address
             })
           },
@@ -352,7 +350,7 @@ Page({
       visitMessage: {
         required: true,
       },
-      urgency:{
+      urgency: {
         required: true,
       }
     };
@@ -378,7 +376,7 @@ Page({
       demand: {
         required: '请输入老人需求',
       },
-      urgency:{
+      urgency: {
         required: '请选择需求紧急程度',
       }
     };

+ 1 - 1
pages/notice/notice.wxml

@@ -1,6 +1,6 @@
 <wxs module="time" src="../../utils/time.wxs"></wxs>
 <view id='tabs'>
-	<view class='tabs-box' style="background-color:#fff;border-radius:40rpx">
+	<view class='tabs-box' style="background-color:#fff;border-radius:40rpx;font-size:30rpx">
 		<block wx:for="{{['未读消息','已读消息']}}" wx:key="index">
 			<view class="tabs-item {{currentTabIndex == index ? 'selected' : '' }}" bindtap='onTabsItemTap' data-index='{{index}}'>
 				{{item}}

+ 1 - 4
pages/notice/notice.wxss

@@ -41,11 +41,8 @@ page {
   border-radius: 50%;
   background: red;
   position: absolute;
-  top: 20rpx;
-  left: 50rpx;
-  position: absolute;
   top: 32rpx;
-  left: 250rpx;
+  left: 265rpx;
 }
 
 .onread {

+ 2 - 3
pages/personInfo/personInfo.js

@@ -36,17 +36,16 @@ Page({
     })
   },
   tuichu() {
-    var that =this;
     wx.showModal({
       showCancel: true,
       content: "您确认要退出吗?",
-      success(res) {
+      success:(res)=> {
         if (res.confirm) {
           wx.showLoading({
             mask: true,
             title: '退出中',
           })
-          that.setData({
+          this.setData({
             isTure :false 
           })
           wx.request({

+ 34 - 64
pages/visitandinfo/visitandinfo.js

@@ -26,9 +26,7 @@ Page({
     })
   },
   cellClick(e) {
-    console.log(e.currentTarget.dataset.infos);
     if (e.currentTarget.dataset.infos.status !== "2") {
-      let that = this
       let fid = e.currentTarget.dataset.infos.fid;
       let name = e.currentTarget.dataset.infos.name;
       const app = getApp()
@@ -48,20 +46,10 @@ Page({
         icon: 'none',
         duration: 2000,
       })
-
-
     }
   },
   // 巡访的记录详情页面
   visitJilu(e) {
-    console.log(e.currentTarget.dataset.infos, "巡访信息");
-    // let photos = e.currentTarget.dataset.infos.visitPhoto.split(",");
-    // console.log(photos, "打印下锕");
-    // this.setData({
-    //   // show: true,
-    //   infos: e.currentTarget.dataset.infos,
-    //   photos: photos
-    // })
     wx.navigateTo({
       url: '../../pages/workDailyInfo/workDailyInfo?infos=' + JSON.stringify(e.currentTarget.dataset.infos),
     })
@@ -73,16 +61,13 @@ Page({
   },
   //删除
   deletes() {
-    console.log("ssss");
-    let that = this;
-    wx.showModal({
-      content: '该操作会将所有选中数据删除,是否删除?',
-      success(res) {
-        if (res.confirm) {
-          //确定绑定的操作
-          let num = 0;
-          if (that.data.batchIds.length) {
-            for (let item of that.data.batchIds) {
+    if (this.data.batchIds.length) {
+      wx.showModal({
+        content: '该操作会删除所有选中数据,是否继续?',
+        success: (res) => {
+          if (res.confirm) {
+            let num = 0;
+            for (let item of this.data.batchIds) {
               wx.request({
                 url: app.globalData.publicUrl + '/wxinfo/delete',
                 method: "GET",
@@ -92,27 +77,25 @@ Page({
                 data: {
                   id: item
                 },
-                success: (res) => {
-                  console.log(res, "000");
+                success: () => {
                   num += 1;
-                  if (num == that.data.batchIds.length) {
-                    console.log("删除了么")
+                  if (num == this.data.batchIds.length) {
                     wx.showToast({
                       title: '删除成功',
                       icon: 'none',
                       duration: 2000,
-                      success: function () {
-                        switch (that.data.number) {
+                      success: () => {
+                        switch (this.data.number) {
                           case 0:
-                            that.openIdInfo();
+                            this.openIdInfo();
                             break;
                           case 1:
-                            that.openIdInfo({
+                            this.openIdInfo({
                               status: "1"
                             });
                             break;
                           case 2:
-                            that.openIdInfo({
+                            this.openIdInfo({
                               status: "0"
                             });
                             break;
@@ -127,16 +110,16 @@ Page({
                             });
                             break;
                           case 5:
-                            that.openIdInfo({
+                            this.openIdInfo({
                               status: "4"
                             });
                             break;
                           default:
-                            that.openIdInfo();
+                            this.openIdInfo();
                         }
                       }
                     })
-                    that.setData({
+                    this.setData({
                       isAllTrue: false,
                     })
                   }
@@ -144,43 +127,31 @@ Page({
               })
             }
             console.log(num)
-
-          } else {
-            wx.showToast({
-              title: '请选择要删除的记录',
-              icon: 'none',
-              duration: 2000,
-            })
           }
-        } else if (res.cancel) {
-          //取消绑定的操作
         }
-      }
-    })
-  },
-  deleteById(id) {
-
+      })
+    } else {
+      wx.showToast({
+        title: '请选择要删除的记录',
+        icon: 'none',
+        duration: 2000,
+      })
+    }
   },
   //全选与反全选
-  selectall: function (e) {
-    console.log(e)
-    var that = this;
+  selectall: function () {
     var arr = []; //存放选中id的数组
-    console.log(that.data.listData);
-    for (let i = 0; i < that.data.listData.length; i++) {
-      if (that.data.listData[i].status != '3') {
-        that.data.listData[i].checked = (!that.data.select_all);
-        console.log(that.data.select_all);
-        if (that.data.listData[i].checked == true) {
-          // 全选获取选中的值
-          arr = arr.concat(that.data.listData[i]._id.split(','));
+    for (let i = 0; i < this.data.listData.length; i++) {
+      if (this.data.listData[i].status != '3') {
+        this.data.listData[i].checked = (!this.data.select_all);
+        if (this.data.listData[i].checked == true) {
+          arr = arr.concat(this.data.listData[i]._id.split(','));
         }
       }
     }
-    console.log(arr)
-    that.setData({
-      listData: that.data.listData,
-      select_all: (!that.data.select_all),
+    this.setData({
+      listData: this.data.listData,
+      select_all: (!this.data.select_all),
       batchIds: arr
     })
   },
@@ -234,7 +205,6 @@ Page({
   openIdInfo(p) {
     this.oldInfo(p);
   },
-
   oldInfo(p) {
     console.log('我查数据了')
     wx.showLoading({

+ 4 - 2
pages/visitandinfo/visitandinfo.wxml

@@ -45,14 +45,16 @@
 		</scroll-view>
 		<image wx:if='{{listData.length==0}}' style="width:220rpx;height:169rpx;position:absolute;top:400rpx;left:265rpx" src="../../images/nodata1.png"></image>
 		<view wx:if='{{listData.length==0}}' style="position:absolute;top:580rpx;left:320rpx;font-size:28rpx;color:#bcdbfd">暂无数据</view>
-		<view class="deletebj" bindtap="delete" wx:if='{{listData.length!=0}}'>
+		<view class="deletebj" bindtap="deletes" wx:if='{{listData.length!=0}}'>
 			<view class="delete">
 				<van-icon name="delete" color="#fd4133" size="35rpx;margin-right:10rpx" /><text>删除</text></view>
 		</view>
 
 	</van-tab>
 	<van-tab title="巡访记录">
-		<view class="top1">共<text class="number"> {{list.length}} </text>条巡访记录</view>
+		<view class="top1" wx:if="{{list.length!=0}}">共<text class="number"> {{list.length}} </text>条巡访记录</view>
+		<image wx:if='{{list.length==0}}' style="width:220rpx;height:169rpx;position:absolute;top:400rpx;left:265rpx" src="../../images/nodata1.png"></image>
+		<view wx:if='{{list.length==0}}' style="position:absolute;top:580rpx;left:320rpx;font-size:28rpx;color:#bcdbfd">暂无数据</view>
 		<scroll-view scroll-y="true" id="scroll1" style='height: {{scrollHeight1 + "px"}};width:700rpx;margin-left:25rpx;margin-top:20rpx;font-size:28rpx'>
 			<view wx:for="{{list}}" class="checkbox_border">
 				<view data-infos="{{item}}" bindtap="visitJilu">