From 266bc4fefbcfb92876c8025fe7a57c14a74a3602 Mon Sep 17 00:00:00 2001 From: xiaohei <11674173+xiaohei102908@user.noreply.gitee.com> Date: Fri, 22 Dec 2023 13:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC1.0.6=20=202023-12-22=20=20lj?= =?UTF-8?q?d=201=E3=80=81=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E5=AF=86=E7=A0=81=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 30 ++++++++--------- pages/addperson/addperson.js | 2 +- pages/login/login.js | 2 +- pages/roomDetail/roomDetail.js | 12 ++++--- pages/roomDetail/roomDetail.wxml | 4 +-- pages/userbluetoothUnlock/userbluetoothUnlock.js | 43 ++++++++++++++++++++---- pagesA/passwordList/passwordList.js | 2 +- utils/ICINPakage/ICINLocker.js | 2 +- utils/request.js | 1 + 9 files changed, 66 insertions(+), 32 deletions(-) diff --git a/app.js b/app.js index 75fb6f9..1887cbe 100644 --- a/app.js +++ b/app.js @@ -20,21 +20,21 @@ App({ }) } }) - wx.login({ - success (res) { - if (res.code) { - let data={ - code:res.code - } - WXAPI.getOpenId(data).then(res=>{ - console.log(res) - wx.setStorageSync('openid', res.openid) - }) - } else { - console.log('登录失败!' + res.errMsg) - } - } - }) + // wx.login({ + // success (res) { + // if (res.code) { + // let data={ + // code:res.code + // } + // WXAPI.getOpenId(data).then(res=>{ + // console.log(res) + // wx.setStorageSync('openid', res.openid) + // }) + // } else { + // console.log('登录失败!' + res.errMsg) + // } + // } + // }) // 展示本地存储能力 var logs = wx.getStorageSync('token') || '' var userRole = wx.getStorageSync('userRole') || '' diff --git a/pages/addperson/addperson.js b/pages/addperson/addperson.js index 35cae42..c2a09ec 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 < 9) { + if (pwdNo.length < 9) { pwdNo = '0' + pwdNo } else { pwdNo = pwdNo diff --git a/pages/login/login.js b/pages/login/login.js index 1471249..b0eb4fc 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -36,7 +36,7 @@ Page({ username,password,usernameOne,passwordOne,checked, corid:options.corid }) - this.noCodeLogin() + // this.noCodeLogin() }, refresh:WXAPI.throttle(function(e){ this.noCodeLogin() diff --git a/pages/roomDetail/roomDetail.js b/pages/roomDetail/roomDetail.js index bb127a8..07e7587 100644 --- a/pages/roomDetail/roomDetail.js +++ b/pages/roomDetail/roomDetail.js @@ -1087,6 +1087,7 @@ Page({ openTheDoor() { // if(this.data.deviceinfo.info){ // JSON.parse(this.data.deviceinfo.info) + var that = this wx.showLoading({ title: '连接中', mask: true, @@ -1127,6 +1128,9 @@ Page({ duration: 2000, icon: 'none' }) + if(that.data.deviceinfo.manufactureId == 201 || that.data.deviceinfo.manufactureId == 221){ + that.synchroPlatformTask() + } WXAPI.sendCommand(data).then(res => { console.log(res) }) @@ -1264,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/roomDetail/roomDetail.wxml b/pages/roomDetail/roomDetail.wxml index 73e92f6..61307b7 100644 --- a/pages/roomDetail/roomDetail.wxml +++ b/pages/roomDetail/roomDetail.wxml @@ -82,10 +82,10 @@ 添加蓝牙扣 --> - + diff --git a/pages/userbluetoothUnlock/userbluetoothUnlock.js b/pages/userbluetoothUnlock/userbluetoothUnlock.js index 1fe617c..1adc71f 100644 --- a/pages/userbluetoothUnlock/userbluetoothUnlock.js +++ b/pages/userbluetoothUnlock/userbluetoothUnlock.js @@ -6,6 +6,7 @@ var util = require('../../utils/util'); const config = require('../../config') const plugin = requirePlugin('myPlugin') const util1 = require('../../utils/util1.js') +import IotTask from '../../utils/IotTask' import { BLE } from "../../utils/btls/ble"; @@ -216,13 +217,39 @@ Page({ }) } }, - // 添加远程密码 - addRemotePassword(){ - this.setData({ - showTwo:true, - remotePasswordStatus:true - }) - }, + // // 同步平台任务 + // synchroPlatformTask() { + // wx.showLoading({ + // title: '同步平台任务中', + // icon: 'none', + // mask: true + // }) + // const iotInstance = new IotTask(this.data.cgInfo.lockerId, this.iotCallBack) + // iotInstance.run() + // }, + // iotCallBack(sendData) { + // let _this = this + // if (!sendData) return + // return new Promise((resolve, reject) => { + // console.log(_this.data.cgInfo.commonKey) + // ICINLocker.nbIotTransmit(sendData, _this.data.cgInfo.commonKey, (callback) => { + // console.log('发送数据' + new Date(), sendData) + // console.log('同步任务回调结果' + new Date(), callback) + // if (callback) { + // resolve(callback.nbIotResp) + // } else { + // reject('同步任务fail') + // } + // }) + // }) + // }, + // // 添加远程密码 + // addRemotePassword(){ + // this.setData({ + // showTwo:true, + // remotePasswordStatus:true + // }) + // }, // 配网 changeshow2() { this.setData({ @@ -987,6 +1014,7 @@ Page({ // if(this.data.deviceinfo.info){ // JSON.parse(this.data.deviceinfo.info) // var deviceinfo = this.data.deviceinfo + var that = this var userInfo = wx.getStorageSync('deviceinfo') ICINLocker.getSignKey(this.data.cgInfo.lockerId, this.data.cgInfo.superId, this.data.cgInfo.superId, (callback) => { console.log(callback) @@ -996,6 +1024,7 @@ Page({ console.log(callback) var commonKey = callback.commonKey ICINLocker.openTheDoor(this.data.cgInfo.lockerId, this.data.cgInfo.superId, userSignKey, this.data.cgInfo.superId, '', '01', commonKey, (callback) => { + // that.synchroPlatformTask() var data = { code: "zg/bleUnlockRecord", signature:wx.getStorageSync('signature'), diff --git a/pagesA/passwordList/passwordList.js b/pagesA/passwordList/passwordList.js index 8498ef1..24f0747 100644 --- a/pagesA/passwordList/passwordList.js +++ b/pagesA/passwordList/passwordList.js @@ -498,7 +498,7 @@ Page({ var pwdNo = res.data.index.toString(16) var passwordIndex = res.data.index console.log("500",pwdNo); - if (pwdNo < 9) { + if (pwdNo.length < 9) { pwdNo = '0' + pwdNo } else { pwdNo = pwdNo diff --git a/utils/ICINPakage/ICINLocker.js b/utils/ICINPakage/ICINLocker.js index d0d77c7..8f79939 100644 --- a/utils/ICINPakage/ICINLocker.js +++ b/utils/ICINPakage/ICINLocker.js @@ -3856,7 +3856,7 @@ function getIIData() { function datasubpck(datahex) { var arrayObj = new Array(); let dataPackageLength = packageSize - console.log('分包大小', dataPackageLength) + console.log('分包大小', dataPackageLength, datahex) for (var i = 0; i < datahex.length; i += dataPackageLength) { // 预加 最大包长度,如果依然小于总数据长度,可以取最大包数据大小 if (i + dataPackageLength < datahex.length) { diff --git a/utils/request.js b/utils/request.js index b75a92f..73c1975 100644 --- a/utils/request.js +++ b/utils/request.js @@ -12,6 +12,7 @@ function setCode(str, text) { return data; } let tenantIdEnter='100' +// let tenantIdEnter='1200' function setTenantId(tenantId){ tenantIdEnter=tenantId wx.setStorageSync('tenantId',tenantId)