|
|
@ -61,11 +61,10 @@ Page({ |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
platformId: 0, // 运营商
|
|
|
|
platformId: 0, // 运营商
|
|
|
|
platformname: "", |
|
|
|
sheetshow: false, |
|
|
|
actions1: [ |
|
|
|
{ |
|
|
|
actions1: [{ |
|
|
|
name: '电信', |
|
|
|
id: 1 |
|
|
|
}, |
|
|
@ -234,7 +233,7 @@ Page({ |
|
|
|
} |
|
|
|
let superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length) |
|
|
|
basecode = superAdminId |
|
|
|
console.log(superAdminId, basecode); |
|
|
|
console.log("超管", basecode, superAdminId, this.data.lock); |
|
|
|
this.setData({ |
|
|
|
deviceInfo: res.data.list[0], |
|
|
|
lock: lock, |
|
|
@ -1727,7 +1726,7 @@ Page({ |
|
|
|
|
|
|
|
// 注册到平台
|
|
|
|
resgiterDeviceMethods1() { |
|
|
|
if(this.data.platformId == 0){ |
|
|
|
if (this.data.platformId == 0) { |
|
|
|
return wx.showToast({ |
|
|
|
title: '请先选择运营商', |
|
|
|
icon: "none", |
|
|
@ -1756,15 +1755,28 @@ Page({ |
|
|
|
var superAdmin = [] |
|
|
|
var superAdminId |
|
|
|
var deviceimei |
|
|
|
if(this.data.selectRadio1 == 1201){ |
|
|
|
deviceimei = this.data.lock.imei |
|
|
|
}else if(this.data.selectRadio1 == 1241) { |
|
|
|
if (this.data.deviceNum.length <= 15) { |
|
|
|
deviceimei = this.data.deviceNum |
|
|
|
console.log(that.data.lock); |
|
|
|
if (that.data.selectRadio1 == 1201) { |
|
|
|
deviceimei = that.data.lock.imei |
|
|
|
} else if (that.data.selectRadio1 == 1241) { |
|
|
|
if (that.data.deviceNum.length <= 15) { |
|
|
|
deviceimei = that.data.deviceNum |
|
|
|
} else { |
|
|
|
deviceimei = that.data.deviceNum.slice(that.data.deviceNum.length - 15, that.data.deviceNum.length) |
|
|
|
} |
|
|
|
} |
|
|
|
for (let i = 0; i < superAdminIdlist.length; i++) { |
|
|
|
if (superAdminIdlist[i] >= 0 && superAdminIdlist[i] <= 9) { |
|
|
|
superAdmin.push(superAdminIdlist[i]) |
|
|
|
} else { |
|
|
|
deviceimei = this.data.deviceNum.slice(this.data.deviceNum.length - 15, this.data.deviceNum.length) |
|
|
|
let adminid = superAdminIdlist.charCodeAt(i) |
|
|
|
superAdmin.push(adminid) |
|
|
|
} |
|
|
|
} |
|
|
|
superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length) |
|
|
|
console.log(lockMac, superAdminIdlist, superAdminId); |
|
|
|
// let superAdmin = []
|
|
|
|
// var superAdminIdlist = lock.mac.slice(lock.mac.length - 11, lock.mac.length).split(":").join("")
|
|
|
|
// for (let i = 0; i < superAdminIdlist.length; i++) {
|
|
|
|
// if (superAdminIdlist[i] >= 0 && superAdminIdlist[i] <= 9) {
|
|
|
|
// superAdmin.push(superAdminIdlist[i])
|
|
|
@ -1773,9 +1785,9 @@ Page({ |
|
|
|
// superAdmin.push(adminid)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length)
|
|
|
|
// console.log(lockMac, superAdminIdlist, superAdminId);
|
|
|
|
console.log("123123123123", basecode); |
|
|
|
// let superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length)
|
|
|
|
basecode = superAdminId |
|
|
|
console.log("123123123123", basecode, superAdminId, deviceimei); |
|
|
|
let data = { |
|
|
|
code: 'lwj/registerDevice', |
|
|
|
data: { |
|
|
@ -1788,7 +1800,7 @@ Page({ |
|
|
|
} |
|
|
|
console.log(data); |
|
|
|
WXAPI.sendCommand(data).then(res => { |
|
|
|
console.log(res, data); |
|
|
|
console.log(res, data, basecode); |
|
|
|
if (res.success) { |
|
|
|
let data1 = { |
|
|
|
code: 'lwj/registerSupperAdmin', |
|
|
@ -2761,6 +2773,20 @@ Page({ |
|
|
|
console.log(isInitReady, 'isConnected', isConnected) |
|
|
|
if (isConnected) { |
|
|
|
if (isInitReady) { |
|
|
|
let lock = that.data.lock |
|
|
|
let superAdmin = [] |
|
|
|
var superAdminIdlist = lock.mac.slice(lock.mac.length - 11, lock.mac.length).split(":").join("") |
|
|
|
for (let i = 0; i < superAdminIdlist.length; i++) { |
|
|
|
if (superAdminIdlist[i] >= 0 && superAdminIdlist[i] <= 9) { |
|
|
|
superAdmin.push(superAdminIdlist[i]) |
|
|
|
} else { |
|
|
|
let adminid = superAdminIdlist.charCodeAt(i) |
|
|
|
superAdmin.push(adminid) |
|
|
|
} |
|
|
|
} |
|
|
|
let superAdminId = superAdmin.join('').slice(superAdmin.length - 8, superAdmin.length) |
|
|
|
basecode = superAdminId |
|
|
|
console.log(basecode,"basecode") |
|
|
|
setTimeout(() => { |
|
|
|
that.doWork() |
|
|
|
}, 500) |
|
|
|