1
0
forked from dyf/APP

合并版本

This commit is contained in:
liub
2025-08-15 11:09:06 +08:00
parent 4df8330738
commit 6ef2bb08b9
3 changed files with 1474 additions and 1339 deletions

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
<uni-swipe-action-item :right-options="Options"
@click="handleSwipeClick($event, item, index)" class="device-card"
:style="{ border: item.communicationMode==0 && item.onlineStatus==0 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
:style="{ border: item.communicationMode==0 && item.onlineStatus==1 && item.alarmStatus==1 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
@ -54,7 +54,8 @@
</view>
</view>
<view class="device-callpolice"
v-if="item.communicationMode==0 && item.onlineStatus==0">报警中</view>
v-if="item.communicationMode==0 && item.onlineStatus==1 && item.alarmStatus==1">
报警中</view>
<view v-if="item.communicationMode==1">
<view class="device-status online">已连接</view>
<view class="device-status unline">未连接</view>
@ -144,6 +145,10 @@
deviceReName
} from '@/api/common/index.js'
export default {
onPullDownRefresh() {
// 执行下拉刷新时的操作,比如重新获取数据
this.onIntall();
},
data() {
return {
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
@ -313,16 +318,18 @@
this.showTooltip = false; // 关闭弹窗
switch (item.action) {
case 'scan':
// uni.navigateTo({
// url: '/pages/common/scan/scan'
// });
// 扫一扫
uni.scanCode({
success: (res) => {
console.log('条码内容:' + res.result);
console.log('条码内容:', res);
// 清除之前的数据
this.previousScanResult = null;
// 处理新的扫码结果
const cleanedResult = res.result.trim();
console.log('扫码结果:', cleanedResult);
// 跳转并传递扫描结果
uni.navigateTo({
url: `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(res.result)}`
url: `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(cleanedResult)}`
});
},
fail: (err) => {
@ -438,7 +445,7 @@
},
success: (res) => {
res.eventChannel.emit('devicePolice', {
data: deviceType
data: currentTab
});
}
})
@ -455,7 +462,8 @@
},
success: (res) => {
res.eventChannel.emit('deviceSend', {
data: deviceType
//data: deviceType,
data: currentTab
});
}
})
@ -475,72 +483,33 @@
}
})
},
// 列表跳转
handleFile(item) {
// communicationMode 0是4G 1是蓝牙,考虑多个4g设备
console.log("item=",item);
if (item.typeName == 'BJQ6170') {
uni.navigateTo({
url: "/pages/6170/deviceControl/index",
events: {
ack: function(data) {}
},
success: (res) => {
// 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', {
data: item,
apiType: 'listA' // 自定义标识,详情哪里根据这个参数不同信息
});
}
})
} else if (item.typeName == 'HBY210') {
const currentTab = this.tabs[this.activeTab];
const deviceType = currentTab.id || '';
uni.navigateTo({
url: "/pages/210/deviceControl/index",
events: {
ack: function(data) {}
},
success: (res) => {
// 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', {
data: item,
deviceType: deviceType,
apiType: 'listA' // 自定义标识
});
}
})
}
else if (item.typeName == '6155') {
uni.navigateTo({
url: "/pages/6155/deviceDetail",
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('deviceControl', {
data: item
});
}
})
}
else if (item.typeName == '650') {
uni.navigateTo({
url: "/pages/650/HBY650",
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('deviceControl', {
data: item
});
}
})
}
let url = item.detailPageUrl;
uni.navigateTo({
url: url,
events: {
ack: function(data) {}
},
success: (res) => {
// 页面跳转成功后的回调函数
res.eventChannel.emit('detailData', {
data: item,
deviceType: this.tabs[this.activeTab].id || '',
apiType: 'listA' //标识,根据这个参数,区分普通详情,分享跳转详情,查不一样的权限信息
});
}
})
},
onIntall() {
this.page = 1;
this.finished = false;
this.getData(this.deviceType); // 重新加载第一页数据
const deviceType = this.activeTabInfo?.id === '' ? undefined : this.activeTabInfo?.id;
this.getData(deviceType); // 重新加载第一页数据
setTimeout(() => {
// 停止下拉刷新动画
uni.stopPullDownRefresh();
}, 800);
},
updateDeviceStatus(data) {
this.deviceList = this.deviceList