Browse Source

空调开关修复

wh 1 năm trước cách đây
mục cha
commit
00652f80d4
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      pages/Workorder/Remotecontrol/Remotecontrol.vue

+ 3 - 3
pages/Workorder/Remotecontrol/Remotecontrol.vue

@@ -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