完成100
This commit is contained in:
@ -333,8 +333,8 @@
|
||||
this.total = 0; // 重置总数
|
||||
const deviceType = tab.id === '' ? undefined : tab.id;
|
||||
this.$nextTick(() => {
|
||||
this.getSystemInfoSyncH();
|
||||
});
|
||||
this.getSystemInfoSyncH();
|
||||
});
|
||||
this.getData(deviceType);
|
||||
if (this.mescroll) {
|
||||
this.mescroll.resetUpScroll();
|
||||
@ -400,9 +400,54 @@
|
||||
case 'scan':
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
const cleanedResult = res.result.trim();
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`
|
||||
let cleanedResult = res.result.trim();
|
||||
console.log("scanResult=", cleanedResult);
|
||||
let promise = new Promise((resolve, reject) => {
|
||||
let url = '';
|
||||
try {
|
||||
let json = JSON.parse(cleanedResult);
|
||||
console.log("json=", json);
|
||||
if ('blue' in json) {
|
||||
let mac = json.blue;
|
||||
if (mac) {
|
||||
if (!mac.includes(':')) {
|
||||
mac = mac.replace(/(.{2})/g,'$1:').slice(0,-1)
|
||||
}
|
||||
url =`/pages/common/addBLE/LinkBle?mac=${encodeURIComponent(mac)}`;
|
||||
console.log("蓝牙设备",mac);
|
||||
}
|
||||
|
||||
|
||||
} else if ('imei' in json) {
|
||||
let imei = json.imei;
|
||||
if (iemi) {
|
||||
url =
|
||||
`/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(imei)}`;
|
||||
console.log("4G设备:",imei)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error("识别二维码失败,",error);
|
||||
} finally {
|
||||
|
||||
if(!url){
|
||||
url =
|
||||
`/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`
|
||||
console.log("未知设备:",cleanedResult)
|
||||
}
|
||||
|
||||
resolve(url);
|
||||
}
|
||||
});
|
||||
promise.then(res => {
|
||||
uni.navigateTo({
|
||||
url: res
|
||||
});
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
@ -456,9 +501,9 @@
|
||||
if (this.$refs.swipeAction) {
|
||||
this.$refs.swipeAction.closeAll();
|
||||
}
|
||||
console.log("111111",this.deviceId);
|
||||
console.log("ble==null,",ble)
|
||||
ble && ble.DropDevice(null,this.deviceId.id);
|
||||
console.log("111111", this.deviceId);
|
||||
console.log("ble==null,", ble)
|
||||
ble && ble.DropDevice(null, this.deviceId.id);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
@ -541,10 +586,10 @@
|
||||
// 列表跳转
|
||||
handleFile(item) {
|
||||
let url = item.detailPageUrl;
|
||||
|
||||
|
||||
// url="/pages/6331/BJQ6331";
|
||||
|
||||
|
||||
|
||||
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
|
||||
Reference in New Issue
Block a user