210新增自动报警弹框提示,历史记录页面功能

This commit is contained in:
fengerli
2025-08-07 11:48:58 +08:00
parent 77d1fdbe64
commit ae608e04c0
8 changed files with 140 additions and 83 deletions

View File

@ -5,9 +5,11 @@
</view>
<!-- 使用自定义导航栏 -->
<view v-show="!pageLoading">
<custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF"
:rightIcon="isRightIconVisible ? '/static/images/common/shape.png' : ''"
@right-click="shareUp"></custom-navbar>
<custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF" :rightIcons="[
{src: '/static/images/210/ls.png'},
...(isRightIconVisible ? [{src: '/static/images/common/shape.png'}] : [])
]" @right-click="shareUp" @icon-click="handleIconClick"></custom-navbar>
<view class="device-detail-container" :style="{ paddingTop: navBarHeight + 'px' }">
<!-- 设备电量信息 -->
<view class="battery-section">
@ -88,7 +90,7 @@
</view>
</view>
<view class="mode-v1">
<view class="mode-v2" @click="lasermode">
<view class="mode-v2" @click="automaticAlarm">
<image src="/static/images/210/zd.png" class="setIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">自动报警</view>
@ -114,7 +116,7 @@
</view>
<view class="mode-v1">
<view class="mode-v2" @click="alarmTime">
<image src="/static/images/jg.png" class="setIMG" mode="aspectFit"></image>
<image src="/static/images/210/time.png" class="setIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">报警时长</view>
<view class="mode-v3">{{alarmTimeDisplay }}</view>
@ -239,7 +241,7 @@
message: '信息发送成功',
showCancel: false
},
},
// 开机log
logo: {
@ -248,7 +250,7 @@
message: '上传成功',
showCancel: false
},
},
bettery: {
config: {
@ -265,6 +267,7 @@
return true; // 直接关闭
}
},
cancel: {
config: {
titleColor: 'rgba(224, 52, 52, 1)',
@ -288,8 +291,28 @@
onConfirm() {
console.log('删除确认');
}
},
// 自动报警
autoAlarm: {
config: {
icon: '/static/images/6170/svg.png',
title: '报警信息',
message: '002号设备(ID:123456)\n出现报警', // 使用\n换行
showCountdown: true,
countdownTime: 59,
confirmText: '解除报警',
popupBorder: '1rpx solid rgba(224, 52, 52, 0.3)',
confirmBtnBg: 'rgba(224, 52, 52, 1)',
confirmBtnColor: "rgba(255, 255, 255, 0.87)",
showCancel: false,
},
onConfirm() {
console.log('自动报警确认');
// 这里可以添加自动报警的逻辑
}
}
}
import MqttClient from '@/utils/mqtt.js';
import {
@ -371,7 +394,7 @@
callback: POPUP_CONFIGS[type].onConfirm
}
},
handleConfirm(){
handleConfirm() {
this.currentPopup.show = false;
console.log('这是点击了确认');
},
@ -387,6 +410,10 @@
this.radioSelected = index;
console.log('选中了单选选项:', this.radioList[index]);
},
// 自动报警
automaticAlarm() {
this.showPopup('autoAlarm');
},
// *******定位******
gpsPosition() {
uni.navigateTo({
@ -514,20 +541,38 @@
this.lightModeA = false;
console.log("保存的时间:", time);
},
handleIconClick(index) {
// 历史记录
if (index === 0) {
uni.navigateTo({
url: '/pages/210/historyRecords/index',
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('share', {
data: this.itemInfo,
});
}
})
} else {
uni.navigateTo({
url: '/pages/6170/share/index',
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('share', {
data: this.itemInfo,
});
}
})
}
},
// 分享
shareUp() {
uni.navigateTo({
url: '/pages/6170/share/index',
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('share', {
data: this.itemInfo,
});
}
})
},
// 操作说明

View File

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@ -482,7 +482,8 @@
// 页面跳转成功后的回调函数
res.eventChannel.emit('deviceControl', {
data: item,
deviceType: deviceType
deviceType: deviceType,
apiType: 'listA' // 自定义标识
});
}
})