1
0
forked from dyf/APP

设备发送

This commit is contained in:
fengerli
2025-08-14 16:05:16 +08:00
parent a773823c3f
commit 9bac0995a3
3 changed files with 1363 additions and 1357 deletions

View File

@ -66,7 +66,6 @@
data() { data() {
return { return {
deviceList: [], deviceList: [],
messageToSend: '', //发送信息
showPopupFlag: false, showPopupFlag: false,
popupTitle: '', popupTitle: '',
popupMessage: '确认要对所选设备开启强制报警?', popupMessage: '确认要对所选设备开启强制报警?',
@ -88,7 +87,7 @@
* @param {string} batchId - 批次ID * @param {string} batchId - 批次ID
* @param {number} [interval=1000] - 轮询间隔(毫秒) * @param {number} [interval=1000] - 轮询间隔(毫秒)
*/ */
async getdeviceSTatus(val, batchId, interval =800) { async getdeviceSTatus(val, batchId, interval = 800) {
let retries = 0; let retries = 0;
const checkStatus = async () => { const checkStatus = async () => {
try { try {
@ -163,7 +162,6 @@
// 强制报警 // 强制报警
forceAlarm() { forceAlarm() {
const selectedDevices = this.deviceList.filter(item => item.checked) const selectedDevices = this.deviceList.filter(item => item.checked)
const deviceIds = selectedDevices.map(item => item.id);
if (selectedDevices.length === 0) { if (selectedDevices.length === 0) {
uni.showToast({ uni.showToast({
title: '请选择一个设备', title: '请选择一个设备',
@ -192,25 +190,25 @@
this.showPopupFlag = true; this.showPopupFlag = true;
this.pendingAlarmAction = 0 this.pendingAlarmAction = 0
}, },
async sendAlarmCommand(type) { // 确认
async sendAlarmCommand() {
const selectedDevices = this.deviceList.filter(item => item.checked); const selectedDevices = this.deviceList.filter(item => item.checked);
const deviceIds = selectedDevices.map(item => item.id); const deviceIds = selectedDevices.map(item => item.id);
const deviceImeiList = selectedDevices.map(item => item.deviceImei); const deviceImeiList = selectedDevices.map(item => item.deviceImei);
let loadingShown = false; const isAlarming = this.pendingAlarmAction == 1;
try { try {
uni.showLoading({ uni.showLoading({
title: '报警中...', title: isAlarming ? '设备报警中...' : '解除报警中...',
mask: true mask: true
}); });
loadingShown = true;
// 2. 准备请求数据 // 2. 准备请求数据
const batchId = generateShortId(); const batchId = generateShortId();
const data = { const data = {
sendMsg: this.messageToSend,
deviceIds: deviceIds, deviceIds: deviceIds,
batchId: batchId, batchId: batchId,
typeName: this.sendInfo.typeName, typeName: this.sendInfo.typeName,
deviceImeiList: deviceImeiList deviceImeiList: deviceImeiList,
instructValue: this.pendingAlarmAction == 1 ? '1' : '0'
}; };
// 3.人员信息 // 3.人员信息
const registerRes = await deviceSendAlarmMessage(data); const registerRes = await deviceSendAlarmMessage(data);

View File

@ -63,11 +63,9 @@
{{ deviceInfo.address }} {{ deviceInfo.address }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="callpolice" v-if="deviceInfo.onlineStatus == 0 && deviceInfo.alarmStatus == 1"> <view class="callpolice" v-if="deviceInfo.onlineStatus == 1 && deviceInfo.alarmStatus == 1">
<view class="">设备强制报警中</view> <view class="">设备强制报警中</view>
<view> <view>
<uni-icons type="closeempty" size="15" color="rgba(255, 255, 255, 0.9)" <uni-icons type="closeempty" size="15" color="rgba(255, 255, 255, 0.9)"
@ -78,8 +76,6 @@
<text class="info-label">灯光亮度</text> <text class="info-label">灯光亮度</text>
<text class="info-value status-running">{{ sliderValue }}%</text> <text class="info-value status-running">{{ sliderValue }}%</text>
</view> </view>
<!-- 灯光亮度控制 --> <!-- 灯光亮度控制 -->
<view class="control-card" @touchstart="cardTouchStart" @touchmove="cardTouchMove" <view class="control-card" @touchstart="cardTouchStart" @touchmove="cardTouchMove"
@touchend="cardTouchEnd"> @touchend="cardTouchEnd">
@ -164,8 +160,7 @@
</view> </view>
<view class="form-row"> <view class="form-row">
<input class="form-input1" maxlength="20" placeholder="请输入文字" v-model="messageToSend" <input class="form-input1" maxlength="20" placeholder="请输入文字" v-model="messageToSend" />
@input="filterChinese" />
</view> </view>
</view> </view>
<!-- 产品信息 --> <!-- 产品信息 -->
@ -274,11 +269,11 @@
</template> </template>
<script> <script>
import MqttClient from '@/utils/mqtt.js'; import MqttClient from '@/utils/mqtt.js';
import { import {
generateShortId generateShortId
} from '@/utils/function.js'; } from '@/utils/function.js';
import { import {
deviceDetail, deviceDetail,
registerPersonInfo, registerPersonInfo,
deviceSendMessage, deviceSendMessage,
@ -287,16 +282,16 @@
laserModeSettings, //激光模式设置 laserModeSettings, //激光模式设置
lightBrightnessSettings, //灯光亮度设置 lightBrightnessSettings, //灯光亮度设置
deviceRealTimeStatus //设备状态 deviceRealTimeStatus //设备状态
} from '@/api/6170/deviceControl.js' } from '@/api/6170/deviceControl.js'
import { import {
baseURL, baseURL,
getToken, getToken,
clientid clientid
} from '@/utils/request' } from '@/utils/request'
import { import {
deviceSendAlarmMessage deviceSendAlarmMessage
} from '@/api/6170/callPolice.js' } from '@/api/6170/callPolice.js'
export default { export default {
data() { data() {
return { return {
lastBrightnessTime: 0, lastBrightnessTime: 0,
@ -390,15 +385,6 @@
}; };
return checkStatus(); return checkStatus();
}, },
filterChinese(e) {
const value = e.detail.value;
// 允许中文和常见中文标点
this.messageToSend = value.replace(/[^\u4e00-\u9fa5“”【】《》…—]/g, '');
// 修复某些平台输入法兼容性问题
this.$nextTick(() => {
e.target.value = this.messageToSend;
});
},
// 点击弹框外的区域关闭 // 点击弹框外的区域关闭
closePopup() { closePopup() {
this.lightModeA = false; this.lightModeA = false;
@ -413,7 +399,7 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/common/map/index', url: '/pages/common/map/index',
events: { events: {
ack: function(data) {} ack: function (data) { }
}, },
success: (res) => { success: (res) => {
res.eventChannel.emit('Map', { res.eventChannel.emit('Map', {
@ -422,12 +408,7 @@
} }
}) })
}, },
// 强制报警()
handlePolice() {
this.popupType = 'cancel';
this.popupMessage = '确认要解除所选设备的报警状态';
this.showPopupFlag = true;
},
// ***********进度条*********** // ***********进度条***********
cardTouchStart(e) { cardTouchStart(e) {
if (!this.cardRect) return; if (!this.cardRect) return;
@ -803,7 +784,7 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/6170/share/index', url: '/pages/6170/share/index',
events: { events: {
ack: function(data) {} ack: function (data) { }
}, },
success: (res) => { success: (res) => {
res.eventChannel.emit('share', { res.eventChannel.emit('share', {
@ -891,34 +872,61 @@
this.isSending = false; this.isSending = false;
} }
}, },
// 所有弹框,确定关闭按钮
onPopupConfirm() { onPopupConfirm() {
this.showPopupFlag = false this.showPopupFlag = false
}, },
// 解除报警 // 强制报警()
onPopupConfirmPolice() { handlePolice() {
let data = { this.popupType = 'cancel';
this.popupMessage = '确认要解除所选设备的报警状态';
this.showPopupFlag = true;
},
// 解除报警逻辑
async onPopupConfirmPolice() {
try {
uni.showLoading({
title: '解除告警中...',
mask: true
});
// 2. 准备请求数据
const batchId = generateShortId();
const data = {
deviceIds: this.apiType === 'listA' ? [this.deviceID] : [this.itemInfo.deviceId], deviceIds: this.apiType === 'listA' ? [this.deviceID] : [this.itemInfo.deviceId],
batchId: batchId,
typeName: this.itemInfo.typeName,
deviceImeiList: [this.itemInfo.deviceImei],
instructValue: 0, // '解除报警' instructValue: 0, // '解除报警'
} };
deviceSendAlarmMessage(data).then((res) => { // 3.人员信息
if (res.code == 200) { const registerRes = await deviceSendAlarmMessage(data);
if (registerRes.code !== 200) {
uni.showToast({ uni.showToast({
title: res.msg, title: registerRes.msg,
icon: 'none'
})
return
}
// 4. 获取设备状态 批量的报警解除报警发送信息都传2单次的都传1
const statusRes = await this.getdeviceSTatus(2, batchId);
if (statusRes.data.functionAccess === 'OK') {
uni.showToast({
title: statusRes.msg,
icon: 'none' icon: 'none'
}); });
this.showPopupFlag = false // 刷新详情接口
setTimeout(() => {
this.fetchDeviceDetail(this.deviceID); this.fetchDeviceDetail(this.deviceID);
uni.$emit('deviceStatusUpdate', {}); uni.$emit('deviceStatusUpdate', {});
}, 500) this.showPopupFlag = false
}
} else { } catch (error) {
uni.showToast({ uni.showToast({
title: res.msg, title: error.message,
icon: 'none' icon: 'none'
}); });
} finally {
uni.hideLoading();
} }
});
}, },
// 发送文本消息 // 发送文本消息
async sendTextMessage() { async sendTextMessage() {
@ -1129,11 +1137,11 @@
} }
}, },
} }
</script> </script>
<style scoped> <style scoped>
.page-loading-mask { .page-loading-mask {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@ -1144,36 +1152,36 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 9999; z-index: 9999;
} }
/* 优化权限控制区域的显示 */ /* 优化权限控制区域的显示 */
.mode-section, .mode-section,
.form-section { .form-section {
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
} }
.device-detail-container { .device-detail-container {
padding: 30rpx; padding: 30rpx;
background: #121212; background: #121212;
min-height: 100vh; min-height: 100vh;
} }
.status-bar { .status-bar {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
.time { .time {
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
} }
.battery { .battery {
font-size: 36rpx; font-size: 36rpx;
} }
.battery-section { .battery-section {
background-color: rgb(26, 26, 26); background-color: rgb(26, 26, 26);
border-radius: 16rpx; border-radius: 16rpx;
padding: 30rpx; padding: 30rpx;
@ -1181,38 +1189,38 @@
justify-content: space-between; justify-content: space-between;
margin-bottom: 20rpx; margin-bottom: 20rpx;
align-items: center; align-items: center;
} }
.battery-info, .battery-info,
.duration { .duration {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.bipImg { .bipImg {
width: 204rpx; width: 204rpx;
height: 144rpx; height: 144rpx;
margin-top: 30rpx; margin-top: 30rpx;
} }
.dlIMG { .dlIMG {
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
} }
.chargeStateIMG { .chargeStateIMG {
width: 27rpx; width: 27rpx;
height: 37rpx; height: 37rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
.cpIMG { .cpIMG {
width: 66rpx; width: 66rpx;
height: 66rpx; height: 66rpx;
} }
.battery-sectionLeft { .battery-sectionLeft {
width: 308rpx; width: 308rpx;
height: 220rpx; height: 220rpx;
background: rgba(42, 42, 42, 0.5); background: rgba(42, 42, 42, 0.5);
@ -1220,121 +1228,121 @@
text-align: center; text-align: center;
align-items: center; align-items: center;
line-height: 220rpx; line-height: 220rpx;
} }
.percentage { .percentage {
font-size: 48rpx; font-size: 48rpx;
font-weight: bold; font-weight: bold;
color: #007AFF; color: #007AFF;
} }
.label { .label {
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
margin-top: 10rpx; margin-top: 10rpx;
} }
.battery-v1 { .battery-v1 {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.battery-v2 { .battery-v2 {
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
margin-left: 18rpx; margin-left: 18rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.battery-v3 { .battery-v3 {
color: rgba(255, 255, 255, 0.6); color: rgba(255, 255, 255, 0.6);
margin-left: 25rpx; margin-left: 25rpx;
font-size: 26rpx; font-size: 26rpx;
} }
.mode-v3 { .mode-v3 {
color: rgba(255, 255, 255, 0.6); color: rgba(255, 255, 255, 0.6);
font-size: 26rpx; font-size: 26rpx;
padding-top: 10rpx; padding-top: 10rpx;
} }
.info-card { .info-card {
background-color: rgb(26, 26, 26); background-color: rgb(26, 26, 26);
border-radius: 16rpx; border-radius: 16rpx;
padding: 10rpx 20rpx 5rpx 20rpx; padding: 10rpx 20rpx 5rpx 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.info-row { .info-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.info-label { .info-label {
font-size: 28rpx; font-size: 28rpx;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
white-space: nowrap; white-space: nowrap;
} }
.info-value { .info-value {
font-size: 28rpx; font-size: 28rpx;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
} }
.status-running { .status-running {
color: rgba(255, 255, 255, 0.6); color: rgba(255, 255, 255, 0.6);
text-align: end; text-align: end;
} }
.locationGPS { .locationGPS {
width: 88%; width: 88%;
text-align: end; text-align: end;
float: right; float: right;
line-height: 50rpx; line-height: 50rpx;
} }
.control-card { .control-card {
background-color: rgb(26, 26, 26); background-color: rgb(26, 26, 26);
border-radius: 16rpx; border-radius: 16rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative; position: relative;
} }
.light { .light {
position: absolute; position: absolute;
/* top:10rpx; */ /* top:10rpx; */
color: rgba(74, 74, 74, 0.87); color: rgba(74, 74, 74, 0.87);
top: 58rpx; top: 58rpx;
left: 108rpx left: 108rpx
} }
.section-title { .section-title {
font-size: 32rpx; font-size: 32rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
display: block; display: block;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
} }
.slider-container { .slider-container {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.slider { .slider {
flex: 1; flex: 1;
margin: 0 20rpx; margin: 0 20rpx;
} }
.mode-buttons { .mode-buttons {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
} }
.mode_1 { .mode_1 {
width: 180rpx; width: 180rpx;
height: 180rpx; height: 180rpx;
border-radius: 16rpx; border-radius: 16rpx;
@ -1343,9 +1351,9 @@
text-align: center; text-align: center;
color: rgba(255, 255, 255, 0.6); color: rgba(255, 255, 255, 0.6);
padding-top: 37rpx; padding-top: 37rpx;
} }
.mode-v1 { .mode-v1 {
background: #1A1A1A; background: #1A1A1A;
border-radius: 18rpx; border-radius: 18rpx;
height: 150rpx; height: 150rpx;
@ -1353,17 +1361,17 @@
width: 47%; width: 47%;
display: flex; display: flex;
text-align: center; text-align: center;
} }
.mode-v2 { .mode-v2 {
display: flex; display: flex;
align-items: center; align-items: center;
text-align: center; text-align: center;
margin-left: 40rpx; margin-left: 40rpx;
} }
.callpolice { .callpolice {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
border-radius: 16rpx; border-radius: 16rpx;
@ -1373,35 +1381,35 @@
color: #fff; color: #fff;
line-height: 35rpx; line-height: 35rpx;
font-size: 26rpx; font-size: 26rpx;
} }
.example-body { .example-body {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 65%; top: 65%;
width: 100%; width: 100%;
transform: translate(-20%, -100%); transform: translate(-20%, -100%);
} }
.icoContent { .icoContent {
width: 320rpx; width: 320rpx;
height: 160rpx; height: 160rpx;
border-radius: 8rpx; border-radius: 8rpx;
background: rgba(58, 58, 58, 1); background: rgba(58, 58, 58, 1);
text-align: center; text-align: center;
line-height: 200rpx; line-height: 200rpx;
} }
.img { .img {
width: 62rpx; width: 62rpx;
height: 62rpx; height: 62rpx;
} }
.example_title { .example_title {
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
} }
.mode-btn { .mode-btn {
width: 48%; width: 48%;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
@ -1410,82 +1418,82 @@
border-radius: 8rpx; border-radius: 8rpx;
font-size: 28rpx; font-size: 28rpx;
border: none; border: none;
} }
.mode-btn.active { .mode-btn.active {
background-color: #007AFF; background-color: #007AFF;
color: #fff; color: #fff;
} }
.form-section { .form-section {
background-color: rgb(26, 26, 26); background-color: rgb(26, 26, 26);
border-radius: 16rpx; border-radius: 16rpx;
padding: 30rpx; padding: 30rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.form-row { .form-row {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
background: rgba(42, 42, 42, 1); background: rgba(42, 42, 42, 1);
border-radius: 16rpx; border-radius: 16rpx;
padding-left: 20rpx; padding-left: 20rpx;
} }
.form-label { .form-label {
font-size: 32rpx; font-size: 32rpx;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
white-space: nowrap; white-space: nowrap;
} }
.form-input { .form-input {
height: 80rpx; height: 80rpx;
border: 1rpx solid transparent; border: 1rpx solid transparent;
font-size: 32rpx; font-size: 32rpx;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
width: 100%; width: 100%;
} }
.form-input1 { .form-input1 {
height: 80rpx; height: 80rpx;
border: 1rpx solid transparent; border: 1rpx solid transparent;
font-size: 32rpx; font-size: 32rpx;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
width: 98%; width: 98%;
} }
.product-section { .product-section {
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 30rpx; padding: 30rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
} }
.product-tabs { .product-tabs {
display: flex; display: flex;
margin-top: 20rpx; margin-top: 20rpx;
} }
.tab { .tab {
padding: 15rpx 30rpx; padding: 15rpx 30rpx;
font-size: 28rpx; font-size: 28rpx;
color: #666; color: #666;
border-bottom: 4rpx solid transparent; border-bottom: 4rpx solid transparent;
} }
.tab.active { .tab.active {
color: #007AFF; color: #007AFF;
border-bottom-color: #007AFF; border-bottom-color: #007AFF;
} }
.action-buttons { .action-buttons {
padding: 30rpx 0; padding: 30rpx 0;
} }
.send-btn { .send-btn {
background-color: rgb(187, 230, 0); background-color: rgb(187, 230, 0);
color: rgba(35, 35, 35, 0.87); color: rgba(35, 35, 35, 0.87);
height: 50rpx; height: 50rpx;
@ -1498,9 +1506,9 @@
position: absolute; position: absolute;
right: 70rpx; right: 70rpx;
} }
.send-btn1 { .send-btn1 {
background-color: rgb(187, 230, 0); background-color: rgb(187, 230, 0);
color: rgba(35, 35, 35, 0.87); color: rgba(35, 35, 35, 0.87);
height: 50rpx; height: 50rpx;
@ -1513,11 +1521,11 @@
position: absolute; position: absolute;
right: 0rpx; right: 0rpx;
top: -70rpx top: -70rpx
} }
/* 遮罩层 */ /* 遮罩层 */
.agreement-mask { .agreement-mask {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@ -1528,10 +1536,10 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 9999; z-index: 9999;
} }
/* 弹窗主体 */ /* 弹窗主体 */
.agreement-popup { .agreement-popup {
width: 100%; width: 100%;
height: 50%; height: 50%;
background-color: rgb(42, 42, 42); background-color: rgb(42, 42, 42);
@ -1540,9 +1548,9 @@
box-sizing: border-box; box-sizing: border-box;
position: absolute; position: absolute;
bottom: 0rpx; bottom: 0rpx;
} }
.agreement-popupB { .agreement-popupB {
width: 100%; width: 100%;
height: 32%; height: 32%;
background-color: rgb(42, 42, 42); background-color: rgb(42, 42, 42);
@ -1551,66 +1559,66 @@
box-sizing: border-box; box-sizing: border-box;
position: absolute; position: absolute;
bottom: 0rpx; bottom: 0rpx;
} }
.agreement-popupC { .agreement-popupC {
width: 80%; width: 80%;
background-color: rgb(42, 42, 42); background-color: rgb(42, 42, 42);
border-radius: 40rpx; border-radius: 40rpx;
padding: 40rpx; padding: 40rpx;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid rgba(255, 200, 78, 1); border: 1px solid rgba(255, 200, 78, 1);
} }
.popup-Title { .popup-Title {
color: rgba(255, 200, 78, 1); color: rgba(255, 200, 78, 1);
} }
/* 标题 */ /* 标题 */
.popup-title { .popup-title {
font-size: 36rpx; font-size: 36rpx;
text-align: center; text-align: center;
margin-bottom: 30rpx; margin-bottom: 30rpx;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
} }
/* 内容文本 */ /* 内容文本 */
.popup-content { .popup-content {
font-size: 30rpx; font-size: 30rpx;
line-height: 1.6; line-height: 1.6;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
margin-bottom: 50rpx; margin-bottom: 50rpx;
} }
.item { .item {
padding: 10px; padding: 10px;
margin: 5px 0; margin: 5px 0;
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
transition: background-color 0.3s; transition: background-color 0.3s;
} }
.setIMG { .setIMG {
width: 24px; width: 24px;
height: 24px; height: 24px;
margin-right: 10px; margin-right: 10px;
} }
.item.selected { .item.selected {
background-color: rgb(58, 58, 58); background-color: rgb(58, 58, 58);
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
border-radius: 8rpx; border-radius: 8rpx;
} }
/* 按钮容器 */ /* 按钮容器 */
.popup-buttons { .popup-buttons {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
/*确定按钮 */ /*确定按钮 */
.agree { .agree {
background-color: rgb(187, 230, 0); background-color: rgb(187, 230, 0);
color: #232323; color: #232323;
border: none; border: none;
@ -1622,54 +1630,54 @@
position: absolute; position: absolute;
bottom: 0rpx; bottom: 0rpx;
left: 0rpx left: 0rpx
} }
/* 通用按钮样式 */ /* 通用按钮样式 */
.btn { .btn {
flex: 1; flex: 1;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 32rpx; font-size: 32rpx;
margin: 0 20rpx; margin: 0 20rpx;
} }
/* 不同意按钮 */ /* 不同意按钮 */
.disagree { .disagree {
background-color: transparent; background-color: transparent;
color: rgba(255, 255, 255, 0.87); color: rgba(255, 255, 255, 0.87);
border: 1px solid rgba(255, 200, 78, 0.7); border: 1px solid rgba(255, 200, 78, 0.7);
font-size: 24rpx; font-size: 24rpx;
color: rgba(255, 200, 78, 1); color: rgba(255, 200, 78, 1);
} }
/* 同意按钮 */ /* 同意按钮 */
.agreeBtn { .agreeBtn {
background-color: rgba(255, 200, 78, 1); background-color: rgba(255, 200, 78, 1);
color: #232323; color: #232323;
border: none; border: none;
font-size: 24rpx; font-size: 24rpx;
} }
.right-icons { .right-icons {
/* display: flex; */ /* display: flex; */
align-items: center; align-items: center;
} }
.toggle-icon { .toggle-icon {
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 16px;
margin-top: -40rpx; margin-top: -40rpx;
} }
.icon { .icon {
font-size: 14px; font-size: 14px;
color: #fff; color: #fff;
} }
.form-content { .form-content {
transition: all 0.3s ease; transition: all 0.3s ease;
margin-top: 60rpx; margin-top: 60rpx;
position: relative; position: relative;
} }
</style> </style>

View File

@ -31,7 +31,7 @@
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index"> <block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
<uni-swipe-action-item :right-options="Options" <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==0 && item.alarmStatus==1 ? '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 @click.stop="handleFile(item)">
<view class="device-header"> <view class="device-header">
<view class="deviceIMG"> <view class="deviceIMG">
@ -54,7 +54,7 @@
</view> </view>
</view> </view>
<view class="device-callpolice" <view class="device-callpolice"
v-if="item.communicationMode==0 && item.onlineStatus==0 && item.alarmStatus==1"> v-if="item.communicationMode==0 && item.onlineStatus==1 && item.alarmStatus==1">
报警中</view> 报警中</view>
<view v-if="item.communicationMode==1"> <view v-if="item.communicationMode==1">
<view class="device-status online">已连接</view> <view class="device-status online">已连接</view>