首页更新,添加蓝牙电量显示
This commit is contained in:
@ -1,10 +1,21 @@
|
||||
<template>
|
||||
<view class="content contentBg">
|
||||
<custom-navbar :title="Status.navbar.title" :showBack="Status.navbar.showBack" color="#FFFFFF"
|
||||
:rightIcons="Status.navbar.icons" @icon-click="handleRightClick"></custom-navbar>
|
||||
<view>
|
||||
<!-- <custom-navbar :title="Status.navbar.title" :showBack="Status.navbar.showBack" color="#FFFFFF"
|
||||
:rightIcons="Status.navbar.icons" @icon-click="handleRightClick" backgroundColor="#121212"></custom-navbar>
|
||||
-->
|
||||
<uni-nav-bar :border="false" @clickLeft="prevPage" fixed="true" statusBar="true"
|
||||
background-color="#121212" color="#FFFFFF" :title="Status.navbar.title">
|
||||
<template v-slot:left><view>
|
||||
<uni-icons type="left" size="24" color="#FFFFFF"></uni-icons>
|
||||
</view></template>
|
||||
<block slot="right">
|
||||
<view class="navbarRight">
|
||||
<image @click.stop="handleRightClick(index,item)" v-for="item,index in Status.navbar.icons" class="img" :src="item.src" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
</uni-nav-bar>
|
||||
|
||||
</view>
|
||||
<view class="eq" :style="{marginTop:Status.navbar.height+'px'}">
|
||||
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
|
||||
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
|
||||
@ -90,8 +101,7 @@
|
||||
<view :class="getWarnStyle(5)" class="net netfive"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="warnnig" :class="formData.qzwarn ?'':'displayNone'"
|
||||
@click="CloseWarn(true)">
|
||||
<view class="warnnig" :class="formData.qzwarn ?'':'displayNone'" @click="CloseWarn(true)">
|
||||
<view>设备强制报警中!</view>
|
||||
<view class="netContent" :class="{'displayNone':!Status.staticWarn.time}">
|
||||
{{Status.staticWarn.time}}s
|
||||
@ -219,8 +229,8 @@
|
||||
<view>
|
||||
|
||||
<view class="item">
|
||||
<input maxlength="16" class="value" style="text-indent: 20rpx;" v-model="formData.msgTxt" placeholder="请输入文字"
|
||||
placeholder-class="usrplace" />
|
||||
<input maxlength="16" class="value" style="text-indent: 20rpx;" v-model="formData.msgTxt"
|
||||
placeholder="请输入文字" placeholder-class="usrplace" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -560,6 +570,11 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
prevPage() {
|
||||
uni.navigateBack({
|
||||
|
||||
})
|
||||
},
|
||||
deviceRecovry(res) {
|
||||
if (this.Status.pageHide) {
|
||||
return;
|
||||
@ -679,20 +694,24 @@
|
||||
});
|
||||
},
|
||||
gotoMap() {
|
||||
let lnglat = lnglatConvert.wgs84_to_gcj02(this.formData.Lon, this.formData.Lat);
|
||||
this.detailData.longitude = lnglat[0];
|
||||
this.detailData.latitude = lnglat[1];
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/map/index',
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('Map', {
|
||||
data: this.detailData
|
||||
});
|
||||
}
|
||||
})
|
||||
let promise = lnglatConvert.wgs84_to_gcj02(this.formData.Lon, this.formData.Lat);
|
||||
promise.then(lnglat => {
|
||||
|
||||
this.detailData.longitude = lnglat[0];
|
||||
this.detailData.latitude = lnglat[1];
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/map/index',
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('Map', {
|
||||
data: this.detailData
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
},
|
||||
getDetail() {
|
||||
var that = this;
|
||||
@ -799,7 +818,7 @@
|
||||
return className;
|
||||
},
|
||||
handleRightClick: function(s, e) {
|
||||
|
||||
|
||||
if (s === 0) {
|
||||
console.log("消息");
|
||||
uni.navigateTo({
|
||||
@ -832,8 +851,8 @@
|
||||
},
|
||||
|
||||
initMQ() {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
if (mqttClient) {
|
||||
// console.log("无需再次初始化")
|
||||
resolve();
|
||||
@ -869,7 +888,8 @@
|
||||
if (keys.indexOf('sta_BreakNews') > -
|
||||
1) { //紧急通知
|
||||
if (json.sta_BreakNews ===
|
||||
'I get it') // && this.Status.msgOkTime && this.Status.msgOkIntval){
|
||||
'I get it'
|
||||
) // && this.Status.msgOkTime && this.Status.msgOkIntval){
|
||||
{
|
||||
these.showPop({
|
||||
showPop: true,
|
||||
@ -973,9 +993,9 @@
|
||||
if ("sta_SOSGrade" in json) {
|
||||
let sosText = json.sta_SOSGrade === 2 ? 'rb' : json.sta_SOSGrade === 1 ? "sg" : "close";
|
||||
receiveData.SOS = sosText;
|
||||
|
||||
receiveData.qzwarn=sosText==='sg';
|
||||
|
||||
|
||||
receiveData.qzwarn = sosText === 'sg';
|
||||
|
||||
}
|
||||
|
||||
if ("sta_ShakeBit" in json) {
|
||||
@ -1059,14 +1079,14 @@
|
||||
if (this.formData.imei) {
|
||||
this.initMQ();
|
||||
}
|
||||
let msgs=[];
|
||||
if(this.formData.qzwarn){
|
||||
let msgs = [];
|
||||
if (this.formData.qzwarn) {
|
||||
msgs.push("设备强制报警中");
|
||||
}
|
||||
if (this.formData.staticWarn) { //有静止报警
|
||||
msgs.push("设备静止报警中");
|
||||
}
|
||||
if(msgs.length>0){
|
||||
if (msgs.length > 0) {
|
||||
this.showPop({
|
||||
message: msgs.join(";"),
|
||||
iconUrl: "/static/images/6155/DeviceDetail/warnning.png",
|
||||
@ -1076,7 +1096,7 @@
|
||||
clickEvt: "staticWarn"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.setBleFormData();
|
||||
},
|
||||
@ -3320,4 +3340,13 @@
|
||||
.net.active {
|
||||
background: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.navbarRight .img{
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.uni-navbar--fixed{
|
||||
top:0rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user