Former-commit-id: 4160dc04a7c78d6d802d5ff5c5150c195054ed7c
TangShanKaiPing
wanggang 6 years ago
parent b3f9604d1f
commit f4dcc0eb2b

@ -14,8 +14,8 @@
<iot-curtain v-else-if="device.name==='窗帘电机'" v-bind:device="device"></iot-curtain>
<iot-switch3 v-else-if="device.name==='三路开关'" v-bind:device="device"></iot-switch3>
<iot-socket v-else-if="device.name==='智能插座'" v-bind:device="device"></iot-socket>
<iot-ir v-else-if="device.name==='红外转发器'" v-bind:device="device"></iot-ir>
<iot-camera v-else-if="device.name==='摄像头'" v-bind:device="device"></iot-camera>
<iot-ir v-else-if="device.name==='红外转发器'" v-bind:device="device" v-bind:edit="true"></iot-ir>
<iot-camera v-else-if="device.name==='摄像头'" v-bind:device="device" v-bind:edit="true"></iot-camera>
</div>
</div>
</div>

@ -4,11 +4,11 @@
{{device.displayName}}
</div>
<div class="card-body" style="padding:0;">
<div class="row" style="width:320px;height:240px;margin: 0 auto;background-color:#000;">
<div class="row" style="width:320px;height:240px;margin: 0 auto;background-color:black;">
<video :class="device.number" v-if="flvjs.isSupported()"></video>
<canvas :class="device.number" v-else></canvas>
</div>
<div v-if="ptz" :class="'row ptz '+ device.number" style="width:320px;height:140px;margin:0 auto;" >
<div v-if="ptz" :class="'row ptz '+ device.number" style="box-sizing:border-box; width:320px;height:140px;margin:5px auto;" >
<table class="ptz" style="width:100%;height:100%;">
<tr>
<td></td>
@ -38,7 +38,7 @@
</template>
<script>
({
props: ['device'],
props: ['device','edit'],
mounted: function () {
if (flvjs.isSupported()) {
this.playByFlvJs();

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

Loading…
Cancel
Save