100Jbug修改
This commit is contained in:
@ -231,9 +231,6 @@
|
||||
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";
|
||||
@ -241,6 +238,7 @@
|
||||
data() {
|
||||
return {
|
||||
mqttClient: null,
|
||||
activePermissions: [], // 存储当前设备的权限数组
|
||||
Status: {
|
||||
isRightIconVisible: false,
|
||||
navTitle: '',
|
||||
@ -249,6 +247,7 @@
|
||||
curr: 0,
|
||||
total: 0,
|
||||
pageHide: false,
|
||||
|
||||
Pop: {
|
||||
showPop: false, //是否显示弹窗
|
||||
popType: 'custom',
|
||||
@ -580,13 +579,13 @@
|
||||
})
|
||||
})
|
||||
console.log(data, 'datatatatat');
|
||||
// 分享接口
|
||||
if (these.Status.apiType === 'listA') {
|
||||
these.fetchDeviceDetail(data.data.id)
|
||||
} else {
|
||||
console.log('走到这里了没');
|
||||
// 分享权限详情
|
||||
these.fetchSharedDeviceDetail(data.data.id)
|
||||
these.fetchDeviceDetail(data.data.deviceId)
|
||||
}
|
||||
|
||||
});
|
||||
this.createThrottledFunctions();
|
||||
|
||||
@ -638,17 +637,13 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取分享设备详情
|
||||
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) {
|
||||
|
||||
}
|
||||
// 检查权限的方法
|
||||
hasPermission(permissionCode) {
|
||||
// 如果还在加载中,直接返回false
|
||||
if (this.pageLoading) return false
|
||||
// 如果不是分享设备,默认有全部权限
|
||||
if (!this.isSharedDevice) return true
|
||||
return this.activePermissions.includes(permissionCode)
|
||||
},
|
||||
handleRightClick(item, s) {
|
||||
if (item && item.callback) {
|
||||
@ -858,28 +853,8 @@
|
||||
this.formData.sta_VoiceType = val;
|
||||
// 模式类型为7时才去判断
|
||||
console.log(val, 'valllll');
|
||||
const voiceStrobeAlarm = this.deviceInfo?.voiceStrobeAlarm ?? 0; // 兜底0,避免undefined
|
||||
const isVoiceOperate = val === '7' || val === '-1'; // 标记是否是语音开启/关闭操作
|
||||
if (voiceStrobeAlarm === 0 && isVoiceOperate) {
|
||||
let data = {
|
||||
deviceId: this.deviceInfo.deviceId,
|
||||
voiceBroadcast: Number(this.formData.sta_VoiceType) === -1 ? 0 : 1
|
||||
}
|
||||
deviceVoiceBroadcast(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
} else if (this.deviceInfo.voiceStrobeAlarm == 1) {
|
||||
console.log('走到这里了没');
|
||||
if (this.deviceInfo.voiceStrobeAlarm == 1) {
|
||||
// 如果强制报警已经开启了,那么切换下面的模式需要时,需要触发报警指令
|
||||
const data = {
|
||||
deviceIds: [this.deviceInfo.deviceId],
|
||||
@ -900,8 +875,26 @@
|
||||
});
|
||||
}
|
||||
})
|
||||
} else if (isVoiceOperate) {
|
||||
console.log('我是谁');
|
||||
let data = {
|
||||
deviceId: this.deviceInfo.deviceId,
|
||||
voiceBroadcast: Number(this.formData.sta_VoiceType) === -1 ? 0 : 1
|
||||
}
|
||||
deviceVoiceBroadcast(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 报警模式
|
||||
sosSetting(item) {
|
||||
|
||||
Reference in New Issue
Block a user