diff --git a/pages/addperson/addperson.js b/pages/addperson/addperson.js index c2a09ec..9a10c07 100644 --- a/pages/addperson/addperson.js +++ b/pages/addperson/addperson.js @@ -1619,7 +1619,7 @@ Page({ var pwdNo = res.data.index.toString(16) // var pwdNo = res.data.index var passwordIndex = res.data.index - if (pwdNo.length < 9) { + if (pwdNo.length < 2) { pwdNo = '0' + pwdNo } else { pwdNo = pwdNo @@ -4297,7 +4297,7 @@ Page({ } console.log(dataPasswod); WXAPI.sendCommand(dataPasswod).then(res => { - console.log(res); + console.log("123123",res); if (res.success) { fingerprintIndex = res.data.index serialNumber = res.data.serialNumber @@ -4335,6 +4335,7 @@ Page({ var startTime = new Date(Number(moment(that.data.starttime).format('x'))) var endTime = new Date(Number(moment(that.data.endtime).format('x'))) // fingerprintIndex = Math.floor(Math.random() * 100) + console.log(lockDevice.name, basecode, fingerprintIndex, startTime, endTime); var bytes = plugin.addFingerprint(lockDevice.name, basecode, fingerprintIndex, startTime, endTime) console.debug('bytes', bytes) that.sendBytes(bytes) @@ -4415,6 +4416,7 @@ Page({ } WXAPI.getCertificates(data).then(res => { var dataOne = util.zlib_unzip(res.data) + console.log("123123",dataOne); if (res.success) { dataOne.map(li => { li['pzname'] = JSON.parse(li.content).pzname diff --git a/pages/roomDetail/roomDetail.js b/pages/roomDetail/roomDetail.js index 07e7587..c535039 100644 --- a/pages/roomDetail/roomDetail.js +++ b/pages/roomDetail/roomDetail.js @@ -1268,10 +1268,10 @@ Page({ searchDevicesMethods() { var that = this; - // wx.showLoading({ - // title: '正在搜索', - // // mask: true - // }) + wx.showLoading({ + title: '正在搜索', + // mask: true + }) this.setData({ searchClick: false }) diff --git a/pages/userbluetoothUnlock/userbluetoothUnlock.js b/pages/userbluetoothUnlock/userbluetoothUnlock.js index 1adc71f..7e72965 100644 --- a/pages/userbluetoothUnlock/userbluetoothUnlock.js +++ b/pages/userbluetoothUnlock/userbluetoothUnlock.js @@ -165,7 +165,7 @@ Page({ } this.getApartmentCardInfoMethods() - this.getPassWordMehods() + // this.getPassWordMehods() app.globalData.deviceNum = deviceinfo.deviceNum console.log("169",this.data.minDate, this.data.minDate1); if(deviceinfo.manufactureId == 101){ @@ -176,11 +176,11 @@ Page({ }, // 获取合同信息 getApartmentCardInfoMethods(){ - let deviceinfoList = wx.getStorageSync('deviceinfoList') - if(deviceinfoList[0].cardId){ + let deviceinfo = wx.getStorageSync('deviceinfo') + if(deviceinfo.cardId){ let data={ signature:wx.getStorageSync('signature'), - id:deviceinfoList[0].cardId, + id:deviceinfo.cardId, } WXAPI.getApartmentCardInfo(data).then(res=>{ console.log("184",res); @@ -2548,13 +2548,14 @@ Page({ signature:wx.getStorageSync('signature'), }; WXAPI.tsGetCertificate(data).then(res=>{ + console.log(res); if(res.success){ var dataOne=[],dataTwo=[] res.data.map(li=>{ - if(li.type == 14){ + if(li.type == 4 && (li.deviceNum == deviceinfoList.deviceNum)){ li.content=JSON.parse(li.content) dataOne.push(li) - }else if(li.type == 13){ + }else if(li.type == 3 && (li.deviceNum == deviceinfoList.deviceNum)){ li.content=JSON.parse(li.content) dataTwo.push(li) } diff --git a/pagesA/passwordList/passwordList.js b/pagesA/passwordList/passwordList.js index 24f0747..1d7a6d0 100644 --- a/pagesA/passwordList/passwordList.js +++ b/pagesA/passwordList/passwordList.js @@ -64,10 +64,12 @@ Page({ }, // 获取凭证数据 getvoucher() { - var data = JSON.stringify({ - id: this.data.personLi.cardId, + const deviceInfo = wx.getStorageSync('deviceinfo') + var data = { + id: deviceInfo.cardId, + deviceNum: deviceInfo.deviceNum, signature: wx.getStorageSync('signature') - }) + } WXAPI.tsGetCertificate(data).then(res => { console.log("72",res); res.data.map(li => { @@ -76,13 +78,13 @@ Page({ li.content.passwordEndTime = moment(li.endTime*1000).format('YYYY-MM-DD HH:mm:ss') }) const list = res.data.filter(li => { - return li.type == 3 && (li.status == 1 || li.status == 0); + return li.type == 3 && (li.status == 1 || li.status == 0) && li.deviceNum == deviceInfo.deviceNum; }) const list1 = res.data.filter(li => { - return li.type == 4 && (li.status == 1 || li.status == 0); + return li.type == 4 && (li.status == 1 || li.status == 0) && li.deviceNum == deviceInfo.deviceNum; }) const list2 = res.data.filter(li => { - return li.type == 1 && (li.status == 1 || li.status == 0); + return li.type == 1 && (li.status == 1 || li.status == 0) && li.deviceNum == deviceInfo.deviceNum; }) this.setData({ cardlist: list, @@ -498,7 +500,7 @@ Page({ var pwdNo = res.data.index.toString(16) var passwordIndex = res.data.index console.log("500",pwdNo); - if (pwdNo.length < 9) { + if (pwdNo.length < 2) { pwdNo = '0' + pwdNo } else { pwdNo = pwdNo diff --git a/utils/request.js b/utils/request.js index 73c1975..0a20089 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,7 +1,7 @@ const app = getApp() let subDomain = '' // 子域名,没有就等于 -// const API_BASE_URL = 'https://apartmentcloud.xiaozhisz.cn/' // 主域名 -const API_BASE_URL = 'http://test.zhiweisz.cn/' // 主域名 +const API_BASE_URL = 'https://apartmentcloud.xiaozhisz.cn/' // 主域名 +// const API_BASE_URL = 'http://test.zhiweisz.cn/' // 主域名 // const API_BASE_URL = 'https://yktms-cs.utsz.edu.cn/' // 主域名 import JSEncrypt from '../js_sdk/jsencrypt-Rsa/jsencrypt/jsencrypt.min.js'; function setCode(str, text) { @@ -11,8 +11,8 @@ function setCode(str, text) { let data = encryptStr.encrypt(text.toString()); // 进行加密 return data; } -let tenantIdEnter='100' -// let tenantIdEnter='1200' +// let tenantIdEnter='100' +let tenantIdEnter='1200' function setTenantId(tenantId){ tenantIdEnter=tenantId wx.setStorageSync('tenantId',tenantId)