diff --git a/pages/210/deviceControl/index.vue b/pages/210/deviceControl/index.vue index c212ba5..c33f86e 100644 --- a/pages/210/deviceControl/index.vue +++ b/pages/210/deviceControl/index.vue @@ -16,14 +16,14 @@ - + {{deviceInfo.batteryPercentage}}% 电量 - + 1小时 续航时间 @@ -55,41 +55,72 @@ + + + + - + - + 灯光模式 {{ currentMainMode }} - - - - - 激光模式 - - - - + - + 开机画面 上传 + + + + + 自动报警 + + + + + + + + 手动报警 + + + + + + + + 报警声音 + 上传 + + + + + + + + 报警时长 + 2分30秒 + + + + - + 人员信息登记 @@ -118,7 +149,7 @@ - + 发送信息 @@ -129,19 +160,19 @@ - + 产品信息 - + 产品参数 - + 操作说明 - + 操作视频 @@ -622,12 +653,6 @@ }); } }) - // const topic = `device/command/${this.deviceID}/message`; - // this.mqttClient.publish(topic, this.messageToSend); - // uni.showToast({ - // title: '消息已发送', - // icon: 'success' - // }); }, // 统一处理返回方法 handleDeviceData(res, isFromShared = false) { @@ -646,14 +671,6 @@ uni.hideLoading() } }, - // 检查权限的方法 - hasPermission(permissionCode) { - // 如果还在加载中,直接返回false - if (this.pageLoading) return false - // 如果不是分享设备,默认有全部权限 - if (!this.isSharedDevice) return true - return this.activePermissions.includes(permissionCode) - }, // 获取设备详情(普通详情) async fetchDeviceDetail(id) { try { @@ -685,7 +702,7 @@ this.mqttClient.connect(() => { console.log('MQTT 连接成功,开始订阅主题'); // 订阅来自设备的状态更新 - const statusTopic = `A/${this.itemInfo.nnnnnnnnnnnnnnnnnnn}`; + const statusTopic = `A/${this.itemInfo.id}`; this.mqttClient.subscribe(statusTopic, (payload) => { console.log(`收到来自 ${statusTopic} 的消息:`, payload); // uni.showModal({ diff --git a/pages/6170/allShare/index.vue b/pages/6170/allShare/index.vue index 4cdfb9d..024ce1b 100644 --- a/pages/6170/allShare/index.vue +++ b/pages/6170/allShare/index.vue @@ -41,7 +41,7 @@ ID:{{item.deviceImei}} 在线 - 电量:{{item.battery || '80'}}% + 电量:{{item.battery || '0'}}% @@ -67,7 +67,7 @@ - + {{ tabs[activeTab].name === '我的分享' ? '确定停止分享该设备' : '确定移除他人分享给你的这台设备' }} diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue index 8b1f1ba..c4b1a12 100644 --- a/pages/6170/deviceControl/index.vue +++ b/pages/6170/deviceControl/index.vue @@ -6,7 +6,7 @@ @@ -16,14 +16,14 @@ - + {{deviceInfo.batteryPercentage}}% 电量 - + {{deviceInfo.batteryRemainingTime || '0分钟'}} 续航时间 @@ -45,13 +45,16 @@ {{deviceInfo.onlineStatus===0?'离线':'在线'}} - 定位信息 - - 114.72 30.28 + 定位信息 + + {{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }} + {{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }} + + - 深圳市龙华区富源晟 + {{deviceInfo.address}} @@ -64,7 +67,7 @@ - + @@ -75,7 +78,7 @@ - + 灯光模式 {{ currentMainMode }} @@ -84,7 +87,7 @@ - + 激光模式 @@ -92,7 +95,7 @@ - + 开机画面 上传 @@ -147,15 +150,15 @@ 产品信息 - + 产品参数 - + 操作说明 - + 操作视频 @@ -189,10 +192,7 @@ 上传开机画面 - - - @@ -306,9 +306,17 @@ this.lightModeC = false; }, // *******定位****** - gpsPosition() { + gpsPosition(item) { uni.navigateTo({ - url: '/pages/common/map/index' + url: '/pages/common/map/index', + events: { + ack: function(data) {} + }, + success: (res) => { + res.eventChannel.emit('MapData', { + data: item + }); + } }) }, // ***********进度条*********** @@ -334,31 +342,31 @@ this.items = [{ text: '强光', selected: this.currentMainMode === '强光', // 修正匹配条件 - image: '/static/images/sett.png', + image: '/static/images/6170/sett.png', instructValue: '1' }, { text: '弱光', selected: this.currentMainMode === '弱光', - image: '/static/images/rg.png', + image: '/static/images/6170/rg.png', instructValue: '2' }, { text: '爆闪', selected: this.currentMainMode === '爆闪', - image: '/static/images/bs.png', + image: '/static/images/6170/bs.png', instructValue: '3' }, { text: '泛光', selected: this.currentMainMode === '泛光', - image: '/static/images/settt.png', + image: '/static/images/6170/settt.png', instructValue: '4' }, { text: '关闭', selected: this.currentMainMode === '关闭', - image: '/static/images/close.png', + image: '/static/images/6170/close.png', instructValue: '0' }, ]; @@ -488,7 +496,7 @@ // 显示上传中加载提示 uni.showLoading({ title: '上传中...', - mask: true + mask: true }); uni.uploadFile({ @@ -737,14 +745,9 @@ this.mqttClient.connect(() => { console.log('MQTT 连接成功,开始订阅主题'); // 订阅来自设备的状态更新 - const statusTopic = `A/${this.itemInfo.nnnnnnnnnnnnnnnnnnn}`; + const statusTopic = `A/${this.deviceID}`; this.mqttClient.subscribe(statusTopic, (payload) => { console.log(`收到来自 ${statusTopic} 的消息:`, payload); - // uni.showModal({ - // title: '收到设备消息', - // content: payload, - // showCancel: false - // }); // ✅ 发送全局事件通知主页面更新 uni.$emit('deviceStatusUpdate', { message: JSON.stringify(payload), // 消息内容 @@ -899,7 +902,7 @@ .info-card { background-color: rgb(26, 26, 26); border-radius: 16rpx; - padding: 10rpx 30rpx 5rpx 30rpx; + padding: 10rpx 20rpx 5rpx 20rpx; margin-bottom: 20rpx; } @@ -913,6 +916,7 @@ .info-label { font-size: 28rpx; color: rgba(255, 255, 255, 0.87); + white-space: nowrap; } .info-value { @@ -924,7 +928,12 @@ color: rgba(255, 255, 255, 0.6); text-align: end; } - + .locationGPS { + width:88%; + text-align: end; + float: right; + line-height:50rpx; + } .control-card { background-color: rgb(26, 26, 26); border-radius: 16rpx; diff --git a/pages/6170/shareDevices/index.vue b/pages/6170/shareDevices/index.vue index 8766f08..fcc8ac6 100644 --- a/pages/6170/shareDevices/index.vue +++ b/pages/6170/shareDevices/index.vue @@ -48,7 +48,7 @@ - + 设备分享成功 diff --git a/pages/6170/shareManagement/index.vue b/pages/6170/shareManagement/index.vue index 91e7a96..540b9e6 100644 --- a/pages/6170/shareManagement/index.vue +++ b/pages/6170/shareManagement/index.vue @@ -4,7 +4,7 @@ - + 用户名:{{item.deviceName}} @@ -22,7 +22,7 @@ - + 确定移除该用户! diff --git a/pages/common/addvideo/index.vue b/pages/common/addvideo/index.vue index 3b34679..abddf44 100644 --- a/pages/common/addvideo/index.vue +++ b/pages/common/addvideo/index.vue @@ -25,7 +25,7 @@ - + 保存成功! diff --git a/pages/common/allType/index.vue b/pages/common/allType/index.vue index 29571b7..b2555f8 100644 --- a/pages/common/allType/index.vue +++ b/pages/common/allType/index.vue @@ -4,7 +4,7 @@ - + {{ item.typeName }} diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue index b33a3bd..52acd6f 100644 --- a/pages/common/index/index.vue +++ b/pages/common/index/index.vue @@ -2,7 +2,7 @@ + rightIcon="/static/images/common/add.png" @right-click="scan"> @@ -15,7 +15,7 @@ - + @@ -56,7 +56,7 @@ 未连接 - + @@ -77,7 +77,7 @@ - + 确定删除所选设备! @@ -170,23 +170,23 @@ RenameModel: false, menuItems: [{ text: '扫一扫添加', - icon: '/static/images/scane.png', + icon: '/static/images/common/scane.png', action: 'scan' }, { text: '蓝牙添加', - icon: '/static/images/bluetooth.png', + icon: '/static/images/common/bluetooth.png', action: 'bluetooth' } ], shareItems: [{ text: '所有类型', - icon: '/static/images/type.png', + icon: '/static/images/common/type.png', action: 'type' }, { text: '所有分享', - icon: '/static/images/share.png', + icon: '/static/images/common/share.png', action: 'share' } ], @@ -427,7 +427,7 @@ }, handleFile(item) { //console.log('item' + JSON.stringify(item)); - // communicationMode 0是4G 1是蓝牙 + // communicationMode 0是4G 1是蓝牙,考虑多个4g设备 if (item.typeName == 'BJQ6170') { uni.navigateTo({ url: "/pages/6170/deviceControl/index", diff --git a/pages/common/login/index.vue b/pages/common/login/index.vue index 828101e..7d0ce18 100644 --- a/pages/common/login/index.vue +++ b/pages/common/login/index.vue @@ -1,6 +1,6 @@ diff --git a/pages/common/user/index.vue b/pages/common/user/index.vue index c1d4077..7c54b36 100644 --- a/pages/common/user/index.vue +++ b/pages/common/user/index.vue @@ -1,9 +1,9 @@