new-20250827 加入008A、100Y #41

Merged
liubiao merged 10 commits from liubiao/APP:new-20250827 into main 2026-04-03 10:05:25 +08:00
46 changed files with 4457 additions and 2914 deletions

View File

@ -3,7 +3,7 @@
import upgrade from '@/utils/update.js';
// 延迟断开蓝牙:选择文件/录音等会触发 onHide8 秒内返回则不断开
const BLE_DISCONNECT_DELAY = 8000;
const BLE_DISCONNECT_DELAY = 30000;
let _bleDisconnectTimer = null;
export default {
@ -74,6 +74,9 @@
initOS();
}
let system=uni.getSystemInfoSync();
console.log("system=",system);
// #endif
},
onShow: function() {

View File

@ -130,12 +130,12 @@
return json;
},
//弹出预定好的种弹窗
//弹出预定好的种弹窗
showMsg(msg, btnTxt, type, okCallback) {
let cfg = {
error: {
icoUrl: '/static/images/6155/DeviceDetail/uploadErr.png',
icoUrl: '/static/images/common/uploadErr.png',
borderColor: "#e034344d",
buttonBgColor: "#E03434"
},
@ -148,6 +148,10 @@
icoUrl: '/static/images/common/warning.png',
borderColor: "#FFC84E",
buttonBgColor: "#FFC84E",
},
info:{
borderColor: "#BBE600",
buttonBgColor: "#BBE600"
}
}

View File

@ -0,0 +1,112 @@
<template>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proDetail('productDes')">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="proDetail('operatingInstruct')">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="proDetail('operationVideo')">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
</template>
<script>
export default {
name:"ProParams",
props:{
id: {
type: String,
default: '0'
},
},
methods:{
proDetail: function(pgetpe) {
let id=(this.id ? this.id : 0);
if(id===0){
console.error("id=0,不跳转")
return;
}
let url = '/pages/common/' + pgetpe + '/index?id=' + id;
uni.navigateTo({
url: url,
fail(ex) {
console.error(ex);
}
});
}
}
}
</script>
<style>
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.lamp {
margin-top: 24rpx;
}
.lamp .title {
width: 100%;
height: 60rpx;
line-height: 60rpx;
padding: 0rpx 28rpx;
box-sizing: border-box;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
color: #FFFFFF;
}
</style>

View File

@ -124,9 +124,10 @@
*/
async drawAndGetPixels() {
// 第一次调用时先预热画布解决APP重新打开后第一次获取数据不完整的问题
await this.warmupCanvas();
// await this.warmupCanvas();
let convertCharToMatrix=function(imageData) {
debugger;
// console.log("imgData=",imageData)
let matrix = [];
@ -166,6 +167,7 @@
}
let drawTxt=async (textLine)=> {
debugger;
let result = {};
let ctx = this.ctx;
@ -226,7 +228,7 @@
let arr = [];
// 循环处理每行文本
for (let i = 0; i < this.validTxts.length; i++) {
debugger;
let linePixls = [];
let item = this.validTxts[i];

View File

@ -429,7 +429,7 @@
{
"path": "pages/common/addDevice/addBle",
"style": {
"navigationBarTitleText": "蓝牙添加设备"
"navigationStyle": "custom"
}
},
{
@ -446,6 +446,19 @@
"navigationStyle": "custom",
"fullscreen": true
}
},
{
"path" : "pages/008A/HBY008A",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path": "pages/100Y/HBY100Y",
"style": {
"navigationBarTitleText": ""
}
}
],

1213
pages/008A/HBY008A.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,16 +7,17 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_PowerPercent}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
<view class="bigTxt">
{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
</view>
<view class="smallTxt">设备状态</view>
</view>
@ -54,7 +55,7 @@
<view class="lampMode">
<view class="sosContent">
<view class="btnSos openSos center" :class="{active:formData.sta_LedType==='led_alarm'}"
@click="sosSetting(dic.sta_LightType[4],4)">
@click="sosSetting(dic.sta_LightType[4],4)">
{{formData.sta_LedType==='led_alarm'?'报警中':'声光报警'}}
</view>
<view class="btnSos closeSos center" @click="sosSetting(dic.sta_LightType[3],3)">解除</view>
@ -72,7 +73,7 @@
<view class="lampMode">
<view class="mode fleft " v-for="item,index in dic.sta_LightType.filter(v=>{return v.group=='sta_LedType'})"
:class="{'active':formData[item.group]===item.key,
:class="{'active':formData[item.group]===item.key,
'marginLeft':index%2===1,
'displayNone':!item.show
}" v-on:click.stop="LighSetting(item,index)">
@ -92,47 +93,12 @@
<view class="clear"></view>
</view>
<view style="padding-bottom: 20rpx;">
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
</view>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" />
<!-- 下方菜单 -->
<ProParams :id="device.id"></ProParams>
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -144,7 +110,15 @@
showLoading,
hideLoading,
updateLoading
} from '@/utils/loading.js'
} from '@/utils/loading.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
import request, {
baseURL
} from '@/utils/request.js'
@ -167,26 +141,7 @@
curr: 0,
total: 0,
pageHide: false,
Pop: {
showPop: false, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '您确定要这样做吗?',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '设备名称',
modelValue: '',
visibleClose: false,
okCallback: null,
buttonCancelText: '',
showCancel: false,
},
usrToggle: false,
},
@ -340,7 +295,10 @@
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
these.formData.sta_IntrusTime = 0;
these.formData.sta_sosadd = "";
these.setBleFormData();
@ -362,7 +320,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
computed: {
@ -401,7 +362,7 @@
these.setBleFormData();
}).catch(ex => {
this.showMsg(ex.msg);
MsgError(ex.msg,'',these);
});
},
@ -443,7 +404,7 @@
these.setBleFormData();
resolve();
}).catch(ex => {
this.showMsg(ex.msg);
MsgError(ex.msg,'',these);
reject(ex);
});
});
@ -451,9 +412,9 @@
}
if (item.key == 'led_alarm') {
this.showPop({
showPop({
message: '确定开启声光报警?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -462,12 +423,12 @@
buttonText: "开启",
showCancel: true,
buttonCancelText: '取消'
});
},these);
} else {
if (this.formData.sta_LedType == 'led_alarm') {
this.showPop({
showPop({
message: '确定解除声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -482,7 +443,7 @@
showCancel: true,
buttonCancelText: '取消'
});
},these);
} else {
task(item.key);
}
@ -559,7 +520,8 @@
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
these.formData.bleStatu = 'err';
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -620,7 +582,7 @@
if (msg.length > 0) {
this.showMsg(msg.join(','));
MsgError(msg.join(','),'',these);
}
these.setBleFormData();
@ -655,9 +617,9 @@
},
showBleUnConnect() {
this.showPop({
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -683,121 +645,16 @@
}
})
}
});
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},these);
},
closePop: function() {
this.Status.Pop.showPop = false;
if (this.Status.Pop.cancelCallback) {
this.Status.Pop.cancelCallback();
}
},
HidePop: function() {
if (this.Status.Pop.clickEvt == 'SendUsr') {
}
this.Status.Pop.showPop = false;
if (this.Status.Pop.okCallback) {
this.Status.Pop.okCallback();
}
},
showPop: function(option) {
// hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {
icoUrl = '/static/images/common/success.png';
borderColor = "#BBE600";
buttonBgColor = "#BBE600";
}
this.showPop({
message: msg,
iconUrl: icoUrl,
borderColor: borderColor,
buttonBgColor: buttonBgColor,
buttonText: '确定',
okCallback: null
});
}
}
}
</script>
@ -1162,46 +1019,6 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -28,14 +28,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_battery}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_system?dic.sta_system[formData.sta_system]:"" }}</view>
<view class="smallTxt">设备状态</view>
@ -62,9 +62,9 @@
<text class="value" :class="formData.bleStatu?'green':'red'">{{getbleStatu}}</text>
</view>
<!-- <view class="item">
<text class="lbl">设备状态</text>
<text class="value">{{formData.sta_system?dic.sta_system[formData.sta_system]:"" }}</text>
</view> -->
<text class="lbl">设备状态</text>
<text class="value">{{formData.sta_system?dic.sta_system[formData.sta_system]:"" }}</text>
</view> -->
</view>
<view class="lampMode">
@ -96,9 +96,10 @@
<view class="modeSetting">
<view class="arrow" @click.stop="openVolume(item,index)" v-if="item.show"
v-for="item,index in dic.sta_VoiceType" :class="{'active':formData.sta_VoiceType===item.key,
'displayNone':!Status.usrToggle && index>3
}">
v-for="item,index in dic.sta_VoiceType" :class="{'active':formData.sta_VoiceType===item.key,
'displayNone' :!Status.usrToggle && index>
3
}">
<view class="outCircle">
<view class="item">
<view class="text">{{item.name}}</view>
@ -121,12 +122,12 @@
<view class="lampMode">
<view class="mode fleft " v-on:click.stop="openVolume(null,'8')"
:class="{'active':formData.sta_VoiceType==='8'}">
:class="{'active':formData.sta_VoiceType==='8'}">
<view class="leftImg">
<image class="img" :class="{'displayNone':formData.sta_VoiceType==='8'}"
src="/static/images/common/play.png" mode="aspectFit"></image>
src="/static/images/common/play.png" mode="aspectFit"></image>
<image class="img" :class="{'displayNone':formData.sta_VoiceType!=='8'}"
src="/static/images/common/pauseActive.png" mode="aspectFit"></image>
src="/static/images/common/pauseActive.png" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">播放语音</text>
@ -163,9 +164,9 @@
}" v-on:click.stop="lightTypeSet(item,index)">
<view class="leftImg">
<image class="img" :class="{'displayNone':formData.sta_LightType===item.key}"
src="/static/images/100/light.png" mode="aspectFit"></image>
src="/static/images/100/light.png" mode="aspectFit"></image>
<image class="img" :class="{'displayNone':formData.sta_LightType!==item.key}"
src="/static/images/100/lightActive.png" mode="aspectFit"></image>
src="/static/images/100/lightActive.png" mode="aspectFit"></image>
</view>
<view class="rightTxt">
@ -193,8 +194,8 @@
<view class="slider-container">
<slider min="10" max="100" step="10" :disabled="false" :value="formData.sta_LightDimmer"
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
@change="onBrightnessChanged" @changing="onBrightnessChanging" class="custom-slider" />
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
@change="onBrightnessChanged" @changing="onBrightnessChanging" class="custom-slider" />
</view>
<view class="line"></view>
@ -205,8 +206,8 @@
<view class="slider-container">
<slider min="0.5" max="10" step="0.5" :disabled="false" :value="formData.sta_LightFreq"
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
@change="onFreqChanged" @changing="onFreqChanging" class="custom-slider" />
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
@change="onFreqChanged" @changing="onFreqChanging" class="custom-slider" />
</view>
<view class="line"></view>
@ -217,8 +218,8 @@
<view class="slider-container">
<slider min="1" max="8" step="1" :disabled="false" :value="formData.sta_VoiceVolume"
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
@change="onVolumeChanged" @changing="onVolumeChanging" class="custom-slider" />
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
@change="onVolumeChanged" @changing="onVolumeChanging" class="custom-slider" />
</view>
@ -228,45 +229,11 @@
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" />
<!-- 下方菜单 -->
<!-- <BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
@btnClick="btnClick">
<view>
<view class="addIco">
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
<image mode="aspectFit" class="img" src="/static/images/6155/DeviceDetail/add.png"></image>
</view>
</view>
</view>
</BottomSlideMenuPlus> -->
<MsgBox ref="msgPop" />
<global-loading ref="loading" />
</view>
</template>
@ -279,7 +246,15 @@
showLoading,
hideLoading,
updateLoading
} from '@/utils/loading.js'
} from '@/utils/loading.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js';
import request, {
baseURL
} from '@/utils/request.js';
@ -311,26 +286,7 @@
curr: 0,
total: 0,
pageHide: false,
Pop: {
showPop: false, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '您确定要这样做吗?',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '设备名称',
modelValue: '',
visibleClose: false,
okCallback: null,
buttonCancelText: '',
showCancel: false,
},
BottomMenu: {
show: false,
showHeader: true,
@ -475,9 +431,9 @@
sta_system: {
"0": '关机',
"1": '充电',
"2": '开机未充电',
"3": '开机且充电',
"1": '充电',//仅充电
"2": '未充电',//开机未充电
"3": '充电',//开机且充电
"": ""
}
@ -520,7 +476,7 @@
this.$watch("formData.sta_battery", (newVal, oldVal) => {
if (newVal <= 20 && this.formData.sta_system == 2) {
this.showMsg("设备电量低");
MsgError("设备电量低",'',these);
}
});
@ -582,6 +538,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
these.setBleFormData();
@ -602,7 +559,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
computed: {
@ -656,14 +616,14 @@
audioManager() {
if (!this.permissions.includes('52') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
uni.navigateTo({
@ -846,7 +806,7 @@
text: "握手成功,等待设备响应"
});
}).catch(ex => {
this.showMsg(ex.msg);
MsgError(ex.msg,'',these);
});
},
@ -991,14 +951,14 @@ onFreqChanging(e){
if (!this.permissions.includes('51') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
let f = this.getDevice();
@ -1043,14 +1003,14 @@ onFreqChanging(e){
if (!this.permissions.includes('50') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -1083,14 +1043,14 @@ onFreqChanging(e){
this.formData.sta_VoiceType = val;
these.setBleFormData();
}).catch(ex => {
this.showMsg(ex.msg);
MsgError(ex.msg,'',these);
});
},
showUnWarn(val) {
this.showPop({
showPop({
message: '确定解除声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -1102,20 +1062,20 @@ onFreqChanging(e){
showCancel: true,
buttonCancelText: '取消'
});
},these);
},
sosSetting(item, isOk) {
if (!this.permissions.includes('50') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -1164,7 +1124,7 @@ onFreqChanging(e){
})
.catch(ex => {
this.showMsg(ex.msg);
MsgError(ex.msg,'',these);
});
}
@ -1173,16 +1133,16 @@ onFreqChanging(e){
this.showUnWarn(0);
} else {
this.showPop({
showPop({
message: '确定开启强制报警?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: task,
buttonText: "开启",
showCancel: true,
buttonCancelText: '取消'
});
},these);
}
@ -1371,6 +1331,7 @@ onFreqChanging(e){
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
@ -1393,9 +1354,9 @@ onFreqChanging(e){
},
showBleUnConnect() {
this.showPop({
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -1421,124 +1382,15 @@ onFreqChanging(e){
}
})
}
});
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},these);
},
closePop: function() {
this.Status.Pop.showPop = false;
if (this.Status.Pop.cancelCallback) {
this.Status.Pop.cancelCallback();
}
},
HidePop: function() {
if (this.Status.Pop.clickEvt == 'SendUsr') {
}
this.Status.Pop.showPop = false;
if (this.Status.Pop.okCallback) {
this.Status.Pop.okCallback();
}
},
showPop: function(option) {
// hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {
icoUrl = '/static/images/common/success.png';
borderColor = "#BBE600";
buttonBgColor = "#BBE600";
}
this.showPop({
message: msg,
iconUrl: icoUrl,
borderColor: borderColor,
buttonBgColor: buttonBgColor,
buttonText: '确定',
okCallback: null
});
},
btnClick() {
}
}
}
</script>
@ -1903,46 +1755,7 @@ onFreqChanging(e){
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -11,7 +11,7 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt" :style="{ color: deviceInfo.batteryPercentage < 20 ? '#FF0000' : '' }">
{{ deviceInfo.batteryPercentage }}%
@ -20,7 +20,7 @@
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">
{{ Math.floor((Number(deviceInfo.batteryRemainingTime) || 0) / 60) }}小时
@ -190,36 +190,9 @@
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="onVolumeChanging"
@changing="onVolumeChanging" class="custom-slider" />
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit">
</image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit">
</image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit">
</image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt"
:promptTitle="Status.Pop.promptTitle" v-model="Status.Pop.modelValue"
:buttonCancelText="Status.Pop.buttonCancelText" :showCancel="Status.Pop.showCancel"
@cancelPop="closePop" />
</view>
<ProParams :id="device.id"></ProParams>
<MsgBox ref="msgPop" />
</view>
</view>
</template>
@ -231,7 +204,15 @@
showLoading,
hideLoading,
updateLoading
} from '@/utils/loading.js'
} from '@/utils/loading.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js';
import request, {
baseURL
} from '@/utils/request.js';
@ -1460,28 +1441,6 @@
},
showBleUnConnect() {},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.deviceInfo.deviceId,
success(ev) {}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.deviceInfo.deviceId,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.deviceInfo.deviceId,
success(ev) {
}
});
},
closePop: function() {
this.Status.Pop.showPop = false;
@ -1547,6 +1506,7 @@
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
showPop(option,this);
},
btnClick() {
@ -1920,44 +1880,7 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {
padding: 0px;

View File

@ -698,7 +698,7 @@
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {

View File

@ -1146,7 +1146,7 @@
if (okCallback === undefined) {
okCallback = null;
}
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {

1213
pages/100Y/HBY100Y.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" @click.stop="handleRightClick(item,index)"
v-for="item,index in Status.navbar.icons">
v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -28,16 +28,17 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_PowerPercent}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
<view class="bigTxt">
{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
</view>
<view class="smallTxt">设备状态</view>
</view>
@ -79,7 +80,7 @@
<view class="lampMode">
<view class="sosContent">
<view class="btnSos openSos center" :class="{active:formData.sta_LedType==='led_alarm'}"
@click="sosSetting(dic.sta_LightType[6],6)">
@click="sosSetting(dic.sta_LightType[6],6)">
{{formData.sta_LedType==='led_alarm'?'报警中':'强制报警'}}
</view>
<view class="btnSos closeSos center" @click="sosSetting(dic.sta_LightType[5],5)">解除</view>
@ -97,7 +98,7 @@
<view class="lampMode">
<view class="mode fleft " v-for="item,index in dic.sta_LightType.filter(v=>{return v.group=='sta_LedType'})"
:class="{'active':formData[item.group]===item.key,
:class="{'active':formData[item.group]===item.key,
'marginLeft':index%2===1,
'displayNone':!item.show
}" v-on:click.stop="actionSett(item,index)">
@ -125,7 +126,7 @@
</view>
<view class="lampMode">
<view class="mode fleft "
v-for="item,index in dic.sta_LightType.filter(v=>{return v.group!=='sta_LedType'})" :class="{'active':formData[item.group]===item.key,
v-for="item,index in dic.sta_LightType.filter(v=>{return v.group!=='sta_LedType'})" :class="{'active':formData[item.group]===item.key,
'marginLeft':index%2===1,
'displayNone':!item.show
}" v-on:click.stop="actionSett(item,index)">
@ -147,41 +148,19 @@
</view>
<view style="padding-bottom: 20rpx;">
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot">
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot">
<view v-if="Status.ShowEditChannel" class="popup-prompt">
<text class="popup-prompt-title">修改信道</text>
<input class="popup-prompt-input" type="number" placeholder="1-125的整数"
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.ins_Channel" />
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.ins_Channel" />
</view>
</MessagePopup>
@ -194,6 +173,7 @@
<BottomSlideMenuPlus :config="Status.BottomMenu" @itemClick="btnClick" @close="closeActionSheet">
</BottomSlideMenuPlus>
<MsgBox ref="msgPop" />
</view>
</template>
@ -211,6 +191,14 @@
} from '@/utils/request.js'
import Common from '@/utils/Common.js'
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
const pagePath = "/pages/102/HBY102";
var ble = null;
@ -502,6 +490,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
these.formData.sta_IntrusTime = 0;
these.formData.sta_sosadd = "";
@ -524,9 +513,12 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
this.getWarns();
// this.getLinkedCnt();
},
computed: {
@ -596,14 +588,14 @@
if (!this.permissions.includes('55') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -673,7 +665,7 @@
}
let warnKey = "102_" + these.device.id + "_warning";
let linkKey = "102_" + these.device.id + "_linked";
// let linkKey = "102_" + these.device.id + "_linked";
let p1 = new Promise((succ, err) => {
uni.getStorage({
key: warnKey,
@ -690,33 +682,33 @@
});
});
let p2 = new Promise((succ, err) => {
uni.getStorage({
key: linkKey,
success(res) {
console.error("获取到联机数据", res);
let data = res.data;
let fs = data.filter(v => {
return !v.read
});
console.error("未读联机数据", fs);
succ(fs);
},
fail(ex) {
err(null);
}
});
});
// let p2 = new Promise((succ, err) => {
// uni.getStorage({
// key: linkKey,
// success(res) {
// console.error("获取到联机数据", res);
// let data = res.data;
// let fs = data.filter(v => {
// return !v.read
// });
// console.error("未读联机数据", fs);
// succ(fs);
// },
// fail(ex) {
// err(null);
// }
// });
// });
Promise.allSettled([p1, p2]).then(results => {
Promise.allSettled([p1]).then(results => {
let fs = [];
if (results[0].status == 'fulfilled') {
fs = fs.concat(results[0].value);
}
if (results[1].status == 'fulfilled') {
fs = fs.concat(results[1].value);
}
// if (results[1].status == 'fulfilled') {
// fs = fs.concat(results[1].value);
// }
console.error("获取到未读消息", fs);
these.$set(these.Status.navbar.icons[0], "math", fs.length);
});
@ -772,14 +764,14 @@
if (!this.permissions.includes(item.permission) && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -840,9 +832,9 @@
if (val === 'E49_on') {
this.showPop({
showPop({
message: '确定开启联机模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -852,7 +844,7 @@
showCancel: true,
buttonCancelText: '取消'
});
},these);
} else {
task();
}
@ -922,9 +914,9 @@
}
if (val == 'status_off') {
this.showPop({
showPop({
message: '确定关闭物体感应功能?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -934,7 +926,7 @@
showCancel: true,
buttonCancelText: '取消'
});
},these);
} else {
task();
}
@ -945,17 +937,16 @@
sosSetting(item, isOk) {
if (!this.permissions.includes('46') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -993,7 +984,7 @@
these.setBleFormData();
resolve();
}).catch(ex => {
this.showMsg(ex.msg);
MsgError(ex.msg,null,these);
reject(ex);
});
});
@ -1001,9 +992,9 @@
}
if (item.key == 'led_alarm') {
this.showPop({
showPop({
message: '确定开启强制报警?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -1012,12 +1003,12 @@
buttonText: "开启",
showCancel: true,
buttonCancelText: '取消'
});
},these);
} else {
if (this.formData.sta_LedType == 'led_alarm') {
this.showPop({
showPop({
message: '确定解除声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -1032,9 +1023,10 @@
showCancel: true,
buttonCancelText: '取消'
});
},these);
} else {
task(item.key);
let newval=this.formData.sta_LedType===item.key?'led_off':item.key;
task(newval);
}
}
@ -1155,7 +1147,7 @@
this.Status.BottomMenu.activeIndex = active;
let msg = [];
if (json.sta_PowerPercent <= 20 && (json.sta_charge === 0 || json.sta_charge === '0')) {
if (json.sta_PowerPercent <= 20 && json.sta_PowerPercent!=this.formData.sta_PowerPercent && (json.sta_charge === 0 || json.sta_charge === '0')) {
msg.push("设备电量低");
}
@ -1201,7 +1193,7 @@
name: deviceName
});
}
this.showMsg(msg.join(','));
MsgError(msg.join(','),'',these);
});
return;
// clearInterval(instrusionTime);
@ -1221,7 +1213,7 @@
// this.formData.sta_IntrusTime = 0;
}
if (msg.length > 0) {
this.showMsg(msg.join(','));
MsgError(msg.join(','),'',these);
}
@ -1345,6 +1337,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
@ -1366,9 +1359,9 @@
},
showBleUnConnect() {
this.showPop({
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -1394,121 +1387,80 @@
}
})
}
});
},these);
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
closePop: function() {
this.Status.Pop.showPop = false;
this.Status.Pop.showPop = false;
if (this.Status.Pop.cancelCallback) {
this.Status.Pop.cancelCallback();
}
},
HidePop: function() {
if (this.Status.Pop.clickEvt == 'SendUsr') {
if (this.Status.Pop.cancelCallback) {
this.Status.Pop.cancelCallback();
}
},
HidePop: function() {
if (this.Status.Pop.clickEvt == 'SendUsr') {
}
}
this.Status.Pop.showPop = false;
if (this.Status.Pop.okCallback) {
this.Status.Pop.okCallback();
}
},
showPop: function(option) {
// hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
this.Status.Pop.showPop = false;
if (this.Status.Pop.okCallback) {
this.Status.Pop.okCallback();
}
},
showPop: function(option) {
hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
}
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {
icoUrl = '/static/images/common/success.png';
borderColor = "#BBE600";
buttonBgColor = "#BBE600";
}
this.showPop({
message: msg,
iconUrl: icoUrl,
borderColor: borderColor,
buttonBgColor: buttonBgColor,
buttonText: '确定',
okCallback: null
});
}
}
}
</script>
@ -1878,46 +1830,6 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -18,14 +18,14 @@
</view>
<view>
<view class="battery-v1">
<image src="/static/images/common/dl.png" class="dlIMG"></image>
<image src="/static/images/common/battry.png" class="dlIMG"></image>
<view>
<view class="battery-v2">{{deviceInfo.batteryPercentage}}%</view>
<view class="battery-v3">电量</view>
</view>
</view>
<view class="battery-v1">
<image src="/static/images/common/nz.png" class="dlIMG" mode="aspectFit"></image>
<image src="/static/images/common/time.png" class="dlIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">{{deviceInfo.batteryRemainingTime}}分钟</view>
<view class="battery-v3">续航时间</view>
@ -127,23 +127,8 @@
</view>
</view>
<!-- 产品信息 -->
<view>
<view class="section-title">产品信息</view>
<view class="mode-buttons">
<view class="mode_1" @click="productparams">
<image src="/static/images/common/cp.png" class="cpIMG" mode="aspectFit"></image>
<view class="">产品参数</view>
</view>
<view class="mode_1" @click="operatingInst">
<image src="/static/images/common/sm.png" class="cpIMG" mode="aspectFit"></image>
<view class="">操作说明</view>
</view>
<view class="mode_1" @click="operatingVideo">
<image src="/static/images/common/sp.png" class="cpIMG" mode="aspectFit"></image>
<view class="">操作视频</view>
</view>
</view>
</view>
<ProParams :id="itemInfo.id"></ProParams>
</view>
<!-- 弹框 -->
<view class="agreement-mask" v-if="lightModeA" @click.stop="closePopup">
@ -780,25 +765,7 @@
})
}
},
// 操作说明
operatingInst() {
uni.navigateTo({
url: `/pages/common/operatingInstruct/index?id=${this.deviceID}`
})
},
// 产品参数
productparams() {
uni.navigateTo({
url: `/pages/common/productDes/index?id=${this.deviceID}`
})
},
// 操作视频
operatingVideo() {
uni.navigateTo({
url: `/pages/common/operationVideo/index?id=${this.deviceID}`
})
},
// 发送人员信息
sendPersonnelInfo() {

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -26,19 +26,19 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_PowerPercent}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<!-- <view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
</view>
</view> -->
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
</view>
</view> -->
</view>
</view>
<view class="eqinfo">
@ -72,17 +72,17 @@
</view>
<!-- <view class="lamp">
<view class="title">
<text>信道设置</text>
<text>{{formData.sta_Channel}}</text>
</view>
<view class="title">
<text>信道设置</text>
<text>{{formData.sta_Channel}}</text>
</view>
</view>
<view class="lampMode">
<slider min="1" max="125" step="1" :disabled="false" :value="formData.sta_Channel" activeColor="#bbe600"
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="onChannelChanging"
@changing="onChannelChanging" class="custom-slider" />
</view> -->
<view class="lampMode">
<slider min="1" max="125" step="1" :disabled="false" :value="formData.sta_Channel" activeColor="#bbe600"
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="onChannelChanging"
@changing="onChannelChanging" class="custom-slider" />
</view> -->
<view class="lamp">
<view class="title">
@ -95,13 +95,13 @@
<view class="lampMode">
<view class="mode fleft " v-for="item,index in dic.SOS"
:class="{active:formData.sta_SOSType===item.val,marginLeft:index%2==1}"
v-on:click.stop="sosSetting(item,index)">
:class="{active:formData.sta_SOSType===item.val,marginLeft:index%2==1}"
v-on:click.stop="sosSetting(item,index)">
<view class="leftImg">
<image class="img" :class="(formData.sta_SOSType!==item.val || !item.activeImg)?'':'displayNone'"
:src="item.img" mode="aspectFit"></image>
:src="item.img" mode="aspectFit"></image>
<image class="img" :class="(formData.sta_SOSType===item.val && item.activeImg)?'':'displayNone'"
:src="item.activeImg" mode="aspectFit"></image>
:src="item.activeImg" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">{{item['text']}}</text>
@ -128,8 +128,8 @@
<view class="lampMode">
<view class="colorContent">
<view v-for="item,index in formData.groups" class="item"
:class="{active:item.id==formData.sta_GroupType,marginNoLeft:index%3===0}"
@click.stop="groupSetting(item,index)">
:class="{active:item.id==formData.sta_GroupType,marginNoLeft:index%3===0}"
@click.stop="groupSetting(item,index)">
<view class="polygon" :style="{backgroundColor:item.hex}">
@ -153,7 +153,7 @@
<view class="modeSetting">
<view class="arrow" @click.stop="ArrowModeSet('right_off')"
:class="formData.sta_ArrowMode=='right_off'?'active':''">
:class="formData.sta_ArrowMode=='right_off'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal" src="/static/images/4877/arrow.png" mode="aspectFit"></image>
@ -164,13 +164,13 @@
<view class="text">朝左</view>
</view>
<view class="arrow" @click.stop="ArrowModeSet('right_on')"
:class="formData.sta_ArrowMode=='right_on'?'active':''">
:class="formData.sta_ArrowMode=='right_on'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal translate" src="/static/images/4877/arrow.png" mode="aspectFit">
</image>
<image class="img activity translate" src="/static/images/4877/arrowActive.png"
mode="aspectFit"></image>
mode="aspectFit"></image>
</view>
</view>
<view class="text">朝右</view>
@ -185,7 +185,7 @@
<view class="modeSetting">
<view class="arrow" @click.stop="ArrowSet('red_front')"
:class="formData.sta_ArrowType=='red_front'?'redactive':''">
:class="formData.sta_ArrowType=='red_front'?'redactive':''">
<view class="outCircle">
<view class="item">
<view class="text">红色</view>
@ -194,7 +194,7 @@
</view>
<view class="arrow" @click.stop="ArrowSet('green_back')"
:class="formData.sta_ArrowType=='green_back'?'greenactive':''">
:class="formData.sta_ArrowType=='green_back'?'greenactive':''">
<view class="outCircle">
<view class="item">
<view class="text">绿色</view>
@ -217,7 +217,7 @@
<view class="modeSetting">
<view class="arrow" @click.stop="ArrowSet('red_all')"
:class="formData.sta_ArrowType=='red_all'?'active':''">
:class="formData.sta_ArrowType=='red_all'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal" src="/static/images/4877/arrowLR.png" mode="aspectFit"></image>
@ -228,13 +228,13 @@
<view class="text">红色双向</view>
</view>
<view class="arrow" @click.stop="ArrowSet('green_all')"
:class="formData.sta_ArrowType=='green_all'?'active':''">
:class="formData.sta_ArrowType=='green_all'?'active':''">
<view class="outCircle">
<view class="item">
<image class="img nomal translate" src="/static/images/4877/arrowLR.png" mode="aspectFit">
</image>
<image class="img activity translate" src="/static/images/4877/arrowLRActive.png"
mode="aspectFit"></image>
mode="aspectFit"></image>
</view>
</view>
<view class="text">绿色双向</view>
@ -243,45 +243,26 @@
</view>
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot">
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :buttonCancelText="Status.Pop.buttonCancelText"
:showCancel="Status.Pop.showCancel" @cancelPop="closePop" :showSlot="Status.Pop.showSlot">
<view v-if="Status.ShowEditChannel" class="popup-prompt">
<text class="popup-prompt-title">修改信道</text>
<input class="popup-prompt-input" type="number" placeholder="1-125的整数"
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.sta_Channel" />
placeholder-class="popup-prompt-input-placeHolder" v-model="formData.sta_Channel" />
</view>
</MessagePopup>
<MsgBox ref="msgPop" />
<global-loading ref="loading" />
</view>
</template>
@ -304,7 +285,14 @@
} from '@/api/4877/BJQ4877.js';
import MqTool from '@/utils/MqHelper.js'
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
const pagePath = "/pages/4877/BJQ4877";
var ble = null;
@ -711,14 +699,14 @@
if (!this.permissions.includes('55') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -749,7 +737,7 @@
cancelCallback: () => {
this.Status.ShowEditChannel = false;
}
});
},these);
},
onChannelChanging() {
let regex = /^(0|([1-9]\d?)|1[01]\d|12[0-5])$/;
@ -792,14 +780,14 @@
if (!this.permissions.includes('53') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -855,14 +843,14 @@
groupCheck() {
if (!this.permissions.includes('54') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
uni.navigateTo({
@ -916,9 +904,9 @@
showUnWarn(val) {
// this.showPop({
// showPop({
// message: '确定解除声光报警模式?',
// iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
// iconUrl: "/static/images/common/uploadErr.png",
// borderColor: "#e034344d",
// buttonBgColor: "#E03434",
// okCallback: () => {
@ -938,14 +926,14 @@
if (!this.permissions.includes('54') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -997,14 +985,14 @@
sosSetting(item, index) {
if (!this.permissions.includes('42') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
let f = this.getDevice();
@ -1037,16 +1025,16 @@
let confirmTask = () => {
this.showPop({
showPop({
message: '确定' + (this.formData.sta_SOSType === 'sos' ? '关闭' : '开启') + '声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: task,
buttonText: (this.formData.sta_SOSType === 'sos' ? '关闭' : '开启'),
showCancel: true,
buttonCancelText: '取消'
});
},these);
}
if (item.val === 'sos') {
confirmTask();
@ -1258,9 +1246,9 @@
},
showBleUnConnect() {
this.showPop({
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -1286,34 +1274,10 @@
}
})
}
});
},these);
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
@ -1335,56 +1299,58 @@
this.Status.Pop.okCallback();
}
},
showPop: function(option) {
hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
showPop: function (option) {
hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
let keys = Object.keys(def);
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {
@ -1392,17 +1358,14 @@
borderColor = "#BBE600";
buttonBgColor = "#BBE600";
}
this.showPop({
showPop({
message: msg,
iconUrl: icoUrl,
borderColor: borderColor,
buttonBgColor: buttonBgColor,
buttonText: '确定',
okCallback: null
});
},
btnClick() {
},this);
}
}
}
@ -1768,46 +1731,7 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -195,7 +195,7 @@
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {

View File

@ -7,14 +7,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_PowerPercent}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<!-- <view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
@ -188,23 +188,7 @@
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
@ -507,7 +491,7 @@ import request, { baseURL } from '@/utils/request.js';
showUnWarn(val) {
this.showPop({
message: '确定解除声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: () => {
@ -562,7 +546,7 @@ import request, { baseURL } from '@/utils/request.js';
if (item.val === 'sos') {
this.showPop({
message: '确定开启声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: task,
@ -760,7 +744,7 @@ import request, { baseURL } from '@/utils/request.js';
this.showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -789,34 +773,6 @@ import request, { baseURL } from '@/utils/request.js';
});
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
closePop: function() {
this.Status.Pop.showPop = false;
@ -884,7 +840,7 @@ import request, { baseURL } from '@/utils/request.js';
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {
@ -1268,46 +1224,7 @@ import request, { baseURL } from '@/utils/request.js';
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -18,14 +18,14 @@
</view>
<view>
<view class="battery-v1">
<image src="/static/images/common/dl.png" class="dlIMG"></image>
<image src="/static/images/common/battry.png" class="dlIMG"></image>
<view>
<view class="battery-v2">{{deviceInfo.batteryPercentage}}%</view>
<view class="battery-v3">电量</view>
</view>
</view>
<view class="battery-v1">
<image src="/static/images/common/nz.png" class="dlIMG" mode="aspectFit"></image>
<image src="/static/images/common/time.png" class="dlIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">{{deviceInfo.batteryRemainingTime}}分钟</view>
<view class="battery-v3">续航时间</view>

View File

@ -23,24 +23,24 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_PowerPercent}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{battery}}</view>
<view class="bigTxt">{{formData.sta_PowerTime}}</view>
<view class="smallTxt">续航时间</view>
</view>
</view>
</view>
</view>
<view class="warnnig" :class="formData.sta_ShakeBit!==0 && formData.showShakeBit ?'':'displayNone'">
<view>{{formData.sta_ShakeBit==1?'设备疑似受到外力碰撞':'设备声光报警中'}}</view>
<view class="warnnig" :class="formData.sta_ShakeBit!==0 ?'':'displayNone'">
<view>{{formData.sta_ShakeBit==3?'设备疑似受到外力碰撞':'设备声光报警中'}}</view>
<view @click.stop="SOSToggle()">
<uni-icons type="closeempty" color="#FFFFFFde" size="16"></uni-icons>
</view>
@ -76,7 +76,10 @@
<text class="lbl">设备状态</text>
<text class="value valueFont">{{sta_system}}</text>
</view>
<view class="item">
<text class="lbl">环境温度</text>
<text class="value " :class="heatStyle">{{formData.sta_Heat}}</text>
</view>
<view class="item">
<text class="lbl">定位信息</text>
<view class="multiValue" @click.stop="gotoMap()">
@ -108,7 +111,7 @@
<view class="item">
<view>
<text class="lbl">海拔高度</text>
<view class="value valueFont leftIndent">{{formData.sta_height}}m</view>
<view class="value valueFont leftIndent">{{formData.sta_Height}}m</view>
</view>
<view>
<text class="lbl">相对高度</text>
@ -150,23 +153,23 @@
<text class="smallTxt">{{FuLight}}</text>
</view>
</view>
<view class="mode " :class="{active:formData.sta_laser===1}" v-on:click.stop="laserToggle">
<view class="mode " :class="{active:formData.sta_laser==1}" v-on:click.stop="laserToggle">
<view class="leftImg">
<image class="img" src="/static/images/common/jig.png" v-show="formData.sta_laser!==1"
<image class="img" src="/static/images/common/jig.png" v-show="formData.sta_laser!=1"
mode="aspectFit"></image>
<image class="img" src="/static/images/common/jigA.png" v-show="formData.sta_laser===1"
<image class="img" src="/static/images/common/jigA.png" v-show="formData.sta_laser==1"
mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">激光模式</text>
</view>
</view>
<view class="mode " :class="{active:formData.sta_ShakeBit!==0}" v-on:click.stop="SOSToggle">
<view class="mode " :class="{active:formData.sta_ShakeBit!=0}" v-on:click.stop="SOSToggle">
<view class="leftImg">
<image class="img" src="/static/images/common/sg.png" v-show="formData.sta_ShakeBit===0"
<image class="img" src="/static/images/common/sg.png" v-show="formData.sta_ShakeBit==0"
mode="aspectFit"></image>
<image class="img" src="/static/images/common/sgActive.png" v-show="formData.sta_ShakeBit!==0"
<image class="img" src="/static/images/common/sgActive.png" v-show="formData.sta_ShakeBit!=0"
mode="aspectFit"></image>
</view>
<view class="rightTxt">
@ -236,30 +239,14 @@
<view>
<view class="item">
<input maxlength="16" class="value" style="text-indent: 20rpx;" v-model="formData.msgTxt"
<input maxlength="16" class="value" style="text-indent: 20rpx;" v-model="formData.sendMsg"
placeholder="请输入文字" placeholder-class="usrplace" />
</view>
</view>
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proDetail('productDes')">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="proDetail('operatingInstruct')">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="proDetail('operationVideo')">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<MsgBox ref="msgPop" />
<global-loading ref="loading" />
@ -296,7 +283,7 @@
var eventChannel = null;
var these = null;
var ble = null;
var rec = null;
var recei = null;
var mq = null;
var pagePath = "pages/6075J/BJQ6075J";
var brightnessTimer = null;
@ -334,7 +321,7 @@
sta_imei: "", //sta_imei
sta_longitude: "", //经度
sta_latitude: "", //纬度
address:'',
address: '',
textLines: [],
company: "湖北星汉文化", //单位
@ -348,19 +335,20 @@
bleStatu: false,
sta_LightGrade: "", //主灯档位
sta_LightGrade: "", //副灯档位
sta_ShakeBit: "1", //报警状态
sta_Side_Light: "", //副灯档位
sta_ShakeBit: 0, //报警状态
sta_4gSinal: "", //4G信号强度
sta_laser: "", //激光状态
sta_brightness: 100, //亮度
sta_SOSGrade: "1", //强制报警状态
showSosGrade:false,
showShakeBit:false,
sta_height:'',//海拔
sta_releaHeight:'',
sta_BreakNews:'',
deviceId:''
sta_Height: '', //海拔
sta_Heat: '', //温度
sta_releaHeight: '',
sta_BreakNews: '',
deviceId: ''
},
device: {
id: "",
@ -412,7 +400,7 @@
staPowerPercent: null,
staDetectResult: null
},
inteval:50
inteval: 80
}
},
computed: {
@ -449,20 +437,24 @@
}
return state;
},
battery(){
let hours = Math.floor(this.formData.sta_PowerTime / 60);
let remainingMinutes = this.formData.sta_PowerTime % 60;
let xuhang = '0分';
// 处理不同情况的显示
if (hours === 0) {
xuhang = `${remainingMinutes}`;
} else if (remainingMinutes === 0) {
xuhang = `${hours}小时`;
} else {
xuhang = `${hours}小时${remainingMinutes}`;
heatStyle() {
if (this.formData.sta_Heat < 0) {
return 'hanleng';
}
return xuhang;
if (this.formData.sta_Heat >= 0 && this.formData.sta_Heat <= 30) {
return 'green';
}
if (this.formData.sta_Heat > 30 && this.formData.sta_Heat <= 40) {
return 're'
}
if (this.formData.sta_Heat > 40 && this.formData.sta_Heat <= 60) {
return 'yanRe'
}
if (this.formData.sta_Heat > 60) {
return 'kuRe'
}
return '';
}
},
created() {
@ -487,14 +479,17 @@
onShow() {
this.Status.pageHide = false;
let f=this.getDevice();
if(f){
these.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}
let f = this.getDevice();
if (f) {
these.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
onHide: function() {
this.Status.pageHide = true;
@ -509,7 +504,7 @@
rec = BleReceive.getBleReceive();
recei = BleReceive.getBleReceive();
ble = BleTool.getBleTool();
@ -561,7 +556,10 @@
these.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
});
@ -587,52 +585,40 @@
this.formData.usrid = personnelInfo.code
}
this.formData.sta_PowerPercent = json.staPowerPercent
this.formData.sta_PowerTime = json.staPowerTime;
this.formData.sta_SOSGrade = json.staSOSGrade;
}
});
},
initWatch(){
this.$watch("formData.sta_SOSGrade", (newVal, oldVal) => {
console.log("报警状态发生变化");
if (newVal == 1) {
this.formData.showSosGrade = true;
initWatch() {
this.$watch("formData.sta_Heat", (newVal, oldVal) => {
if (newVal) {
if (newVal < -30) {
MsgError("危险:环境温度过低,当前温度" + newVal + ",请立即撤离", "确定");
}
if (newVal >= 40 && newVal < 60) {
MsgWarning("注意:环境温度过高,当前温度" + newVal, "确定");
} else if (newVal >= 60 && newVal < 80) {
MsgWarning("警告:环境温度过高,当前温度" + newVal + ",注意停留时间", "确定");
} else if (newVal >= 80) {
MsgError("危险:环境温度过高,当前温度" + newVal + ",请立即撤离", "确定");
}
}
});
this.$watch("formData.sta_ShakeBit", (newVal, oldVal) => {
console.log("碰撞状态发生变化");
if (newVal != 0) {
this.formData.showShakeBit = true;
}
});
this.$watch("formData.sta_BreakNews",(newVal,oldVal)=>{
if(newVal){
MsgSuccess("用户已确认收到紧急通知","确定",these);
setTimeout(()=>{
these.formData.sta_BreakNews="";
},10);
this.$watch("formData.sta_BreakNews", (newVal, oldVal) => {
if (newVal) {
MsgSuccess("用户已确认收到紧急通知", "确定", these);
setTimeout(() => {
these.formData.sta_BreakNews = "";
}, 10);
}
});
this.$watch("formData.sta_PowerPercent", (newVal, oldVal) => {
console.log("电量发生变化");
if (newVal <=20 && this.formData.sta_system===2 || this.formData.sta_system===0) {
if (newVal <= 20 && (this.formData.sta_system === 2 || this.formData.sta_system === 0)) {
//电量在20%及以及下,且是未充电状态提醒
showPop({
message: "设备电量低于20%,请充电",
@ -644,8 +630,8 @@
showHeader: false,
visibleClose: true,
textColor: '#E03434',
iconUrl:'/static/images/common/path.png'
},this);
iconUrl: '/static/images/common/path.png'
}, this);
}
});
@ -778,7 +764,7 @@
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: "确定",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png"
iconUrl: "/static/images/common/uploadErr.png"
}, these);
reject(err);
these.videoHexArray = null;
@ -868,7 +854,7 @@
if (arr[0].status == 'rejected') {
showPop({
message: "设备准备未就绪",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
}, these);
@ -895,7 +881,7 @@
showPop({
message: "与服务器连接出现异常,请检查网络设置",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
}, these);
@ -906,7 +892,7 @@
hideLoading(these);
showPop({
message: "出现异常," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
}, these);
@ -978,7 +964,7 @@
err = err.join(";");
showPop({
message: err,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
}, these);
@ -1025,16 +1011,17 @@
if (currentPacket > totalPackets) {
hideLoading(these);
these.closeAction();
these.showPop({
showPop({
showPop: true,
message: "上传成功",
iconUrl: "/static/images/common/success.png",
});
setTimeout(()=>{
ble.sendString(f.deviceId, "transmit complete", f.writeServiceId, f
.wirteCharactId);
},1000);
setTimeout(() => {
ble.sendString(f.deviceId, "transmit complete", f
.writeServiceId, f
.wirteCharactId);
}, 1000);
these.rgb565Data = null;
resolve();
@ -1070,24 +1057,14 @@
'0')); // 包序号
if (packetData.length == 250) {
dataView.setUint8(3, 0x01);
dataView.setUint8(4, 0xF4);
} else {
dataView.setUint8(3, 0x00);
dataView.setUint8(4, 0x64);
}
dataView.setUint16(3, packetData.length*2,false); // 包t长度
// 填充数据每个RGB565值占2字节
for (let i = 0; i < packetData.length; i++) {
dataView.setUint16(5 + i * 2, packetData[i], false); // 大端字节序
}
if (currentPacket > 51) { //第52包补FF
for (var i = 105; i < bufferSize; i++) {
dataView.setUint8(i, 0xFF);
}
}
@ -1111,9 +1088,9 @@
return;
}
these.closeAction();
these.showPop({
showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1134,9 +1111,9 @@
}).catch((err) => {
console.log("握手没有成功");
these.showPop({
showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1205,7 +1182,7 @@
ins_brightness: e.detail.value
}
this.sendData(json, null, 'string').then(res=>{
this.sendData(json, null, 'string').then(res => {
this.setBleFormData();
}).catch(ex => {
@ -1220,18 +1197,18 @@
},
getLightMode(type) {
let item = null;
let index = null;
let value = null;
if (type === 'main') {
index = 0;
value = this.formData.sta_LightGrade;
item = this.dic.actionSheets[0];
} else {
index = 1;
value = this.formData.sta_Side_Light;
item = this.dic.actionSheets[1];
}
let f = item.menuItems.find(v => {
if (v.value == this.dic.actionSheets[index].value) {
if (v.value == value) {
return true;
}
});
@ -1286,37 +1263,37 @@
item.menuItems = [{
text: '强光',
icon: '/static/images/lightImg/qiang.png',
value: '1',
value: 1,
key: 'ins_LightGrade'
},
{
text: '工作光',
icon: '/static/images/lightImg/work.png',
value: '2',
value: 2,
key: 'ins_LightGrade'
},
{
text: '节能光',
icon: '/static/images/lightImg/jieN.png',
value: '3',
value: 3,
key: 'ins_LightGrade'
},
{
text: '爆闪',
icon: '/static/images/lightImg/shan.png',
value: '4',
value: 4,
key: 'ins_LightGrade'
},
{
text: 'SOS',
icon: '/static/images/lightImg/sos.png',
value: '5',
value: 5,
key: 'ins_LightGrade'
},
{
text: '关闭',
icon: '/static/images/lightImg/closeLight.png',
value: '6',
value: 6,
key: 'ins_LightGrade'
}
];
@ -1329,31 +1306,31 @@
item1.menuItems = [{
text: '泛光',
icon: '/static/images/lightImg/fan.png',
value: '2',
value: 2,
key: 'ins_Side_Light'
},
{
text: '泛光爆闪',
icon: '/static/images/lightImg/fan.png',
value: '3',
value: 3,
key: 'ins_Side_Light'
},
{
text: '警示灯',
icon: '/static/images/lightImg/warn.png',
value: '1',
value: 1,
key: 'ins_Side_Light'
},
{
text: '警示灯/泛光',
icon: '/static/images/lightImg/warn.png',
value: '4',
value: 4,
key: 'ins_Side_Light'
},
{
text: '关闭',
icon: '/static/images/lightImg/closeLight.png',
value: '5',
value: 5,
key: 'ins_Side_Light'
}
];
@ -1418,13 +1395,16 @@
this.dic.actionSheets = [item, item1, item3];
},
SOSToggle() {
debugger;
if (!this.permissions.includes('42') && this.Status.apiType !== 'listA') {
MsgError('无操作权限', '确定', these);
return;
}
let val = 1;
if (this.formData.sta_ShakeBit === 1) {
if (this.formData.sta_ShakeBit == 3) {
val = 0;
} else if (this.formData.sta_ShakeBit == 1) {
val = 0;
}
@ -1438,19 +1418,19 @@
console.error("出现错误", ex)
});
}
let msg=val==1?'确定开启声光报警':'确定关闭声光报警';
let msg = val == 1 ? '确定开启声光报警' : '确定关闭声光报警';
showPop({
message: msg,
iconUrl: "/static/images/670/sgActive.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '确定',
buttonTextColor: '#232323de',
showCancel: true,
buttonCancelText: '取消',
okCallback: send
}, these);
showPop({
message: msg,
iconUrl: "/static/images/670/sgActive.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '确定',
buttonTextColor: '#232323de',
showCancel: true,
buttonCancelText: '取消',
okCallback: send
}, these);
@ -1508,6 +1488,7 @@
let key = li.key.replace(/ins_/g, 'sta_');
this.formData[key] = li.value;
this.setBleFormData();
this.formData.sta_brightness = 100;
}).catch((ex) => {
console.error("出现错误", ex)
});
@ -1674,11 +1655,14 @@
}, 0);
},
sendMsg() {
debugger;
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
MsgError('无操作权限', '确定', these);
return;
}
this.formData.sendMsg.padStart(16, ' ');
this.formData.textLines = [this.formData.sendMsg.slice(0, 8), this.formData.sendMsg.slice(8, 16)];
@ -1907,11 +1891,13 @@
},
getDevice: function() {
console.log("LinkedList=", ble.data.LinkedList);
console.log("this.device=", this.device);
// console.log("LinkedList=", ble.data.LinkedList);
// console.log("this.device=", this.device);
let f = ble.data.LinkedList.find((v) => {
if(v.macAddress == these.device.deviceMac){
if(!this.formData.deviceId){this.formData.deviceId=v.deviceId};
if (v.macAddress == these.device.deviceMac) {
if (!this.formData.deviceId) {
this.formData.deviceId = v.deviceId
};
return true;
}
});
@ -1922,7 +1908,7 @@
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -1987,10 +1973,17 @@
keys.forEach(key => {
this.formData[key] = data[key];
});
this.$set(this.dic.actionSheets[0], 'value', this.formData.sta_LightGrade);
this.$set(this.dic.actionSheets[1], 'value', this.formData.sta_Side_Light);
this.setBleFormData();
},
setBleFormData() {
if (!ble) {
return;
}
let f = ble.data.LinkedList.find((v) => {
if (v.deviceId == these.formData.deviceId) {
v.formData = these.formData;
@ -2071,13 +2064,41 @@
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
these.formData.bleStatu = 'err';
}).finally(() => {
setTimeout(() => {
hideLoading(these);
}, 1000);
});
},
bleStatuToggle() {
let f = this.getDevice();
if (!f) {
this.showBleUnConnect();
return;
}
if (this.formData.bleStatu === true) {
this.formData.bleStatu = 'dicconnect';
ble.disconnectDevice(f.deviceId).finally(r => {
this.formData.bleStatu = false;
});
return;
}
if (this.formData.bleStatu === false || this.formData.bleStatu === 'err') {
this.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
},
gotoMap() {
let promise = lnglatConvert.wgs84_to_gcj02(this.formData.sta_longitude, this.formData.sta_latitude);
@ -2099,18 +2120,7 @@
});
},
proDetail: function(pgetpe) {
let url = '/pages/common/' + pgetpe + '/index?id=' + (this.device.id ? this.device.id : 0);
uni.navigateTo({
url: url,
fail(ex) {
console.error(ex);
}
});
},
prevPage() {
uni.navigateBack({
@ -2515,46 +2525,6 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {
@ -2914,4 +2884,20 @@
text-indent: 10rpx;
display: inline-block;
}
.hanleng {
color: #66CCFF;
}
.re {
color: #FFB74D
}
.yanRe {
color: #F57C00;
}
.kuRe {
color: #B71C1C;
}
</style>

View File

@ -7,16 +7,17 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_PowerPercent}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
<view class="bigTxt">
{{formData.sta_charge?dic.sta_charge[formData.sta_charge+'']:"未充电" }}
</view>
<view class="smallTxt">设备状态</view>
</view>
@ -74,12 +75,12 @@
<view class="h50">
<view class="workMode">
<view class="item" @click.stop="highSpeedSetting(item,index,true)"
:class="{'active':formData.sta_highSpeed && formData.sta_LedType===item.key}">
:class="{'active':formData.sta_highSpeed && formData.sta_LedType===item.key}">
<view class="checkbox"></view>
<text>强光</text>
</view>
<view class="item " @click.stop="highSpeedSetting(item,index,false)"
:class="{'active':formData.sta_highSpeed===false && formData.sta_LedType===item.key}">
:class="{'active':formData.sta_highSpeed===false && formData.sta_LedType===item.key}">
<view class="checkbox "></view>
<text>工作光</text>
</view>
@ -93,7 +94,7 @@
<view class="mode fleft marginLeft" :class="{'rbActive':formData.SOS}" v-on:click.stop="sosSetting()">
<view class="leftImg">
<image class="img" :src="formData.SOS?'/static/images/670/sgActive.png':'/static/images/670/sg.png'"
mode="aspectFit">
mode="aspectFit">
</image>
</view>
<view class="rightTxt">
@ -114,9 +115,9 @@
<view class="mode fleft " @click.stop="playVolume()" :class="{'active':formData.isPlay}">
<view class="leftImg">
<image class="img" :class="{'displayNone':formData.isPlay}" src="/static/images/common/play.png"
mode="aspectFit"></image>
mode="aspectFit"></image>
<image class="img" :class="{'displayNone':!formData.isPlay}"
src="/static/images/common/playingActive.png" mode="aspectFit"></image>
src="/static/images/common/playingActive.png" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">{{formData.isPlay?'正在播放':'播放语音'}}</text>
@ -183,36 +184,14 @@
</view>
</view>
<view style="padding-bottom: 20rpx;">
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup v-for="item,key in Msgboxs" :visible="item.showPop" :type="item.popType" :bgColor="item.bgColor"
:borderColor="item.borderColor" :textColor="item.textColor" :buttonBgColor="item.buttonBgColor"
:buttonTextColor="item.buttonTextColor" :iconUrl="item.iconUrl" :message="item.message"
:buttonText="item.buttonText" @buttonClick="item.okCallback(item)" :visiblePrompt="item.visiblePrompt"
:promptTitle="item.promptTitle" v-model="item.modelValue" @closePop="closePop(item)"
:buttonCancelText="item.buttonCancelText" :showCancel="item.showCancel" @cancelPop="closePop(item)" />
:borderColor="item.borderColor" :textColor="item.textColor" :buttonBgColor="item.buttonBgColor"
:buttonTextColor="item.buttonTextColor" :iconUrl="item.iconUrl" :message="item.message"
:buttonText="item.buttonText" @buttonClick="item.okCallback(item)" :visiblePrompt="item.visiblePrompt"
:promptTitle="item.promptTitle" v-model="item.modelValue" @closePop="closePop(item)"
:buttonCancelText="item.buttonCancelText" :showCancel="item.showCancel" @cancelPop="closePop(item)" />
<!-- 下方菜单 -->
@ -226,7 +205,7 @@
<view class="header">
<uni-icons @click.stop="Status.showVolumPop=false" type="closeempty" size="15"
color="#FFFFFFde"></uni-icons>
color="#FFFFFFde"></uni-icons>
</view>
<view class="txtContent">
<view class="volTxt">
@ -239,8 +218,8 @@
<view class="slider-container">
<slider min="0" max="100" step="1" :disabled="false" :value="formData.volumn" activeColor="#bbe600"
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="volumechange"
@changing="volumechange" class="custom-slider" />
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="volumechange"
@changing="volumechange" class="custom-slider" />
</view>
@ -248,7 +227,7 @@
</view>
</view>
<MsgBox ref="msgPop" />
</view>
</template>
@ -265,7 +244,16 @@
baseURL
} from '@/utils/request.js'
import Common from '@/utils/Common.js'
import Common from '@/utils/Common.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
const pagePath = "/pages/018A/HBY018A";
var ble = null;
@ -419,7 +407,10 @@
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
these.setBleFormData();
@ -439,7 +430,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
computed: {
@ -551,7 +545,7 @@
this.closePop(item);
}
if (msg) {
this.showPop({
showPop({
key: Common.guid(),
message: msg,
iconUrl: "/static/images/common/playingActive.png",
@ -561,7 +555,7 @@
buttonText: '确定',
buttonCancelText: '取消',
showCancel: true
});
},these);
} else {
exec();
}
@ -667,17 +661,17 @@
// },500)
}
this.showPop({
showPop({
key: key,
message: msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: sosToggle,
buttonText: '确定',
buttonCancelText: '取消',
showCancel: true
});
},these);
},
deviceRecovry(res) {
@ -742,7 +736,8 @@
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
these.formData.bleStatu = 'err';
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -838,10 +833,10 @@
},
showBleUnConnect() {
this.showPop({
showPop({
key: Common.guid(),
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -867,34 +862,10 @@
}
})
}
});
},these);
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
//关闭某个弹窗,并执行关闭的回调函数
@ -918,63 +889,12 @@
}
},
//根据传入的配置,自定义一个弹窗
showPop: function(option) {
let def = {
key: '',
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
cancelCallback: null
}
let json = {};
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
json[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
json[key] = option[key];
}
}
if (!json.borderColor) {
json.borderColor = '#BBE600';
json.buttonBgColor = '#BBE600';
}
json.showPop = true;
if (!('key' in json)) {
json.key = Common.guid();
}
this.Msgboxs.push(json);
},
showMsg(msg, type) {
let cfg = {
error: {
icoUrl: '/static/images/6155/DeviceDetail/uploadErr.png',
icoUrl: '/static/images/common/uploadErr.png',
borderColor: "#e034344d",
buttonBgColor: "#E03434"
},
@ -1008,7 +928,7 @@
buttonText: '确定',
okCallback: this.closePop
};
this.showPop(options);
showPop(options,these);
}
}
}
@ -1487,46 +1407,7 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -28,14 +28,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.battary}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
@ -74,8 +74,8 @@
<view class="slider-container">
<slider min="1" max="100" step="1" :disabled="false" :value="formData.liangDu" activeColor="#bbe600"
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" @changing="sliderChanging"
class="custom-slider" />
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange" @changing="sliderChanging"
class="custom-slider" />
</view>
</view>
@ -124,55 +124,33 @@
<view class="btnSend fright" v-on:click.stop="sendUsr">发送</view>
<view class="clear"></view>
<TextToHexV1 class="TextToHex" ref="textToHex" :txts="formData.textLines" :bgColor="'#FFFFFF'"
:color="'#000000'" :fontSize="16" />
:color="'#000000'" :fontSize="16" />
</view>
<view class="item">
<text class="lbl">单位</text>
<input class="value" v-model.trim="formData.textLines[0]" placeholder="请输入单位" maxlength="8"
placeholder-class="usrplace" />
placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">部门</text>
<input class="value" v-model.trim="formData.textLines[1]" placeholder="请输入姓名" maxlength="8"
placeholder-class="usrplace" />
placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">姓名</text>
<input class="value" v-model.trim="formData.textLines[2]" placeholder="请输入职位" maxlength="8"
placeholder-class="usrplace" />
placeholder-class="usrplace" />
</view>
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" @closePop="closePop" :visiblePrompt="Status.Pop.visiblePrompt"
:promptTitle="Status.Pop.promptTitle" v-model="Status.Pop.modelValue" />
<!-- 下方菜单 -->
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
@btnClick="btnClick">
@btnClick="btnClick">
<view class="addIco">
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
<image mode="aspectFit" class="img" src="/static/images/6155/DeviceDetail/add.png"></image>
@ -182,6 +160,7 @@
</BottomSlideMenuPlus>
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -201,6 +180,14 @@
} from '@/utils/request.js';
var pagePath = "/pages/6155/BJQ6155";
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
var ble = null;
var these = null;
@ -413,7 +400,10 @@
these.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
these.setBleFormData();
these.getDetail();
@ -433,7 +423,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
onBackPress(e) {
@ -480,6 +473,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
@ -640,7 +634,8 @@
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
MsgError("连接错误:" + ex.msg, "确定", these);
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -698,42 +693,18 @@
if (this.formData.battary <= 20) {
this.showPop({
message: "设备电量低",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
}
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
showBleUnConnect() {
this.showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -769,11 +740,11 @@
return;
}
let os = plus.os.name;
// 分包发送图片数据
var sendImagePackets = function(ReSendNo) {
return new Promise((resolve, reject) => {
// 总数据包数
let totalPackets = os=='Android'?52:200;
let currentPacket = 1;
@ -808,11 +779,7 @@
// 计算当前包的数据
let packetSize = os == 'Android' ? 250 : 64;
// if (currentPacket <= 51) {
// packetSize = 250; // 前51个包每个500字节
// } else {
// packetSize = 50; // 最后一个包100字节
// }
// 创建数据包
let startIndex = (currentPacket - 1) * packetSize;
@ -824,7 +791,7 @@
let packetData = these.rgb565Data.slice(startIndex,
endIndex);
// 构建数据包
let bufferSize = os ==packetSize.length*2+5; // 5 + packetData.length * 2; // 头部5字节 + 数据部分
let bufferSize = packetData.length * 2+5; // 头部5字节 + 数据部分
let buffer = new ArrayBuffer(bufferSize);
let dataView = new DataView(buffer);
@ -860,7 +827,7 @@
these.Status.BottomMenu.show = false;
these.showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -883,7 +850,7 @@
console.log("握手没有成功");
these.showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -911,8 +878,9 @@
console.log("data=", data);
these.Status.BottomMenu.show = false;
these.rgb565Data = Common.convertToRGB565(data.piexls);
console.log("1111111111")
setTimeout(function() {
console.log("1111111111")
sendImagePackets().catch(() => {
});
@ -939,7 +907,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1072,7 +1040,7 @@
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: "确定",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png"
iconUrl: "/static/images/common/uploadErr.png"
});
reject(err);
these.videoHexArray = null;
@ -1162,7 +1130,7 @@
if (arr[0].status == 'rejected') {
these.showPop({
message: "设备准备未就绪",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1189,7 +1157,7 @@
these.showPop({
message: "与服务器连接出现异常,请检查网络设置",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1200,7 +1168,7 @@
hideLoading(these);
these.showPop({
message: "出现异常," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1273,7 +1241,7 @@
err = err.join(";");
these.showPop({
message: err,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1297,7 +1265,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1353,7 +1321,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1437,7 +1405,7 @@
}).catch((ex) => {
these.showPop({
message: "发送失败," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1540,13 +1508,14 @@
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
showPop(option, these);
},
sendUsr() {
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1585,7 +1554,7 @@
if (err) {
this.showPop({
message: "单位、部门、姓名必须填写且最多8字",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1706,7 +1675,7 @@
hideLoading(these);
these.showPop({
message: "发送失败: " + (err.msg || err.message),
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1723,7 +1692,7 @@
hideLoading(these);
this.showPop({
message: "发送失败: " + (ex.msg || ex.message),
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1793,7 +1762,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -2217,46 +2186,6 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: "PingFang SC";
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -11,7 +11,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -29,14 +29,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.battary}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
@ -75,8 +75,8 @@
<view class="slider-container">
<slider min="1" max="100" step="1" :disabled="false" :value="formData.liangDu" activeColor="#bbe600"
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChange" class="custom-slider" />
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChange" class="custom-slider" />
</view>
</view>
@ -125,55 +125,33 @@
<view class="btnSend fright" v-on:click.stop="sendUsr">发送</view>
<view class="clear"></view>
<TextToHexV1 class="TextToHex" ref="textToHex" :txts="formData.textLines" :bgColor="'#FFFFFF'"
:color="'#000000'" :fontSize="14" />
:color="'#000000'" :fontSize="14" />
</view>
<view class="item">
<text class="lbl">单位</text>
<input class="value" v-model.trim="formData.textLines[0]" placeholder="请输入单位"
placeholder-class="usrplace" />
placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">部门</text>
<input class="value" v-model.trim="formData.textLines[1]" placeholder="请输入姓名"
placeholder-class="usrplace" />
placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">姓名</text>
<input class="value" v-model.trim="formData.textLines[2]" placeholder="请输入职位"
placeholder-class="usrplace" />
placeholder-class="usrplace" />
</view>
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" @closePop="closePop" :visiblePrompt="Status.Pop.visiblePrompt"
:promptTitle="Status.Pop.promptTitle" v-model="Status.Pop.modelValue" />
<!-- 下方菜单 -->
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
@btnClick="btnClick">
@btnClick="btnClick">
<view class="addIco">
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
<image mode="aspectFit" class="img" src="/static/images/6155/DeviceDetail/add.png"></image>
@ -183,6 +161,7 @@
</BottomSlideMenuPlus>
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -202,6 +181,14 @@
} from '@/utils/request.js';
var pagePath = "/pages/6155/deviceDetail";
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
var ble = null;
var these = null;
@ -383,7 +370,10 @@
these.formData.bleStatu = 'connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
these.setBleFormData();
these.getDetail();
@ -403,7 +393,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
onBackPress(e) {
@ -450,6 +443,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
@ -621,7 +615,8 @@
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
these.formData.bleStatu = 'err';
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -678,42 +673,18 @@
if (this.formData.battary <= 20) {
this.showPop({
message: "设备电量低",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
}
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
showBleUnConnect() {
this.showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -913,7 +884,7 @@
these.Status.BottomMenu.show = false;
these.showPop({
message: "发送数据包失败了" + err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -972,7 +943,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1285,7 +1256,7 @@
err = err.join(";");
these.showPop({
message: err,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1362,7 +1333,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1442,7 +1413,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1522,7 +1493,7 @@
}).catch((ex) => {
these.showPop({
message: "发送失败," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1625,6 +1596,7 @@
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
showPop(option,this);
},
sendUsr() {
@ -1632,7 +1604,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1658,7 +1630,7 @@
if (err) {
this.showPop({
message: "单位、部门、姓名必须填写且最多7字",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1756,7 +1728,7 @@
hideLoading(these);
this.showPop({
message: "发送失败: " + (ex.msg || ex.message),
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1798,7 +1770,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -2192,46 +2164,7 @@
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: "PingFang SC";
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -16,7 +16,7 @@
</view>
<view>
<view class="battery-v1">
<image src="/static/images/common/dl.png" class="dlIMG"></image>
<image src="/static/images/common/battry.png" class="dlIMG"></image>
<view>
<view class="battery-v2"
:style="{ color: deviceInfo.batteryPercentage < 20 ? '#FF0000' : '' }">
@ -29,7 +29,7 @@
</view>
</view>
<view class="battery-v1">
<image src="/static/images/common/nz.png" class="dlIMG" mode="aspectFit"></image>
<image src="/static/images/common/time.png" class="dlIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">{{ deviceInfo.batteryRemainingTime || '0' }}分钟</view>
<view class="battery-v3">续航时间</view>
@ -54,7 +54,7 @@
</view>
<view class="info-row" v-if="itemInfo.deviceMac" @click="bleStatuToggle">
<text class="info-label">蓝牙状态</text>
<text class="info-value status-running" >
<text class="info-value status-running" :class="formData.bleStatu?'green':'red'" >
{{getbleStatu}}
</text>
</view>
@ -115,6 +115,17 @@
</view>
</view>
</view>
<view class="mode-v1" :class="{'active':itemInfo.alarmStatus===1 || itemInfo.alarmStatus==='1'}" >
<view class="mode-v2" @click="warnToggle">
<image v-show="itemInfo.alarmStatus!=1" src="/static/images/common/sg.png" class="setIMG" mode="aspectFit"></image>
<image v-show="itemInfo.alarmStatus==1" src="/static/images/common/sgActive.png" class="setIMG" mode="aspectFit"></image>
<view>
<view class="battery-v2">{{itemInfo.alarmStatus==1?'解除报警':'强制报警'}}</view>
</view>
</view>
</view>
<view class="mode-v1" v-if="hasPermission('3')">
<view class="mode-v2" @click="uploadStartup">
<image src="/static/images/common/path7.png" class="setIMG" mode="aspectFit"></image>
@ -130,7 +141,7 @@
<!-- 人员信息登记 -->
<view class="form-section" v-if="hasPermission('4')">
<TextToHexV2 class="TextToHex" ref="textToHex" :txts="formData.textLines" :bgColor="'#FFFFFF'"
:color="'#000000'" :fontSize="12" :returnType="10" />
:color="'#000000'" :fontSize="14" :returnType="10" />
<view class="mode-buttons">
<view class="section-title">人员信息登记</view>
@ -175,23 +186,8 @@
</view>
</view>
<!-- 产品信息 -->
<view v-if="hasPermission('6')">
<view class="section-title">产品信息</view>
<view class="mode-buttons">
<view class="mode_1" @click="productparams">
<image src="/static/images/common/cp.png" class="cpIMG" mode="aspectFit"></image>
<view class="">产品参数</view>
</view>
<view class="mode_1" @click="operatingInst">
<image src="/static/images/common/sm.png" class="cpIMG" mode="aspectFit"></image>
<view class="">操作说明</view>
</view>
<view class="mode_1" @click="operatingVideo">
<image src="/static/images/common/sp.png" class="cpIMG" mode="aspectFit"></image>
<view class="">操作视频</view>
</view>
</view>
</view>
<ProParams :id="itemInfo.id"></ProParams>
</view>
<!-- 弹框 -->
<view class="agreement-mask" v-if="lightModeA" @click.stop="closePopup">
@ -273,9 +269,16 @@
<!-- 解除报警 -->
<CustomPopup v-if="popupType === 'cancel'" :show="showPopupFlag"
popupBorder="1rpx solid rgba(224, 52, 52, 0.3)" :message="popupMessage"
icon="/static/images/6170/svg.png" :confirm-text="popupConfirmText" :show-cancel="false"
icon="/static/images/6170/svg.png" :confirm-text="popupConfirmText" :show-cancel="true"
@confirm="onPopupConfirmPolice" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
<!-- 强制报警 -->
<CustomPopup v-if="popupType === 'openWarn'" :show="showPopupFlag"
popupBorder="1rpx solid rgba(224, 52, 52, 0.3)" :message="popupMessage"
icon="/static/images/6170/svg.png" :confirm-text="popupConfirmText" :show-cancel="true"
@confirm="OpenWarn(1)" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
<MsgBox ref="msgPop" />
<global-loading ref="loading" />
</view>
@ -405,7 +408,7 @@
Status: {
pageHide: null
},
inteval: 120
inteval: 200
}
},
computed: {
@ -453,6 +456,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:"+ex.msg,"确定",these);
});
return;
}
@ -461,8 +465,7 @@
},
getDevice: function() {
if (ble) {
console.log("LinkedList=", ble.data.LinkedList);
console.log("this.device=", this.itemInfo);
let f = ble.data.LinkedList.find((v) => {
if (v.macAddress == this.itemInfo.deviceMac) {
if (!this.formData.deviceId) {
@ -497,7 +500,7 @@
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -566,6 +569,8 @@
updateLoading(these, {
text: ex.msg
})
these.formData.bleStatu = 'err';
MsgError("连接错误:"+ex.msg,"确定",these);
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -904,7 +909,7 @@
json.instruct[1] = parseInt(selectedItem.instructValue);
ble.sendString(f.deviceId, json).then(res => {
console.log("ble send success")
console.log("ble send success",json);
this.lightModeA = false;
}).catch(ex => {
console.error("ble send fail,mqsending....")
@ -926,6 +931,7 @@
},
// 激光确认框提交
handleBtn() {
@ -1208,15 +1214,9 @@
dataView.setUint8(0, 0x55); // 帧头
dataView.setUint8(1, 0x02); // 帧类型:开机画面
dataView.setUint8(2, currentPacket); // 包序号
dataView.setUint16(3, packetData.length*2,false); // 包t长度
if (packetData.length == 250) {
dataView.setUint8(3, 0x01);
dataView.setUint8(4, 0xF4);
} else {
dataView.setUint8(3, 0x00);
dataView.setUint8(4, 0x64);
}
// 填充数据每个RGB565值占2字节
for (let i = 0; i < packetData.length; i++) {
@ -1254,7 +1254,7 @@
showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
}, these);
@ -1277,7 +1277,7 @@
console.log("握手没有成功");
showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
}, these);
@ -1561,16 +1561,69 @@
// 强制报警()
handlePolice() {
this.popupType = 'cancel';
this.popupMessage = '确认解除所选设备的报警状态';
this.popupMessage = '确认解除报警状态';
this.showPopupFlag = true;
// this.popupConfirmText="";
},
OpenWarn(val){//开启/解除强制报警
const topic = `B/${this.itemInfo.deviceImei}`;
let message={"instruct":[7,val,0,0,0,0]};
message=JSON.stringify(message);
let flag=this.mqttClient.publish(topic, message, {
qos: 1
});
if(flag){
this.itemInfo.alarmStatus=val;
}
this.showPopupFlag = false;
},
warnToggle(){
if(this.itemInfo.alarmStatus==1){
this.popupType = 'cancel';
this.popupMessage = '确认解除报警状态';
}else{
this.popupType = 'openWarn';
this.popupMessage = '确认开启报警状态';
}
this.showPopupFlag = true;
// this.popupConfirmText="开启";
// let val=1;
// let msg="确认开启强制报警?";
// if(this.itemInfo.alarmStatus==1){
// val=0;
// msg="确认解除强制报警?";
// }
// let mqSend=()=>{
// const topic = `B/${this.itemInfo.deviceImei}`;
// let message={"instruct":[7,val,0,0,0,0]};
// message=JSON.stringify(message);
// let flag=this.mqttClient.publish(topic, message, {
// qos: 1
// });
// if(flag){
// this.itemInfo.alarmStatus=val;
// }
// }
},
// 解除报警逻辑
async onPopupConfirmPolice() {
if (this.deviceInfo.onlineStatus !== 1) {
uni.showToast({
title: '设备已离线',
icon: 'none'
});
// uni.showToast({
// title: '设备已离线',
// icon: 'none'
// });
this.OpenWarn(0);//走mq直发
return;
}
this.isPolling = true; // 标记开始轮询
@ -1595,8 +1648,10 @@
title: registerRes.msg,
icon: 'none'
})
return
}
this.itemInfo.alarmStatus=0;
// 4. 获取设备状态FunctionAccessBatchStatusRule 批量
let deviceImei = this.itemInfo.deviceImei
let typeName = this.itemInfo.typeName
@ -1791,27 +1846,7 @@
}
}
},
// 操作说明
operatingInst() {
let id = this.computedDeviceId
uni.navigateTo({
url: `/pages/common/operatingInstruct/index?id=${id}`
})
},
// 产品参数
productparams() {
let id = this.computedDeviceId
uni.navigateTo({
url: `/pages/common/productDes/index?id=${id}`
})
},
// 操作视频
operatingVideo() {
let id = this.computedDeviceId
uni.navigateTo({
url: `/pages/common/operationVideo/index?id=${id}`
})
},
// 发送mqtt查询设备信息
queryDeviceStatus() {
if (this.mqttClient && this.mqttClient.isConnected()) {
@ -1956,6 +1991,9 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(
res => {
these.formData.bleStatu = true;
}).catch(ex=>{
these.formData.bleStatu = 'err';
MsgError("连接错误:"+ex.msg,"确定",these);
});
}
}
@ -1976,6 +2014,8 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
this.formData.bleStatu = true;
}).catch(ex=>{
MsgError("连接错误:"+ex.msg,"确定",these);
});
}
},
@ -2210,6 +2250,11 @@
width: 47%;
display: flex;
text-align: center;
box-sizing: border-box;
border: 1rpx solid #00000000;
}
.mode-v1.active{
border:1rpx solid #bbe600 !important;
}
.mode-v2 {

View File

@ -6,14 +6,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.battary}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
@ -22,14 +22,14 @@
</view>
</view>
<view class="eqinfo">
<view class="item">
<view class="item">
<text class="lbl">设备名称</text>
<text class="value">{{device.deviceName}}</text>
</view>
<view class="item">
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<text class="lbl">Mac地址</text>
<text class="value">{{device.deviceMac}}</text>
</view>
<view class="item">
<text class="lbl">蓝牙名称</text>
<text class="value">{{device.bluetoothName}}</text>
@ -45,34 +45,34 @@
<view class="title">
<text>照明模式</text>
<text @click="showLihgtPercent('shuxie')"
:class="formData.lightCurr=='shuxie'?'active':'noActive'">亮度</text>
:class="formData.lightCurr=='shuxie'?'active':'noActive'">亮度</text>
</view>
</view>
<view class="lightMode">
<view class="item" @click="lightSetting('shuxie')" @longpress="showLihgtPercent('shuxie')"
:class="formData.lightCurr=='shuxie'?'active':''">
:class="formData.lightCurr=='shuxie'?'active':''">
<view class="imgContent center">
<image class="img"
:src="formData.lightCurr=='shuxie'?'/static/images/6331/shuxieActive.png':'/static/images/6331/shuXie.png'"
mode="aspectFit"></image>
:src="formData.lightCurr=='shuxie'?'/static/images/6331/shuxieActive.png':'/static/images/6331/shuXie.png'"
mode="aspectFit"></image>
</view>
<view class="txt">书写</view>
</view>
<view class="item" @click="lightSetting('work')" :class="formData.lightCurr=='work'?'active':''">
<view class="imgContent center">
<image class="img"
:src="formData.lightCurr=='work'?'/static/images/6331/workActive.png':'/static/images/6331/work.png'"
mode="aspectFit"></image>
:src="formData.lightCurr=='work'?'/static/images/6331/workActive.png':'/static/images/6331/work.png'"
mode="aspectFit"></image>
</view>
<view class="txt">工作光</view>
</view>
<view class="item" @click="lightSetting('jieN')" :class="formData.lightCurr=='jieN'?'active':''">
<view class="imgContent center">
<image class="img"
:src="formData.lightCurr=='jieN'?'/static/images/lightImg/jieNActive.png':'/static/images/lightImg/jieN.png'"
mode="aspectFit"></image>
:src="formData.lightCurr=='jieN'?'/static/images/lightImg/jieNActive.png':'/static/images/lightImg/jieN.png'"
mode="aspectFit"></image>
</view>
<view class="txt">节能光</view>
</view>
@ -130,7 +130,7 @@
</view>
<view class="mode fleft marginLeft noMargintop" :class="formData.cMode?'active':''"
v-on:click.stop="audioManage()">
v-on:click.stop="audioManage()">
<view class="leftImg">
<image class="img" src="/static/images/6331/upload.png" mode="aspectFit"></image>
</view>
@ -153,31 +153,15 @@
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :showSlot="Status.Pop.showSlot">
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" :showSlot="Status.Pop.showSlot">
<view :class="Status.showLightingSet?'':'displayNone'">
<view class="slideTitle">
@ -186,8 +170,8 @@
</view>
<view class="slider-container">
<slider min="1" max="100" step="1" :disabled="false" :value="formData.liangDu" activeColor="#bbe600"
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChange" class="custom-slider" />
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChange" class="custom-slider" />
</view>
</view>
@ -199,8 +183,8 @@
</view>
<view class="slider-container">
<slider min="1" max="100" step="1" :disabled="false" :value="formData.volume" activeColor="#bbe600"
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChange" class="custom-slider" />
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChange" class="custom-slider" />
</view>
</view>
@ -209,7 +193,7 @@
<!-- 下方菜单 -->
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
@btnClick="btnClick">
@btnClick="btnClick">
<view>
<view class="addIco">
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
@ -221,7 +205,7 @@
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -236,7 +220,15 @@
} from '@/utils/loading.js'
import request, { baseURL } from '@/utils/request.js';
import usrApi from '@/api/670/HBY670.js'
import usrApi from '@/api/670/HBY670.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
const pagePath = "pages/6331/BJQ6331";
var ble = null;
@ -401,7 +393,10 @@ import request, { baseURL } from '@/utils/request.js';
these.formData.deviceId = f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
these.setBleFormData();
these.getDetail();
@ -420,7 +415,10 @@ import request, { baseURL } from '@/utils/request.js';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
computed: {
@ -452,7 +450,7 @@ import request, { baseURL } from '@/utils/request.js';
let play = () => {
alert('正在播放中');
}
this.showPop({
showPop({
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
@ -469,7 +467,7 @@ import request, { baseURL } from '@/utils/request.js';
modelValue: '',
visibleClose: true,
okCallback: play
});
},these);
},
audioManage() { //语音管理
uni.navigateTo({
@ -594,12 +592,12 @@ import request, { baseURL } from '@/utils/request.js';
ble.sendHexs(f.deviceId, array, f.writeServiceId, f.wirteCharactId, 100).catch(ex => {
these.showPop({
showPop({
message: "发送失败," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
});
},
@ -670,7 +668,8 @@ import request, { baseURL } from '@/utils/request.js';
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
these.formData.bleStatu = 'err';
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -734,9 +733,9 @@ import request, { baseURL } from '@/utils/request.js';
showBleUnConnect() {
this.showPop({
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -762,7 +761,7 @@ import request, { baseURL } from '@/utils/request.js';
}
})
}
});
},these);
@ -770,31 +769,7 @@ import request, { baseURL } from '@/utils/request.js';
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
closePop: function() {
this.Status.Pop.showPop = false;
@ -1186,46 +1161,7 @@ import request, { baseURL } from '@/utils/request.js';
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -27,14 +27,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.battary}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
@ -78,19 +78,19 @@
<view class="modeSetting">
<view class="item" :class="formData.modeCurr=='smalllow'?'active':''"
@click="MainModeSetting('smalllow','staticBattery')">
@click="MainModeSetting('smalllow','staticBattery')">
<view class="p100 center">前置</view>
</view>
<view class="item" :class="formData.modeCurr=='low'?'active':''"
@click="MainModeSetting('low','staticBattery')">
@click="MainModeSetting('low','staticBattery')">
<view class="p100 center">低档</view>
</view>
<view class="item " :class="formData.modeCurr=='center'?'active':''"
@click="MainModeSetting('center','staticBattery')">
@click="MainModeSetting('center','staticBattery')">
<view class="p100 center">中档</view>
</view>
<view class="item " :class="formData.modeCurr=='hight'?'active':''"
@click="MainModeSetting('hight','staticBattery')">
@click="MainModeSetting('hight','staticBattery')">
<view class="p100 center">高档</view>
</view>
@ -98,9 +98,9 @@
<!-- <view class="item " :class="formData.modeCurr=='close'?'active':''"
@click="MainModeSetting('close','staticBattery')">
<view class="p100 center">关闭</view>
</view> -->
@click="MainModeSetting('close','staticBattery')">
<view class="p100 center">关闭</view>
</view> -->
</view>
<view class="lampMode">
<view class="mode fleft" :class="formData.cMode?'active':''" v-on:click.stop="LampToggle()">
@ -114,7 +114,7 @@
</view>
<view class="mode marginLeft fleft" :class="formData.cMode=='mode'?'':'active'"
v-on:click.stop="ShowUpload()">
v-on:click.stop="ShowUpload()">
<view class="leftImg">
<image class="img" src="/static/images/6155/DeviceDetail/open.png" mode="aspectFit"></image>
</view>
@ -159,35 +159,13 @@
</view>
</view>
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<ProParams :id="device.id"></ProParams>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" :visiblePrompt="Status.Pop.visiblePrompt" :promptTitle="Status.Pop.promptTitle"
v-model="Status.Pop.modelValue" @closePop="closePop" />
<!-- 下方菜单 -->
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
@btnClick="btnClick">
@btnClick="btnClick">
<view>
<view class="addIco">
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
@ -198,6 +176,7 @@
</BottomSlideMenuPlus>
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -213,7 +192,15 @@
} from '@/utils/loading.js'
import request, { baseURL } from '@/utils/request.js';
import usrApi from '@/api/670/HBY670.js'
import usrApi from '@/api/670/HBY670.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
const pagePath = "/pages/650/HBY650";
var ble = null;
@ -234,24 +221,7 @@ import request, { baseURL } from '@/utils/request.js';
},
pageHide: false,
Pop: {
showPop: false, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '您确定要这样做吗?',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '设备名称',
modelValue: '',
visibleClose: false,
okCallback: null
},
BottomMenu: {
show: false,
showHeader: true,
@ -404,7 +374,10 @@ import request, { baseURL } from '@/utils/request.js';
these.formData.bleStatu='connecting';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
these.setBleFormData();
console.error("222222");
these.getDetail();
@ -425,7 +398,10 @@ import request, { baseURL } from '@/utils/request.js';
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
computed: {
@ -466,6 +442,7 @@ import request, { baseURL } from '@/utils/request.js';
these.formData.bleStatu = true;
}).catch(ex=>{
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
@ -569,7 +546,8 @@ import request, { baseURL } from '@/utils/request.js';
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
MsgError("连接错误:" + ex.msg, "确定", these);
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -655,12 +633,12 @@ import request, { baseURL } from '@/utils/request.js';
}
if (these.formData.iswarn) {
these.showPop({
showPop({
message: "环境存在漏电电源",
iconUrl: "/static/images/6155/DeviceDetail/warnning.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
}
these.setBleFormData();
@ -733,14 +711,14 @@ import request, { baseURL } from '@/utils/request.js';
if (!this.permissions.includes('41') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -813,12 +791,12 @@ import request, { baseURL } from '@/utils/request.js';
console.log("发送成功了");
}).catch((ex) => {
these.showPop({
showPop({
message: ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
}).finally(() => {
@ -838,9 +816,9 @@ import request, { baseURL } from '@/utils/request.js';
},
showBleUnConnect() {
this.showPop({
showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -866,49 +844,25 @@ import request, { baseURL } from '@/utils/request.js';
}
})
}
});
},these);
},
LampToggle: function() {
if (!this.permissions.includes('1') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
this.formData.cMode = !this.formData.cMode;
this.MainModeSetting(this.formData.cMode, "lamp");
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
checkImgUpload: function(type, index) {
console.log("123213213213");
let f = these.getDevice();
@ -932,11 +886,11 @@ import request, { baseURL } from '@/utils/request.js';
if (currentPacket > totalPackets) {
hideLoading(these);
these.Status.BottomMenu.show = false;
these.showPop({
showPop({
showPop: true,
message: "上传成功",
iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png",
});
},these);
if (!ReSendNo) {
setTimeout(() => {
these.HoldYouHand("transmit complete", 0, f
@ -975,17 +929,10 @@ import request, { baseURL } from '@/utils/request.js';
// 填充头部
dataView.setUint8(0, 0x55); // 帧头
dataView.setUint8(1, 0x02); // 帧类型:开机画面
dataView.setUint8(2, '0x' + currentPacket.toString(16).padStart(2,
'0')); // 包序号
dataView.setUint8(2, currentPacket); // 包序号
if (packetData.length == 250) {
dataView.setUint8(3, 0x01);
dataView.setUint8(4, 0xF4);
} else {
dataView.setUint8(3, 0x00);
dataView.setUint8(4, 0x64);
}
dataView.setUint16(3, packetData.length*2,false); // 包t长度
// 填充数据每个RGB565值占2字节
for (let i = 0; i < packetData.length; i++) {
@ -1012,23 +959,23 @@ import request, { baseURL } from '@/utils/request.js';
})
currentPacket++;
setTimeout(sendNextPacket, 0);
setTimeout(sendNextPacket, 80);
}).catch(err => {
console.log("发送数据包失败了" + JSON.stringify(err));
if (err.code == '10007') {
setTimeout(sendNextPacket, 0);
setTimeout(sendNextPacket, 500);
return;
}
these.Status.BottomMenu.show = false;
these.showPop({
showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
hideLoading(these);
reject(err);
});
@ -1044,12 +991,12 @@ import request, { baseURL } from '@/utils/request.js';
sendNextPacket();
}).catch((err) => {
console.log("握手没有成功");
these.showPop({
showPop({
message: err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
hideLoading(these);
reject(err);
});
@ -1121,11 +1068,11 @@ import request, { baseURL } from '@/utils/request.js';
}
these.Status.BottomMenu.show = false;
hideLoading(these);
these.showPop({
showPop({
showPop: true,
message: "上传成功",
iconUrl: "/static/images/6155/DeviceDetail/uploadSuccess.png"
});
},these);
@ -1195,14 +1142,14 @@ import request, { baseURL } from '@/utils/request.js';
these.Status.BottomMenu.show = false;
hideLoading(these);
these.showPop({
showPop({
showPop: true,
message: err.msg + ",发送失败了",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: "确定",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png"
});
iconUrl: "/static/images/common/uploadErr.png"
},these);
reject(err);
return;
}
@ -1297,23 +1244,23 @@ import request, { baseURL } from '@/utils/request.js';
console.log("服务器未返回正确的数据");
these.showPop({
showPop({
message: "与服务器连接出现异常,请检查网络设置",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
}
}).catch((ex) => {
hideLoading(these);
these.showPop({
showPop({
message: "出现异常," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
})
}
let f = these.getDevice();
@ -1380,14 +1327,14 @@ import request, { baseURL } from '@/utils/request.js';
if (!this.permissions.includes('3') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
//上传开机画面
@ -1429,84 +1376,19 @@ import request, { baseURL } from '@/utils/request.js';
this.Status.BottomMenu.activeIndex = index;
},
closePop: function() {
this.Status.Pop.showPop = false;
if (this.Status.Pop.cancelCallback) {
this.Status.Pop.cancelCallback();
}
},
HidePop: function() {
if (this.Status.Pop.clickEvt == 'SendUsr') {
}
this.Status.Pop.showPop = false;
if (this.Status.Pop.okCallback) {
this.Status.Pop.okCallback();
}
},
showPop: function(option) {
hideLoading(this);
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
sendUsr: function(ReSendNo) {
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
this.showPop({
showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
buttonText: "确定"
})
},these)
return;
}
@ -1550,7 +1432,7 @@ import request, { baseURL } from '@/utils/request.js';
}
these.showPop({
showPop({
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
@ -1566,7 +1448,7 @@ import request, { baseURL } from '@/utils/request.js';
promptTitle: '',
modelValue: '',
visibleClose: true
});
},these);
these.setBleFormData();
@ -1624,12 +1506,12 @@ import request, { baseURL } from '@/utils/request.js';
setTimeout(sendNextPacket, 0);
}).catch(err => {
these.showPop({
showPop({
message: "文字发送失败," + err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
}).finally(() => {
hideLoading(these);
});
@ -1658,12 +1540,12 @@ import request, { baseURL } from '@/utils/request.js';
}).catch((ex) => {
console.log("握手没有成功", ex);
hideLoading(these);
these.showPop({
showPop({
message: ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
},these);
});
}, 0);
@ -2039,46 +1921,6 @@ import request, { baseURL } from '@/utils/request.js';
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: PingFang SC;
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
<view slot="right">
<view class="navbarRight center">
<view class="imgContent" :class="{'visibilityHidden':Status.apiType!=item.apiType}"
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
@click.stop="handleRightClick(item,index)" v-for="item,index in Status.navbar.icons">
<image class="img" :src="item.src" mode="aspectFit"></image>
<view class="baber" v-if="item.math">{{item.math>9?'9+':item.math}}</view>
</view>
@ -26,14 +26,14 @@
</view>
<view class="rightTxt">
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/battry.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/battry.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.battary}}%</view>
<view class="smallTxt">电量</view>
</view>
</view>
<view class="row">
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/time.png" mode="aspectFit"></image>
<view class="txt">
<view class="bigTxt">{{formData.xuhang}}</view>
<view class="smallTxt">续航时间</view>
@ -73,8 +73,8 @@
<view class="slider-container">
<slider min="1" max="100" step="1" :disabled="false" :value="formData.liangDu" activeColor="#bbe600"
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChanging" class="custom-slider" />
backgroundColor="#00000000" block-size="20" block-color="#ffffffde" @change="sliderChange"
@changing="sliderChanging" class="custom-slider" />
</view>
</view>
@ -89,14 +89,14 @@
</view>
</view>
<!-- <view class="mode marginLeft fleft" v-on:click.stop="ModeSetting('fu')">
<view class="leftImg">
<image class="img" src="/static/images/6155/DeviceDetail/fuLamp.png" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">辅灯模式</text>
<text class="smallTxt">泛光模式</text>
</view>
</view> -->
<view class="leftImg">
<image class="img" src="/static/images/6155/DeviceDetail/fuLamp.png" mode="aspectFit"></image>
</view>
<view class="rightTxt">
<text class="bigTxt">辅灯模式</text>
<text class="smallTxt">泛光模式</text>
</view>
</view> -->
<view class="mode marginLeft fleft" v-on:click.stop="UploadOpenImg()">
<view class="leftImg">
<image class="img" src="/static/images/6155/DeviceDetail/open.png" mode="aspectFit"></image>
@ -114,52 +114,28 @@
<view class="btnSend fright" v-on:click.stop="sendUsr">发送</view>
<view class="clear"></view>
<textToDotMatrixFor7305 class="TextToHex" ref="textToHex" :txts="formData.textLines"
:bgColor="'#FFFFFF'" :color="'#000000'" :fontSize="13" />
:bgColor="'#FFFFFF'" :color="'#000000'" :fontSize="13" />
</view>
<view class="item">
<text class="lbl">单位</text>
<input class="value" v-model="formData.inputLines[0]" placeholder="请输入单位" placeholder-class="usrplace" />
<input class="value" maxlength="5" v-model="formData.inputLines[0]" placeholder="请输入单位" placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">部门</text>
<input class="value" v-model="formData.inputLines[1]" placeholder="请输入姓名" placeholder-class="usrplace" />
<input class="value" maxlength="5" v-model="formData.inputLines[1]" placeholder="请输入姓名" placeholder-class="usrplace" />
</view>
<view class="item">
<text class="lbl">姓名</text>
<input class="value" v-model="formData.inputLines[2]" placeholder="请输入职位" placeholder-class="usrplace" />
<input class="value" maxlength="5" v-model="formData.inputLines[2]" placeholder="请输入职位" placeholder-class="usrplace" />
</view>
</view>
<view class="proinfo lamp">
<text class="title">产品信息</text>
<view class="itemcontent">
<view class="item" @click="proParam()">
<image class="img" src="/static/images/6155/DeviceDetail/param.png" mode="aspectFit"></image>
<text class="txt">产品参数</text>
</view>
<view class="item" @click="handRemark()">
<image class="img" src="/static/images/6155/DeviceDetail/remark.png" mode="aspectFit"></image>
<text class="txt">操作说明</text>
</view>
<view class="item" @click="handVideo()">
<image class="img" src="/static/images/6155/DeviceDetail/video.png" mode="aspectFit"></image>
<text class="txt">操作视频</text>
</view>
</view>
</view>
<!-- 弹窗通知 -->
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
:buttonBgColor="Status.Pop.buttonBgColor" :buttonTextColor="Status.Pop.buttonTextColor"
:iconUrl="Status.Pop.iconUrl" :message="Status.Pop.message" :buttonText="Status.Pop.buttonText"
@buttonClick="HidePop" @closePop="closePop" :visiblePrompt="Status.Pop.visiblePrompt"
:promptTitle="Status.Pop.promptTitle" v-model="Status.Pop.modelValue" />
<ProParams :id="device.id"></ProParams>
<!-- 下方菜单 -->
<BottomSlideMenuPlus :config="Status.BottomMenu" @close="closeMenu" @itemClick="handleItemClick"
@btnClick="btnClick">
@btnClick="btnClick">
<view class="addIco">
<view class="icoContent center" v-on:click.stop="checkImgUpload()">
<image mode="aspectFit" class="img" src="/static/images/6155/DeviceDetail/add.png"></image>
@ -169,6 +145,7 @@
</BottomSlideMenuPlus>
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -183,7 +160,14 @@
} from '@/utils/loading.js'
import BleReceive from '@/utils/BleReceive';
import Common from '@/utils/Common.js';
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgInfo
} from '@/utils/MsgPops.js'
var ble = null;
var these = null;
var BrighInteval = null;
@ -363,7 +347,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
these.setBleFormData();
these.getDetail();
@ -384,7 +371,10 @@
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
console.log("连接成功")
these.formData.bleStatu = true;
});
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});;
}
},
computed: {
@ -452,6 +442,7 @@
these.formData.bleStatu = true;
}).catch(ex => {
these.formData.bleStatu = 'err';
MsgError("连接错误:" + ex.msg, "确定", these);
});
return;
}
@ -560,7 +551,8 @@
}).catch(ex => {
updateLoading(these, {
text: ex.msg
})
});
these.formData.bleStatu = 'err';
}).finally(() => {
setTimeout(() => {
hideLoading(these);
@ -620,7 +612,7 @@
if ('battary' in json && this.formData.battary <= 20) {
this.showPop({
message: "设备电量低",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -628,35 +620,11 @@
},
proParam: function() {
uni.navigateTo({
url: '/pages/common/productDes/index?id=' + this.device.id,
success(ev) {
}
});
},
handRemark: function() {
uni.navigateTo({
url: '/pages/common/operatingInstruct/index?id=' + this.device.id,
success(ev) {
}
});
},
handVideo: function() {
uni.navigateTo({
url: '/pages/common/operationVideo/index?id=' + this.device.id,
success(ev) {
}
});
},
showBleUnConnect() {
this.showPop({
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
@ -766,7 +734,7 @@
these.Status.BottomMenu.show = false;
these.showPop({
message: "发送数据包失败了: " + err.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -931,7 +899,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -951,7 +919,7 @@
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1081,7 +1049,7 @@
}).catch((ex) => {
these.showPop({
message: "发送失败," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1177,13 +1145,14 @@ debugger;
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
showPop(option,this);
},
sendUsr() {
if (!this.permissions.includes('4') && this.Status.apiType !== 'listA') {
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1209,7 +1178,7 @@ debugger;
if (err) {
this.showPop({
message: "单位、部门、姓名必须填写且最多5字",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1360,7 +1329,7 @@ debugger;
} else {
this.showPop({
message: "出现异常发送失败",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1407,7 +1376,7 @@ debugger;
this.showPop({
message: '无操作权限',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: null,
@ -1439,7 +1408,7 @@ debugger;
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 100).catch(ex => {
these.showPop({
message: "发送失败," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1488,7 +1457,7 @@ debugger;
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 100).catch(ex => {
these.showPop({
message: "发送失败," + ex.msg,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
@ -1856,46 +1825,6 @@ debugger;
text-align: left;
}
.proinfo .itemcontent {
display: flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-evenly;
}
.proinfo .item {
width: 180rpx;
height: 180rpx;
box-sizing: border-box;
padding: 40rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
}
.proinfo .item .img {
width: 50rpx;
height: 50rpx;
}
.proinfo .item .txt {
color: rgba(255, 255, 255, 0.6);
font-family: "PingFang SC";
font-size: 24rpx;
font-weight: 400;
margin-top: 20rpx;
letter-spacing: 0.07px;
text-align: left;
}
.slider-container {

View File

@ -282,8 +282,8 @@
}
//无效的设备回调
let deviceInvalid = () => {
these.$set(these.device, "deviceName", "");
these.$set(these.device, "deviceName", "");
}
clearTimeout(this.Statu.timeInteval);

View File

@ -528,7 +528,7 @@
ble.StartSearch().then(result => {
// console.log("开始搜索成功", result);
these.Status.BottomMenu.show=false;
}).catch(err => {
console.error("开始搜索失败:", err);
if (err.code === 10001) {
@ -580,6 +580,9 @@
ble.showBlueSetting(false);
},
DeviceVerdict(deviceId) { //判断是否是目标设备
if (these.Status.isPageHidden) {
return;
}
console.log("deviceid=", deviceId);
console.log("these.device=", these.device)
if (these.device) { //从设备详情过来的,回设备详情去
@ -616,6 +619,9 @@
}
//找到目标设备的处理方法
let deviceOK = () => {
if (these.Status.isPageHidden) {
return;
}
hideLoading(these);
eventChannel.emit('BindOver', these.device);
@ -761,6 +767,9 @@
if (index == total) {
console.log("连接了N次都没连上");
reject(ex);
updateLoading(this, {
text: ex.msg
})
return;
}
index++;
@ -777,6 +786,9 @@
execLink().then((res) => {
console.log("res=", res);
if(this.Status.isPageHidden){
return;
}
linkCallback(res);
}).catch(ex => {
console.error("ex=", ex)

View File

@ -1,6 +1,22 @@
<template>
<view class="content">
<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 center">
<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 class="topStatric">
@ -10,6 +26,9 @@
</view>
<view class="lblTitle">
<view>添加:{{type.typeName}} 设备数量:{{devicesCnt}}</view>
<view class="btn" style="color: #FFFFFF;" @click="ReSearch()">刷新</view>
</view>
<view class="lblTitle">
@ -76,8 +95,6 @@
<!-- <image :src="isItemLink(item,index,'upload')" class="img" mode="aspectFit">
</image> -->
@ -87,6 +104,8 @@
</view>
</view>
<global-loading ref="loading" />
<MsgBox ref="msgPop" />
</view>
</template>
@ -100,17 +119,40 @@
} from '@/utils/loading.js'
import common from '@/utils/Common.js'
const pagePath = "pages/common/addBLE/addEquip";
import {
MsgSuccess,
MsgError,
MsgClose,
MsgWarning,
showPop,
MsgClear,
MsgInfo
} from '@/utils/MsgPops.js';
import MQTT from '@/utils/MqHelper.js';
var ble = null;
var these = null;
var eventChannel = null;
var time = null;
var time1 = null;
// var serv = null;
var mq = null;
export default {
data() {
return {
Status: {
intval: null,
pcAuthori: false,
navbar: {
icons: [
{
src: '/static/images/common/scane.png'
}
],
title: '添加设备',
showBack: true,
height: 90
}
},
search: '',
groupid: '',
@ -120,7 +162,8 @@
EquipMents: [], //搜索出来的设备
devices: [],
devicesCnt: 0,
privateNetUrl: ''
privateNetUrl: '',
scanKey: ''
}
},
@ -137,18 +180,30 @@
},
onUnload() {
ble.StopSearch().then(res => {
console.log("停止搜索成功")
}).catch(ex => {
console.error("停止搜索成功", ex);
});
ble.removeAllCallback(pagePath);
ble.disconnectDevice();
if (ble) {
ble.StopSearch().then(res => {
console.log("停止搜索成功")
}).catch(ex => {
console.error("停止搜索成功", ex);
});
ble.removeAllCallback(pagePath);
ble.disconnectDevice();
}
if (mq) {
mq.disconnect();
}
},
onLoad() {
these = this;
mq = MQTT.getMqTool();
mq.init();
this.groupid = common.DateFormat(new Date(), 'yyyy-MM-dd HH:mm:ss');
these = this;
ble = bleTool.getBleTool();
// serv = serTool.serverInit();
@ -358,7 +413,7 @@
}
arr[i].name=arr[i].name.replace(/\r\n/g, '').replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
arr[i].name = arr[i].name.replace(/\r\n/g, '').replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,'');
@ -381,7 +436,7 @@
}
}
these.sendEquipToMq();
// console.log("equip=", these.EquipMents)
}, pagePath);
// console.log("addEquip")
@ -403,6 +458,7 @@
console.log("111111");
}
if (f.imei) {
f.imei = f.imei.replace(/\u0000/g, '');
item = this.EquipMents.find((v, index) => {
if (v.deviceId == f.deviceId) {
v.imei = f.imei;
@ -474,7 +530,7 @@
let callback = () => {
these.getTypeDeviceCnt().then(res => {
console.error("设备数量:",res);
console.error("设备数量:", res);
these.devicesCnt = res;
if (res > 0 && res <= 10000) {
these.getAlltypeDevices().then(devs => {
@ -493,7 +549,34 @@
callback();
});
setTimeout(()=>{
MsgInfo("如需要在PC上查看此数据,请复制链接后通过微信发送到PC,在PC端打开然后点右上角扫码授权","复制链接",these,true,()=>{
console.log("执行复制");
uni.setClipboardData({
data:'https://static-mp-5b7c35fc-f6fe-4100-a2e1-3669e4d4bfc9.next.bspapp.com/AppTools/views/index.html',
success(){
uni.showToast({
title:'已复制链接'
});
plus.runtime.openURL('weixin://', (err) => {
MsgError("打开微信失败,请手动打开微信粘贴");
});
},
fail(ex){
console.error("无法复制",ex)
}
});
});
},500);
},
onShow: function() {
@ -503,31 +586,53 @@
},
methods: {
prevPage() {
uni.navigateBack({
});
},
handleRightClick: function(s, e) {
this.scan();
},
initWatch() {
this.$watch("devicesCnt", (newVal, oldVal) => {
const phone = uni.getStorageSync('phone');
mq.sendData('pc/' + phone, JSON.stringify({
devicesCnt: this.devicesCnt
}), false);
});
},
//获取某个类型下的所有设备
getAlltypeDevices() {
return new Promise((succ, err) => {
let json = {
"tenant_id": this.type.tenantId,
"deviceType": this.type.deviceTypeId
};
let json = {
"tenant_id": this.type.tenantId,
"deviceType": this.type.deviceTypeId
};
request({
url: "/app/xinghan/device/getEquipAllByType",
method: 'POST',
data: json,
}).then(res=>{
request({
url: "/app/xinghan/device/getEquipAllByType",
method: 'POST',
data: json,
}).then(res => {
if(res && res.code==200){
if (res && res.code == 200) {
succ(res.data);
return;
}
err(res);
}).catch(ex=>{
console.error("ex=",ex);
err(ex);
});
succ(res.data);
return;
}
err(res);
}).catch(ex => {
console.error("ex=", ex);
err(ex);
});
});
},
@ -538,28 +643,28 @@
let json = {
"tenant_id": this.type.tenantId,
"deviceType": this.type.deviceTypeId
};
console.error("json=",json);
let json = {
"tenant_id": this.type.tenantId,
"deviceType": this.type.deviceTypeId
};
console.error("json=", json);
request({
url: "/app/xinghan/device/getEquipCountByType",
method: 'POST',
data: json,
}).then(res=>{
console.error("getEquipCountByType res.data=",res.data)
if(res && res.code==200){
request({
url: "/app/xinghan/device/getEquipCountByType",
method: 'POST',
data: json,
}).then(res => {
console.error("getEquipCountByType res.data=", res.data)
if (res && res.code == 200) {
resolve(res.data);
return;
}
reject(res);
}).catch(ex=>{
console.error("ex=",ex);
reject(ex);
});
resolve(res.data);
return;
}
reject(res);
}).catch(ex => {
console.error("ex=", ex);
reject(ex);
});
});
@ -581,7 +686,8 @@
if (this.devicesCnt > 0) {
if (this.devices && this.devices.length > 0) {
let eqp = this.devices.find(v => {
let flag= v.bluetooth_name.replace(/\r\n/g, '').replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '') == item.name;
let flag = v.bluetooth_name.replace(/\r\n/g, '').replace(
/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '') == item.name;
return flag;
@ -594,24 +700,26 @@
"校验完成,设备已入库");
these.$set(these.EquipMents[fIndex], "macAddress",
eqp.device_mac);
these.$set(these.EquipMents[fIndex], "device_name",eqp.device_name);
console.log("从缓存中找到了设备",eqp);
these.$set(these.EquipMents[fIndex], "device_name", eqp.device_name);
console.log("从缓存中找到了设备", eqp);
resolve(eqp);
return;
}
}
console.error("缓存中找不到此设备22222222",this.devices);
// console.error("缓存中找不到此设备22222222", this.devices);
these.$set(these.EquipMents[fIndex], "remark",
"校验完成,设备未入库");
reject(null);
these.sendEquipToMq();
return;
}
let succCallback=(data)=>{
if(data){
let succCallback = (data) => {
if (data) {
these.$set(these.EquipMents[fIndex], "isUpload",
true);
these.$set(these.EquipMents[fIndex], "remark",
@ -620,25 +728,26 @@
data.device_mac);
these.$set(these.EquipMents[fIndex], "imei", data
.device_imei);
these.$set(these.EquipMents[fIndex], "device_name",data.device_name);
}
else{
console.error("设备未入库111111",data)
these.$set(these.EquipMents[fIndex], "device_name", data.device_name);
} else {
console.error("设备未入库111111", data)
these.$set(these.EquipMents[fIndex], "remark",
"校验完成,设备未入库");
}
these.sendEquipToMq();
}
let errCallback=()=>{
let errCallback = () => {
these.$set(these.EquipMents[fIndex], "remark",
"校验出现异常");
these.sendEquipToMq();
}
let p2=new Promise((resolve,reject)=>{
let p2 = new Promise((resolve, reject) => {
let json = {
"tenant_id": this.type.tenantId,
"deviceType": this.type.deviceTypeId,
@ -646,33 +755,129 @@
};
request({
url:'/app/xinghan/device/GetDeviceByName',
data:json,
url: '/app/xinghan/device/GetDeviceByName',
data: json,
method: 'POST'
}).then(res=>{
if(res && res.code==200){
}).then(res => {
if (res && res.code == 200) {
resolve(res.data);
return;
resolve(res.data);
return;
}
reject(res);
}).catch(ex=>{
}).catch(ex => {
reject(ex);
});
})
Promise.any([p2]).then(res=>{
Promise.any([p2]).then(res => {
succCallback(res);
}).catch(ex=>{
}).catch(ex => {
errCallback(ex);
}).finally(() => {
});
});
},
scan() {
uni.scanCode({
success: (res) => {
console.log('条码内容:' + res.result);
let getUrlParams = (url) => {
var p = {},
s = (url.indexOf('?') > -1 ? url.split('?')[1] : '').split('&');
for (var i = 0; i < s.length; i++) {
if (!s[i]) continue;
var kv = s[i].split('=');
p[decodeURIComponent(kv[0])] = kv[1] ? decodeURIComponent(kv[1].replace(
/\+/g, ' ')) : '';
}
return p;
}
let json = getUrlParams(res.result);
if (!json.key) {
uni.showModal({
title: '错误',
content: "无效的二维码"
})
return;
}
this.scanKey = json.key;
let msg = {
scanResult: '已扫码',
scanCode: 200
};
mq.sendData('pc/' + json.key, JSON.stringify(msg), false);
uni.showModal({
title: '授权申请',
content: 'pc端授权登陆',
confirmText: '同意',
cancelText: '拒绝',
showCancel: true,
success(res) {
if (res.confirm) {
these.pcAuthori(json);
return;
}
if (res.cancel) {
msg.scanResult = "用户拒绝授权";
msg.scanCode = 500;
mq.sendData('pc/' + json.key, JSON.stringify(msg), false);
}
},
})
},
fail: (err) => {
console.log('扫码失败', err);
uni.showToast({
title: '扫码失败',
icon: 'none'
});
}
});
},
pcAuthori() { //同意授权
const token = 'Bearer ' + uni.getStorageSync('token');
const clientid = uni.getStorageSync('clientID');
const phone = uni.getStorageSync('phone');
let msg = {
scanResult: '用户同意授权',
scanUsr: phone,
scanCode: 0,
Authorization: token,
clientid: clientid,
};
console.log("同意授权", msg);
this.Status.pcAuthori = true;
mq.sendData('pc/' + this.scanKey, JSON.stringify(msg), false);
these.sendEquipToMq();
},
sendEquipToMq() {
if (mq && this.scanKey) {
const phone = uni.getStorageSync('phone');
setTimeout(() => {
mq.sendData('pc/' + phone, JSON.stringify({
EquipMents: this.EquipMents
}), false);
}, 500);
}
},
ReSearch() {
if (!ble) {
return;
@ -682,15 +887,20 @@
ble.StopSearch().finally(res => {
this.EquipMents = [];
setTimeout(()=>{
this.EquipMents = [];
this.PairEquip = [];
ble.StartSearch().then(result => {
}).catch(err => {
console.error("err=", err);
MsgError("出现错误:" + err.msg, '', these);
});
},200);
}).catch(ex => {
console.error("ex=", ex);
MsgError("出现错误:" + ex.msg, '', these);
});
});
@ -727,7 +937,7 @@
this.devices.push({
bluetooth_name: item.name,
device_mac: item.macAddress,
device_name:item.name
device_name: item.name
});
this.devicesCnt = this.devices.length;
@ -744,10 +954,11 @@
this.$set(this.EquipMents[index], "remark", res.msg);
this.devices.find((d,i)=>{
if(d.device_mac==item.macAddress){
this.devices.find((d, i) => {
if (d.device_mac == item.macAddress) {
this.$set(this.EquipMents[index], "device_name", d.device_name);
this.$set(this.EquipMents[index], "device_name", d
.device_name);
return true;
}
});
@ -758,47 +969,14 @@
});
}
})
}).catch(ex => {}).finally(() => {
these.sendEquipToMq();
});
}
time = setTimeout(exec, 100)
},
isItemLink: function(item, index, type) {
let src = '/static/images/BLEAdd/noLink.png';
if (!item) {
return src;
}
if (type == 'link') {
if (this.PairEquip && this.PairEquip.length) {
if (this.PairEquip.length > 0) {
let f = this.PairEquip.find(function(v) {
return v.deviceId == item.deviceId;
});
if (f) {
src = '/static/images/BLEAdd/linked.png';
}
}
}
} else if (type == 'mac') {
if (item.macAddress) {
src = '/static/images/BLEAdd/linked.png';
}
} else if (type == 'imei') {
if (item.imei) {
src = '/static/images/BLEAdd/linked.png';
}
} else if (type == 'upload') {
if (item.isUpload) {
src = '/static/images/BLEAdd/linked.png';
}
}
return src;
},
Link: function(item) {
let exec = () => {
@ -848,6 +1026,9 @@
}).catch((ex) => {
if (index == total) {
console.log("连接了N次都没连上");
updateLoading(this, {
text: ex.msg
});
reject(ex);
return;
}
@ -865,6 +1046,8 @@
execLink().then((res) => {
linkCallback(res);
these.sendEquipToMq();
}).catch(ex => {
console.log("ex=", ex)
uni.showModal({
@ -1042,6 +1225,7 @@
width: 100%;
height: calc(100% - 186rpx);
overflow-y: scroll;
margin-top: 120rpx;
}
.list .item {
@ -1253,6 +1437,16 @@
animation: rotateClockwise 3s linear infinite;
}
.topStatric {
width: 100%;
box-sizing: border-box;
padding: 30rpx;
position: fixed;
top: 0rpx;
z-index: 99;
background-color: #121212;
}
/* #ifdef H5 */
.topStatric {
@ -1274,17 +1468,13 @@
margin-top: 240rpx;
}
.topStatric {
top: 90rpx
}
/* #endif */
.topStatric {
width: 100%;
box-sizing: border-box;
padding: 30rpx;
position: fixed;
top: 0rpx;
z-index: 99;
background-color: #121212;
}
.uni-mt-5 {
background-color: #000000;
@ -1293,4 +1483,22 @@
.uni-easyinput__content {
background-color: #121212 !important;
}
.navbarRight .img {
width: 35rpx;
height: 35rpx;
margin-right: 20rpx;
}
.uni-navbar--fixed {
top: 0rpx;
}
/deep/ .uni-navbar--fixed {
top: 0px;
}
/deep/ .uni-navbar__placeholder {
display: none !important;
}
</style>

View File

@ -24,7 +24,7 @@
<view class="scanPanel center">
<image @click.stop="scan" class="img" src="/static/images/common/scan.png" mode="aspectFit"></image>
</view>
<view class="txt">
<view class="txt" @click.stop="scan">
对准二维码进行扫描
</view>
@ -284,9 +284,10 @@
.btnOK {
color: rgba(255, 255, 255, 0.6);
font-family: 'PingFang SC';
font-size: 30rpx;
font-size: 40rpx;
font-weight: 400;
letter-spacing: 5rpx;
margin-top: 20rpx;
}
.btnOK.active {

View File

@ -872,7 +872,7 @@
these.Status.Pop.showPop = true;
},
showMsg(msg, isSucc) {
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {

View File

@ -1206,7 +1206,7 @@
if (okCallback === undefined) {
okCallback = null;
}
let icoUrl = '/static/images/6155/DeviceDetail/uploadErr.png';
let icoUrl = '/static/images/common/uploadErr.png';
let borderColor = "#e034344d";
let buttonBgColor = "#E03434";
if (isSucc) {

View File

@ -363,7 +363,7 @@
}
//统一通信协议方法
let CommonSend = () => {
let json=JSON.stringify({ins_ShakeBit:1});
let json=JSON.stringify({ins_ShakeBit:isAlarming?1:0});
for (let i = 0; i < deviceImeiList.length; i++) {
let imei = deviceImeiList[i];
mq.sendData("B/"+imei,json,false);

View File

@ -18,13 +18,10 @@
<image src="/static/images/common/more.png" mode="aspectFit" class="more"></image>
</view>
</view>
<view class="sendFlex"
v-show="showSendFlex"
>
<view class="sendFlex" v-show="showSendFlex">
<view class="callpolice" @click="callpolice" v-show="showWarn">报警</view>
<view class="Sendmessage" @click="location" v-show="showMap">位置</view>
<view class="Sendmessage" @click="handleSend"
v-show="ShowSendmessage">发送信息</view>
<view class="Sendmessage" @click="handleSend" v-show="ShowSendmessage">发送信息</view>
</view>
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
@ -159,22 +156,22 @@
components: {
MescrollUni
},
computed:{
showSendFlex(){
computed: {
showSendFlex() {
// return this.activeTab && this.activeTab.id !== ''&& (this.activeTabInfo.communicationMode==0 || this.activeTabInfo.communicationMode==2);
if(this.showMap || this.ShowSendmessage || this.showWarn){
if (this.showMap || this.ShowSendmessage || this.showWarn) {
return true;
}
return false;
},
ShowSendmessage(){
return this.dic.showMsgTypes.indexOf(this.activeTabInfo.typeName)>-1
ShowSendmessage() {
return this.dic.showMsgTypes.indexOf(this.activeTabInfo.typeName) > -1
},
showMap(){
return this.dic.showMapTypes.indexOf(this.activeTabInfo.typeName)>-1
showMap() {
return this.dic.showMapTypes.indexOf(this.activeTabInfo.typeName) > -1
},
showWarn(){
return this.dic.showCallPolice.indexOf(this.activeTabInfo.typeName)>-1
showWarn() {
return this.dic.showCallPolice.indexOf(this.activeTabInfo.typeName) > -1
}
},
data() {
@ -254,10 +251,15 @@
deviceName: "", //重命名
activeTabInfo: '',
dic: {
showMsgTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'BJQ6075J'],//需要发送消息的类型
showMapTypes:['BJQ6170','HBY210','HBY670','BJQ6075','HBY018A','HBY100-J','BJQ6075J','HBY008A','HBY100-Y'],//需要显示地图的类型
showCallPolice:['BJQ6170','HBY210','HBY670','BJQ6075','HBY018A','HBY100-J','BJQ6075J','HBY008A','HBY100-Y']//需要发送报警的类型
}
showMsgTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'BJQ6075J'], //需要发送消息的类型
showMapTypes: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J', 'HBY008A',
'HBY100-Y'
], //需要显示地图的类型
showCallPolice: ['BJQ6170', 'HBY210', 'HBY670', 'BJQ6075', 'HBY018A', 'HBY100-J', 'BJQ6075J',
'HBY008A', 'HBY100-Y'
] //需要发送报警的类型
},
isPageShow: true
}
},
methods: {
@ -299,8 +301,11 @@
this.updateBleStatu();
},
bleStateRecovery() {
console.log("蓝牙适配器恢复可用,重连断开的设备");
if (ble && ble.linkAllDevices) ble.linkAllDevices();
if (this.isPageShow) {
console.log("蓝牙适配器恢复可用,重连断开的设备");
ble.linkAllDevices();
}
},
bleBreak(res) {
@ -327,7 +332,7 @@
let f = null;
if (ble.data && ble.data.LinkedList) {
f = ble.data.LinkedList.find(v => {
if (!v) return false;
if (v.macAddress && v.device && v.device.id) {
return v.device.id == this.deviceList[i].id;
}
@ -738,8 +743,11 @@
.filter(Boolean);
},
},
onHide() {
this.isPageShow = false;
},
onShow() {
this.isPageShow = true;
if (ble) {
//因为vue视图只能后退不能隐藏后再显示
//所以回到首页后将其他所有页面的订阅都删除
@ -749,9 +757,6 @@
onLoad() {
// console.error("首页加载");
// 必须先初始化 blegetTab/downCallback 会触发 updateBleStatu否则会访问 null
ble = bleTool.getBleTool();
recei = BleReceive.getBleReceive();
this.getTab()
this.downCallback();
@ -766,6 +771,8 @@
console.log('列表收到消息了么');
this.downCallback();
});
ble = bleTool.getBleTool();
recei = BleReceive.getBleReceive();
//蓝牙连接成功的回调
ble.addRecoveryCallback((res) => {
// console.log("蓝牙连接成功的回调");

View File

@ -77,6 +77,8 @@
import {
Logout
} from '@/api/common/login.js'
import bleTool from '@/utils/BleHelper.js';
var ble=null;
export default {
data() {
return {
@ -87,6 +89,7 @@
},
onLoad() {
var these=this;
ble=bleTool.getBleTool();
uni.getSystemInfo({
success(res) {
if(res.uniPlatform=='app'){
@ -139,7 +142,12 @@
uni.showToast({
title: '退出成功',
icon: 'success'
})
});
if(ble){
ble.StopSearch().catch(ex => {});
ble.disconnectDevice().catch(ex => {});
}
uni.reLaunch({
url: '/pages/common/login/index'
});

View File

@ -2,7 +2,7 @@
<view class="contentBg maincontent">
<view class="main">
<view class="center">
<image class="img" src="/static/images/6155/DeviceDetail/uploadErr.png" mode="aspectFit"></image>
<image class="img" src="/static/images/common/uploadErr.png" mode="aspectFit"></image>
</view>
<view class="txt" style="margin-top: 30rpx;">
注销账号后账号将永久失效且不可恢复,

View File

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

View File

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 321 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -668,7 +668,7 @@ class BleHelper {
BleReceive() {
uni.onBLECharacteristicValueChange((receive) => {
//订阅消息
// console.log("收到订阅消息", receive);
console.log("收到订阅消息", receive);
let f = this.data.LinkedList.find((v) => {
return v.deviceId == receive.deviceId;
})
@ -909,7 +909,7 @@ class BleHelper {
this.updateCache();
}
}, 500);
}, 100);
});
@ -1157,7 +1157,7 @@ class BleHelper {
//停止搜索
StopSearch() {
if (this.data.platform == 'web' || !this.data.discovering) {
console.error("web平台或当前没有搜索,直接返回");
console.error("web平台或当前没有搜索,直接返回",this.data.discovering);
return Promise.resolve();
}
let p1 = new Promise((resolve, reject) => {

View File

@ -14,7 +14,8 @@ class BleReceive {
'/pages/100/HBY100': this.Receive_100.bind(this),
'/pages/102/HBY102': this.Receive_102.bind(this),
'/pages/6170/deviceControl/index':this.Receive_6170.bind(this),
'/pages/100J/HBY100-J': this.Receive_100J.bind(this)
'/pages/100J/HBY100-J': this.Receive_100J.bind(this),
'/pages/6075J/BJQ6075J':this.Receive_6075.bind(this)
};
}
@ -910,7 +911,36 @@ Receive_6170(receive, f, path, recArr) {
}
Receive_6075(receive,f,path,recArr){
let receiveData = {};
try {
receiveData = JSON.parse(receive.str);
let recCnt = recArr.find(v => {
return v.key.replace(/\//g, "").toLowerCase() == f.device.detailPageUrl
.replace(/\//g, "").toLowerCase();
});
if (!recCnt) {
// if (receiveData.sta_PowerPercent <= 20) {
// uni.showModal({
// title: "提示",
// content: "设备'" + f.device.deviceName + "'电量低",
// showCancel: false
// });
// }
}
} catch (error) {
receiveData = {};
console.log("文本解析失败", error)
}
return receiveData;
}
}

View File

@ -282,7 +282,7 @@ export default {
value: "46",
label: "手动报警",
checked: false,
type: ['210','102']
type: ['210','102','6170']
},
{
value: "47",

View File

@ -1,11 +1,12 @@
var MsgType = {
error: "error",
succ: "succ",
warn: "warn"
warn: "warn",
info:'info'
}
var time = null;
// 显示成功
export const MsgSuccess = (msg, btnTxt, ev) => {
export const MsgSuccess = (msg, btnTxt, ev,tapCallback) => {
if (!ev) {
@ -15,13 +16,13 @@ export const MsgSuccess = (msg, btnTxt, ev) => {
return null;
}
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.succ);
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.succ,tapCallback);
createClear(ev);
return option;
}
//显示失败
export const MsgError = (msg, btnTxt, ev) => {
export const MsgError = (msg, btnTxt, ev,tapCallback) => {
if (!ev) {
@ -32,12 +33,12 @@ export const MsgError = (msg, btnTxt, ev) => {
return null;
}
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.error);
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.error,tapCallback);
createClear(ev);
return option;
}
//显示警告
export const MsgWarning = (msg, btnTxt, ev, isClear) => {
export const MsgWarning = (msg, btnTxt, ev, isClear,tapCallback) => {
if (!ev) {
return null;
@ -46,7 +47,7 @@ export const MsgWarning = (msg, btnTxt, ev, isClear) => {
return null;
}
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.warn);
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.warn,tapCallback);
if (isClear === undefined || isClear) {
createClear(ev);
}
@ -55,7 +56,25 @@ export const MsgWarning = (msg, btnTxt, ev, isClear) => {
}
//显示警告
export const MsgInfo = (msg, btnTxt, ev, isClear,btnCallback) => {
if (!ev) {
return null;
}
if (!ev.$refs.msgPop) {
return null;
}
let option = ev.$refs.msgPop.showMsg(msg, btnTxt, MsgType.info,btnCallback);
if (isClear === undefined || isClear) {
createClear(ev);
}
return option;
}
// 隐藏loading
export const MsgClose = (options, ev) => {
@ -109,7 +128,7 @@ const createClear = (ev) => {
showPop({
key: key,
message: "消息太多, 是否全部关闭",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
iconUrl: "/static/images/common/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '全部关闭',