瀏覽代碼

空调开关修复

wh 1 年之前
父節點
當前提交
00652f80d4
共有 1 個文件被更改,包括 3 次插入3 次删除
  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