1
0
forked from dyf/APP

2 Commits

Author SHA1 Message Date
569c7cf0b4 100J分享接口bug修复 2026-03-03 17:19:14 +08:00
253733ad2b 100J4Gbug已修复完成 2026-03-02 18:51:38 +08:00
3 changed files with 30 additions and 17 deletions

View File

@ -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";
@ -454,16 +457,6 @@
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');
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);

View File

@ -216,7 +216,7 @@
const res = await deviceShareAdd({
phonenumber: this.phone,
smsCode: this.code,
deviceId: this.itemInfo.id,
deviceId: this.itemInfo.id || this.itemInfo.deviceId,
permission: selectedPermissions.join(',')
})
@ -250,8 +250,8 @@
const eventChannel = this.getOpenerEventChannel();
// 监听 'shareDevice' 事件,获取传过来的数据
eventChannel.on('shareDevice', (data) => {
console.log(data, 'data1t111');
this.itemInfo = data.data;
console.log(this.itemInfo,'this.itemInfo');
this.permissions=Common.getPermissions(this.itemInfo.persissonType);
console.log(this.itemInfo.persissonType,'this.itemInfo.persissonType');
})

View File

@ -86,7 +86,9 @@
},
getData(val) {
let data = {
deviceId: val
deviceId: val,
pageNum: 1,
pageSize: 500
}
deviceShareList(data).then((res) => {
if (res.code == 200) {
@ -117,7 +119,7 @@
eventChannel.on('shareManagement', (data) => {
console.log(data, 'data1t111');
this.itemInfo = data.data;
this.getData(this.itemInfo.id)
this.getData(this.itemInfo.id ||this.itemInfo.deviceId)
})
}
}