Compare commits
19 Commits
8421e7346b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 736f24839f | |||
| c6a33832d4 | |||
| 899078534d | |||
| d82ae6445e | |||
| e94dfd6fe5 | |||
| bb49564646 | |||
| f67bad8895 | |||
| 57c8631070 | |||
| 6715507125 | |||
| 17f0151d15 | |||
| 2b7ae4ebaa | |||
| 1e51023c00 | |||
| f7f369e7bd | |||
| 1264ec70a2 | |||
| aef68d5968 | |||
| 222c578f2c | |||
| 4391d30f86 | |||
| 2d7117b0af | |||
| 6654ee54b5 |
@ -7,7 +7,7 @@
|
||||
},
|
||||
{
|
||||
"customPlaygroundType" : "local",
|
||||
"playground" : "custom",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
|
||||
159
api/102J/hby102jBleProtocol.js
Normal file
@ -0,0 +1,159 @@
|
||||
/**
|
||||
* HBY102J 晶全应用层协议:下行 FA … FF,上行 FB/FC … FF。
|
||||
* 与 HBY100-J 使用同一颗蓝牙模组 / 同一套 GATT(AE30 + AE03 写 + AE02 通知),
|
||||
* 见 `api/100J/HBY100-J.js` 中 SERVICE_UUID / WRITE / NOTIFY;仅帧语义与 100J 不同。
|
||||
*/
|
||||
|
||||
export const HBY102J_SERVICE = '0000AE30-0000-1000-8000-00805F9B34FB'
|
||||
export const HBY102J_WRITE = '0000AE03-0000-1000-8000-00805F9B34FB'
|
||||
export const HBY102J_NOTIFY = '0000AE02-0000-1000-8000-00805F9B34FB'
|
||||
|
||||
function buildFaFrame(func, dataBytes = []) {
|
||||
return [0xfa, func & 0xff, ...dataBytes.map((b) => b & 0xff), 0xff]
|
||||
}
|
||||
|
||||
const BYTE_TO_RADAR = {
|
||||
0: 'status_off',
|
||||
1: 'status_2M',
|
||||
2: 'status_4M',
|
||||
3: 'status_7M',
|
||||
4: 'status_10M'
|
||||
}
|
||||
|
||||
const BYTE_TO_LED = {
|
||||
0: 'led_off',
|
||||
1: 'led_flash',
|
||||
2: 'led_low_flash',
|
||||
3: 'led_steady',
|
||||
4: 'led_alarm'
|
||||
}
|
||||
|
||||
const RADAR_KEY_TO_BYTE = {
|
||||
status_off: 0,
|
||||
status_2M: 1,
|
||||
status_4M: 2,
|
||||
status_7M: 3,
|
||||
status_10M: 4,
|
||||
status_on: 1
|
||||
}
|
||||
|
||||
const LED_KEY_TO_BYTE = {
|
||||
led_off: 0,
|
||||
led_flash: 1,
|
||||
led_low_flash: 2,
|
||||
led_steady: 3,
|
||||
led_alarm: 4
|
||||
}
|
||||
|
||||
export function encodeChannelSet(channelDecimal1to80) {
|
||||
const ch = Math.max(1, Math.min(80, Number(channelDecimal1to80) || 1))
|
||||
return buildFaFrame(0x21, [ch])
|
||||
}
|
||||
|
||||
export function encodeOnline(on) {
|
||||
return buildFaFrame(0x22, [on ? 1 : 0])
|
||||
}
|
||||
|
||||
export function encodeRadarFromUiKey(sta_RadarType) {
|
||||
const b = RADAR_KEY_TO_BYTE[sta_RadarType] !== undefined ? RADAR_KEY_TO_BYTE[sta_RadarType] : 0
|
||||
return buildFaFrame(0x23, [b])
|
||||
}
|
||||
|
||||
export function encodeWarningLightFromLedKey(ledKey) {
|
||||
const m = LED_KEY_TO_BYTE[ledKey] !== undefined ? LED_KEY_TO_BYTE[ledKey] : 0
|
||||
return buildFaFrame(0x24, [m])
|
||||
}
|
||||
|
||||
export function encodeQueryOnlineCount() {
|
||||
return buildFaFrame(0x25, [0])
|
||||
}
|
||||
|
||||
export function encodeQueryPower() {
|
||||
return buildFaFrame(0x26, [])
|
||||
}
|
||||
|
||||
function formatMacFromBytes(u8, start, len) {
|
||||
const hex = []
|
||||
for (let i = 0; i < len; i++) {
|
||||
hex.push(u8[start + i].toString(16).padStart(2, '0'))
|
||||
}
|
||||
return hex.join(':').toUpperCase()
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析设备上行一帧(Notify),输出与 HBY102 页 formData 对齐的字段
|
||||
*/
|
||||
export function parseHby102jUplink(u8) {
|
||||
const out = {}
|
||||
if (!u8 || u8.length < 3) return out
|
||||
|
||||
const h = u8[0]
|
||||
const func = u8[1]
|
||||
const tail = u8[u8.length - 1]
|
||||
|
||||
if (tail !== 0xff && u8.length >= 4) {
|
||||
// 非标准结尾时仍尽量解析
|
||||
}
|
||||
|
||||
if (h === 0xfc && u8.length >= 8 && u8[7] === 0xff) {
|
||||
out.sta_address = formatMacFromBytes(u8, 1, 6)
|
||||
return out
|
||||
}
|
||||
|
||||
if (h !== 0xfb) return out
|
||||
|
||||
switch (func) {
|
||||
case 0x21:
|
||||
if (u8.length >= 4) {
|
||||
out.sta_Channel = u8[2]
|
||||
}
|
||||
break
|
||||
case 0x22:
|
||||
out.sta_Online = u8[2] === 1 ? 'E49_on' : 'E49_off'
|
||||
break
|
||||
case 0x23:
|
||||
out.sta_RadarType = BYTE_TO_RADAR[u8[2]] !== undefined ? BYTE_TO_RADAR[u8[2]] : 'status_off'
|
||||
break
|
||||
case 0x24:
|
||||
out.sta_LedType = BYTE_TO_LED[u8[2]] !== undefined ? BYTE_TO_LED[u8[2]] : 'led_off'
|
||||
break
|
||||
case 0x25:
|
||||
if (u8.length >= 4) {
|
||||
out.sta_onlineQuantity = u8[2]
|
||||
}
|
||||
break
|
||||
case 0x26:
|
||||
if (u8.length >= 5) {
|
||||
out.sta_PowerPercent = u8[2]
|
||||
out.sta_charge = u8[3]
|
||||
}
|
||||
break
|
||||
case 0x27:
|
||||
if (u8.length >= 9) {
|
||||
out.sta_PowerPercent = u8[2]
|
||||
out.sta_charge = u8[3]
|
||||
out.sta_Channel = u8[4]
|
||||
out.sta_LedType = BYTE_TO_LED[u8[5]] !== undefined ? BYTE_TO_LED[u8[5]] : 'led_off'
|
||||
out.sta_RadarType = BYTE_TO_RADAR[u8[6]] !== undefined ? BYTE_TO_RADAR[u8[6]] : 'status_off'
|
||||
out.sta_Online = u8[7] === 1 ? 'E49_on' : 'E49_off'
|
||||
}
|
||||
break
|
||||
case 0x28:
|
||||
if (u8.length >= 10) {
|
||||
const peerMac = formatMacFromBytes(u8, 2, 6)
|
||||
const ev = u8[8]
|
||||
if (ev === 0x01) {
|
||||
out.sta_sosadd = peerMac
|
||||
out.sta_Intrusion = 1
|
||||
} else if (ev === 0x02) {
|
||||
out.sta_sosadd_off = peerMac
|
||||
} else if (ev === 0x03) {
|
||||
out.sta_tomac = peerMac
|
||||
}
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
return out
|
||||
}
|
||||
@ -6,10 +6,12 @@
|
||||
:buttonTextColor="item.buttonTextColor" :iconUrl="item.iconUrl" :message="item.message"
|
||||
:buttonText="item.buttonText" @buttonClick="okCallback(item,index)" :visiblePrompt="item.visiblePrompt"
|
||||
:promptTitle="item.promptTitle" v-model="item.modelValue" @closePop="closePop(item)"
|
||||
:buttonCancelText="item.buttonCancelText" :showCancel="item.showCancel"
|
||||
:buttonCancelText="item.buttonCancelText" :showCancel="item.showCancel" :showSlot="item.showSlot"
|
||||
:showHeader="item.showHeader" :headerTxt="item.headerTxt"
|
||||
|
||||
@cancelPop="cancelClick(item,index)" />
|
||||
@cancelPop="cancelClick(item,index)" >
|
||||
<slot />
|
||||
</MessagePopup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -48,10 +50,10 @@
|
||||
this.closePop(item);
|
||||
},
|
||||
closePop: function(item) {
|
||||
debugger;
|
||||
|
||||
if (item) {
|
||||
this.Msgboxs.find((v, i) => {
|
||||
debugger;
|
||||
|
||||
if (item.key && v.key) {
|
||||
if (item.key === v.key) {
|
||||
this.Msgboxs.splice(i, 1);
|
||||
@ -79,7 +81,7 @@
|
||||
showPop: true, //是否显示弹窗
|
||||
popType: 'custom',
|
||||
bgColor: '#383934bd',
|
||||
borderColor: '#BBE600',
|
||||
borderColor: '#BBE6004d',
|
||||
textColor: '#ffffffde',
|
||||
buttonBgColor: '#BBE600',
|
||||
buttonTextColor: '#232323DE',
|
||||
@ -116,7 +118,7 @@
|
||||
}
|
||||
|
||||
if (!json.borderColor) {
|
||||
json.borderColor = '#BBE600';
|
||||
json.borderColor = '#BBE6004d';
|
||||
json.buttonBgColor = '#BBE600';
|
||||
}
|
||||
json.showPop = true;
|
||||
@ -130,24 +132,44 @@
|
||||
|
||||
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"
|
||||
buttonBgColor: "#E03434",
|
||||
bgColor:'#38393466',
|
||||
buttonTextColor:'#FFFFFFde'
|
||||
},
|
||||
succ: {
|
||||
icoUrl: '/static/images/common/success.png',
|
||||
borderColor: "#BBE600",
|
||||
buttonBgColor: "#BBE600"
|
||||
borderColor: "#BBE6004d",
|
||||
buttonBgColor: "#BBE600",
|
||||
bgColor:'#38393466'
|
||||
},
|
||||
warn: {
|
||||
icoUrl: '/static/images/common/warning.png',
|
||||
borderColor: "#FFC84E",
|
||||
borderColor: "#FFC84E4d",
|
||||
buttonBgColor: "#FFC84E",
|
||||
bgColor:'#38393466'
|
||||
},
|
||||
info:{
|
||||
borderColor: "#BBE6004d",
|
||||
buttonBgColor: "#BBE600",
|
||||
bgColor:'#38393466'
|
||||
},
|
||||
prompt:{
|
||||
|
||||
|
||||
borderColor: "#aed6004d",
|
||||
buttonBgColor: "#aed600",
|
||||
bgColor:'#38393466',
|
||||
buttonTextColor:'#232323de',
|
||||
showSlot:true,
|
||||
showCancel:true,
|
||||
buttonCancelText:'取消'
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,7 +189,13 @@
|
||||
borderColor: cfg[type].borderColor,
|
||||
buttonBgColor: cfg[type].buttonBgColor,
|
||||
buttonText: btnTxt ? btnTxt : '确定',
|
||||
okCallback: okCallback ? okCallback : this.closePop
|
||||
okCallback: okCallback ? okCallback : this.closePop,
|
||||
buttonTextColor:cfg[type].buttonTextColor,
|
||||
bgColor:cfg[type].bgColor,
|
||||
showSlot:cfg[type].showSlot,
|
||||
showCancel:cfg[type].showCancel,
|
||||
buttonCancelText:cfg[type].buttonCancelText
|
||||
|
||||
};
|
||||
return this.showPop(options);
|
||||
|
||||
|
||||
112
components/ProParams/ProParams.vue
Normal 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: #FFFFFFde;
|
||||
}
|
||||
</style>
|
||||
@ -58,7 +58,7 @@
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.setFillStyle('#FFFFFF');//this.bgColor
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
@ -73,31 +73,49 @@
|
||||
|
||||
// 逐行处理
|
||||
for (let y = 0; y < 16; y++) {
|
||||
let byte1 = 0,
|
||||
byte2 = 0;
|
||||
let byte1 = '',
|
||||
byte2 = '';
|
||||
|
||||
// 每行16个像素,分为两个字节
|
||||
for (let x = 0; x < 16; x++) {
|
||||
// 计算像素在imageData中的索引 (RGBA格式)
|
||||
let index = (y * 16 + x) * 4;
|
||||
let red = imageData[index];
|
||||
|
||||
// 黑色像素(R值较低)视为1,白色视为0
|
||||
let isBlack = red < 128;
|
||||
|
||||
if (x < 8) {
|
||||
// 第一个字节(左8位)
|
||||
if (isBlack) {
|
||||
byte1 |= 0x80 >> x; // 从左到右设置位
|
||||
}
|
||||
} else {
|
||||
// 第二个字节(右8位)
|
||||
if (isBlack) {
|
||||
byte2 |= 0x80 >> (x - 8);
|
||||
}
|
||||
let index = (y * 16 + x) * 4;
|
||||
let r = imageData[index];
|
||||
let g = imageData[index+1];
|
||||
let b = imageData[index+2];
|
||||
|
||||
|
||||
let gray = (r + g + b) / 3;
|
||||
let bit = gray < 255 ? '1' : '0';
|
||||
|
||||
|
||||
|
||||
if (x < 8) {
|
||||
byte1+=bit;
|
||||
} else {
|
||||
byte2+=bit;
|
||||
}
|
||||
}
|
||||
// let red = imageData[index];
|
||||
|
||||
// // 黑色像素(R值较低)视为1,白色视为0
|
||||
// let isBlack = red < 128;
|
||||
|
||||
// if (x < 8) {
|
||||
// // 第一个字节(左8位)
|
||||
// if (isBlack) {
|
||||
// byte1 |= 0x80 >> x; // 从左到右设置位
|
||||
// }
|
||||
// } else {
|
||||
// // 第二个字节(右8位)
|
||||
// if (isBlack) {
|
||||
// byte2 |= 0x80 >> (x - 8);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
byte1=parseInt(byte1,2);
|
||||
byte2=parseInt(byte2,2);
|
||||
// 将字节转换为两位十六进制字符串
|
||||
matrix.push('0x' + byte1.toString(16).padStart(2, '0').toUpperCase());
|
||||
matrix.push('0x' + byte2.toString(16).padStart(2, '0').toUpperCase());
|
||||
@ -118,7 +136,7 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setFillStyle('#000000');//this.color
|
||||
ctx.setTextBaseline('middle');
|
||||
ctx.setFontSize(this.fontSize);
|
||||
ctx.font = `${this.fontSize}px "PingFang SC", PingFang SC, Arial, sans-serif`;
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.setFillStyle('#FFFFFF'); //this.bgColor
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
@ -71,22 +71,22 @@
|
||||
if (this.canvasWarmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// 设置画布尺寸
|
||||
this.currentCanvasWidth = 16;
|
||||
this.currentCanvasHeight = 16;
|
||||
|
||||
|
||||
// 清空画布
|
||||
this.clearCanvas();
|
||||
|
||||
|
||||
// 绘制一个测试字符来预热字体和画布
|
||||
this.ctx.setFillStyle(this.color);
|
||||
this.ctx.setFillStyle('#000000'); //this.color
|
||||
this.ctx.setFontSize(this.fontSize);
|
||||
this.ctx.font = `${this.fontSize}px "PingFangBold", "PingFang SC", Arial, sans-serif`;
|
||||
this.ctx.setTextBaseline('middle');
|
||||
this.ctx.fillText('测', 0, 8);
|
||||
|
||||
|
||||
// 等待画布绘制完成
|
||||
await new Promise((resolve) => {
|
||||
this.ctx.draw(false, () => {
|
||||
@ -110,7 +110,7 @@
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// 额外等待确保字体完全加载
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
} catch (ex) {
|
||||
@ -118,55 +118,55 @@
|
||||
this.canvasWarmed = true; // 即使失败也标记为已预热,避免重复尝试
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 复用单个Canvas处理所有文本行
|
||||
*/
|
||||
async drawAndGetPixels() {
|
||||
// 第一次调用时先预热画布(解决APP重新打开后第一次获取数据不完整的问题)
|
||||
// await this.warmupCanvas();
|
||||
|
||||
let convertCharToMatrix=function(imageData) {
|
||||
debugger;
|
||||
let convertCharToMatrix = function(imageData) {
|
||||
|
||||
// console.log("imgData=",imageData)
|
||||
let matrix = [];
|
||||
|
||||
|
||||
// 逐行处理
|
||||
for (let y = 0; y < 16; y++) {
|
||||
let byte1 = 0,
|
||||
byte2 = 0;
|
||||
|
||||
// 每行16个像素,分为两个字节
|
||||
let byte1 = '',
|
||||
byte2 = '';
|
||||
|
||||
|
||||
for (let x = 0; x < 16; x++) {
|
||||
// 计算像素在imageData中的索引 (RGBA格式)
|
||||
|
||||
let index = (y * 16 + x) * 4;
|
||||
let red = imageData[index];
|
||||
|
||||
// 黑色像素(R值较低)视为1,白色视为0
|
||||
let isBlack = red < 128;
|
||||
|
||||
if (x < 8) {
|
||||
// 第一个字节(左8位)
|
||||
if (isBlack) {
|
||||
byte1 |= 0x80 >> x; // 从左到右设置位
|
||||
}
|
||||
} else {
|
||||
// 第二个字节(右8位)
|
||||
if (isBlack) {
|
||||
byte2 |= 0x80 >> (x - 8);
|
||||
}
|
||||
let r = imageData[index];
|
||||
let g = imageData[index+1];
|
||||
let b = imageData[index+2];
|
||||
|
||||
|
||||
let gray = (r + g + b) / 3;
|
||||
let bit = gray < 255 ? '1' : '0';
|
||||
|
||||
|
||||
|
||||
if (x < 8) {
|
||||
byte1+=bit;
|
||||
} else {
|
||||
byte2+=bit;
|
||||
}
|
||||
}
|
||||
|
||||
byte1=parseInt(byte1,2);
|
||||
byte2=parseInt(byte2,2);
|
||||
// 将字节转换为两位十六进制字符串
|
||||
matrix.push('0x' + byte1.toString(16).padStart(2, '0').toUpperCase());
|
||||
matrix.push('0x' + byte2.toString(16).padStart(2, '0').toUpperCase());
|
||||
}
|
||||
|
||||
|
||||
return matrix;
|
||||
}
|
||||
|
||||
|
||||
let drawTxt=async (textLine)=> {
|
||||
let drawTxt = async (textLine) => {
|
||||
debugger;
|
||||
let result = {};
|
||||
let ctx = this.ctx;
|
||||
@ -179,12 +179,12 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setFillStyle('#000000'); //this.color
|
||||
ctx.setTextBaseline('middle');
|
||||
// ctx.setTextAlign('center')
|
||||
ctx.setFontSize(this.fontSize);
|
||||
ctx.font = `${this.fontSize}px "PingFangBold", "PingFang SC", Arial, sans-serif`;
|
||||
|
||||
ctx.font = `${this.fontSize}px "PingFang SC","PingFangBold", Arial, sans-serif`;
|
||||
|
||||
// 4. 绘制当前行文本
|
||||
let currentX = 0;
|
||||
let currentY = this.fontSize / 2;
|
||||
@ -206,8 +206,8 @@
|
||||
width: this.currentCanvasWidth,
|
||||
height: this.currentCanvasHeight,
|
||||
success: res => {
|
||||
|
||||
result={
|
||||
|
||||
result = {
|
||||
line: textLine,
|
||||
pixelData: res.data,
|
||||
width: this.currentCanvasWidth,
|
||||
@ -228,10 +228,10 @@
|
||||
let arr = [];
|
||||
// 循环处理每行文本
|
||||
for (let i = 0; i < this.validTxts.length; i++) {
|
||||
debugger;
|
||||
debugger;
|
||||
let linePixls = [];
|
||||
let item = this.validTxts[i];
|
||||
|
||||
|
||||
for (var j = 0; j < item.length; j++) {
|
||||
let result = await drawTxt(item[j]);
|
||||
linePixls.push(convertCharToMatrix(result.pixelData));
|
||||
@ -239,7 +239,7 @@ debugger;
|
||||
// console.log("hexs=",linePixls.join(","));
|
||||
arr.push(linePixls);
|
||||
}
|
||||
|
||||
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.setFillStyle('#FFFFFF');//this.bgColor
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 绘制一个测试字符来预热字体和画布
|
||||
this.ctx.setFillStyle(this.color);
|
||||
this.ctx.setFillStyle('#000000');//this.color
|
||||
this.ctx.setFontSize(this.fontSize);
|
||||
this.ctx.font = `${this.fontSize}px "PingFangBold","PingFang SC", Arial, sans-serif`;
|
||||
this.ctx.setTextBaseline('middle');
|
||||
@ -212,7 +212,7 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setFillStyle('#000000');//this.color
|
||||
ctx.setTextBaseline('middle');
|
||||
// ctx.setTextAlign('center')
|
||||
ctx.setFontSize(this.fontSize);
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.setFillStyle('#FFFFFF');//this.bgColor
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
@ -100,10 +100,19 @@
|
||||
for (let x = 0; x < 16; x++) {
|
||||
// 计算像素在imageData中的索引 (RGBA格式)
|
||||
let index = (y * 16 + x) * 4;
|
||||
let red = imageData[index];
|
||||
// let red = imageData[index];
|
||||
|
||||
|
||||
let r = imageData[index];
|
||||
let g = imageData[index+1];
|
||||
let b = imageData[index+2];
|
||||
|
||||
|
||||
let gray = (r + g + b) / 3;
|
||||
let bit = gray < 255 ? '1' : '0';
|
||||
|
||||
// 黑色像素(R值较低)视为1,白色视为0
|
||||
let isBlack = red < 128 ? 1 : 0;
|
||||
let isBlack =gray < 255 ? 1 : 0;// red < 128 ? 1 : 0;
|
||||
arr.push(isBlack);
|
||||
|
||||
}
|
||||
@ -154,7 +163,7 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setFillStyle('#000000');//this.color
|
||||
ctx.setTextBaseline('middle');
|
||||
// ctx.setTextAlign('center')
|
||||
ctx.setFontSize(this.fontSize);
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.setFillStyle('#FFFFFF');//this.bgColor
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
@ -82,9 +82,9 @@
|
||||
this.currentCanvasWidth = 16;
|
||||
this.currentCanvasHeight = 16;
|
||||
this.clearCanvas();
|
||||
this.ctx.setFillStyle(this.color);
|
||||
this.ctx.setFillStyle('#000000');//this.color
|
||||
this.ctx.setFontSize(this.fontSize);
|
||||
this.ctx.font = `${this.fontSize}px "PingFangBold", "PingFang SC", Arial, sans-serif`;
|
||||
this.ctx.font = `${this.fontSize}px "PingFang SC","PingFangBold", Arial, sans-serif`;
|
||||
this.ctx.setTextBaseline('middle');
|
||||
this.ctx.fillText('测', 0, 8);
|
||||
|
||||
@ -158,12 +158,20 @@
|
||||
// pixels.push(R < 128 ? 1 : 0);
|
||||
|
||||
|
||||
const R = imageData[i];
|
||||
const G = imageData[i + 1];
|
||||
const B = imageData[i + 2];
|
||||
const gray = 0.299 * R + 0.587 * G + 0.114 * B; // 灰度转换
|
||||
pixels.push(gray < 128 ? 1 : 0);
|
||||
// const R = imageData[i];
|
||||
// const G = imageData[i + 1];
|
||||
// const B = imageData[i + 2];
|
||||
// const gray = 0.299 * R + 0.587 * G + 0.114 * B; // 灰度转换
|
||||
// pixels.push(gray < 128 ? 1 : 0);
|
||||
|
||||
let r = imageData[i];
|
||||
let g = imageData[i+1];
|
||||
let b = imageData[i+2];
|
||||
|
||||
|
||||
let gray = (r + g + b) / 3;
|
||||
let bit = gray < 255 ? 1 : 0;
|
||||
pixels.push(bit);
|
||||
}
|
||||
|
||||
const lowBytes = new Array(charWidth).fill(0);
|
||||
@ -197,11 +205,11 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setFillStyle('#000000');//this.color
|
||||
ctx.setTextBaseline('middle');
|
||||
// ctx.setTextAlign('center')
|
||||
ctx.setFontSize(this.fontSize);
|
||||
ctx.font = `${this.fontSize}px "PingFangBold", "PingFang SC", Arial, sans-serif`;
|
||||
ctx.font = `${this.fontSize}px "PingFang SC","PingFangBold", Arial, sans-serif`;
|
||||
|
||||
// 4. 绘制当前行文本
|
||||
debugger;
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
* 清除Canvas内容
|
||||
*/
|
||||
clearCanvas() {
|
||||
this.ctx.setFillStyle(this.bgColor);
|
||||
this.ctx.setFillStyle('#FFFFFF');//this.bgColor
|
||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||
},
|
||||
|
||||
@ -105,10 +105,18 @@
|
||||
let G = imageData[index+1];
|
||||
let B = imageData[index]+2;
|
||||
|
||||
// let r = imageData[i];
|
||||
// let g = imageData[i+1];
|
||||
// let b = imageData[i+2];
|
||||
|
||||
|
||||
let gray = (R + G + B) / 3;
|
||||
let bit = gray < 255 ? 1 : 0;
|
||||
|
||||
|
||||
// 黑色像素(R值较低)视为1,白色视为0
|
||||
let isBlack = R < 128 ? 1 : 0;
|
||||
arr.push(isBlack);
|
||||
// let isBlack = R < 128 ? 1 : 0;
|
||||
arr.push(bit);
|
||||
|
||||
}
|
||||
}
|
||||
@ -159,11 +167,11 @@
|
||||
this.clearCanvas();
|
||||
|
||||
// 3. 设置文字样式
|
||||
ctx.setFillStyle(this.color);
|
||||
ctx.setFillStyle('#000000');//this.color
|
||||
ctx.setTextBaseline('middle');
|
||||
// ctx.setTextAlign('center')
|
||||
ctx.setFontSize(this.fontSize);
|
||||
ctx.font = `${this.fontSize}px "PingFangBold", "PingFang SC", Arial, sans-serif`;
|
||||
ctx.font = `${this.fontSize}px PingFangBold", "PingFang SC", Arial, sans-serif`;
|
||||
|
||||
// 4. 绘制当前行文本
|
||||
let currentX = 0;
|
||||
|
||||
@ -141,9 +141,8 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transform: translateZ(0);
|
||||
/* 启用GPU加速 */
|
||||
margin-top: -150rpx;
|
||||
transform: translateZ(0);
|
||||
margin-top: 0rpx;
|
||||
}
|
||||
|
||||
/* 刻度容器 */
|
||||
|
||||
30
pages.json
@ -339,6 +339,14 @@
|
||||
"navigationBarTitleText" : "HBY102"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/102J/HBY102J",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText" : "HBY102"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/common/user/logOff",
|
||||
"style" :
|
||||
@ -429,7 +437,7 @@
|
||||
{
|
||||
"path": "pages/common/addDevice/addBle",
|
||||
"style": {
|
||||
"navigationBarTitleText": "蓝牙添加设备"
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -446,6 +454,26 @@
|
||||
"navigationStyle": "custom",
|
||||
"fullscreen": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/008A/HBY008A",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/100Y/HBY100Y",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/210/HBY210",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "HBY210"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
1216
pages/008A/HBY008A.vue
Normal file
@ -16,7 +16,8 @@
|
||||
<view class="row">
|
||||
<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,13 +617,13 @@
|
||||
},
|
||||
showBleUnConnect() {
|
||||
|
||||
this.showPop({
|
||||
showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
buttonText: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -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,47 +1019,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;
|
||||
|
||||
@ -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>
|
||||
@ -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,
|
||||
@ -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,13 +1354,13 @@ 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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -1421,124 +1382,15 @@ onFreqChanging(e){
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},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;
|
||||
|
||||
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 {
|
||||
|
||||
@ -58,6 +58,11 @@
|
||||
<text class="value"
|
||||
:class="deviceInfo.onlineStatus===0?'red':'green'">{{ deviceInfo.onlineStatus === 0 ? '离线': '在线' }}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">充电状态</text>
|
||||
<text class="value"
|
||||
>{{ deviceInfo.chargingStatus === 0 ? '未充电': '充电中' }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label" style="display: flex; align-items: center;">定位信息</text>
|
||||
<view class="info-value status-running" @click="gpsPosition(deviceInfo)">
|
||||
@ -190,36 +195,19 @@
|
||||
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>
|
||||
|
||||
<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" />
|
||||
|
||||
<MsgBox ref="msgPop" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -231,7 +219,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';
|
||||
@ -813,6 +809,14 @@
|
||||
that.formData.strobeFrequency = that.normalizeStrobeFreq(that.formData.strobeFrequency);
|
||||
that.deviceInfo = res.data;
|
||||
that.$nextTick(() => that.sync100JBleUiFromHelper && that.sync100JBleUiFromHelper());
|
||||
// 语音频闪报警:0=关闭,1=开启 ui7是播放的状态
|
||||
const voiceBroadcast = res.data.voiceBroadcast;
|
||||
if (voiceBroadcast === 1) {
|
||||
console.log('wo shi shui ');
|
||||
that.formData.sta_VoiceType = '7'
|
||||
} else {
|
||||
that.formData.sta_VoiceType = '-1'
|
||||
}
|
||||
const strobeEnable = res.data.strobeEnable ?? 0; // 0=关闭,1=开启
|
||||
const strobeMode = res.data.strobeMode ?? 0; // 0=红闪、1=蓝闪、3=红色顺时针...
|
||||
if (strobeEnable === 1) {
|
||||
@ -1041,7 +1045,7 @@
|
||||
openVolume(item, index) {
|
||||
if (!item) {
|
||||
item = this.dic.sta_VoiceType[index];
|
||||
}
|
||||
}
|
||||
let val = item.key;
|
||||
const prevVoiceType = this.formData.sta_VoiceType;
|
||||
if (this.formData.sta_VoiceType === val) {
|
||||
@ -1056,7 +1060,7 @@
|
||||
const data = {
|
||||
deviceIds: [this.deviceInfo.deviceId],
|
||||
voiceStrobeAlarm: 1,
|
||||
mode: this.formData.sta_VoiceType
|
||||
mode: item.key
|
||||
};
|
||||
deviceForceAlarmActivation(data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
@ -1075,7 +1079,7 @@
|
||||
const data = {
|
||||
deviceId: this.deviceInfo.deviceId,
|
||||
voiceBroadcast: Number(this.formData.sta_VoiceType) === -1 ? 0 : 1,
|
||||
mode: this.formData.sta_VoiceType,
|
||||
mode: item.key,
|
||||
voiceStrobeAlarm: this.deviceInfo.voiceStrobeAlarm
|
||||
};
|
||||
deviceVoiceBroadcast(data).then((res) => {
|
||||
@ -1460,29 +1464,7 @@
|
||||
},
|
||||
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 +1529,7 @@
|
||||
option.buttonBgColor = '#BBE600';
|
||||
}
|
||||
these.Status.Pop.showPop = true;
|
||||
|
||||
},
|
||||
btnClick() {
|
||||
|
||||
@ -1920,44 +1903,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;
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
@ -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>
|
||||
@ -37,7 +37,8 @@
|
||||
<view class="row">
|
||||
<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>
|
||||
@ -60,7 +61,7 @@
|
||||
</view>
|
||||
<view class="item" @click.top="bleStatuToggle">
|
||||
<text class="lbl">蓝牙状态</text>
|
||||
<text class="value" :class="(!formData.bleStatu || formData.bleStatu==='err')?'red':'green'">{{getbleStatu}}</text>
|
||||
<text class="value" :class="(!formData.bleStatu || formData.bleStatu==='err')?'red':'green'">{{getbleStatu}}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<text class="lbl">信道:{{formData.sta_Channel}}</text>
|
||||
@ -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,7 +513,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);
|
||||
});;
|
||||
}
|
||||
this.getWarns();
|
||||
// this.getLinkedCnt();
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
debugger;
|
||||
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 @@ debugger;
|
||||
these.setBleFormData();
|
||||
resolve();
|
||||
}).catch(ex => {
|
||||
this.showMsg(ex.msg);
|
||||
MsgError(ex.msg,null,these);
|
||||
reject(ex);
|
||||
});
|
||||
});
|
||||
@ -1001,9 +992,9 @@ debugger;
|
||||
|
||||
}
|
||||
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 @@ debugger;
|
||||
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,7 +1023,7 @@ debugger;
|
||||
showCancel: true,
|
||||
buttonCancelText: '取消'
|
||||
|
||||
});
|
||||
},these);
|
||||
} else {
|
||||
let newval=this.formData.sta_LedType===item.key?'led_off':item.key;
|
||||
task(newval);
|
||||
@ -1202,7 +1193,7 @@ debugger;
|
||||
name: deviceName
|
||||
});
|
||||
}
|
||||
this.showMsg(msg.join(','));
|
||||
MsgError(msg.join(','),'',these);
|
||||
});
|
||||
return;
|
||||
// clearInterval(instrusionTime);
|
||||
@ -1222,7 +1213,7 @@ debugger;
|
||||
// this.formData.sta_IntrusTime = 0;
|
||||
}
|
||||
if (msg.length > 0) {
|
||||
this.showMsg(msg.join(','));
|
||||
MsgError(msg.join(','),'',these);
|
||||
}
|
||||
|
||||
|
||||
@ -1346,6 +1337,7 @@ debugger;
|
||||
these.formData.bleStatu = true;
|
||||
}).catch(ex => {
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:" + ex.msg, "确定", these);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -1367,13 +1359,13 @@ debugger;
|
||||
},
|
||||
showBleUnConnect() {
|
||||
|
||||
this.showPop({
|
||||
showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
buttonText: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -1395,121 +1387,80 @@ debugger;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
},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);
|
||||
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];
|
||||
}
|
||||
}
|
||||
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
|
||||
});
|
||||
}
|
||||
if (!option.borderColor) {
|
||||
option.borderColor = '#BBE600';
|
||||
option.buttonBgColor = '#BBE600';
|
||||
}
|
||||
these.Status.Pop.showPop = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -1879,47 +1830,7 @@ 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 {
|
||||
padding: 0px;
|
||||
|
||||
2302
pages/102J/HBY102J.vue
Normal file
2752
pages/210/HBY210.vue
1528
pages/210/HBY210Old.vue
Normal 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>
|
||||
@ -33,12 +33,12 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="row">
|
||||
<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> -->
|
||||
<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,13 +1246,13 @@
|
||||
},
|
||||
showBleUnConnect() {
|
||||
|
||||
this.showPop({
|
||||
showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
buttonText: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
this.Status.Pop[key] = option[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (!option.borderColor) {
|
||||
option.borderColor = '#BBE600';
|
||||
option.buttonBgColor = '#BBE600';
|
||||
}
|
||||
these.Status.Pop.showPop = true;
|
||||
},
|
||||
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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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,11 +744,11 @@ 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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -788,35 +772,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;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="warnnig" :class="formData.sta_ShakeBit!==0 ?'':'displayNone'">
|
||||
<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>
|
||||
@ -246,23 +246,7 @@
|
||||
</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" />
|
||||
@ -279,7 +263,7 @@
|
||||
baseURL
|
||||
} from '@/utils/request.js';
|
||||
import {
|
||||
showLoading,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
updateLoading
|
||||
} from '@/utils/loading.js';
|
||||
@ -309,7 +293,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
Status: {
|
||||
Status: {
|
||||
|
||||
|
||||
pageHide: false,
|
||||
@ -501,7 +485,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);
|
||||
});;
|
||||
}
|
||||
},
|
||||
onHide: function() {
|
||||
@ -569,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);
|
||||
});;
|
||||
});
|
||||
|
||||
|
||||
@ -774,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;
|
||||
@ -864,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);
|
||||
@ -891,7 +881,7 @@
|
||||
|
||||
showPop({
|
||||
message: "与服务器连接出现异常,请检查网络设置",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
}, these);
|
||||
@ -902,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);
|
||||
@ -974,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);
|
||||
@ -1067,13 +1057,7 @@
|
||||
'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++) {
|
||||
@ -1106,7 +1090,7 @@
|
||||
these.closeAction();
|
||||
showPop({
|
||||
message: err.msg,
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
});
|
||||
@ -1129,7 +1113,7 @@
|
||||
console.log("握手没有成功");
|
||||
showPop({
|
||||
message: err.msg,
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
});
|
||||
@ -1434,7 +1418,7 @@
|
||||
console.error("出现错误", ex)
|
||||
});
|
||||
}
|
||||
let msg = val == 1 ? '确定开启声光报警' : '确定关闭声光报警';
|
||||
let msg = val == 1 ? '确定开启声光报警' : '确定解除声光报警';
|
||||
|
||||
showPop({
|
||||
message: msg,
|
||||
@ -1924,11 +1908,11 @@
|
||||
|
||||
showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
buttonText: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
showCancel: true,
|
||||
okCallback: function() {
|
||||
console.log("1111");
|
||||
@ -2080,7 +2064,8 @@
|
||||
}).catch(ex => {
|
||||
updateLoading(these, {
|
||||
text: ex.msg
|
||||
})
|
||||
});
|
||||
these.formData.bleStatu = 'err';
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoading(these);
|
||||
@ -2108,6 +2093,7 @@
|
||||
these.formData.bleStatu = true;
|
||||
}).catch(ex => {
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:" + ex.msg, "确定", these);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -2134,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({
|
||||
|
||||
@ -2550,47 +2525,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;
|
||||
@ -2923,7 +2858,7 @@
|
||||
.navbarRight .img {
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.uni-navbar--fixed {
|
||||
|
||||
@ -16,7 +16,8 @@
|
||||
<view class="row">
|
||||
<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,14 +833,14 @@
|
||||
},
|
||||
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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -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 {
|
||||
|
||||
@ -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>
|
||||
@ -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,46 +693,22 @@
|
||||
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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
// console.log("1111");
|
||||
uni.navigateTo({
|
||||
@ -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);
|
||||
|
||||
@ -833,12 +800,12 @@
|
||||
dataView.setUint8(1, 0x02); // 帧类型:开机画面
|
||||
dataView.setUint8(2, currentPacket); // 包序号
|
||||
dataView.setUint16(3, packetData.length*2,false);
|
||||
|
||||
|
||||
// 填充数据(每个RGB565值占2字节)
|
||||
for (let i = 0; i < packetData.length; i++) {
|
||||
dataView.setUint16(5 + i * 2, packetData[i], false); // 大端字节序
|
||||
}
|
||||
|
||||
|
||||
//发送数据包
|
||||
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId,
|
||||
10).then(() => {
|
||||
@ -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,47 +2186,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;
|
||||
|
||||
@ -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>
|
||||
@ -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,46 +673,22 @@
|
||||
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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
// console.log("1111");
|
||||
uni.navigateTo({
|
||||
@ -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 {
|
||||
|
||||
@ -58,6 +58,12 @@
|
||||
{{getbleStatu}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="info-row" v-if="itemInfo.deviceMac" @click="bleStatuToggle">
|
||||
<text class="info-label">充电状态</text>
|
||||
<text class="info-value status-running" >
|
||||
{{deviceInfo.chargeState != 0?'充电中':'未充电'}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label" style="display: flex; align-items: center;">定位信息</text>
|
||||
<view class="info-value status-running" @click="gpsPosition(deviceInfo)">
|
||||
@ -73,7 +79,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="callpolice" v-if="deviceInfo.onlineStatus == 1 && deviceInfo.alarmStatus == 1">
|
||||
<view class="callpolice" v-if="deviceInfo.alarmStatus == 1">
|
||||
<view class="">设备强制报警中</view>
|
||||
<view>
|
||||
<uni-icons type="closeempty" size="15" color="rgba(255, 255, 255, 0.9)"
|
||||
@ -141,7 +147,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>
|
||||
@ -186,23 +192,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">
|
||||
@ -423,7 +414,7 @@
|
||||
Status: {
|
||||
pageHide: null
|
||||
},
|
||||
inteval: 1000
|
||||
inteval: 200
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -451,6 +442,52 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onReceive(deviceState){//蓝牙/Mq通用消息处理
|
||||
switch (deviceState[0]) {
|
||||
// 1设备切换灯光实时返回
|
||||
case 1:
|
||||
this.currentMainMode = this.getMainLightModeLabel(
|
||||
deviceState[
|
||||
1]);
|
||||
this.sliderValue = deviceState[2];
|
||||
this.deviceInfo.batteryRemainingTime = deviceState[3];
|
||||
break;
|
||||
// 12为设备实时上报
|
||||
case 12:
|
||||
this.currentMainMode = this.getMainLightModeLabel(
|
||||
deviceState[
|
||||
1]);
|
||||
this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位
|
||||
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||
if (this.deviceInfo) {
|
||||
this.deviceInfo.batteryPercentage = deviceState[3]; //第4位电量百分比
|
||||
this.deviceInfo.chargeState = deviceState[4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满)
|
||||
this.deviceInfo.batteryRemainingTime = deviceState[5]; //第6位200代表电池剩余续航时间200分钟
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (this.deviceInfo.batteryPercentage < 20 &&
|
||||
this.deviceInfo.chargeState == 0) {
|
||||
this.popupType = 'bettery';
|
||||
this.popupMessage = '请及时充电';
|
||||
this.showPopupFlag = true;
|
||||
}
|
||||
if (this.apiType === 'listA') {
|
||||
this.fetchDeviceDetail(data.data.id)
|
||||
} else {
|
||||
// 分享权限详情
|
||||
this.fetchSharedDeviceDetail(data.data.id)
|
||||
}
|
||||
}, 10000);
|
||||
// 上报电量,在列表里面同步
|
||||
uni.$emit('deviceStatusUpdate', {
|
||||
message: parsedMessage,
|
||||
timestamp: new Date().getTime()
|
||||
});
|
||||
break;
|
||||
default:
|
||||
console.log('未知的 deviceState 类型:', deviceState[0]);
|
||||
}
|
||||
},
|
||||
bleStatuToggle() {
|
||||
let f = this.getDevice();
|
||||
if (!f) {
|
||||
@ -471,6 +508,7 @@
|
||||
these.formData.bleStatu = true;
|
||||
}).catch(ex => {
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:"+ex.msg,"确定",these);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -514,11 +552,11 @@
|
||||
|
||||
showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
buttonText: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
showCancel: true,
|
||||
okCallback: function() {
|
||||
console.log("1111");
|
||||
@ -546,11 +584,9 @@
|
||||
}
|
||||
let data = rec.ReceiveData(receive, device, pagePath, recArr);
|
||||
console.log("蓝牙收到消息", data)
|
||||
this.receivData(data);
|
||||
},
|
||||
receivData(data) {
|
||||
|
||||
this.onReceive(data.state);
|
||||
},
|
||||
|
||||
bleStateBreak() {
|
||||
if (this.Status.pageHide) {
|
||||
return;
|
||||
@ -583,6 +619,8 @@
|
||||
updateLoading(these, {
|
||||
text: ex.msg
|
||||
})
|
||||
these.formData.bleStatu = 'err';
|
||||
MsgError("连接错误:"+ex.msg,"确定",these);
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoading(these);
|
||||
@ -921,7 +959,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....")
|
||||
@ -1226,15 +1264,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++) {
|
||||
@ -1272,7 +1304,7 @@
|
||||
|
||||
showPop({
|
||||
message: err.msg,
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
iconUrl: "/static/images/common/uploadErr.png",
|
||||
borderColor: "#e034344d",
|
||||
buttonBgColor: "#E03434",
|
||||
}, these);
|
||||
@ -1295,7 +1327,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);
|
||||
@ -1584,6 +1616,7 @@
|
||||
// this.popupConfirmText="";
|
||||
},
|
||||
OpenWarn(val){//开启/解除强制报警
|
||||
debugger;
|
||||
const topic = `B/${this.itemInfo.deviceImei}`;
|
||||
let message={"instruct":[7,val,0,0,0,0]};
|
||||
message=JSON.stringify(message);
|
||||
@ -1593,6 +1626,8 @@
|
||||
});
|
||||
if(flag){
|
||||
this.itemInfo.alarmStatus=val;
|
||||
}else{
|
||||
MsgError("操作没有成功",'确定',this);
|
||||
}
|
||||
|
||||
this.showPopupFlag = false;
|
||||
@ -1662,11 +1697,11 @@
|
||||
// 3.解除告警状态
|
||||
const registerRes = await deviceSendAlarmMessage(data);
|
||||
if (registerRes.code !== 200) {
|
||||
uni.showToast({
|
||||
title: registerRes.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
// uni.showToast({
|
||||
// title: registerRes.msg,
|
||||
// icon: 'none'
|
||||
// })
|
||||
this.OpenWarn(0);
|
||||
return
|
||||
}
|
||||
this.itemInfo.alarmStatus=0;
|
||||
@ -1864,27 +1899,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()) {
|
||||
@ -1946,53 +1961,8 @@
|
||||
const deviceState = parsedMessage.state; // 直接取 state 数组
|
||||
// 切换主灯光模式,亮度值设备同步
|
||||
if (!deviceState) return;
|
||||
// 1设备切换灯光实时返回
|
||||
switch (deviceState[0]) {
|
||||
case 1:
|
||||
this.currentMainMode = this.getMainLightModeLabel(
|
||||
deviceState[
|
||||
1]);
|
||||
this.sliderValue = deviceState[2];
|
||||
this.deviceInfo.batteryRemainingTime = deviceState[3];
|
||||
break;
|
||||
// 12为设备实时上报
|
||||
case 12:
|
||||
this.currentMainMode = this.getMainLightModeLabel(
|
||||
deviceState[
|
||||
1]);
|
||||
this.isLaserOn = deviceState[2] === 1; //第3位表示当时激光灯档位
|
||||
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||
if (this.deviceInfo) {
|
||||
this.deviceInfo.batteryPercentage = deviceState[
|
||||
3]; //第4位电量百分比
|
||||
this.deviceInfo.chargeState = deviceState[
|
||||
4]; //第5位为充电状态(0没有充电,1正在充电,2为已充满)
|
||||
this.deviceInfo.batteryRemainingTime = deviceState[
|
||||
5]; //第6位200代表电池剩余续航时间200分钟
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (this.deviceInfo.batteryPercentage < 20 &&
|
||||
this.deviceInfo.chargeState == 0) {
|
||||
this.popupType = 'bettery';
|
||||
this.popupMessage = '请及时充电';
|
||||
this.showPopupFlag = true;
|
||||
}
|
||||
if (this.apiType === 'listA') {
|
||||
this.fetchDeviceDetail(data.data.id)
|
||||
} else {
|
||||
// 分享权限详情
|
||||
this.fetchSharedDeviceDetail(data.data.id)
|
||||
}
|
||||
}, 10000);
|
||||
// 上报电量,在列表里面同步
|
||||
uni.$emit('deviceStatusUpdate', {
|
||||
message: parsedMessage,
|
||||
timestamp: new Date().getTime()
|
||||
});
|
||||
break;
|
||||
default:
|
||||
console.log('未知的 deviceState 类型:', deviceState[0]);
|
||||
}
|
||||
|
||||
this.onReceive(deviceState);
|
||||
} catch (error) {
|
||||
console.log('解析MQTT消息失败:', error, '原始消息:', payload);
|
||||
}
|
||||
@ -2029,6 +1999,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);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -2049,6 +2022,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);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -22,19 +22,19 @@
|
||||
</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>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="item">
|
||||
<text class="lbl">蓝牙状态</text>
|
||||
<text class="value" :class="formData.bleStatu?'green':'red'">{{formData.bleStatu?'已连接':'未连接'}}</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,13 +733,13 @@ 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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -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 {
|
||||
|
||||
@ -10,17 +10,17 @@
|
||||
<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>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</uni-nav-bar>
|
||||
|
||||
|
||||
<view class="eq">
|
||||
<view class="leftImg" @click.stop="previewImg(device.devicePic?device.devicePic:formData.img)">
|
||||
<image class="img" :src="device.devicePic?device.devicePic:formData.img" mode="aspectFit"></image>
|
||||
@ -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,13 +816,13 @@ 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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
|
||||
uni.navigateTo({
|
||||
@ -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,47 +1921,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 {
|
||||
padding: 0px;
|
||||
|
||||
@ -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>
|
||||
@ -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,39 +620,15 @@
|
||||
|
||||
},
|
||||
|
||||
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: '去连接',
|
||||
buttonTextColor: '#232323de',
|
||||
buttonTextColor: '#FFFFFFde',
|
||||
okCallback: function() {
|
||||
console.log("1111");
|
||||
uni.navigateTo({
|
||||
@ -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,47 +1825,7 @@ 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 {
|
||||
padding: 0px;
|
||||
|
||||
@ -281,9 +281,9 @@
|
||||
return;
|
||||
}
|
||||
//无效的设备回调
|
||||
let deviceInvalid = () => {
|
||||
|
||||
these.$set(these.device, "deviceName", "");
|
||||
let deviceInvalid = () => {
|
||||
these.$set(these.device, "deviceName", "");
|
||||
|
||||
|
||||
}
|
||||
clearTimeout(this.Statu.timeInteval);
|
||||
|
||||
@ -357,8 +357,12 @@
|
||||
device.isTarget = true;
|
||||
}
|
||||
}
|
||||
// 102J:与 100J 同 AE30 芯片;协议不同。广播名一般为 HBY102J-xxxxxx(见协议)
|
||||
if (device.name && /^HBY102J/i.test(device.name)) {
|
||||
device.isTarget = true;
|
||||
}
|
||||
if (device.name) {
|
||||
device.name = device.name.replace('JQZM-', '');
|
||||
device.name = device.name.replace(/^JQZM-/i, '').replace(/^HBY102J-/i, '');
|
||||
}
|
||||
these.EquipMents.push(device);
|
||||
}
|
||||
@ -399,9 +403,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (receivData.str.indexOf('mac address:') > -1 || receivData.str.indexOf(
|
||||
'sta_address') > -1 ||
|
||||
(receivData.bytes[0] === 0xFC && receivData.bytes.length >= 7)) {
|
||||
if ((receivData.str && (receivData.str.indexOf('mac address:') > -1 || receivData.str.indexOf(
|
||||
'sta_address') > -1)) ||
|
||||
(receivData.bytes && receivData.bytes[0] === 0xFC && receivData.bytes.length >= 7)) {
|
||||
|
||||
if (f.macAddress && these.device) {
|
||||
|
||||
@ -767,6 +771,9 @@
|
||||
if (index == total) {
|
||||
console.log("连接了N次都没连上");
|
||||
reject(ex);
|
||||
updateLoading(this, {
|
||||
text: ex.msg
|
||||
})
|
||||
return;
|
||||
}
|
||||
index++;
|
||||
|
||||
@ -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">
|
||||
@ -69,15 +88,13 @@
|
||||
</view>
|
||||
<view class="name lbl">
|
||||
设备名:
|
||||
<text class="green">{{item.device_name}}</text>
|
||||
<text class="green">{{item.device_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="rightIco " :class="item.isUpload?'bggreen':'bgred'">
|
||||
|
||||
|
||||
|
||||
<!-- <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>
|
||||
|
||||
@ -98,19 +117,42 @@
|
||||
hideLoading,
|
||||
updateLoading
|
||||
} from '@/utils/loading.js'
|
||||
import common from '@/utils/Common.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();
|
||||
|
||||
@ -356,12 +411,12 @@
|
||||
if (!arr[i].name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
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,'');
|
||||
|
||||
|
||||
|
||||
let f = these.EquipMents.find(function(v, index) {
|
||||
if (v.deviceId == arr[i].deviceId) {
|
||||
these.$set(these.EquipMents[index], "RSSI", arr[i].RSSI);
|
||||
@ -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;
|
||||
@ -426,20 +482,20 @@
|
||||
|
||||
|
||||
ble.addStateBreakCallback(() => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '蓝牙不可用'
|
||||
});
|
||||
|
||||
|
||||
MsgError('蓝牙不可用','',these);
|
||||
|
||||
these.EquipMents.filter((v, i) => {
|
||||
these.$set(these.EquipMents[i], 'link', false);
|
||||
});
|
||||
}, pagePath);
|
||||
ble.addStateRecoveryCallback(() => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '蓝牙恢复可用'
|
||||
});
|
||||
|
||||
|
||||
MsgSuccess('蓝牙恢复可用','',these,()=>{
|
||||
MsgClear(these);
|
||||
})
|
||||
},
|
||||
pagePath);
|
||||
|
||||
@ -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 => {
|
||||
@ -490,10 +546,37 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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,65 +586,87 @@
|
||||
|
||||
},
|
||||
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
|
||||
};
|
||||
|
||||
request({
|
||||
url: "/app/xinghan/device/getEquipAllByType",
|
||||
method: 'POST',
|
||||
data: json,
|
||||
}).then(res=>{
|
||||
|
||||
if(res && res.code==200){
|
||||
|
||||
succ(res.data);
|
||||
return;
|
||||
}
|
||||
err(res);
|
||||
}).catch(ex=>{
|
||||
console.error("ex=",ex);
|
||||
err(ex);
|
||||
});
|
||||
|
||||
|
||||
let json = {
|
||||
"tenant_id": this.type.tenantId,
|
||||
"deviceType": this.type.deviceTypeId
|
||||
};
|
||||
|
||||
request({
|
||||
url: "/app/xinghan/device/getEquipAllByType",
|
||||
method: 'POST',
|
||||
data: json,
|
||||
}).then(res => {
|
||||
|
||||
if (res && res.code == 200) {
|
||||
|
||||
succ(res.data);
|
||||
return;
|
||||
}
|
||||
err(res);
|
||||
}).catch(ex => {
|
||||
console.error("ex=", ex);
|
||||
err(ex);
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
//获取类型下的设备数量
|
||||
getTypeDeviceCnt() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
|
||||
|
||||
|
||||
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){
|
||||
|
||||
resolve(res.data);
|
||||
return;
|
||||
}
|
||||
reject(res);
|
||||
}).catch(ex=>{
|
||||
console.error("ex=",ex);
|
||||
reject(ex);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
resolve(res.data);
|
||||
return;
|
||||
}
|
||||
reject(res);
|
||||
}).catch(ex => {
|
||||
console.error("ex=", ex);
|
||||
reject(ex);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
getDevice(item) {
|
||||
@ -581,37 +686,40 @@
|
||||
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;
|
||||
|
||||
|
||||
});
|
||||
if (eqp) {
|
||||
|
||||
|
||||
these.$set(these.EquipMents[fIndex], "isUpload",
|
||||
true);
|
||||
these.$set(these.EquipMents[fIndex], "remark",
|
||||
"校验完成,设备已入库");
|
||||
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,77 +728,177 @@
|
||||
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,
|
||||
"deviceName": item.name
|
||||
};
|
||||
|
||||
|
||||
request({
|
||||
url:'/app/xinghan/device/GetDeviceByName',
|
||||
data:json,
|
||||
url: '/app/xinghan/device/GetDeviceByName',
|
||||
data: json,
|
||||
method: 'POST'
|
||||
}).then(res=>{
|
||||
if(res && res.code==200){
|
||||
|
||||
|
||||
resolve(res.data);
|
||||
return;
|
||||
|
||||
|
||||
}).then(res => {
|
||||
if (res && res.code == 200) {
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
MsgError('无效的二维码','',these);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
ble.disconnectDevice().finally(dis => {
|
||||
|
||||
|
||||
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 +935,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;
|
||||
|
||||
@ -742,63 +950,31 @@
|
||||
if (v.deviceId == item.deviceId) {
|
||||
this.$set(this.EquipMents[index], "isUpload", false);
|
||||
this.$set(this.EquipMents[index], "remark", res.msg);
|
||||
|
||||
|
||||
this.devices.find((d,i)=>{
|
||||
if(d.device_mac==item.macAddress){
|
||||
|
||||
this.$set(this.EquipMents[index], "device_name", d.device_name);
|
||||
|
||||
|
||||
this.devices.find((d, i) => {
|
||||
if (d.device_mac == item.macAddress) {
|
||||
|
||||
this.$set(this.EquipMents[index], "device_name", d
|
||||
.device_name);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}).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 +1024,9 @@
|
||||
}).catch((ex) => {
|
||||
if (index == total) {
|
||||
console.log("连接了N次都没连上");
|
||||
updateLoading(this, {
|
||||
text: ex.msg
|
||||
});
|
||||
reject(ex);
|
||||
return;
|
||||
}
|
||||
@ -865,11 +1044,12 @@
|
||||
|
||||
execLink().then((res) => {
|
||||
linkCallback(res);
|
||||
|
||||
these.sendEquipToMq();
|
||||
}).catch(ex => {
|
||||
console.log("ex=", ex)
|
||||
uni.showModal({
|
||||
content: "连接失败:" + ex.msg
|
||||
});
|
||||
|
||||
MsgError("连接失败:" + ex.msg,'',these);
|
||||
hideLoading(these);
|
||||
});
|
||||
}
|
||||
@ -1042,6 +1222,7 @@
|
||||
width: 100%;
|
||||
height: calc(100% - 186rpx);
|
||||
overflow-y: scroll;
|
||||
margin-top: 120rpx;
|
||||
}
|
||||
|
||||
.list .item {
|
||||
@ -1253,6 +1434,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 +1465,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 +1480,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>
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
|
||||
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
||||
<view v-if="deviceList.length>0">
|
||||
<uni-swipe-action ref="swipeAction">
|
||||
<uni-swipe-action ref="swipeAction" >
|
||||
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
||||
<uni-swipe-action-item :right-options="Options"
|
||||
@click="handleSwipeClick($event, item, index)" class="device-card"
|
||||
@ -88,6 +88,7 @@
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons">
|
||||
<button class="btn cancelBtn" @click="closePopup('delete')">取消</button>
|
||||
<button class="btn agreeBtn" @click="handleBtn">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
@ -98,14 +99,15 @@
|
||||
<view class="popup-content">
|
||||
<view>
|
||||
<view class="popup-flex">
|
||||
<text>设备名称</text>
|
||||
<input type="text" v-model="deviceName" placeholder="请输入设备名称" class="popup-input"
|
||||
<text>名称</text>
|
||||
<input type="text" v-model="deviceName" placeholder="请输入名称" class="popup-input"
|
||||
@click.stop />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons" style="margin-top:50rpx;">
|
||||
<button class="btn cancelBtn" @click="closePopup('rename')">取消</button>
|
||||
<button class="btn agreeBtn4" @click="handleBtnName">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
@ -134,6 +136,9 @@
|
||||
</view>
|
||||
<!-- 蒙板、用于点击任意位置关闭悬浮的菜单 -->
|
||||
<view class="mask" v-show="showTooltip||showshare" @click.stop="closePopMenu"></view>
|
||||
|
||||
|
||||
<MsgBox ref="msgPop" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -252,8 +257,12 @@
|
||||
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'] //需要发送报警的类型
|
||||
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
|
||||
}
|
||||
@ -768,7 +777,8 @@
|
||||
this.downCallback();
|
||||
});
|
||||
ble = bleTool.getBleTool();
|
||||
recei = BleReceive.getBleReceive();
|
||||
console.log("this=",this);
|
||||
recei = BleReceive.getBleReceive(this);
|
||||
//蓝牙连接成功的回调
|
||||
ble.addRecoveryCallback((res) => {
|
||||
// console.log("蓝牙连接成功的回调");
|
||||
@ -795,8 +805,9 @@
|
||||
|
||||
//接收到消息的回调
|
||||
ble.addReceiveCallback((receive, device, path, recArr) => {
|
||||
// console.error("首页收到消息了");
|
||||
recei.ReceiveData(receive, device, path, recArr);
|
||||
console.error("首页收到消息了");
|
||||
let json=recei.ReceiveData(receive, device, path, recArr);
|
||||
console.error("消息内容",json);
|
||||
this.updateBleStatu();
|
||||
}, pagePath);
|
||||
|
||||
@ -869,12 +880,25 @@
|
||||
text-align: center;
|
||||
/* 文字居中 */
|
||||
/* 设置最小宽度 */
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: rgba(187, 230, 0, 1);
|
||||
border-bottom: 6rpx solid rgba(187, 230, 0, 1);
|
||||
.tab-item.active {
|
||||
color: #bbe600;
|
||||
|
||||
height: 60rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.tab-item.active::before{
|
||||
content: "";
|
||||
background-color: #bbe600;
|
||||
position: absolute;
|
||||
top: 90%;
|
||||
left:35%;
|
||||
width: 30%;
|
||||
height: 6rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.sendFlex {
|
||||
@ -1124,14 +1148,32 @@
|
||||
border-radius: 40rpx;
|
||||
padding: 30rpx;
|
||||
text-align: center;
|
||||
border: 1px solid rgba(255, 200, 78, 0.3);
|
||||
border: 1px solid #E034344d;
|
||||
}
|
||||
|
||||
|
||||
.cancelBtn{
|
||||
|
||||
|
||||
text-align: center;
|
||||
width: 170rpx !important;
|
||||
background-color: #00000000;
|
||||
}
|
||||
|
||||
.agreement-popupC .cancelBtn{
|
||||
border:1rpx solid #E034344d;
|
||||
color:#E03434;
|
||||
}
|
||||
|
||||
.agreement-popupD .cancelBtn{
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.6);
|
||||
color:rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
.agreement-popupD {
|
||||
width: 70%;
|
||||
width: 75%;
|
||||
background-color: rgb(42, 42, 42);
|
||||
border-radius: 40rpx;
|
||||
padding: 40rpx;
|
||||
padding: 40rpx 5rpx;
|
||||
text-align: center;
|
||||
border: 1px solid rgba(187, 230, 0, 0.3);
|
||||
}
|
||||
@ -1153,6 +1195,7 @@
|
||||
font-size: 28rpx;
|
||||
text-align: left;
|
||||
text-indent: 5rpx;
|
||||
width: calc(100% - 75rpx);
|
||||
}
|
||||
|
||||
.svg {
|
||||
@ -1173,8 +1216,8 @@
|
||||
|
||||
/* 同意按钮 */
|
||||
.agreeBtn {
|
||||
background: #FFC84E;
|
||||
color: #232323;
|
||||
background: #E03434;
|
||||
color: #FFFFFF;
|
||||
border: none;
|
||||
width: 170rpx !important;
|
||||
}
|
||||
|
||||
@ -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;">
|
||||
注销账号后账号将永久失效且不可恢复,
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
static/images/lightImg/closeLightActive.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
@ -22,9 +22,6 @@ const serviceDic = [ //合作供应商的蓝牙主服务
|
||||
class BleHelper {
|
||||
constructor() {
|
||||
this.StorageKey = "linkedDevices";
|
||||
|
||||
recei = receivTool.getBleReceive();
|
||||
|
||||
this.init();
|
||||
}
|
||||
init() {
|
||||
@ -41,16 +38,12 @@ class BleHelper {
|
||||
if (!v) return false;
|
||||
v.Linked = false;
|
||||
v.notifyState = false;
|
||||
return !!v.device;
|
||||
return v.device;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
|
||||
|
||||
|
||||
|
||||
this.data = {
|
||||
isOpenBlue: false, //蓝牙模块是否开启
|
||||
available: false, //蓝牙状态是否可用
|
||||
@ -71,17 +64,7 @@ class BleHelper {
|
||||
stateRecoveryCallback: [], //蓝牙适配器恢复可用事件
|
||||
stateBreakCallback: [] //蓝牙适配器不可用事件
|
||||
}
|
||||
//蓝牙模块不再订阅,改到首页订阅
|
||||
// this.addReceiveCallback((receive, f, path, recArr) => {
|
||||
// recei.ReceiveData(receive, f, path, recArr);
|
||||
// }, "BleReceiveData");
|
||||
|
||||
// setTimeout(() => {
|
||||
// this.OpenBlue().then(() => {
|
||||
// this.linkAllDevices();
|
||||
// });
|
||||
|
||||
// }, 10);
|
||||
|
||||
this.dic = {
|
||||
errRemarks: [{
|
||||
@ -668,7 +651,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 +892,7 @@ class BleHelper {
|
||||
|
||||
this.updateCache();
|
||||
}
|
||||
}, 500);
|
||||
}, 100);
|
||||
|
||||
});
|
||||
|
||||
@ -1157,7 +1140,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) => {
|
||||
|
||||
@ -1,8 +1,25 @@
|
||||
import Common from '@/utils/Common.js'
|
||||
import { parseBleData } from '@/api/100J/HBY100-J.js'
|
||||
import {
|
||||
parseBleData
|
||||
} from '@/api/100J/HBY100-J.js'
|
||||
import {
|
||||
parseHby102jUplink
|
||||
} from '@/api/102J/hby102jBleProtocol.js'
|
||||
import {
|
||||
MsgSuccess,
|
||||
MsgError,
|
||||
MsgClose,
|
||||
MsgWarning,
|
||||
showPop,
|
||||
MsgClear,
|
||||
MsgInfo
|
||||
} from '@/utils/MsgPops.js';
|
||||
|
||||
class BleReceive {
|
||||
constructor() {
|
||||
constructor(_ref) {
|
||||
if(_ref){
|
||||
this.ref = _ref;
|
||||
}
|
||||
this.StorageKey = "linkedDevices";
|
||||
this.HandlerMap = {
|
||||
'/pages/6155/deviceDetail': this.Receive_6155.bind(this),
|
||||
@ -13,10 +30,13 @@ class BleReceive {
|
||||
'/pages/4877/BJQ4877': this.Receive_4877.bind(this),
|
||||
'/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/102J/HBY102J': this.Receive_102J.bind(this),
|
||||
'/pages/6170/deviceControl/index': this.Receive_6170.bind(this),
|
||||
'/pages/100J/HBY100-J': this.Receive_100J.bind(this),
|
||||
'/pages/6075J/BJQ6075J':this.Receive_6075.bind(this)
|
||||
'/pages/6075J/BJQ6075J': this.Receive_6075.bind(this),
|
||||
'/pages/210/HBY210':this.Receive_210.bind(this),
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -50,36 +70,45 @@ class BleReceive {
|
||||
|
||||
|
||||
ReceiveData(receive, f, path, recArr) {
|
||||
// 100J:首页等场景 LinkedList 项可能未带齐 mac/device,但语音分片上传依赖 parseBleData 消费 FB 05
|
||||
// AE30 服务:100J 与 102J 为同一套蓝牙芯片(GATT 相同),应用层协议不同。
|
||||
// 100J:f 未就绪时仍需 parseBleData 消费 FB 05 等语音/文件应答。
|
||||
// 102J:上行 FB 21–28 为晶全协议,不得走 100J parseBleData,避免误触发语音/文件回调。
|
||||
const sid = receive && receive.serviceId ? String(receive.serviceId) : '';
|
||||
const is100JAe30 = /ae30/i.test(sid);
|
||||
const isAe30 = /ae30/i.test(sid);
|
||||
const fReady = f && f.macAddress && f.device && f.device.id;
|
||||
if (is100JAe30 && receive && receive.bytes && receive.bytes.length >= 3 && !fReady) {
|
||||
try {
|
||||
parseBleData(new Uint8Array(receive.bytes));
|
||||
} catch (e) {
|
||||
console.warn('[100J] ReceiveData 兜底解析失败', e);
|
||||
const u8Early = receive && receive.bytes && receive.bytes.length >= 4
|
||||
? new Uint8Array(receive.bytes)
|
||||
: null;
|
||||
const is102JFbControl = u8Early && u8Early[0] === 0xfb && u8Early[u8Early.length - 1] === 0xff
|
||||
&& u8Early[1] >= 0x21 && u8Early[1] <= 0x28;
|
||||
if (isAe30 && receive && receive.bytes && receive.bytes.length >= 3 && !fReady) {
|
||||
if (!is102JFbControl) {
|
||||
try {
|
||||
parseBleData(new Uint8Array(receive.bytes));
|
||||
} catch (e) {
|
||||
console.warn('[100J/AE30] ReceiveData 兜底 parseBleData 失败', e);
|
||||
}
|
||||
}
|
||||
return receive;
|
||||
}
|
||||
|
||||
if (f && f.macAddress && f.device && f.device.id) {
|
||||
if (fReady) {
|
||||
let handler = null;
|
||||
let keys = Object.keys(this.HandlerMap);
|
||||
let devKey = f.device.detailPageUrl ? f.device.detailPageUrl.replace(/\//g, '').toLowerCase() : '';
|
||||
|
||||
|
||||
for (let index = 0; index < keys.length; index++) {
|
||||
let devKey = f.device.detailPageUrl ? f.device.detailPageUrl.replace(/\//g, "").toLowerCase() : '';
|
||||
let key = keys[index].replace(/\//g, '').toLowerCase();
|
||||
if (key == devKey) {
|
||||
handler = this.HandlerMap[keys[index]];
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (handler) {
|
||||
let data = handler(receive, f, path, recArr);
|
||||
let data = handler(receive, f, path, recArr);
|
||||
this.setBleFormData(data, f);
|
||||
return data;
|
||||
} else {
|
||||
@ -87,9 +116,9 @@ class BleReceive {
|
||||
}
|
||||
|
||||
} else {
|
||||
// 100J AE30 二进制帧在 f 不完整时已在上方 parseBleData,此处不再误报「无法处理」
|
||||
if (!is100JAe30) {
|
||||
console.log("已收到该消息,但无法处理", receive, "f:", f);
|
||||
// AE30:100J 在 f 不完整时已在上方 parseBleData;102J 控制帧被有意跳过 parseBleData
|
||||
if (!isAe30) {
|
||||
console.error("已收到该消息,但无法处理", receive, "f:", f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,40 +209,33 @@ class BleReceive {
|
||||
formData.modeCurr = modeCurr;
|
||||
formData.warnLevel = warn;
|
||||
formData.iswarn = iswarn;
|
||||
|
||||
|
||||
|
||||
let recCnt = recArr.find(v => {
|
||||
return v.key.replace(/\//g, "").toLowerCase() == f.device.detailPageUrl
|
||||
.replace(/\//g, "").toLowerCase();
|
||||
});
|
||||
if (!recCnt) {
|
||||
let msg = [];
|
||||
if (f) {
|
||||
if (formData.battary <= 20) {
|
||||
msg.push("设备'" + f.device.deviceName + "'电量低");
|
||||
}
|
||||
if (iswarn) {
|
||||
msg.push("设备'" + f.device.deviceName + "'环境存在漏电电源");
|
||||
}
|
||||
|
||||
if (iswarn) {
|
||||
uni.showModal({
|
||||
content: "'" + f.device.deviceName + "'环境存在漏电电源",
|
||||
title: "警告",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
|
||||
if (f) {
|
||||
uni.navigateTo({
|
||||
url: f.detailPageUrl,
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('detailData', {
|
||||
data: f,
|
||||
deviceType: '',
|
||||
apiType: 'listA'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.ref && msg.length>0) {
|
||||
if (msg.length > 0) {
|
||||
msg = msg.join(',');
|
||||
MsgError("'" + f.device.deviceName + "'环境存在漏电电源", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return formData;
|
||||
} catch (error) {
|
||||
@ -229,7 +251,7 @@ class BleReceive {
|
||||
if (str.indexOf('mac address:') == 0) {
|
||||
let formData = {};
|
||||
formData.macAddress = str.split(':')[1];
|
||||
|
||||
|
||||
return formData;
|
||||
} else {
|
||||
let receiveData = {
|
||||
@ -348,7 +370,7 @@ class BleReceive {
|
||||
receiveData.fourGStrenth = fourGStrenth;
|
||||
receiveData.SOS = sosTxt;
|
||||
receiveData.qzwarn = sosTxt === 'sg';
|
||||
|
||||
|
||||
console.log("recArr=", recArr);
|
||||
let recCnt = recArr.find(v => {
|
||||
return v.key.replace(/\//g, "").toLowerCase() == f.device.detailPageUrl
|
||||
@ -362,13 +384,22 @@ class BleReceive {
|
||||
if (staticWarn) { //有静止报警
|
||||
msgs.push("静止报警中");
|
||||
}
|
||||
if (receiveData.battary <= 20) {
|
||||
msg.push("设备'" + f.device.deviceName + "'电量低");
|
||||
}
|
||||
if (msgs.length > 0) {
|
||||
msgs = "设备'" + f.device.deviceName + msgs.join(";");
|
||||
uni.showModal({
|
||||
title: "警告",
|
||||
content: msgs,
|
||||
showCancel: false
|
||||
});
|
||||
msgs = msgs.join(";");
|
||||
if (this.ref) {
|
||||
MsgError(msgs, '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
|
||||
// uni.showModal({
|
||||
// title: "警告",
|
||||
// content: msgs,
|
||||
// showCancel: false
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
@ -436,7 +467,7 @@ class BleReceive {
|
||||
console.log('将数据转文本失败', ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return receiveData;
|
||||
}
|
||||
|
||||
@ -514,12 +545,13 @@ class BleReceive {
|
||||
|
||||
});
|
||||
if (!recCnt) {
|
||||
if (batteryLevel <= 20) {
|
||||
// 会弹出两个框,暂且注释掉这段代码
|
||||
uni.showModal({
|
||||
content: "设备'" + f.device.deviceName + "'电量低",
|
||||
title: "提示"
|
||||
});
|
||||
if (batteryLevel <= 20 && warn == 0x00) {
|
||||
|
||||
if (this.ref) {
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -613,13 +645,17 @@ class BleReceive {
|
||||
|
||||
|
||||
});
|
||||
console.log("formData=",formData)
|
||||
if (!recCnt) {
|
||||
if (batteryLevel <= 20) {
|
||||
// 会弹出两个框,暂且注释掉这段代码
|
||||
uni.showModal({
|
||||
content: "设备'" + f.device.deviceName + "'电量低",
|
||||
title: "提示"
|
||||
});
|
||||
console.log("11111");
|
||||
if (formData.battary <= 20 && bytes[5] == 0x00) {
|
||||
console.log("2222")
|
||||
if (this.ref) {
|
||||
console.log("3333333");
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -646,11 +682,13 @@ class BleReceive {
|
||||
});
|
||||
if (!recCnt) {
|
||||
if (receiveData.sta_PowerPercent <= 20) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "设备'" + f.device.deviceName + "'电量低",
|
||||
showCancel: false
|
||||
});
|
||||
|
||||
if (this.ref) {
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@ -674,12 +712,16 @@ class BleReceive {
|
||||
.replace(/\//g, "").toLowerCase();
|
||||
});
|
||||
if (!recCnt) {
|
||||
if (receiveData.sta_battery <= 20) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "设备'" + f.device.deviceName + "'电量低",
|
||||
showCancel: false
|
||||
});
|
||||
if (receiveData.sta_battery <= 20 && (receiveData.sta_system != '1' || receiveData.sta_system !=
|
||||
'3')) {
|
||||
|
||||
if (this.ref) {
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@ -695,19 +737,22 @@ class BleReceive {
|
||||
try {
|
||||
if (!receive.bytes || receive.bytes.length < 3) return receiveData;
|
||||
// 与 HBY100-J 页 bleValueNotify 共用 notify,避免 parseBleData 执行两次:重复日志、FB05 双次 resolve、onNotify 双次
|
||||
const parsed = parseBleData(receive.bytes, { skipSideEffects: true });
|
||||
const parsed = parseBleData(receive.bytes, {
|
||||
skipSideEffects: true
|
||||
});
|
||||
if (!parsed) return receiveData;
|
||||
if (parsed.longitude !== undefined) receiveData.longitude = parsed.longitude;
|
||||
if (parsed.latitude !== undefined) receiveData.latitude = parsed.latitude;
|
||||
if (parsed.batteryPercentage !== undefined) receiveData.batteryPercentage = parsed.batteryPercentage;
|
||||
if (parsed.batteryRemainingTime !== undefined) receiveData.batteryRemainingTime = parsed.batteryRemainingTime;
|
||||
if (parsed.batteryRemainingTime !== undefined) receiveData.batteryRemainingTime = parsed
|
||||
.batteryRemainingTime;
|
||||
} catch (e) {
|
||||
console.log('[100J] BleReceive 解析失败', e);
|
||||
}
|
||||
return receiveData;
|
||||
}
|
||||
|
||||
Receive_6170(receive, f, path, recArr) {
|
||||
Receive_6170(receive, f, path, recArr) {
|
||||
let receiveData = {};
|
||||
|
||||
try {
|
||||
@ -721,21 +766,20 @@ Receive_6170(receive, f, path, recArr) {
|
||||
.replace(/\//g, "").toLowerCase();
|
||||
});
|
||||
if (!recCnt) {
|
||||
if (receiveData.sta_PowerPercent <= 20) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "设备'" + f.device.deviceName + "'电量低",
|
||||
showCancel: false
|
||||
});
|
||||
let deviceState = receiveData.state;
|
||||
if (deviceState && deviceState instanceof Array) {
|
||||
if (deviceState[0] == 12 && deviceState[3] <= 20 && deviceState[4] == 0) {
|
||||
if (this.ref) {
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
receiveData = {};
|
||||
console.error("文本解析失败", error)
|
||||
@ -758,18 +802,21 @@ Receive_6170(receive, f, path, recArr) {
|
||||
.replace(/\//g, "").toLowerCase();
|
||||
});
|
||||
if (!recCnt) {
|
||||
if (receiveData.sta_PowerPercent <= 20) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "设备'" + f.device.deviceName + "'电量低",
|
||||
showCancel: false
|
||||
});
|
||||
|
||||
let msgs = [];
|
||||
|
||||
if (receiveData.sta_PowerPercent <= 20 && receiveData.sta_charge == 0) {
|
||||
msgs.push("设备'" + f.device.deviceName + "'电量低");
|
||||
}
|
||||
if (receiveData.sta_Intrusion === 1) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "闯入报警中",
|
||||
showCancel: false
|
||||
msgs.push("设备'" + f.device.deviceName + "'闯入报警中");
|
||||
}
|
||||
|
||||
|
||||
if (this.ref && msg.length>0) {
|
||||
msgs = msgs.join(",");
|
||||
MsgError(msgs, '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
}
|
||||
|
||||
@ -787,7 +834,7 @@ Receive_6170(receive, f, path, recArr) {
|
||||
|
||||
if (receiveData.sta_tomac.indexOf(':') == -1) {
|
||||
receiveData.sta_tomac = receiveData.sta_tomac.replace(/(.{2})/g, '$1:').slice(0, -
|
||||
1); //mac地址自动补:
|
||||
1); //mac地址自动补:
|
||||
}
|
||||
uni.getStorageInfo({
|
||||
success: function(res) {
|
||||
@ -814,9 +861,9 @@ Receive_6170(receive, f, path, recArr) {
|
||||
let dev = arr.find(v => {
|
||||
if (v.linkId == f.linkId) {
|
||||
let vl = v.linkEqs.find(cvl => {
|
||||
if(cvl.linkMac === receiveData.sta_tomac){
|
||||
v.read=false;
|
||||
cvl.linkTime=time;
|
||||
if (cvl.linkMac === receiveData.sta_tomac) {
|
||||
v.read = false;
|
||||
cvl.linkTime = time;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -853,7 +900,7 @@ Receive_6170(receive, f, path, recArr) {
|
||||
console.error("某个设备闯入报警");
|
||||
if (receiveData.sta_sosadd.indexOf(':') == -1) {
|
||||
receiveData.sta_sosadd = receiveData.sta_sosadd.replace(/(.{2})/g, '$1:').slice(0, -
|
||||
1); //mac地址自动补:
|
||||
1); //mac地址自动补:
|
||||
}
|
||||
warnArrs.push({
|
||||
linkId: f.linkId,
|
||||
@ -910,36 +957,203 @@ Receive_6170(receive, f, path, recArr) {
|
||||
|
||||
}
|
||||
|
||||
Receive_102J(receive, f, path, recArr) {
|
||||
let receiveData = {}
|
||||
try {
|
||||
if (receive && receive.bytes && receive.bytes.length >= 3) {
|
||||
receiveData = parseHby102jUplink(new Uint8Array(receive.bytes))
|
||||
}
|
||||
|
||||
Receive_6075(receive,f,path,recArr){
|
||||
let recCnt = recArr.find((v) => {
|
||||
return v.key.replace(/\//g, '').toLowerCase() == f.device.detailPageUrl
|
||||
.replace(/\//g, '').toLowerCase()
|
||||
})
|
||||
if (!recCnt) {
|
||||
let msgs = []
|
||||
if (receiveData.sta_PowerPercent <= 20 && receiveData.sta_charge == 0) {
|
||||
msgs.push("设备'" + f.device.deviceName + "'电量低")
|
||||
}
|
||||
if (receiveData.sta_Intrusion === 1) {
|
||||
msgs.push("设备'" + f.device.deviceName + "'闯入报警中")
|
||||
}
|
||||
if (this.ref && msgs.length > 0) {
|
||||
const text = msgs.join(',')
|
||||
MsgError(text, '', this.ref, () => {
|
||||
MsgClear(this.ref)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (f.device && path === 'pages/common/index') {
|
||||
let linkKey = '102J_' + f.device.id + '_linked'
|
||||
let warnKey = '102J_' + f.device.id + '_warning'
|
||||
let time = new Date()
|
||||
|
||||
if (receiveData.sta_tomac) {
|
||||
if (receiveData.sta_tomac.indexOf(':') === -1) {
|
||||
receiveData.sta_tomac = receiveData.sta_tomac.replace(/(.{2})/g, '$1:').slice(0, -1)
|
||||
}
|
||||
uni.getStorageInfo({
|
||||
success: function(res) {
|
||||
let arr = []
|
||||
let linked = {
|
||||
linkId: f.linkId,
|
||||
read: false,
|
||||
linkEqs: [{
|
||||
linkTime: time,
|
||||
linkMac: f.macAddress
|
||||
}, {
|
||||
linkTime: time,
|
||||
linkMac: receiveData.sta_tomac
|
||||
}]
|
||||
}
|
||||
if (res.keys.includes(linkKey)) {
|
||||
arr = uni.getStorageSync(linkKey)
|
||||
}
|
||||
if (arr.length === 0) {
|
||||
arr.unshift(linked)
|
||||
} else {
|
||||
let dev = arr.find((v) => {
|
||||
if (v.linkId === f.linkId) {
|
||||
let vl = v.linkEqs.find((cvl) => {
|
||||
if (cvl.linkMac === receiveData.sta_tomac) {
|
||||
v.read = false
|
||||
cvl.linkTime = time
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (!vl) {
|
||||
v.linkEqs.push({
|
||||
linkTime: time,
|
||||
linkMac: receiveData.sta_tomac
|
||||
})
|
||||
}
|
||||
return vl
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (!dev) {
|
||||
arr.unshift(linked)
|
||||
}
|
||||
}
|
||||
uni.setStorage({
|
||||
key: linkKey,
|
||||
data: arr
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let warnArrs = []
|
||||
let guid = Common.guid()
|
||||
if (receiveData.sta_sosadd) {
|
||||
if (receiveData.sta_sosadd.indexOf(':') === -1) {
|
||||
receiveData.sta_sosadd = receiveData.sta_sosadd.replace(/(.{2})/g, '$1:').slice(0, -1)
|
||||
}
|
||||
warnArrs.push({
|
||||
linkId: f.linkId,
|
||||
read: false,
|
||||
key: guid,
|
||||
warnType: '闯入报警',
|
||||
warnMac: receiveData.sta_sosadd,
|
||||
warnTime: time,
|
||||
warnName: ''
|
||||
})
|
||||
}
|
||||
|
||||
if (receiveData.sta_LedType === 'led_alarm' || receiveData.ins_LedType === 'led_alarm') {
|
||||
warnArrs.push({
|
||||
linkId: f.linkId,
|
||||
read: false,
|
||||
key: guid,
|
||||
warnType: '强制报警',
|
||||
warnMac: f.macAddress,
|
||||
warnTime: time,
|
||||
warnName: ''
|
||||
})
|
||||
}
|
||||
|
||||
if (warnArrs.length > 0) {
|
||||
uni.getStorageInfo({
|
||||
success: function(res) {
|
||||
let arr = []
|
||||
if (res.keys.includes(warnKey)) {
|
||||
arr = uni.getStorageSync(warnKey)
|
||||
arr = warnArrs.concat(arr)
|
||||
} else {
|
||||
arr = warnArrs
|
||||
}
|
||||
uni.setStorage({
|
||||
key: warnKey,
|
||||
data: arr
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
receiveData = {}
|
||||
console.log('Receive_102J 解析失败', error)
|
||||
}
|
||||
return receiveData
|
||||
}
|
||||
|
||||
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
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
if (!recCnt && this.ref) {
|
||||
if (receiveData.sta_PowerPercent <= 20 && (receiveData.sta_system != 3 || receiveData.sta_system !=1)) {
|
||||
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
receiveData = {};
|
||||
console.log("文本解析失败", error)
|
||||
}
|
||||
return receiveData;
|
||||
|
||||
|
||||
}
|
||||
Receive_210(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 && this.ref) {
|
||||
if (receiveData.sta_PowerPercent <= 20 && (receiveData.sta_system != 3 || receiveData.sta_system !=1)) {
|
||||
|
||||
MsgError("设备'" + f.device.deviceName + "'电量低", '', this.ref, () => {
|
||||
MsgClear(this.ref);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
receiveData = {};
|
||||
console.log("文本解析失败", error)
|
||||
}
|
||||
return receiveData;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -947,10 +1161,12 @@ Receive_6170(receive, f, path, recArr) {
|
||||
|
||||
let receiveInstance = null;
|
||||
export default {
|
||||
getBleReceive: function(found, receive) {
|
||||
getBleReceive: function(_ref) {
|
||||
console.log("_ref=",_ref);
|
||||
if (!receiveInstance) {
|
||||
receiveInstance = new BleReceive();
|
||||
|
||||
receiveInstance = new BleReceive(_ref);
|
||||
}else{
|
||||
console.log("使用现有实例receiveInstance")
|
||||
}
|
||||
return receiveInstance;
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
var MsgType = {
|
||||
error: "error",
|
||||
succ: "succ",
|
||||
warn: "warn"
|
||||
warn: "warn",
|
||||
info:'info',
|
||||
prompt:'prompt'
|
||||
}
|
||||
var time = null;
|
||||
// 显示成功
|
||||
export const MsgSuccess = (msg, btnTxt, ev) => {
|
||||
export const MsgSuccess = (msg, btnTxt, ev,tapCallback) => {
|
||||
|
||||
if (!ev) {
|
||||
|
||||
@ -15,13 +17,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 +34,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 +48,26 @@ 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);
|
||||
}
|
||||
|
||||
return option;
|
||||
|
||||
|
||||
}
|
||||
//显示警告
|
||||
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);
|
||||
}
|
||||
@ -56,6 +77,25 @@ export const MsgWarning = (msg, btnTxt, ev, isClear) => {
|
||||
|
||||
}
|
||||
|
||||
//显示捕获窗口,用于自定义弹窗内容
|
||||
export const MsgPrompt = ( ev,refName, btnCallback,isClear) => {
|
||||
if (!ev) {
|
||||
|
||||
return null;
|
||||
}
|
||||
if (!ev.$refs[refName]) {
|
||||
|
||||
return null;
|
||||
}
|
||||
let option = ev.$refs[refName].showMsg("", "", MsgType.prompt,btnCallback);
|
||||
if (isClear === undefined || isClear) {
|
||||
createClear(ev);
|
||||
}
|
||||
|
||||
return option;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 隐藏loading
|
||||
export const MsgClose = (options, ev) => {
|
||||
@ -109,7 +149,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: '全部关闭',
|
||||
|
||||