1
0
forked from dyf/APP

完善6170报警功能,图片压缩大小

This commit is contained in:
fengerli
2025-08-04 15:49:17 +08:00
parent c15e7b4aad
commit afc79db6bb
64 changed files with 11186 additions and 5867 deletions

View File

@ -18,7 +18,7 @@
<image src="/static/images/common/more.png" mode="aspectFit" class="more"></image>
</view>
</view>
<view class="sendFlex" v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0">
<view class="sendFlex" v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0 && activeTabInfo.typeName=='BJQ6170'">
<view class="callpolice" @click="callpolice">报警</view>
<view class="Sendmessage" @click="location">位置</view>
<view class="Sendmessage" @click="handleSend">发送信息</view>
@ -29,7 +29,7 @@
<uni-swipe-action ref="swipeAction">
<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">
@click="handleSwipeClick($event, item, index)" class="device-card" :style="{ border: item.communicationMode==0 && item.onlineStatus==1 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
@ -51,7 +51,8 @@
</view>
</view>
</view>
<view class="" v-if="item.communicationMode==1">
<view class="device-callpolice" v-if="item.communicationMode==0 && item.onlineStatus==1">报警中</view>
<view v-if="item.communicationMode==1">
<view class="device-status online">已连接</view>
<view class="device-status unline">未连接</view>
</view>
@ -253,6 +254,7 @@
},
// tab切换页
switchTab(tab, index) {
console.log(tab,'tab');
this.deviceList = [];
this.activeTab = index;
this.activeTabInfo = tab
@ -405,7 +407,7 @@
// 报警
callpolice(){
const currentTab = this.tabs[this.activeTab];
const deviceType = currentTab.id || 'all';
const deviceType = currentTab.id || '';
console.log(`跳转到发送信息页面\n当前设备类型: ${deviceType}\n设备类型名称: ${currentTab.typeName}`);
uni.navigateTo({
url: '/pages/6170/callPolice/index',
@ -422,7 +424,7 @@
// 发生短信
handleSend() {
const currentTab = this.tabs[this.activeTab];
const deviceType = currentTab.id || 'all';
const deviceType = currentTab.id || '';
console.log(`跳转到发送信息页面\n当前设备类型: ${deviceType}\n设备类型名称: ${currentTab.typeName}`);
uni.navigateTo({
url: '/pages/common/send/index',
@ -443,7 +445,7 @@
})
},
handleFile(item) {
//console.log('item' + JSON.stringify(item));
console.log('item', item);
// communicationMode 0是4G 1是蓝牙,考虑多个4g设备
if (item.typeName == 'BJQ6170') {
uni.navigateTo({
@ -460,6 +462,8 @@
}
})
} else if (item.typeName == 'HBY210') {
const currentTab = this.tabs[this.activeTab];
const deviceType = currentTab.id || '';
uni.navigateTo({
url: "/pages/210/deviceControl/index",
events: {
@ -469,6 +473,7 @@
// 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', {
data: item,
deviceType:deviceType
});
}
})
@ -501,7 +506,7 @@
// 示例:如果消息包含特定字段,则更新设备状态
return {
...item,
//status: data.message.status || item.status, // 假设消息中有status字段
status: data.message.status || item.status, // 假设消息中有status字段
lastUpdate: data.timestamp // 更新时间戳
};
}
@ -611,14 +616,6 @@
width: 40rpx;
height: 8rpx;
}
.gprs {
width: 28rpx;
height: 35rpx;
position: absolute;
left: 50rpx
}
.Sendmessage {
margin-left: 50rpx;
color: rgba(255, 255, 255, 0.87);
@ -665,7 +662,19 @@
position: relative;
}
.device-callpolice{
width: 122rpx;
height: 52rpx;
font-size: 24rpx;
border-radius: 0px 8px 0px 8px;
background-color: rgba(224, 52, 52, 1);
position: absolute;
top: 0rpx;
right: -4rpx;
text-align: center;
line-height: 52rpx;
color: #fff;
}
.device-status {
width: 122rpx;
height: 52rpx;