修复自测发现的页面显示问题及部分BUG

Former-commit-id: 49e695f95fae2621c21631a138c97ced1c7cb78d
TangShanKaiPing
zhengpengju 5 years ago
parent 7771513eb5
commit 55a86be560

@ -1,5 +1,5 @@
<template>
<div class="card" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card" style="box-sizing:border-box;height:150px;">
<div class="card-header">
{{device.displayName}}
<span class="float-right text-success" v-if="device.isOnline"><i class="ion ion-ios-wifi"></i></span>
@ -12,7 +12,8 @@
</div>
<div class="col-8 align-self-center">
<div class="row" style="line-height:28px;">
<span class="badge badge-info" style="line-height:26px;" v-if="isSmart">{{electricity}} kW‧h</span>
<span class="badge badge-info" style="line-height:26px; margin-right: 10px;" v-if="isSmart">{{electricity}} kW‧h</span>
<span class="badge badge-info" style="line-height:26px; margin-right: 10px;" v-if="isSmart">{{power}} W</span>
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')==='开'" v-on:click="execApi(device.number,'/Socket/Off')" src="/IoTCenter/images/on.png" />
<img style="height:32px;" v-else="getDeviceDataValue(device,'状态')==='关'" v-on:click="execApi(device.number,'/Socket/On')" src="/IoTCenter/images/off.png" />
</div>
@ -30,6 +31,9 @@
},
electricity: function () {
return parseFloat(getDeviceDataValue(this.device, '电量') || 0).toFixed(2);
},
power: function () {
return parseFloat(getDeviceDataValue(this.device, '功率') || 0).toFixed(2);
}
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

@ -1,12 +1,41 @@
<!DOCTYPE html>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-store, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 01:01:01 GMT">
<meta HTTP-EQUIV="expires" CONTENT="0">
<title>载入中...</title>
<style>
html{
height:100%;
}
body{
height:100%;
}
.Center-Container {
background-color: #07c160;
position: relative;
}
.Absolute-Center {
width: 20%;
height: 50%;
overflow: auto;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
</style>
</head>
<body>
<script>
window.location.href = "/IoTCenter";
</script>
<body class="Center-Container">
<img src="loading.svg?v=202004211141" class="Absolute-Center" />
</body>
</html>
<script>
var secScript = document.createElement("script");
secScript.setAttribute("type", "text/javascript");
secScript.setAttribute("src", 'redirect.js?v=' + new Date().toLocaleTimeString());
document.body.insertBefore(secScript, document.body.lastChild);
</script>
</html>

@ -110,7 +110,11 @@ const router = new VueRouter({
});
router.beforeEach((to, from, next) => {
$('#loading').show();
console.log('before...')
console.log('store.state.accessToken', store.state.accessToken)
console.log('to.path', to.path)
if (!store.state.accessToken && to.path !== '/pages/login') {
console.log('router.push')
router.push('/pages/login');
return;
}
@ -123,8 +127,11 @@ router.beforeEach((to, from, next) => {
route = routeList[i];
}
}
console.log('route', route)
if (!route) {
console.log('<<<!route to.path>>>', to.path)
var path = to.path === '/' ? '/pages/home' : to.path;
var url = path + '.js';
var method = path.replace(/\//g, '_').substr(1) + "()";
console.log('preRoute:from ' + from.path + ' to path ' + to.path);
@ -141,6 +148,7 @@ router.beforeEach((to, from, next) => {
});
}
else {
console.log('!route else', route)
console.log('route from:' + from.path + ' to:' + to.path);
next();
}
@ -278,7 +286,9 @@ const app = new Vue({
},
mounted: function () {
console.log('mounted:app');
if(localStorage.getItem('userInfo') === null){
// 判断是否登录
if(localStorage.getItem('accessToken') === null){
//
router.push({path:'/pages/login'})
}
},

@ -15,24 +15,14 @@
},
mounted: function () {
weui.tab('#tab', { defaultIndex: 1 });
/*
timer = setInterval(function(){
if(height != $('.main').height()){
height = $('.main').height();
$('.weui-tab__panel').scrollTop(height);
}
console.log('setInterval>>>>>>>>');
},1000);
*/
console.log('setUser>>>>>>>>');
var url = this.url;
axios.get(url).then(function (response) {
store.commit('setUser', response.data);
}).catch(function (error) {
//error
})
console.log('载入消息>>>>>>>>');
console.log('载入消息2>>>>>>>>');
// 从存储载入消息
if(!isLoadedMSG) {
loadMessage(function(msgs){
@ -72,7 +62,7 @@
}
},
updated: function () {
//
// fix height
if(height != $('.main').height()){
height = $('.main').height();
$('.weui-tab__panel').scrollTop(height);
@ -85,11 +75,10 @@
});
}),
onMessage: function (event, model, to, from) {
if(isLoadedMSG ){
// do something
}
//loadMessage()
// loadMessage()
}
}
}

@ -23,21 +23,21 @@
<tr>
<td></td>
<td></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Up')" :src="config.apigateway+'/IoTCenter/images/up.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Up')" src="/images/up.svg" style="margin: 5px; width:36px;" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomin')" :src="config.apigateway+'/IoTCenter/images/zoomin.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Left')" :src="config.apigateway+'/IoTCenter/images/left.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Stop')" :src="config.apigateway+'/IoTCenter/images/stop.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Right')" :src="config.apigateway+'/IoTCenter/images/right.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomout')" :src="config.apigateway+'/IoTCenter/images/zoomout.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomin')" src="/images/zoomin.svg" style="margin: 5px; width:36px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Left')" src="/images/left.svg" style="margin: 5px; width:36px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Stop')" src="/images/stop.svg" style="margin: 5px; width:36px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Right')" src="/images/right.svg" style="margin: 5px; width:36px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Zoomout')" src="/images/zoomout.svg" style="margin: 5px; width:36px;" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Down')" :src="config.apigateway+'/IoTCenter/images/down.png'" style="margin: 5px;" /></td>
<td style="text-align: center;"><img v-on:click="execApi(device.number,'/Onvif/Down')" src="/images/down.svg" style="margin: 5px; width:36px;" /></td>
<td></td>
<td></td>
</tr>

@ -12,10 +12,10 @@
</div>
<div class="col-9 align-self-center">
<div class="row" style="line-height:28px;">
<span class="badge badge-info" style="line-height:26px;">{{getDeviceDataValue(device,'状态')}}</span>
<img style="height:32px;" v-on:click="execApi(device.number,'/Curtain/On')" src="/IoTCenter/images/left.png" />
<img style="height:32px;" v-on:click="execApi(device.number,'/Curtain/Stop')" src="/IoTCenter/images/stop.png" />
<img style="height:32px;" v-on:click="execApi(device.number,'/Curtain/Off')" src="/IoTCenter/images/right.png" />
<span class="badge badge-info" style="line-height:26px;background-color:#07c160;margin:5px;">{{getDeviceDataValue(device,'状态')}}</span>
<img style="height:32px;margin:5px;" v-on:click="execApi(device.number,'/Curtain/On')" src="/images/left.svg" />
<img style="height:32px;margin:5px;" v-on:click="execApi(device.number,'/Curtain/Stop')" src="/images/stop.svg" />
<img style="height:32px;margin:5px;" v-on:click="execApi(device.number,'/Curtain/Off')" src="/images/right.svg" />
</div>
</div>
</div>

@ -6,7 +6,7 @@
<div class="card-body">
<div class="row" style="height:100%;width:300px;margin: 0 auto;">
<div class="col-3 align-self-center">
<img class="mh-100" src="/images/gateway.png" style="width:48px;" />
<img class="mh-100" src="/images/gateway.svg" style="width:48px;" />
</div>
<div class="col-9 align-self-center">
<div class="row" style="line-height:25px;">

Loading…
Cancel
Save