roose %!s(int64=4) %!d(string=hai) anos
pai
achega
b264202af8

+ 46 - 16
pages/login/login.js

@@ -1,5 +1,7 @@
 const app = require('../../utils/util.js');
 const app = require('../../utils/util.js');
 var util = require('../../utils/md5.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({
 Page({
   data: {
   data: {
     defaultType1: true,
     defaultType1: true,
@@ -21,23 +23,51 @@ Page({
   formSubmit(e) {
   formSubmit(e) {
     console.log(e.detail, "daying");
     console.log(e.detail, "daying");
     var password = e.detail.value.pwd;
     var password = e.detail.value.pwd;
-    wx.request({
-      url: app.globalData.publicUrl + '/applet/bing',
-      method: "GET",
-      data: {
-        name: e.detail.value.name,
-        pwd: util.hexMD5(password),
-        appletsId: wx.getStorageSync('openId')
-      },
-      success: (res) => {
-        if (res.data.code == 0) {
-          wx.switchTab({
-            url: '/pages/index/index',
-          })
-          wx.setStorageSync('user', 'user')
-        }
+    if (e.detail.value.name) {
+      if (e.detail.value.pwd) {
+        wx.request({
+          url: app.globalData.publicUrl + '/applet/bing',
+          method: "GET",
+          data: {
+            name: e.detail.value.name,
+            pwd: util.hexMD5(password),
+            appletsId: wx.getStorageSync('openId')
+          },
+          success: (res) => {
+            console.log(res, "777777");
+
+            if (res.data.code == 0) {
+              Notify({
+                type: 'success',
+                message: '登录成功'
+              });
+              wx.setStorageSync('user', 'user');
+              wx.switchTab({
+                url: '/pages/index/index',
+              })
+            } else {
+              Notify({
+                type: 'danger',
+                message: res.data.message
+              });
+            }
+          }
+        })
+      } else {
+        wx.showToast({
+          title: "密码不能为空",
+          icon: 'none',
+          duration: 2000,
+        })
       }
       }
-    })
+    } else {
+      wx.showToast({
+        title: "账号不能为空",
+        icon: 'none',
+        duration: 2000,
+      })
+    }
+
 
 
   },
   },
   onLoad: function () {
   onLoad: function () {

+ 4 - 2
pages/login/login.json

@@ -1,4 +1,6 @@
 {
 {
-  "navigationBarTitleText":"登录",
-  "usingComponents": {}
+  "navigationBarTitleText": "登录",
+  "usingComponents": {
+    "van-notify": "../../miniprogram_npm/vant-weapp/notify/index"
+  }
 }
 }

+ 3 - 1
pages/login/login.wxml

@@ -19,4 +19,6 @@
 			</view>
 			</view>
 		</view>
 		</view>
 	</form>
 	</form>
-</view>
+
+</view>
+<van-notify id="van-notify" />

+ 63 - 19
pages/updatepassword/updatepassword.js

@@ -11,7 +11,7 @@ Page({
     defaultType3: true,
     defaultType3: true,
     passwordType3: true,
     passwordType3: true,
 
 
-    info:{},
+    info: {},
   },
   },
   eyeStatus1() {
   eyeStatus1() {
     if (this.data.defaultType1) {
     if (this.data.defaultType1) {
@@ -55,24 +55,68 @@ Page({
     }
     }
   },
   },
 
 
-
   formSubmit(e) {
   formSubmit(e) {
     console.log(e.detail, "daying");
     console.log(e.detail, "daying");
-    var password = e.detail.value.pwd;
-    wx.request({
-      url: app.globalData.publicUrl + '/applet/updatePwd',
-      method: "GET",
-      header: {
-        appletsId: wx.getStorageSync('openId')
-      },
-      data: e.detail.value,
-      success: (res) => {
-       
+    if (e.detail.value.oldPwd) {
+      if (e.detail.value.pwd) {
+        if (e.detail.value.newPwd) {
+          if (e.detail.value.pwd.toString().length > 6) {
+            if (e.detail.value.pwd == e.detail.value.newPwd) {
+              wx.request({
+                url: app.globalData.publicUrl + '/applet/updatePwd',
+                method: "GET",
+                header: {
+                  appletsId: wx.getStorageSync('openId')
+                },
+                data: e.detail.value,
+                success: (res) => {
+                  console.log(res);
+                  // if (res.data.code == 0) {
+                  //   wx.switchTab({
+                  //     url: '/pages/updatepassword/updatepassword',
+                  //   })
+                  // }
+                }
+              })
+              wx.switchTab({
+                url: '/pages/index/index',
+              })
+            } else {
+              wx.showToast({
+                title: "两次输入密码不一致",
+                icon: 'none',
+                duration: 2000,
+              })
+            }
+          } else {
+            wx.showToast({
+              title: "密码长度最少为6位",
+              icon: 'none',
+              duration: 2000,
+            })
+          }
+        } else {
+          wx.showToast({
+            title: "在输入新密码不能为空",
+            icon: 'none',
+            duration: 2000,
+          })
+        }
+      } else {
+        wx.showToast({
+          title: "新密码不能为空",
+          icon: 'none',
+          duration: 2000,
+        })
       }
       }
-    })
-    // wx.switchTab({
-    //   url: '/pages/index/index',
-    // })
+    } else {
+      wx.showToast({
+        title: "原密码不能为空",
+        icon: 'none',
+        duration: 2000,
+      })
+    }
+
   },
   },
   onLoad: function () {
   onLoad: function () {
     wx.request({
     wx.request({
@@ -82,12 +126,12 @@ Page({
         appletsId: wx.getStorageSync('openId')
         appletsId: wx.getStorageSync('openId')
       },
       },
       success: (res) => {
       success: (res) => {
-        console.log(res,"000");
+        console.log(res, "000");
         this.setData({
         this.setData({
-          info:res.data.data
+          info: res.data.data
         })
         })
       }
       }
-    }) 
+    })
 
 
   },
   },
 })
 })

+ 1 - 1
pages/updatepassword/updatepassword.wxml

@@ -20,7 +20,7 @@
 			</view>
 			</view>
 			<view class="name" style=" margin-top: 20rpx;">
 			<view class="name" style=" margin-top: 20rpx;">
 				<image src="/images/pwd.png" style="width: 40rpx; height: 40rpx;"> </image>
 				<image src="/images/pwd.png" style="width: 40rpx; height: 40rpx;"> </image>
-				<input name='pwd' class="weui-input" password='{{passwordType3}}' placeholder="请再次输入新密码" />
+				<input name='newPwd' class="weui-input" password='{{passwordType3}}' placeholder="请再次输入新密码" />
 				<image src='{{defaultType3? "/images/eye_close.png": "/images/eye_open.png"}}' class='eye-image' bindtap='eyeStatus3'></image>
 				<image src='{{defaultType3? "/images/eye_close.png": "/images/eye_open.png"}}' class='eye-image' bindtap='eyeStatus3'></image>
 			</view>
 			</view>
 			<view class="register">
 			<view class="register">

+ 68 - 16
pages/visitandinfo/visitandinfo.js

@@ -23,6 +23,39 @@ Page({
     infos: {},
     infos: {},
     photos: [],
     photos: [],
     scrollHeight: '',
     scrollHeight: '',
+    scrollHeight1: '',
+    list: [
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      //   {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+      // {visitTime: "2020-02-16T11:22:07.697Z",oldInfo:'战三的'},
+    ], //探访的数据哈
   },
   },
   onTabsItemTap: function (event) {
   onTabsItemTap: function (event) {
     let index = event.currentTarget.dataset.index;
     let index = event.currentTarget.dataset.index;
@@ -150,6 +183,10 @@ Page({
 
 
   oldInfo(p) {
   oldInfo(p) {
     console.log("老人锕");
     console.log("老人锕");
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    })
     wx.request({
     wx.request({
       url: app.globalData.publicUrl + '/wxinfo/listByOpenid',
       url: app.globalData.publicUrl + '/wxinfo/listByOpenid',
       method: "GET",
       method: "GET",
@@ -159,16 +196,20 @@ Page({
       },
       },
       success: (res) => {
       success: (res) => {
         console.log(res, "0000");
         console.log(res, "0000");
-        this.setData({
-          listData: res.data.data
-        })
-
+        if (res.data.code == 0) {
+          wx.hideLoading();
+          this.setData({
+            listData: res.data.data
+          })
+        }
       }
       }
     })
     })
   },
   },
   visitInfo() {
   visitInfo() {
-
-
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    })
     wx.request({
     wx.request({
       url: app.globalData.publicUrl + '/visit/list',
       url: app.globalData.publicUrl + '/visit/list',
       method: "GET",
       method: "GET",
@@ -177,10 +218,12 @@ Page({
       },
       },
       success: (res) => {
       success: (res) => {
         console.log(res, "0000");
         console.log(res, "0000");
-        this.setData({
-          list: res.data.data
-        })
-
+        if (res.data.code == 0) {
+          wx.hideLoading();
+          this.setData({
+            list: res.data.data
+          })
+        }
       }
       }
     })
     })
   },
   },
@@ -193,22 +236,31 @@ Page({
       let searchHeight = res[0].height
       let searchHeight = res[0].height
       let titleHeight = res[1].height
       let titleHeight = res[1].height
       let windowHeight = wx.getSystemInfoSync().windowHeight
       let windowHeight = wx.getSystemInfoSync().windowHeight
-      let scrollHeight = windowHeight - searchHeight - titleHeight - 30 - 5 - 50
-
-      console.log(titleHeight, "高度0");
-      console.log(searchHeight, "高度1");
-      console.log(windowHeight, "高度222");
-      console.log(scrollHeight, "最重高度");
+      let scrollHeight = windowHeight - searchHeight - titleHeight - 30 - 5 - 50 - 44
       this.setData({
       this.setData({
         scrollHeight: scrollHeight
         scrollHeight: scrollHeight
       })
       })
     })
     })
   },
   },
+  computeScrollViewHeight1() {
+    let that = this
+    let query = wx.createSelectorQuery().in(this)
+    query.select('.zizi').boundingClientRect()
+    query.exec(res => {
+      let searchHeight = res[0].height
+      let windowHeight = wx.getSystemInfoSync().windowHeight
+      let scrollHeight = windowHeight - searchHeight - 30 - 5 - 50
+      this.setData({
+        scrollHeight1: scrollHeight
+      })
+    })
+  },
 
 
   onLoad() {
   onLoad() {
     this.oldInfo();
     this.oldInfo();
     this.visitInfo();
     this.visitInfo();
     this.computeScrollViewHeight();
     this.computeScrollViewHeight();
+    this.computeScrollViewHeight1();
   },
   },
   onShow() {
   onShow() {
     console.log(wx.getStorageSync('user'), "打印");
     console.log(wx.getStorageSync('user'), "打印");

+ 18 - 6
pages/visitandinfo/visitandinfo.wxml

@@ -24,12 +24,12 @@
 					<view class="zizi">共<text class="number">{{listData.length}}</text>条采集数据</view>
 					<view class="zizi">共<text class="number">{{listData.length}}</text>条采集数据</view>
 					<scroll-view class="center" scroll-y="true" style='height: {{scrollHeight + "px"}}'>
 					<scroll-view class="center" scroll-y="true" style='height: {{scrollHeight + "px"}}'>
 						<view class="tr" style=" border-bottom: 1px solid #dadada; padding-bottom: 15rpx;">
 						<view class="tr" style=" border-bottom: 1px solid #dadada; padding-bottom: 15rpx;">
-							<view class="td td22" style="border-bottom: unset; ">
+							<view class="td " style="border-bottom: unset; width: 38%; ">
 								<checkbox bindtap="selectall" />
 								<checkbox bindtap="selectall" />
 							</view>
 							</view>
-							<view class="th" style="border-bottom: unset;">姓名</view>
-							<view class="th " style="border-bottom: unset;  margin-left: 100rpx;">保存时间</view>
-							<view class="th" style="border-bottom: unset;">状态</view>
+							<view class="td" style="border-bottom: unset;">姓名</view>
+							<view class="td " style="border-bottom: unset;  margin-left: 100rpx;">保存时间</view>
+							<view class="td" style="border-bottom: unset;">状态</view>
 						</view>
 						</view>
 						<checkbox-group bindchange="checkboxChange">
 						<checkbox-group bindchange="checkboxChange">
 							<view class="tr" wx:for="{{listData}}" wx:key="">
 							<view class="tr" wx:for="{{listData}}" wx:key="">
@@ -53,7 +53,19 @@
 				</view>
 				</view>
 				<view hidden='{{currentTabIndex != 1}}'>
 				<view hidden='{{currentTabIndex != 1}}'>
 					<view class="zizi">共<text class="number">{{list.length}}</text>条探访数据</view>
 					<view class="zizi">共<text class="number">{{list.length}}</text>条探访数据</view>
-					<view class="table0">
+					<scroll-view class="table0" scroll-y="true" style='height: {{scrollHeight1 + "px"}}'>
+						<view class="tr0 bg-w0" style="padding:0">
+							<view class="th0">老人姓名</view>
+							<view class="th0">探访时间</view>
+						</view>
+						<block wx:for="{{list}}" wx:key="unique">
+							<view class="tr0" bindtap="bindtap" data-infos="{{item}}" bindtap="visitJilu">
+								<view class="td0"><text>{{item.oldInfo}}<text wx:if='{{item.oldIdNumber}}' class="oldzi">({{item.oldIdNumber}})</text></text></view>
+								<view class="td0 td11" style="  padding: 0rpx 10rpx;"><text> {{time.formatDate(item.visitTime)}}</text></view>
+							</view>
+						</block>
+					</scroll-view>
+					<!-- <view class="table0">
 						<view class="tr0 bg-w0" style="padding:0">
 						<view class="tr0 bg-w0" style="padding:0">
 							<view class="th0">老人姓名</view>
 							<view class="th0">老人姓名</view>
 							<view class="th0">探访时间</view>
 							<view class="th0">探访时间</view>
@@ -64,7 +76,7 @@
 								<view class="td0 td11"><text> {{time.formatDate(item.visitTime)}}</text></view>
 								<view class="td0 td11"><text> {{time.formatDate(item.visitTime)}}</text></view>
 							</view>
 							</view>
 						</block>
 						</block>
-					</view>
+					</view> -->
 					<van-overlay show="{{ show }}" bind:click="onClickHide">
 					<van-overlay show="{{ show }}" bind:click="onClickHide">
 						<view class="wrapper">
 						<view class="wrapper">
 							<view class="block">
 							<view class="block">

+ 2 - 2
pages/visitandinfo/visitandinfo.wxss

@@ -86,7 +86,7 @@
   width: 100%;
   width: 100%;
   justify-content: space-between;
   justify-content: space-between;
   border-bottom: 1px solid #dadada;
   border-bottom: 1px solid #dadada;
-  padding: 20rpx 0;
+  padding: 20rpx 0rpx;
 }
 }
 
 
 .bg-w0 {
 .bg-w0 {
@@ -190,4 +190,4 @@ checkbox .wx-checkbox-input {
 .center {
 .center {
   text-align: center;
   text-align: center;
   height: 100%;
   height: 100%;
-}
+}