地图打点动态数据加载,

This commit is contained in:
fengerli
2025-08-05 19:02:04 +08:00
parent d19dc91223
commit 6c5a702ff9
10 changed files with 208 additions and 86 deletions

View File

@ -222,9 +222,9 @@
<!-- 上传画面弹窗 -->
<view class="agreement-popupC" @click.stop>
<!-- 标题 -->
<view class="popup-title">确认开启激光模式</view>
<view class="popup-title">{{ isLaserOn ? '确认关闭激光模式?' : '确认开启激光模式?' }}</view>
<view class="popup-content">
<view class="popup-Title">
<view class="popup-Title" v-if="!isLaserOn">
<view>注意事项</view>
<view>1.禁止直视光源或反射面</view>
<view>2.避免直射人或易燃物</view>
@ -326,7 +326,7 @@
file: '',
selectedItemIndex: 0,
popupType: 'person', //弹框类型
timer: null
isLaserOn: false
}
},
computed: {
@ -346,20 +346,13 @@
// 添加调试日志
uni.navigateTo({
url: '/pages/common/map/index',
success: (res) => {
// 确保使用深拷贝
const mapData = {
deviceLocation: {
longitude: String(item.longitude), // 强制转为字符串
latitude: String(item.latitude),
deviceImage: item.devicePic || '',
deviceName: item.deviceImei || ''
}
}
res.eventChannel.emit('MapData', JSON.parse(JSON.stringify(mapData)))
events: {
ack: function(data) {}
},
fail: (err) => {
success: (res) => {
res.eventChannel.emit('Map', {
data: item
});
}
})
},
@ -558,9 +551,10 @@
},
// 激光确认框提交
handleBtn() {
const instructValue = this.isLaserOn ? 0 : 1;
let data = {
deviceId: this.deviceID,
instructValue: 1
instructValue: instructValue
}
laserModeSettings(data).then((res) => {
if (res.code == 200) {
@ -568,6 +562,7 @@
icon: 'none',
title: res.msg
})
this.isLaserOn = !this.isLaserOn;
this.lightModeC = false
} else {
uni.showToast({
@ -885,7 +880,8 @@
this.mqttClient.subscribe(statusTopic, (payload) => {
console.log(`收到来自 ${statusTopic} 的消息:`, payload);
//收到电量上报。延迟20s请求接口数据
const parsedMessage = typeof payload === 'string' ? JSON.parse(payload) : payload;
const parsedMessage = typeof payload === 'string' ? JSON.parse(payload) :
payload;
const deviceState = parsedMessage.state; // 直接取 state 数组
// ✅ 发送全局事件通知主页面更新
uni.$emit('deviceStatusUpdate', {
@ -896,7 +892,7 @@
setTimeout(() => {
this.fetchDeviceDetail(data.data.id);
}, 20000);
// 这里判断电量低于20%,弹框提示
if (this.deviceInfo.batteryPercentage < 20) {
this.popupType = 'bettery'