From 8e1a37dbea169c0ded78eb349ff2227c3f2b9923 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Fri, 15 Aug 2025 10:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/210/deviceControl/index.vue | 2 +- pages/6170/allShare/index.vue | 2 +- pages/6170/deviceControl/index.vue | 45 +++++++++++++++----- pages/6170/shareManagement/index.vue | 2 +- pages/common/index/index.vue | 62 +++++++--------------------- utils/request.js | 2 +- 6 files changed, 55 insertions(+), 60 deletions(-) diff --git a/pages/210/deviceControl/index.vue b/pages/210/deviceControl/index.vue index 7c64e04..7db6436 100644 --- a/pages/210/deviceControl/index.vue +++ b/pages/210/deviceControl/index.vue @@ -812,7 +812,7 @@ uni.showLoading({ title: '加载中...' }) - eventChannel.on('deviceControl', (data) => { + eventChannel.on('detailData', (data) => { console.log(data, '这是传过来的惨呼啊'); this.itemInfo = data.data; this.deviceID = data.data.id; diff --git a/pages/6170/allShare/index.vue b/pages/6170/allShare/index.vue index cadcdb2..bb6a4ef 100644 --- a/pages/6170/allShare/index.vue +++ b/pages/6170/allShare/index.vue @@ -143,7 +143,7 @@ url: "/pages/6170/deviceControl/index", success: (res) => { // 页面跳转成功后的回调函数 - res.eventChannel.emit('deviceControl', { + res.eventChannel.emit('detailData', { data: item, apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息 }); diff --git a/pages/6170/deviceControl/index.vue b/pages/6170/deviceControl/index.vue index 2ed9953..6fe0ff0 100644 --- a/pages/6170/deviceControl/index.vue +++ b/pages/6170/deviceControl/index.vue @@ -352,13 +352,13 @@ export default { * @param {number} [interval=800] - 轮询间隔(毫秒) * @param {number} [maxRetries=10] - 最大重试次数 */ - async getdeviceSTatus(val, batchId, interval = 800, maxRetries = 10) { - let retries = 0; + async getdeviceSTatus(val, batchId, interval = 800) { + //let retries = 0; const checkStatus = async () => { - if (retries >= maxRetries) { - throw new Error('超过最大重试次数'); - } - retries++; + // if (retries >= maxRetries) { + // throw new Error('超过最大重试次数'); + // } + // retries++; try { const data = { @@ -916,7 +916,7 @@ export default { title: statusRes.msg, icon: 'none' }); - // 刷新详情接口 + // 刷新详情接口 this.fetchDeviceDetail(this.computedDeviceId, true); uni.$emit('deviceStatusUpdate', {}); this.showPopupFlag = false @@ -991,6 +991,7 @@ export default { // 最后关闭加载状态 this.pageLoading = false this.deviceInfo = res.data + if (!isUpdate) { this.personnelInfo = { unitName: res.data.personnelInfo.unitName || '', @@ -999,6 +1000,30 @@ export default { position: res.data.personnelInfo.position || '', }; this.messageToSend = res.data.sendMsg || ''; + this.sliderValue = res.data.lightBrightness || '25' + let mainLightMode = parseInt(res.data.mainLightMode); + switch (mainLightMode) { + case 0: + this.currentMainMode = '关闭'; + break; + case 1: + this.currentMainMode = '强光'; + break; + case 2: + this.currentMainMode = '弱光'; + break; + case 3: + this.currentMainMode = '爆闪'; + break; + case 4: + this.currentMainMode = '泛光'; + break; + default: + console.log('未知的灯光模式:', mainLightMode); + } + const laserMode = res.data.LaserLightMode; + this.isLaserOn = laserMode === 1; + this.currentlaserMode = this.isLaserOn ? "开启" : "关闭"; } // 将权限字符串转换为数组 ["1", "2"] if (isFromShared) { @@ -1007,8 +1032,8 @@ export default { } else { this.isSharedDevice = false; this.activePermissions = []; // 非分享设备清空权限 - } - + } + // 关闭加载中 uni.hideLoading() } @@ -1086,7 +1111,7 @@ export default { uni.showLoading({ title: '加载中...' }) - eventChannel.on('deviceControl', (data) => { + eventChannel.on('detailData', (data) => { console.log(data, 'data'); this.itemInfo = data.data; this.deviceID = data.data.id; diff --git a/pages/6170/shareManagement/index.vue b/pages/6170/shareManagement/index.vue index 3a73f42..36c96a5 100644 --- a/pages/6170/shareManagement/index.vue +++ b/pages/6170/shareManagement/index.vue @@ -175,7 +175,7 @@ url: "/pages/6170/deviceControl/index", success: (res) => { // 页面跳转成功后的回调函数 - res.eventChannel.emit('deviceControl', { + res.eventChannel.emit('detailData', { data: item, apiType: 'listB' // 自定义标识 // 自定义标识,详情哪里根据这个参数不同信息 }); diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue index e64d4a2..70ac5da 100644 --- a/pages/common/index/index.vue +++ b/pages/common/index/index.vue @@ -483,53 +483,23 @@ } }) }, + // 列表跳转 handleFile(item) { - // communicationMode 0是4G 1是蓝牙,考虑多个4g设备 - if (item.typeName == 'BJQ6170') { - uni.navigateTo({ - url: "/pages/6170/deviceControl/index", - events: { - ack: function(data) {} - }, - success: (res) => { - // 页面跳转成功后的回调函数 - res.eventChannel.emit('deviceControl', { - data: item, - apiType: 'listA' // 自定义标识,详情哪里根据这个参数不同信息 - }); - } - }) - } else if (item.typeName == 'HBY210') { - const currentTab = this.tabs[this.activeTab]; - const deviceType = currentTab.id || ''; - uni.navigateTo({ - url: "/pages/210/deviceControl/index", - events: { - ack: function(data) {} - }, - success: (res) => { - // 页面跳转成功后的回调函数 - res.eventChannel.emit('deviceControl', { - data: item, - deviceType: deviceType, - apiType: 'listA' // 自定义标识 - }); - } - }) - } - if (item.typeName == '6155') { - uni.navigateTo({ - url: "/pages/6155/deviceDetail", - events: { - ack: function(data) {} - }, - success: (res) => { - res.eventChannel.emit('detailData', { - data: item - }); - } - }) - } + let url = item.detailPageUrl; + uni.navigateTo({ + url: url, + events: { + ack: function(data) {} + }, + success: (res) => { + // 页面跳转成功后的回调函数 + res.eventChannel.emit('detailData', { + data: item, + deviceType: this.tabs[this.activeTab].id || '', + apiType: 'listA' //标识,根据这个参数,区分普通详情,分享跳转详情,查不一样的权限信息 + }); + } + }) }, onIntall() { this.page = 1; diff --git a/utils/request.js b/utils/request.js index 375949b..a5f55e2 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,5 +1,5 @@ import config from '../config/index.js'; -const env = 'production'; //production development //开发of线上 改这里就行 +const env = 'development'; //production development //开发of线上 改这里就行 const BASE = config[env]; const request = (options) => { console.log("options"+JSON.stringify(options),BASE.BASE_URL)