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-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-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-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-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"></iot-camera> <iot-camera v-else-if="device.name==='摄像头'" v-bind:device="device" v-bind:edit="true"></iot-camera>
</div> </div>
</div> </div>
</div> </div>

@ -4,11 +4,11 @@
{{device.displayName}} {{device.displayName}}
</div> </div>
<div class="card-body" style="padding:0;"> <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> <video :class="device.number" v-if="flvjs.isSupported()"></video>
<canvas :class="device.number" v-else></canvas> <canvas :class="device.number" v-else></canvas>
</div> </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%;"> <table class="ptz" style="width:100%;height:100%;">
<tr> <tr>
<td></td> <td></td>
@ -38,7 +38,7 @@
</template> </template>
<script> <script>
({ ({
props: ['device'], props: ['device','edit'],
mounted: function () { mounted: function () {
if (flvjs.isSupported()) { if (flvjs.isSupported()) {
this.playByFlvJs(); this.playByFlvJs();

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

Loading…
Cancel
Save