@@ -647,7 +647,7 @@
},
//下发指令开关
changeSwitch(type, val, deviceId, index, identifier) {
- console.log(val)
+ let that=this;
let msg = "";
if (!val) {
msg = "开启";
@@ -663,11 +663,11 @@
Api.setControl({
identifier: identifier,
action: 0,
- value: val.detail.value ? 1 : 0,
+ value: val? 1 : 0,
deviceId: deviceId,
}).then((res) => {
if (res.data.code == 0) {
- this.dataList[index].attributeList[3].value = val;
+ that.dataList[index].attributeList[3].value = val?0:1;
uni.showToast({
title: '操作成功',
duration: 2000