6170增加强制报警页面功能

This commit is contained in:
fengerli
2025-08-02 16:32:48 +08:00
parent d0aca9e730
commit c15e7b4aad
9 changed files with 855 additions and 241 deletions

View File

@ -25,7 +25,7 @@
<view class="battery-v1">
<image src="/static/images/common/nz.png" class="dlIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">1小时</view>
<view class="battery-v2">{{deviceInfo.batteryRemainingTime}}分钟</view>
<view class="battery-v3">续航时间</view>
</view>
</view>
@ -58,17 +58,24 @@
</view>
<!-- ===========主副机选择============= -->
<view class="mode-section">
<view class="radio-group">
<view v-for="(item, index) in radioList" :key="index" @click="handleRadioSelect(index)"
class="group-item">
<view class="radio-icon" :class="{ 'selected': radioSelected === index }">
{{ item }}
<view class="uni-border"></view>
</view>
</view>
</view>
</view>
<!-- 灯光模式选择 -->
<view class="mode-section">
<view class="mode-buttons">
<view class="mode-v1">
<view class="mode-v2" @click="selectMode('main')">
<view class="mode-v2" @click="selectMode">
<image src="/static/images/210/lj.png" class="setIMG"></image>
<view>
<view class="battery-v2">灯光模式</view>
<view class="mode-v3">{{ currentMainMode }}</view>
<view class="battery-v2">联机设备</view>
</view>
</view>
</view>
@ -115,7 +122,7 @@
</view>
</view>
</view>
</view>
</view>
@ -278,9 +285,7 @@
secondaryMode: 'string',
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
navTitle: "",
lightModeA: false,
currentMainMode: '强光',
lightModeB: false,
lightModeC: false, //激光提示框
items: [],
@ -306,12 +311,9 @@
showUploadPopup: false,
selectedImage: null, // 添加这个变量来存储选择的图片
file: '',
selectedItemIndex: 0
}
},
computed: {
popupTitle() {
return this.modeType === 'main' ? '灯光模式' : '激光模式';
selectedItemIndex: 0,
radioList: ['M', 'S'],
radioSelected: 0, // -1表示未选中任何项
}
},
methods: {
@ -321,48 +323,21 @@
this.lightModeB = false;
this.lightModeC = false;
},
handleRadioSelect(index) {
this.radioSelected = index;
console.log('选中了单选选项:', this.radioList[index]);
},
// *******定位******
gpsPosition() {
uni.navigateTo({
url: '/pages/common/map/index'
})
},
selectMode(type) {
this.modeType = type;
this.lightModeA = true;
if (type === 'main') {
this.items = [{
text: '强光',
selected: this.currentMainMode === '强光', // 修正匹配条件
image: '/static/images/sett.png',
instructValue: '1'
},
{
text: '弱光',
selected: this.currentMainMode === '弱光',
image: '/static/images/rg.png',
instructValue: '2'
},
{
text: '爆闪',
selected: this.currentMainMode === '爆闪',
image: '/static/images/bs.png',
instructValue: '3'
},
{
text: '泛光',
selected: this.currentMainMode === '泛光',
image: '/static/images/settt.png',
instructValue: '4'
},
{
text: '关闭',
selected: this.currentMainMode === '关闭',
image: '/static/images/close.png',
instructValue: '0'
},
];
}
// 联机设备
selectMode() {
uni.navigateTo({
url:'/pages/210/onlineDevice/index'
})
},
// 人员信息登录
toggleForm() {
@ -488,7 +463,7 @@
// 显示上传中加载提示
uni.showLoading({
title: '上传中...',
mask: true
mask: true
});
uni.uploadFile({
@ -717,7 +692,7 @@
});
});
});
this.fetchDeviceDetail(data.data.id)
this.fetchDeviceDetail(data.data.id)
});
// 如果需要向调用页面返回数据,可以触发 'ack' 事件
@ -857,6 +832,41 @@
padding-top: 10rpx;
}
.radio-group {
display: flex;
gap: 12px;
align-items: center;
margin-bottom: 20rpx;
font-size:200rpx;
}
.group-item {
background: rgba(26, 26, 26, 1);
width: 100%;
height: 136rpx;
border-radius: 72rpx;
text-align: center;
line-height:136rpx;
position: relative;
}
.radio-icon.selected {
background-color: rgba(174, 214, 0, 1);
transition: background-color 0.3s;
border-radius: 72rpx;
}
.radio-icon{
font-size:50rpx;
}
.uni-border{
border:4rpx solid rgba(26, 26, 26, 1);
width:96%;
height:123rpx;
position: absolute;
top:7rpx;
left:6rpx;
border-radius:72rpx;
}
.info-card {
background-color: rgb(26, 26, 26);
border-radius: 16rpx;
@ -885,10 +895,12 @@
color: rgba(255, 255, 255, 0.6);
text-align: end;
}
.status-greend{
.status-greend {
color: rgba(174, 214, 0, 1);
text-align: end;
}
.light {
position: absolute;
/* top:10rpx; */

View File

@ -0,0 +1,241 @@
<template>
<view>
<view class="device-page">
<view class="sendFlex">
<view class="Sendmessage" @click="location">呼叫</view>
<view class="Sendmessage" @click="handleSend">发送信息</view>
</view>
<scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100"
style="height:80vh;">
<view v-if="deviceList.length>0">
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index" class="device-card">
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
</view>
<view class="device-name">
<view>设备:{{item.deviceName}}</view>
<view class="ID">
<view class="ID">ID:{{item.deviceImei}}
</view>
<!-- 在线状态 -->
<view class="onlines">在线</view>
<!-- 离线状态 -->
<view class="offlines" v-if="item.onlineStatus==0">离线</view>
<view>电量{{item.battery || '0'}}%</view>
</view>
</view>
</view>
<view>
<view class="device-status">1</view>
</view>
</view>
</block>
</view>
<view class="content1" @click="addvideo">
<image src="/static/images/common/path1.png" class="path1"></image>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
deviceID: '',
deviceList:[],
loading:false
}
},
methods: {
// 添加视频
addvideo() {
uni.navigateTo({
url: `/pages/common/addvideo/index??id=${this.deviceID}`
})
},
getData() {
let data = {
deviceId: this.deviceID
}
},
// 发生短信
handleSend() {
console.log(`跳转到发送信息页面\n当前设备类型: ${deviceType}\n设备类型名称: ${currentTab.typeName}`);
uni.navigateTo({
url: '/pages/common/send/index',
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('deviceSend', {
});
}
})
},
},
onShow() {
this.getData()
},
onLoad(options) {
this.deviceID = options.id
}
}
</script>
<style scoped>
/* 页面整体样式 */
.device-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
.sendFlex {
display: flex;
color: rgba(255, 255, 255, 0.87);
justify-content: flex-end;
cursor: pointer;
margin-bottom: 30rpx;
font-size: 28rpx;
}
/* 设备卡片 */
.device-card {
background-color: rgb(26, 26, 26);
border-radius: 16rpx;
margin-bottom: 20rpx;
box-sizing: border-box;
position: relative;
}
.device-header {
display: flex;
align-items: center;
margin-bottom: 15rpx;
padding: 30rpx 0 10rpx 30rpx;
}
.device-name {
font-size: 32rpx;
color: rgba(255, 255, 255, 0.87);
margin-left: 24rpx;
line-height: 50rpx;
width: 75%;
white-space: nowrap;
}
.ID {
color: rgba(255, 255, 255, 0.6);
font-size: 26rpx;
display: flex;
justify-content: space-between;
position: relative;
}
.device-status {
width: 122rpx;
height: 52rpx;
font-size: 26rpx;
border-radius: 0px 8px 0px 8px;
background-color: rgb(42, 42, 42);
position: absolute;
top: 0rpx;
right: 0rpx;
text-align: center;
line-height: 52rpx;
color: rgba(255, 255, 255, 0.8)
}
.circle {
width: 8rpx;
height: 40rpx;
position: absolute;
right: 25rpx;
top: 60rpx;
}
.device-id {
font-size: 26rpx;
color: #999;
margin-bottom: 20rpx;
display: block;
}
.device-info {
display: flex;
justify-content: space-evenly;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.87);
position: relative;
padding: 0rpx 0rpx 30rpx 30rpx;
}
.deviceIMG {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
position: relative;
background-color: rgba(42, 42, 42, 0.6);
display: flex;
align-items: center;
}
.IMG {
width: 68rpx;
height: 50rpx;
margin-left: 17%;
object-fit: contain;
}
.onlines {
position: relative;
}
.onlines::before {
content: '';
position: absolute;
width: 15rpx;
height: 15rpx;
background: rgb(0, 171, 103);
border-radius: 50%;
top: 20rpx;
left: -20rpx
}
.offlines{
position: relative;
}
.offlines::before {
content: '';
position: absolute;
width: 15rpx;
height: 15rpx;
background: rgba(255, 255, 255, 0.4);
border-radius: 50%;
top: 20rpx;
left: -20rpx
}
.content1 {
height: 160rpx;
background: rgb(26, 26, 26);
border-radius: 16rpx;
text-align: center;
line-height: 200rpx;
}
.Sendmessage {
margin-left: 50rpx;
color: rgba(255, 255, 255, 0.87);
}
.path1 {
width: 62rpx;
height: 62rpx;
}
</style>