diff --git a/pages/addperson/addperson.js b/pages/addperson/addperson.js index 8e4a67a..2c9827b 100644 --- a/pages/addperson/addperson.js +++ b/pages/addperson/addperson.js @@ -239,8 +239,11 @@ Page({ var cgInfo = wx.getStorageSync('cgInfo') var deviceinfo = wx.getStorageSync('deviceinfo') var personLi = wx.getStorageSync('personLi') - let minDate = wx.getStorageSync('minDate') - let minDate1 = wx.getStorageSync('minDate1') + console.log("242",personLi); + let minDate = moment(personLi.startTime).format('YYYY-MM-DD HH:mm:ss') + let minDate1 = moment(personLi.endTime).format('YYYY-MM-DD HH:mm:ss') + // let minDate = wx.getStorageSync('minDate') + // let minDate1 = wx.getStorageSync('minDate1') this.setData({ cgInfo: cgInfo, minDate, diff --git a/pages/personManger/personManger.js b/pages/personManger/personManger.js index dd62bdb..99a2e3e 100644 --- a/pages/personManger/personManger.js +++ b/pages/personManger/personManger.js @@ -110,13 +110,19 @@ Page({ console.log(moment().format("x")) var deviceinfo = wx.getStorageSync('deviceinfo') var cgInfo = wx.getStorageSync('cgInfo') + let starttime = moment().format('YYYY-MM-DD HH:mm:ss') + let endtime = moment().add(30,'days').format('YYYY-MM-DD HH:mm:ss') if(deviceinfo.roomId){ this.getSiteTenant(deviceinfo.roomId) } this.setData({ deviceinfo: deviceinfo, roomId: deviceinfo.roomId, - cgInfo: cgInfo + cgInfo: cgInfo, + starttime, + endtime, + minDate: starttime, + minDate1: endtime }) }, onChange1(event) { @@ -295,6 +301,8 @@ Page({ mask:true, duration: 2000 }) + // wx.setStorageSync('minDate', data.startTime) + // wx.setStorageSync('minDate1', data.endTime) WXAPI.sendCommand(data3).then(res6 => { if(res6.success){ var data4 = { @@ -426,6 +434,8 @@ Page({ mask:true, duration: 2000 }) + // wx.setStorageSync('minDate', data.startTime) + // wx.setStorageSync('minDate1', data.endTime) } else { wx.hideLoading() wx.showToast({ @@ -525,6 +535,8 @@ Page({ icon: 'none', duration: 2000 }) + // wx.setStorageSync('minDate', data.startTime) + // wx.setStorageSync('minDate1', data.endTime) _this.getSiteTenant(_this.data.roomId) }else{ wx.hideLoading() @@ -609,13 +621,13 @@ Page({ let minDate1 = res1.data.list[0].endTime let starttime = moment(minDate).format('YYYY-MM-DD HH:mm:ss') let endtime = moment(minDate1).format('YYYY-MM-DD HH:mm:ss') - wx.setStorageSync('minDate',starttime) - wx.setStorageSync('minDate1',endtime) + // wx.setStorageSync('minDate',starttime) + // wx.setStorageSync('minDate1',endtime) this.setData({ personList: res1.data.list, starttime, endtime, - minDate,minDate1 + // minDate,minDate1 }) } else { wx.showToast({