|
@@ -416,6 +416,7 @@ Page({
|
|
|
'加湿器', '空调', '音箱', '窗帘', '纱帘'
|
|
'加湿器', '空调', '音箱', '窗帘', '纱帘'
|
|
|
],
|
|
],
|
|
|
temperatureHumidifyName: '温度',
|
|
temperatureHumidifyName: '温度',
|
|
|
|
|
+ temperatureValue:0,
|
|
|
isButtonPressedHumidityUp: false,
|
|
isButtonPressedHumidityUp: false,
|
|
|
isButtonPressedHumidityDown: false,
|
|
isButtonPressedHumidityDown: false,
|
|
|
isButtonPressedClimateUp: false,
|
|
isButtonPressedClimateUp: false,
|
|
@@ -1769,6 +1770,31 @@ Page({
|
|
|
}
|
|
}
|
|
|
this.getService("/services", "/" + domain, "/turn_off", "POST", data);
|
|
this.getService("/services", "/" + domain, "/turn_off", "POST", data);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 拖动空调的值
|
|
|
|
|
+ dragClimate(e) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ let state = e.currentTarget.dataset.state;
|
|
|
|
|
+ console.log(e.detail.value);
|
|
|
|
|
+ if (state == "auto") {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ let list = that.data.listClimate;//这里是将需要循环的数组赋值给list
|
|
|
|
|
+ let indexS = Number(e.currentTarget.dataset.index);
|
|
|
|
|
+ // 将本地缓存数据渲染到对应修改的案例
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
|
|
+ var element = list[i];
|
|
|
|
|
+ if (i == indexS) {
|
|
|
|
|
+ element.temperatureTemp = e.detail.value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ listClimate: list
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log(list);
|
|
|
|
|
+ },
|
|
|
// 更改空调的值
|
|
// 更改空调的值
|
|
|
changeClimate(e) {
|
|
changeClimate(e) {
|
|
|
var that = this;
|
|
var that = this;
|
|
@@ -2888,6 +2914,7 @@ Page({
|
|
|
) {
|
|
) {
|
|
|
climateModeTemp = obj.state;
|
|
climateModeTemp = obj.state;
|
|
|
obj.temperature = resData[i].attributes.temperature;
|
|
obj.temperature = resData[i].attributes.temperature;
|
|
|
|
|
+ obj.temperatureTemp = resData[i].attributes.temperature;
|
|
|
obj.min_temp = resData[i].attributes.min_temp;
|
|
obj.min_temp = resData[i].attributes.min_temp;
|
|
|
obj.max_temp = resData[i].attributes.max_temp;
|
|
obj.max_temp = resData[i].attributes.max_temp;
|
|
|
obj.hvac_modes = resData[i].attributes.hvac_modes;
|
|
obj.hvac_modes = resData[i].attributes.hvac_modes;
|
|
@@ -3437,6 +3464,7 @@ Page({
|
|
|
) {
|
|
) {
|
|
|
climateModeTemp = obj.state;
|
|
climateModeTemp = obj.state;
|
|
|
obj.temperature = resData[i].attributes.temperature;
|
|
obj.temperature = resData[i].attributes.temperature;
|
|
|
|
|
+ obj.temperatureTemp = resData[i].attributes.temperature;
|
|
|
obj.min_temp = resData[i].attributes.min_temp;
|
|
obj.min_temp = resData[i].attributes.min_temp;
|
|
|
obj.max_temp = resData[i].attributes.max_temp;
|
|
obj.max_temp = resData[i].attributes.max_temp;
|
|
|
obj.hvac_modes = resData[i].attributes.hvac_modes;
|
|
obj.hvac_modes = resData[i].attributes.hvac_modes;
|