diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue index 721e2f3..3daa3e8 100644 --- a/pages/100J/HBY100-J.vue +++ b/pages/100J/HBY100-J.vue @@ -231,6 +231,9 @@ deviceUpdateVolume, deviceVoiceBroadcast } from '@/api/100J/HBY100-J.js' + import { + deviceShareId + } from '@/api/6170/deviceControl.js' var these = null; import Common from '@/utils/Common.js' const pagePath = "/pages/100/HBY100"; @@ -453,17 +456,7 @@ these.Status.navTitle = data.data.deviceName; these.Status.apiType = data.apiType; these.Status.isRightIconVisible = these.Status.apiType === 'listA'; - - if (data.apiType !== 'listA') { - Common.getdeviceShareId(data.data.id).then(res => { - if (res.code == 200) { - if (res.data.permission) { - these.permissions = res.data.permission.split(','); - } - } - }); - - } + this.mqttClient = new MqttClient(); this.mqttClient.connect(() => { @@ -503,7 +496,7 @@ .battery_remaining_time //续航时间 // 设备按键, app同步 } else if (funcType == '14') { - // 调节相关字段 + // 调节亮度,音量,频率相关字段 these.formData.strobeFrequency = led_strobe.frequency || 0.5; //频率 these.formData.volume = volume || 10; //音量 @@ -587,7 +580,13 @@ }) }) console.log(data, 'datatatatat'); - these.fetchDeviceDetail(data.data.id) + if (these.Status.apiType === 'listA') { + these.fetchDeviceDetail(data.data.id) + } else { + console.log('走到这里了没'); + // 分享权限详情 + these.fetchSharedDeviceDetail(data.data.id) + } }); this.createThrottledFunctions(); @@ -639,6 +638,18 @@ } }) }, + // 获取分享设备详情 + async fetchSharedDeviceDetail(id) { + try { + const res = await deviceShareId(id) + if (res.code == 200) { + console.log(this.deviceInfo,'this.deviceInfo'); + this.deviceInfo=res.data + } + } catch (error) { + + } + }, handleRightClick(item, s) { if (item && item.callback) { item.callback(item, s);