|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="card" style="box-sizing:border-box;height:550px;margin:10px;">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
{{device.displayName}}
|
|
|
|
|
{{device.displayName}}{{this.code}}
|
|
|
|
|
<span class="float-right text-success" v-if="device.isOnline"><i class="ion ion-ios-wifi"></i></span>
|
|
|
|
|
<span class="float-right text-danger" v-else><i class="ion ion-ios-wifi"></i></span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body" style="padding-top:0;">
|
|
|
|
|
<div class="card-body" style="padding:0;">
|
|
|
|
|
<div class="weui-tab">
|
|
|
|
|
<div class="weui-navbar">
|
|
|
|
|
<a href="javascript:;" class="weui-tabbar__item">
|
|
|
|
@ -333,12 +333,15 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="edit" class="card">
|
|
|
|
|
EDIT
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
({
|
|
|
|
|
props: ['device'],
|
|
|
|
|
props: ['device','edit'],
|
|
|
|
|
mounted: function () {
|
|
|
|
|
weui.tab('.weui-tab');
|
|
|
|
|
},
|
|
|
|
@ -355,12 +358,12 @@
|
|
|
|
|
changePower: function (v) {
|
|
|
|
|
var oldValue = parseInt(v);
|
|
|
|
|
if (oldValue === 1) {
|
|
|
|
|
getData(this.device, '按键').value = 3;
|
|
|
|
|
this.send(3, 1);
|
|
|
|
|
getData(this.device, '按键').value = 3;
|
|
|
|
|
}
|
|
|
|
|
else if (oldValue === 2) {
|
|
|
|
|
getData(this.device, '按键').value = 1;
|
|
|
|
|
this.send(1, 1);
|
|
|
|
|
getData(this.device, '按键').value = 1;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeTemperature: function (v, step) {
|
|
|
|
@ -375,18 +378,19 @@
|
|
|
|
|
newValue = min;
|
|
|
|
|
}
|
|
|
|
|
var newCode = this.code - oldValue + newValue;
|
|
|
|
|
getData(this.device, '按键').value = newCode;
|
|
|
|
|
this.send(newCode, 1);
|
|
|
|
|
getData(this.device, '按键').value = newCode;
|
|
|
|
|
},
|
|
|
|
|
change: function (v, min, max, step) {
|
|
|
|
|
alert(v);
|
|
|
|
|
var oldValue = parseInt(v);
|
|
|
|
|
var newValue = oldValue + step;
|
|
|
|
|
if (newValue > max) {
|
|
|
|
|
newValue = min;
|
|
|
|
|
}
|
|
|
|
|
var newCode = this.code - oldValue + newValue;
|
|
|
|
|
getData(this.device, '按键').value = newCode;
|
|
|
|
|
this.send(newCode, 1);
|
|
|
|
|
getData(this.device, '按键').value = newCode;
|
|
|
|
|
},
|
|
|
|
|
send: function (value, type) {
|
|
|
|
|
execApi(this.device.number, '/Ir/Send', 'type=' + type + '&code=' + value);
|
|
|
|
|