This commit is contained in:
fengerli
2025-11-08 10:33:20 +08:00
44 changed files with 6742 additions and 2545 deletions

File diff suppressed because it is too large Load Diff

View File

@ -240,7 +240,7 @@
</view>
</view>
<!-- ======各个弹框类型======= -->
<CustomPopup :show="currentPopup.show" v-bind="currentPopup.config" @confirm="handleConfirm"
<CustomPopup :show="currentPopup.show" ="currentPopup.config" @confirm="handleConfirm"
@cancel="handleCancel" />
</view>
</view>

View File

@ -1,8 +1,8 @@
<template>
<view class="content contentBg">
<view class="eq">
<view class="leftImg" @click.stop="previewImg(formData.img)">
<image class="img" :src="formData.img?formData.img:'/static/images/4877/4877equip.png'"
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
<image class="img" :src="device.devicePic?device.devicePic:formData.img"
mode="aspectFit"></image>
</view>
<view class="rightTxt">
@ -24,20 +24,24 @@
</view>
<view class="eqinfo">
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{formData.blename}}</text>
<text class="lbl">设备名称</text>
<text class="value">{{device.deviceName}}</text>
</view>
<view class="item">
<text class="lbl">设备名称</text>
<text class="value">{{formData.deviceName}}</text>
</view>
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{device.bluetoothName}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙状态</text>
<text class="value" :class="formData.bleStatu?'green':'red'">{{formData.bleStatu?'已连接':'未连接'}}</text>
</view>
</view>
<view class="warnnig" v-bind:class="formData.sta_SOSType=='sos'?'':'displayNone'"
<view class="warnnig" :class="formData.sta_SOSType=='sos'?'':'displayNone'"
@click.stop="showUnWarn('sos_off')">
<view>设备强制报警中</view>
<view class="netContent">
@ -312,7 +316,7 @@
usrToggle: true,
},
formData: {
img: '/static/images/4877/4877equip.png',
img: '/static/images/common/BJQ4877.png',
sta_PowerPercent: '',
xuhang: '',
blename: '',
@ -439,7 +443,7 @@
}
these.formData.blename = f.name ? f.name : "Unname";
these.formData.deviceName = device.deviceName;
these.formData.img = device.devicePic;
these.formData.bleStatu = false;
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {

View File

@ -1,8 +1,9 @@
<template>
<view class="content contentBg">
<view class="eq">
<view class="leftImg" @click.stop="previewImg(formData.img)">
<image class="img" :src="formData.img" mode="aspectFit"></image>
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<view class="row">
@ -22,18 +23,23 @@
</view>
</view>
<view class="eqinfo">
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{formData.blename}}</text>
</view>
<view class="item">
<text class="lbl">设备名称</text>
<text class="value">{{formData.deviceName}}</text>
<text class="value">{{device.deviceName}}</text>
</view>
<view class="item">
<text class="lbl">充电状态</text>
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<view class="item">
<text class="lbl">设备状态</text>
<text class="value">{{formData.statu}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{device.bluetoothName}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙状态</text>
<text class="value" :class="formData.bleStatu?'green':'red'">{{formData.bleStatu?'已连接':'未连接'}}</text>
@ -227,7 +233,7 @@
}
},
formData: {
img: '',
img: '/static/images/common/HBY6155.png',
battary: '',
xuhang: '',
deviceName: '',
@ -354,7 +360,7 @@
}
these.formData.blename = f.name ? f.name : "Unname";
these.formData.deviceName = device.deviceName;
these.formData.img = device.devicePic;
these.formData.id = device.id;
these.formData.deviceId = f.deviceId;
these.formData.bleStatu = false;

View File

@ -1,22 +0,0 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@ -1,8 +1,8 @@
<template>
<view class="content contentBg">
<view class="eq">
<view class="leftImg" @click.stop="previewImg(formData.img)">
<image class="img" :src="formData.img" mode="aspectFit"></image>
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<view class="row">
@ -22,15 +22,19 @@
</view>
</view>
<view class="eqinfo">
<view class="item">
<text class="lbl">设备名称</text>
<text class="value">{{device.deviceName}}</text>
</view>
<view class="item">
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{formData.blename}}</text>
</view>
<view class="item">
<text class="lbl">设备名称</text>
<text class="value">{{formData.deviceName}}</text>
<text class="value">{{device.bluetoothName}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙状态</text>
<text class="value" :class="formData.bleStatu?'green':'red'">{{formData.bleStatu?'已连接':'未连接'}}</text>
@ -308,7 +312,7 @@
usrToggle: true,
},
formData: {
img: '/static/images/6155/DeviceDetail/equip.png',
img: '/static/images/common/BJQ6331.png',
battary: '',
xuhang: '',
blename: '',
@ -395,7 +399,7 @@
}
these.formData.blename = f.name ? f.name : "Unname";
these.formData.deviceName = device.deviceName;
these.formData.img = device.devicePic;
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {

View File

@ -1,8 +1,8 @@
<template>
<view class="content contentBg">
<view class="eq">
<view class="leftImg" @click.stop="previewImg(formData.img)">
<image class="img" :src="formData.img" mode="aspectFit"></image>
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<view class="row">
@ -24,11 +24,15 @@
<view class="eqinfo">
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{formData.blename}}</text>
<text class="value">{{device.bluetoothName}}</text>
</view>
<view class="item">
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<view class="item">
<text class="lbl">设备名称</text>
<text class="value">{{formData.deviceName}}</text>
<text class="value">{{device.deviceName}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙状态</text>
@ -40,14 +44,14 @@
</view>
</view>
<view class="warnnig" v-bind:class="formData.iswarn?'':'displayNone'">
<view class="warnnig" :class="formData.iswarn?'':'displayNone'">
<view>警告!环境存在漏电电源</view>
<view class="netContent">
<view v-bind:class="getWarnStyle(1)" class="net netone"></view>
<view v-bind:class="getWarnStyle(2)" class="net nettwo"></view>
<view v-bind:class="getWarnStyle(3)" class="net netsiri"></view>
<view v-bind:class="getWarnStyle(4)" class="net netfour"></view>
<view v-bind:class="getWarnStyle(5)" class="net netfive"></view>
<view :class="getWarnStyle(1)" class="net netone"></view>
<view :class="getWarnStyle(2)" class="net nettwo"></view>
<view :class="getWarnStyle(3)" class="net netsiri"></view>
<view :class="getWarnStyle(4)" class="net netfour"></view>
<view :class="getWarnStyle(5)" class="net netfive"></view>
</view>
</view>
@ -250,7 +254,7 @@
usrToggle: true,
},
formData: {
img: '/static/images/6155/DeviceDetail/equip.png',
img: '/static/images/common/HBY650.png',
battary: '',
xuhang: '',
blename: '',
@ -344,7 +348,7 @@
}
these.formData.blename = f.name ? f.name : "Unname";
these.formData.deviceName = device.deviceName;
these.formData.img = device.devicePic;
these.formData.bleStatu = false;
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {

View File

@ -2,10 +2,12 @@
<view class="content contentBg">
<custom-navbar :title="Status.navbar.title" :showBack="Status.navbar.showBack" color="#FFFFFF"
:rightIcons="Status.navbar.icons" @icon-click="handleRightClick"></custom-navbar>
<view>
</view>
<view class="eq" :style="{marginTop:Status.navbar.height+'px'}">
<view class="leftImg" @click.stop="previewImg(device['devicePic'])">
<image class="img" :src="device['devicePic']" mode="aspectFit"></image>
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<view class="row">
@ -25,13 +27,22 @@
</view>
</view>
<view class="eqinfo">
<view class="item">
<text class="lbl">设备名称</text>
<text class="value valueFont">{{device.deviceName}}</text>
</view>
<view class="item">
<text class="lbl">设备IMEI</text>
<text class="value valueFont">{{device.deviceImei}}</text>
</view>
<view class="item">
<text class="lbl">设备名称</text>
<text class="value valueFont">{{device.deviceName}}</text>
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value valueFont">{{device.bluetoothName}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙状态</text>
@ -69,17 +80,17 @@
</view>
</view>
<view class="warnnig" v-bind:class="formData.staticWarn?'':'displayNone'">
<view class="warnnig" :class="formData.staticWarn?'':'displayNone'">
<view>警告设备静止报警中</view>
<view class="netContent">
<view v-bind:class="getWarnStyle(1)" class="net netone"></view>
<view v-bind:class="getWarnStyle(2)" class="net nettwo"></view>
<view v-bind:class="getWarnStyle(3)" class="net netsiri"></view>
<view v-bind:class="getWarnStyle(4)" class="net netfour"></view>
<view v-bind:class="getWarnStyle(5)" class="net netfive"></view>
<view :class="getWarnStyle(1)" class="net netone"></view>
<view :class="getWarnStyle(2)" class="net nettwo"></view>
<view :class="getWarnStyle(3)" class="net netsiri"></view>
<view :class="getWarnStyle(4)" class="net netfour"></view>
<view :class="getWarnStyle(5)" class="net netfive"></view>
</view>
</view>
<view class="warnnig" v-bind:class="(formData.qzwarn && Status.staticWarn.time)?'':'displayNone'"
<view class="warnnig" :class="(formData.qzwarn && Status.staticWarn.time)?'':'displayNone'"
@click="CloseWarn(true)">
<view>设备强制报警中</view>
<view class="netContent">
@ -378,6 +389,7 @@
bleLinkCnt: 0
},
formData: {
img:'/static/images/common/HBY670.png',
battary: "", //电量
xuhang: "", //续航
imei: "", //imei
@ -514,6 +526,7 @@
let keys = Object.keys(form);
for (var i = keys.length; i >= 0; i--) {
let key = keys[i];
these.formData[key] = form[key];
}
}

File diff suppressed because it is too large Load Diff

View File

@ -6,21 +6,21 @@
</image>
</view>
<view class="deviceName">
蓝牙名:{{device.name}}
蓝牙名:{{serverDevice?serverDevice['bluetoothName']: device.name}}
</view>
<view class="deviceName">
状态:{{deviceStatu}}
</view>
<view class="deviceName">
设备名:{{device.deviceName}}
设备名:{{serverDevice?serverDevice['deviceName']:device.deviceName}}
</view>
<view class="deviceId">
设备Mac:{{device.macAddress}}
设备Mac:{{serverDevice?serverDevice['deviceMac']:device.macAddress}}
</view>
<view class="deviceId">
设备IMEI:{{device.imei}}
设备IMEI:{{serverDevice?serverDevice['deviceImei']:device.imei}}
</view>
<view class="bound" v-bind:class="boundStatu">
<view class="bound" :class="boundStatu">
{{Statu.boundRemark}}
</view>
</view>
@ -84,17 +84,18 @@
}
},
deviceStatu: function() {
if (!this.device.name) {
debugger;
if (!this.device.name && !this.device.macAddress) {
return "";
}
if (!this.device.linkStatu) {
if (!this.device.linkStatu && !this.device.macAddress) {
return "蓝牙未连接";
}
if (!this.device.macAddress) {
return '等待设备上报Mac地址';
}
if (!this.device.deviceName) {
if (!this.device.deviceName && !(this.serverDevice && this.serverDevice.deviceName)) {
if (this.Statu.isSearch) {
return "无效设备";
} else {
@ -105,7 +106,10 @@
}
}
} else {
return "找到有效设备"
return "找到有效设备"
}
return "";
@ -192,30 +196,39 @@
}
}, pagePath);
eventChannel = this.getOpenerEventChannel();
eventChannel.on('LinkItem', function(data) {
console.log("data=", data);
let f = ble.data.LinkedList.find((v) => {
return v.deviceId == data.deviceId;
});
if (f) {
let keys = Object.keys(f);
keys.forEach((v, index) => {
these.device[v] = f[v];
})
// console.log("LinkedList=", ble.data.LinkedList)
// console.log("f=", f);
// console.log("获取到设备", these.device);
if (f.macAddress) {
these.device.macAddress = f.macAddress;
these.initDevice();
if(option.mac){
this.device.macAddress=option.mac;
these.initDevice();
}
else{
eventChannel.on('LinkItem', function(data) {
console.log("data=", data);
let f = ble.data.LinkedList.find((v) => {
return v.deviceId == data.deviceId;
});
if (f) {
let keys = Object.keys(f);
keys.forEach((v, index) => {
these.device[v] = f[v];
})
// console.log("LinkedList=", ble.data.LinkedList)
// console.log("f=", f);
// console.log("获取到设备", these.device);
if (f.macAddress) {
these.device.macAddress = f.macAddress;
these.initDevice();
}
} else {
console.log("未获取到设备");
}
} else {
console.log("未获取到设备");
}
})
let inteval = setInterval(this.initDevice, 10000);
})
let inteval = setInterval(this.initDevice, 10000);
}
},
methods: {
reLinkdevice() {
@ -281,6 +294,7 @@
deviceInvalid();
}
} else {
this.serverDevice =null;
deviceInvalid();
}
@ -297,21 +311,21 @@
},
Link() {
// 调用绑定设备接口
let f = ble.data.LinkedList.find((v) => {
return v.deviceId == these.device.deviceId;
});
if (!f) {
// let f = ble.data.LinkedList.find((v) => {
// return v.deviceId == these.device.deviceId;
// });
// if (!f) {
// these.Statu.bound = false;
// these.Statu.boundRemark = "蓝牙连接不成功";
// return;
// }
if (!this.device.macAddress) {
these.Statu.bound = false;
these.Statu.boundRemark = "蓝牙连接不成功";
these.Statu.boundRemark = "获取设备Mac地址异常";
return;
}
if (!f.macAddress) {
these.Statu.bound = false;
these.Statu.boundRemark = "设备上报Mac地址异常";
return;
}
if (!this.device.deviceName) {
if (!this.serverDevice) {
these.Statu.bound = false;
these.Statu.boundRemark = "设备未入库";
return;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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) => {