|
|
@ -96,13 +96,13 @@ |
|
|
|
min="0" |
|
|
|
max="100" |
|
|
|
:step="20" |
|
|
|
@change="handleAttribute()" |
|
|
|
@change="handleAttribute('statusLed', 'LED')" |
|
|
|
></u-slider> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="view-data-item" |
|
|
|
@click="handleCommand('statusMotor', 'curtain')" |
|
|
|
@click="handleAttribute('statusMotor', 'curtain')" |
|
|
|
:class="deviceInfo.curtain == 0 ? 'view-filter' : ''" |
|
|
|
> |
|
|
|
<view class="data-item-img-box"> |
|
|
@ -115,7 +115,7 @@ |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="view-data-item" |
|
|
|
@click="handleCommand('statusHumidifier', 'humidifier')" |
|
|
|
@click="handleAttribute('statusHumidifier', 'humidifier')" |
|
|
|
:class="deviceInfo.humidifier == 0 ? 'view-filter' : ''" |
|
|
|
> |
|
|
|
<view class="data-item-img-box"> |
|
|
@ -128,7 +128,7 @@ |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="view-data-item" |
|
|
|
@click="handleCommand('statusFan', 'fan')" |
|
|
|
@click="handleAttribute('statusFan', 'fan')" |
|
|
|
:class="deviceInfo.fan == 0 ? 'view-filter' : ''" |
|
|
|
> |
|
|
|
<view class="data-item-img-box"> |
|
|
@ -141,7 +141,7 @@ |
|
|
|
</view> |
|
|
|
<view |
|
|
|
class="view-data-item" |
|
|
|
@click="handleCommand('statusAircleaner', 'airCleaner')" |
|
|
|
@click="handleAttribute('statusAircleaner', 'airCleaner')" |
|
|
|
:class="deviceInfo.airCleaner == 0 ? 'view-filter' : ''" |
|
|
|
> |
|
|
|
<view class="data-item-img-box"> |
|
|
@ -167,7 +167,7 @@ |
|
|
|
:value="deviceInfo.humidityLowerThreshold" |
|
|
|
isLink |
|
|
|
@click=" |
|
|
|
handleSettingThreshold('humiLowThreshold', 'humiLowThreshold') |
|
|
|
handleSettingThreshold('humiLowThreshold', 'humidityLowerThreshold') |
|
|
|
" |
|
|
|
></u-cell> |
|
|
|
<u-cell |
|
|
@ -175,14 +175,19 @@ |
|
|
|
:value="deviceInfo.humidityUpperThreshold" |
|
|
|
isLink |
|
|
|
@click=" |
|
|
|
handleSettingThreshold('humiHighThreshold', 'humiHighThreshold') |
|
|
|
handleSettingThreshold( |
|
|
|
'humiHighThreshold', |
|
|
|
'humidityUpperThreshold' |
|
|
|
) |
|
|
|
" |
|
|
|
></u-cell> |
|
|
|
<u-cell |
|
|
|
title="空气质量阈值" |
|
|
|
:value="deviceInfo.airQualityThreshold" |
|
|
|
isLink |
|
|
|
@click="handleSettingThreshold('tvocThreshold', 'tvocThreshold')" |
|
|
|
@click=" |
|
|
|
handleSettingThreshold('tvocThreshold', 'airQualityThreshold') |
|
|
|
" |
|
|
|
></u-cell> |
|
|
|
</u-cell-group> |
|
|
|
</view> |
|
|
@ -228,14 +233,17 @@ export default { |
|
|
|
}); // 跳转到阈值设定页面 |
|
|
|
}, |
|
|
|
/** 下发属性 */ |
|
|
|
async handleAttribute() { |
|
|
|
async handleAttribute(_name, _valueName) { |
|
|
|
if (_valueName !== "LED") { |
|
|
|
this.deviceInfo[_valueName] = this.deviceInfo[_valueName] == 0 ? 1 : 0; |
|
|
|
} |
|
|
|
const res = await sendAttribute({ |
|
|
|
deviceId: this.deviceId, // 设备id |
|
|
|
// 阈值JSON字符串 |
|
|
|
attributeAndValues: [ |
|
|
|
{ |
|
|
|
attributeIdentifier: "statusLed", |
|
|
|
attributeValue: this.deviceInfo.LED, |
|
|
|
attributeIdentifier: _name, |
|
|
|
attributeValue: this.deviceInfo[_valueName], |
|
|
|
}, |
|
|
|
], |
|
|
|
}); |
|
|
|