|
|
@ -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'), |
|
|
|