Compare commits
11 Commits
8ad20ad7fc
...
425b7b9cfd
| Author | SHA1 | Date | |
|---|---|---|---|
| 425b7b9cfd | |||
| bf615de600 | |||
| d3bdc0f358 | |||
| 4c48f0efec | |||
| 5fdeb88103 | |||
| 666cbfba6d | |||
| 8a9a35b2bd | |||
| 80f0ec15b3 | |||
| b7b080a976 | |||
| 6fcf9c814b | |||
| 2cf02932e5 |
@ -7,7 +7,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"customPlaygroundType" : "local",
|
"customPlaygroundType" : "local",
|
||||||
"playground" : "custom",
|
"playground" : "standard",
|
||||||
"type" : "uni-app:app-android"
|
"type" : "uni-app:app-android"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -62,3 +62,7 @@ export function mapReverseGeocoding(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deviceRealTimeStatus(){
|
||||||
|
return Promise.resolve({code:500});
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import qs from 'qs'
|
|
||||||
// 设备列表
|
// 设备列表
|
||||||
export function deviceInfo(params) {
|
export function deviceInfo(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import qs from 'qs'
|
|
||||||
// 查询列表
|
// 查询列表
|
||||||
export function fileInfo(params) {
|
export function fileInfo(params) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -35,7 +35,9 @@
|
|||||||
currentCanvasWidth: 0,
|
currentCanvasWidth: 0,
|
||||||
currentCanvasHeight: 0,
|
currentCanvasHeight: 0,
|
||||||
// Canvas上下文(复用)
|
// Canvas上下文(复用)
|
||||||
ctx: null
|
ctx: null,
|
||||||
|
// 标记画布是否已预热(解决首次发送像素不完整问题)
|
||||||
|
canvasWarmed: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -63,10 +65,63 @@
|
|||||||
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
this.ctx.fillRect(0, 0, this.currentCanvasWidth, this.currentCanvasHeight);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预热画布,防止 APP 首次调用时获取到的像素数据不完整
|
||||||
|
*/
|
||||||
|
async warmupCanvas() {
|
||||||
|
if (this.canvasWarmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 先用一个最小画布绘制测试字形,触发字体和 canvas 初始化
|
||||||
|
this.currentCanvasWidth = 16;
|
||||||
|
this.currentCanvasHeight = 16;
|
||||||
|
this.clearCanvas();
|
||||||
|
this.ctx.setFillStyle(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, () => {
|
||||||
|
// 读取一次数据,确保 canvasGetImageData 就绪
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.canvasGetImageData({
|
||||||
|
canvasId: 'reusableCanvas',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
success: () => {
|
||||||
|
this.canvasWarmed = true;
|
||||||
|
resolve();
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
// 即便失败也认为已尝试过,避免反复预热阻塞流程
|
||||||
|
this.canvasWarmed = true;
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 额外等待,确保字体完全加载
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 200));
|
||||||
|
} catch (ex) {
|
||||||
|
console.log("画布预热异常:", ex);
|
||||||
|
this.canvasWarmed = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 复用单个Canvas处理所有文本行
|
* 复用单个Canvas处理所有文本行
|
||||||
*/
|
*/
|
||||||
async drawAndGetPixels() {
|
async drawAndGetPixels() {
|
||||||
|
// 首次调用先做预热,避免第一次上报缺字
|
||||||
|
await this.warmupCanvas();
|
||||||
|
|
||||||
let binaryToHex = (binaryArray) => {
|
let binaryToHex = (binaryArray) => {
|
||||||
if (!Array.isArray(binaryArray) || binaryArray.length !== 8) {
|
if (!Array.isArray(binaryArray) || binaryArray.length !== 8) {
|
||||||
throw new Error("输入必须是包含8个元素的二进制数组");
|
throw new Error("输入必须是包含8个元素的二进制数组");
|
||||||
@ -92,7 +147,7 @@
|
|||||||
|
|
||||||
let convertCharToMatrix = (imageData, item) => {
|
let convertCharToMatrix = (imageData, item) => {
|
||||||
const charWidth = 13;
|
const charWidth = 13;
|
||||||
const charHeight = 12;
|
const charHeight = 13;
|
||||||
const pixels = [];
|
const pixels = [];
|
||||||
for (let i = 0; i < imageData.length; i += 4) {
|
for (let i = 0; i < imageData.length; i += 4) {
|
||||||
const R = imageData[i];
|
const R = imageData[i];
|
||||||
@ -123,7 +178,7 @@
|
|||||||
|
|
||||||
// 1. 动态调整Canvas尺寸
|
// 1. 动态调整Canvas尺寸
|
||||||
this.currentCanvasWidth = 13;
|
this.currentCanvasWidth = 13;
|
||||||
this.currentCanvasHeight = 12;
|
this.currentCanvasHeight = 13;
|
||||||
|
|
||||||
// 2. 清空Canvas(绘制背景)
|
// 2. 清空Canvas(绘制背景)
|
||||||
this.clearCanvas();
|
this.clearCanvas();
|
||||||
|
|||||||
@ -7,6 +7,9 @@
|
|||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
"compatible" : {
|
||||||
|
"ignoreVersion" : true
|
||||||
|
},
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
|
|||||||
28
pages.json
28
pages.json
@ -317,24 +317,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"path": "pages/4877/BJQ4877",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "BJQ 4877"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/4877/BJQ4877V1",
|
"path": "pages/4877/BJQ4877V1",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "BJQ 4877"
|
"navigationBarTitleText": "BJQ 4877"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/100/HBY100",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "HBY 100"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path" : "pages/4877/BJQ4877CheckColor",
|
"path" : "pages/4877/BJQ4877CheckColor",
|
||||||
"style" :
|
"style" :
|
||||||
@ -355,6 +345,20 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText" : "注销账号"
|
"navigationBarTitleText" : "注销账号"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/common/aboutUs/ContactUs",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "联系我们"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/018A/HBY018A",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : "HBY018A"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1554
pages/018A/HBY018A.vue
Normal file
1554
pages/018A/HBY018A.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -917,7 +917,7 @@
|
|||||||
if (!item) {
|
if (!item) {
|
||||||
item = this.dic.sta_VoiceType[index];
|
item = this.dic.sta_VoiceType[index];
|
||||||
}
|
}
|
||||||
console.log("item=", item);
|
// console.log("item=", item);
|
||||||
let val = item.key;
|
let val = item.key;
|
||||||
if (this.formData.sta_VoiceType === val) {
|
if (this.formData.sta_VoiceType === val) {
|
||||||
val = '0';
|
val = '0';
|
||||||
|
|||||||
@ -131,15 +131,15 @@
|
|||||||
<view class="section-title">产品信息</view>
|
<view class="section-title">产品信息</view>
|
||||||
<view class="mode-buttons">
|
<view class="mode-buttons">
|
||||||
<view class="mode_1" @click="productparams">
|
<view class="mode_1" @click="productparams">
|
||||||
<image src="/static/images/common/cp.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
<image src="/static/images/common/cp.png" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">产品参数</view>
|
<view class="">产品参数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode_1" @click="operatingInst">
|
<view class="mode_1" @click="operatingInst">
|
||||||
<image src="/static/images/common/sm.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
<image src="/static/images/common/sm.png" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">操作说明</view>
|
<view class="">操作说明</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode_1" @click="operatingVideo">
|
<view class="mode_1" @click="operatingVideo">
|
||||||
<image src="/static/images/common/sp.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
<image src="/static/images/common/sp.png" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">操作视频</view>
|
<view class="">操作视频</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -199,11 +199,47 @@
|
|||||||
<image src="/static/images/210/delete.png" mode="aspectFit" class="uploadIMG"></image>
|
<image src="/static/images/210/delete.png" mode="aspectFit" class="uploadIMG"></image>
|
||||||
<text>删除文件</text>
|
<text>删除文件</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 展示已上传的报警声音文件 -->
|
||||||
|
<view class="file-list-tip" v-if="soundFileList.length > 0">
|
||||||
|
<text>已上传文件:{{ soundFileList.map(item => item.name).join('、') }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 按钮组 -->
|
<!-- 按钮组 -->
|
||||||
<view class="popup-buttons">
|
<view class="popup-buttons">
|
||||||
<button class="agree" @click="handleupload">确定</button>
|
<button class="agree" @click="handleSoundUpload">确定</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- =====删除报警声音文件列表弹窗======= -->
|
||||||
|
<view class="agreement-mask" v-if="deleteSoundMode" @click.stop="closeDeleteSoundPopup">
|
||||||
|
<view class="agreement-popupB" @click.stop style="height: 45%;">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<view class="popup-title">选择要删除的报警声音</view>
|
||||||
|
<view class="popup-content">
|
||||||
|
<!-- 无文件提示 -->
|
||||||
|
<view v-if="soundFileList.length === 0" class="empty-tip">
|
||||||
|
<text>暂无已上传的报警声音文件</text>
|
||||||
|
</view>
|
||||||
|
<view v-else class="file-list">
|
||||||
|
<view
|
||||||
|
class="file-item"
|
||||||
|
v-for="(file, index) in soundFileList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<checkbox
|
||||||
|
v-model="selectedSoundFiles"
|
||||||
|
:value="file"
|
||||||
|
@change="handleSoundFileSelect"
|
||||||
|
/>
|
||||||
|
<text class="file-name">{{ file.name }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 按钮组 -->
|
||||||
|
<view class="popup-buttons" style="position: relative; bottom: 0;">
|
||||||
|
<button class="disagree" @click="closeDeleteSoundPopup" style="width: 48%;">取消</button>
|
||||||
|
<button class="agreeBtn" @click="confirmDeleteSound" :disabled="selectedSoundFiles.length === 0" style="width: 48%;">确定删除</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -292,9 +328,23 @@
|
|||||||
console.log('自动报警确认');
|
console.log('自动报警确认');
|
||||||
// 这里可以添加自动报警的逻辑
|
// 这里可以添加自动报警的逻辑
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 报警声音上传成功
|
||||||
|
soundUpload: {
|
||||||
|
config: {
|
||||||
|
icon: '/static/images/common/upload.png',
|
||||||
|
message: '报警声音上传成功',
|
||||||
|
showCancel: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 报警声音删除成功
|
||||||
|
soundDelete: {
|
||||||
|
config: {
|
||||||
|
icon: '/static/images/common/sendSucc.png',
|
||||||
|
message: '报警声音删除成功',
|
||||||
|
showCancel: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
import MqttClient from '@/utils/mqtt.js';
|
import MqttClient from '@/utils/mqtt.js';
|
||||||
import {
|
import {
|
||||||
@ -400,7 +450,11 @@
|
|||||||
radioSelected: 0, // -1表示未选中任何项
|
radioSelected: 0, // -1表示未选中任何项
|
||||||
deviceType: '',
|
deviceType: '',
|
||||||
popupType: '', //弹框类型
|
popupType: '', //弹框类型
|
||||||
lightModeC: false
|
lightModeC: false,
|
||||||
|
// 新增:报警声音文件相关
|
||||||
|
soundFileList: [],
|
||||||
|
deleteSoundMode: false,
|
||||||
|
selectedSoundFiles: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -408,11 +462,112 @@
|
|||||||
closePopup() {
|
closePopup() {
|
||||||
this.lightModeA = false;
|
this.lightModeA = false;
|
||||||
this.lightModeB = false;
|
this.lightModeB = false;
|
||||||
|
this.lightModeC = false;
|
||||||
|
},
|
||||||
|
// 关闭删除报警声音弹窗
|
||||||
|
closeDeleteSoundPopup() {
|
||||||
|
this.deleteSoundMode = false;
|
||||||
|
this.selectedSoundFiles = []; // 清空选中状态
|
||||||
|
this.lightModeC = true; // 回到报警声音上传弹窗
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSoundFileSelect() {
|
||||||
|
console.log("选中的报警声音文件:", this.selectedSoundFiles);
|
||||||
|
},
|
||||||
|
// 确认删除选中的报警声音文件
|
||||||
|
confirmDeleteSound() {
|
||||||
|
this.soundFileList = this.soundFileList.filter(file => !this.selectedSoundFiles.includes(file));
|
||||||
|
this.showPopup('soundDelete');
|
||||||
|
this.selectedSoundFiles = [];
|
||||||
|
this.closeDeleteSoundPopup();
|
||||||
|
},
|
||||||
|
// 上传报警声音文件
|
||||||
|
uploadFile() {
|
||||||
|
uni.chooseFile({
|
||||||
|
count: 1,
|
||||||
|
success: (res) => {
|
||||||
|
const file = res.tempFiles[0];
|
||||||
|
const fileSize = file.size || 0;
|
||||||
|
// 限制文件大小(示例:5MB)
|
||||||
|
if (fileSize > 5 * 1024 * 1024) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '文件大小不能超过5MB',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 显示上传中加载提示
|
||||||
|
uni.showLoading({
|
||||||
|
title: '上传中...',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
// 调用上传接口
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseURL + '/app/device/uploadSound', // 替换为真实的报警声音上传接口
|
||||||
|
filePath: file.path,
|
||||||
|
name: 'file',
|
||||||
|
formData: {
|
||||||
|
deviceId: this.deviceID,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
'Authorization': 'Bearer ' + getToken(),
|
||||||
|
'clientid': clientid(),
|
||||||
|
},
|
||||||
|
complete: (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
try {
|
||||||
|
const responseData = JSON.parse(res.data);
|
||||||
|
if (responseData.code === 200) {
|
||||||
|
// 上传成功,添加到文件列表
|
||||||
|
this.soundFileList.push({
|
||||||
|
name: file.name,
|
||||||
|
url: responseData.data.url // 接口返回的文件地址
|
||||||
|
});
|
||||||
|
this.showPopup('soundUpload');
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: responseData.msg,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '上传失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('选择文件失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '选择文件失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteQ() {
|
||||||
|
if (this.soundFileList.length === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "暂无可删除的报警声音文件",
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.lightModeC = false;
|
||||||
|
this.deleteSoundMode = true;
|
||||||
|
},
|
||||||
|
// 报警声音上传弹窗确定按钮
|
||||||
|
handleSoundUpload() {
|
||||||
|
uni.showToast({
|
||||||
|
title: "报警声音配置确认成功",
|
||||||
|
icon: "success"
|
||||||
|
});
|
||||||
|
this.closePopup();
|
||||||
},
|
},
|
||||||
// 上传文件
|
|
||||||
uploadFile() {},
|
|
||||||
// 删除文件
|
|
||||||
deleteQ() {},
|
|
||||||
// 打开弹框
|
// 打开弹框
|
||||||
showPopup(type) {
|
showPopup(type) {
|
||||||
this.currentPopup = {
|
this.currentPopup = {
|
||||||
@ -497,7 +652,7 @@
|
|||||||
uploadStartup() {
|
uploadStartup() {
|
||||||
this.lightModeB = true
|
this.lightModeB = true
|
||||||
},
|
},
|
||||||
// 上传开机画面
|
// 上传开机画面-选择图片
|
||||||
checkImgUpload() {
|
checkImgUpload() {
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1,
|
count: 1,
|
||||||
@ -766,7 +921,6 @@
|
|||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
})
|
})
|
||||||
eventChannel.on('detailData', (data) => {
|
eventChannel.on('detailData', (data) => {
|
||||||
console.log(data, '这是传过来的惨呼啊');
|
|
||||||
this.itemInfo = data.data;
|
this.itemInfo = data.data;
|
||||||
this.deviceID = data.data.id;
|
this.deviceID = data.data.id;
|
||||||
this.navTitle = data.data.deviceName;
|
this.navTitle = data.data.deviceName;
|
||||||
@ -1380,4 +1534,30 @@
|
|||||||
margin-top: 60rpx;
|
margin-top: 60rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 新增:删除文件列表样式 */
|
||||||
|
.file-list-tip {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
.empty-tip {
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
}
|
||||||
|
.file-list {
|
||||||
|
padding: 10rpx 0;
|
||||||
|
}
|
||||||
|
.file-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.file-name {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.87);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -172,15 +172,15 @@
|
|||||||
<view class="section-title">产品信息</view>
|
<view class="section-title">产品信息</view>
|
||||||
<view class="mode-buttons">
|
<view class="mode-buttons">
|
||||||
<view class="mode_1" @click="productparams">
|
<view class="mode_1" @click="productparams">
|
||||||
<image src="/static/images/common/cp.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
<image src="/static/images/common/cp.png" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">产品参数</view>
|
<view class="">产品参数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode_1" @click="operatingInst">
|
<view class="mode_1" @click="operatingInst">
|
||||||
<image src="/static/images/common/sm.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
<image src="/static/images/common/sm.png" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">操作说明</view>
|
<view class="">操作说明</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode_1" @click="operatingVideo">
|
<view class="mode_1" @click="operatingVideo">
|
||||||
<image src="/static/images/common/sp.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
<image src="/static/images/common/sp.png" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">操作视频</view>
|
<view class="">操作视频</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="rightTxt">
|
<view class="rightTxt">
|
||||||
<text class="bigTxt">主灯模式</text>
|
<text class="bigTxt">主灯模式</text>
|
||||||
<text class="smallTxt">{{getMode}}</text>
|
<text class="smallTxt">{{getMode('main')}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode marginLeft fleft" v-on:click.stop="ModeSetting('fu')">
|
<view class="mode marginLeft fleft" v-on:click.stop="ModeSetting('fu')">
|
||||||
@ -74,7 +74,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="rightTxt">
|
<view class="rightTxt">
|
||||||
<text class="bigTxt">辅灯模式</text>
|
<text class="bigTxt">辅灯模式</text>
|
||||||
<text class="smallTxt">泛光模式</text>
|
<text class="smallTxt">{{getMode('fu')}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode fleft" v-on:click.stop="UploadOpenImg()">
|
<view class="mode fleft" v-on:click.stop="UploadOpenImg()">
|
||||||
@ -108,15 +108,18 @@
|
|||||||
|
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">单位:</text>
|
<text class="lbl">单位:</text>
|
||||||
<input class="value" v-model.trim="formData.textLines[0]" placeholder="请输入单位" placeholder-class="usrplace" />
|
<input class="value" v-model.trim="formData.textLines[0]" placeholder="请输入单位"
|
||||||
|
placeholder-class="usrplace" />
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">部门:</text>
|
<text class="lbl">部门:</text>
|
||||||
<input class="value" v-model.trim="formData.textLines[1]" placeholder="请输入姓名" placeholder-class="usrplace" />
|
<input class="value" v-model.trim="formData.textLines[1]" placeholder="请输入姓名"
|
||||||
|
placeholder-class="usrplace" />
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">姓名:</text>
|
<text class="lbl">姓名:</text>
|
||||||
<input class="value" v-model.trim="formData.textLines[2]" placeholder="请输入职位" placeholder-class="usrplace" />
|
<input class="value" v-model.trim="formData.textLines[2]" placeholder="请输入职位"
|
||||||
|
placeholder-class="usrplace" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -257,6 +260,7 @@
|
|||||||
deviceId: '',
|
deviceId: '',
|
||||||
textLines: ['', '', ''],
|
textLines: ['', '', ''],
|
||||||
mode: '',
|
mode: '',
|
||||||
|
light:null,
|
||||||
bleStatu: ''
|
bleStatu: ''
|
||||||
},
|
},
|
||||||
inteval: 80,
|
inteval: 80,
|
||||||
@ -415,33 +419,48 @@
|
|||||||
remark = '微弱';
|
remark = '微弱';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getMode() {
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMode(type) {
|
||||||
let txt = "关闭";
|
let txt = "关闭";
|
||||||
if (this.Status.BottomMenu.type == 'fu') {
|
|
||||||
return txt;
|
switch (this.formData.light) {
|
||||||
}
|
|
||||||
switch (this.formData.mode) {
|
|
||||||
case 0:
|
case 0:
|
||||||
txt = "强光模式";
|
if (type == 'fu' && this.formData.mode == 'fu') {
|
||||||
|
txt = '泛光';
|
||||||
|
} else if (type == 'main' && this.formData.mode == 'main') {
|
||||||
|
txt = "强光";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
txt = "弱光模式";
|
if (type == 'fu' && this.formData.mode == 'fu') {
|
||||||
|
txt = '强+泛光';
|
||||||
|
} else if (type == 'main' && this.formData.mode == 'main') {
|
||||||
|
txt = "弱光";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
txt = "爆闪模式";
|
if (type == 'main' && this.formData.mode == 'main') {
|
||||||
|
txt = "爆闪";
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
if (type == 'main' && this.formData.mode == 'main') {
|
||||||
txt = "关闭";
|
txt = "关闭";
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
txt = "关闭";
|
txt = "关闭";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return txt;
|
return txt;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
calcTotalPackets(frames) {
|
calcTotalPackets(frames) {
|
||||||
if (!Array.isArray(frames) || frames.length === 0) {
|
if (!Array.isArray(frames) || frames.length === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -570,7 +589,8 @@
|
|||||||
if (!json) {
|
if (!json) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("收到设备数据:", json);
|
console.log("收到原始数据:", receive);
|
||||||
|
console.log("解析设备数据:", json);
|
||||||
let keys = Object.keys(json);
|
let keys = Object.keys(json);
|
||||||
keys.forEach((key) => {
|
keys.forEach((key) => {
|
||||||
if (key in these.formData) {
|
if (key in these.formData) {
|
||||||
@ -919,7 +939,7 @@
|
|||||||
fail: (ex) => {
|
fail: (ex) => {
|
||||||
|
|
||||||
updateLoading(these, {
|
updateLoading(these, {
|
||||||
text : '视频文件上传失败了,请检查网络连接'
|
text: '视频文件上传失败了,请检查网络连接'
|
||||||
});
|
});
|
||||||
|
|
||||||
reject(ex);
|
reject(ex);
|
||||||
@ -942,8 +962,8 @@
|
|||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}else{
|
} else {
|
||||||
console.log("res.data=",res.data);
|
console.log("res.data=", res.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1264,9 +1284,10 @@
|
|||||||
},
|
},
|
||||||
ModeSetting: function(type) {
|
ModeSetting: function(type) {
|
||||||
|
|
||||||
this.formData.mode = type;
|
|
||||||
let items = [];
|
let items = [];
|
||||||
let title = '';
|
let title = '';
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "main":
|
case "main":
|
||||||
title = '主灯模式';
|
title = '主灯模式';
|
||||||
@ -1310,6 +1331,10 @@
|
|||||||
this.Status.BottomMenu.title = title;
|
this.Status.BottomMenu.title = title;
|
||||||
this.Status.BottomMenu.type = type;
|
this.Status.BottomMenu.type = type;
|
||||||
this.Status.BottomMenu.show = true;
|
this.Status.BottomMenu.show = true;
|
||||||
|
if(this.formData.mode != type){
|
||||||
|
|
||||||
|
this.Status.BottomMenu.activeIndex =null;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
showMenu(flag) {
|
showMenu(flag) {
|
||||||
@ -1320,8 +1345,8 @@
|
|||||||
},
|
},
|
||||||
btnClick(item, index) {
|
btnClick(item, index) {
|
||||||
|
|
||||||
if (this.Status.BottomMenu.activeIndex == -1) {
|
if (parseInt(this.Status.BottomMenu.activeIndex) === NaN) {
|
||||||
this.showToast('请选择模式');
|
uni.showToast('请选择模式');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//发送指令给设备
|
//发送指令给设备
|
||||||
@ -1386,7 +1411,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 30).then(() => {
|
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 30).then(() => {
|
||||||
this.formData.mode = mode;
|
this.formData.light = mode;
|
||||||
|
this.formData.mode = type
|
||||||
this.setBleFormData();
|
this.setBleFormData();
|
||||||
}).catch((ex) => {
|
}).catch((ex) => {
|
||||||
these.showPop({
|
these.showPop({
|
||||||
@ -1404,14 +1430,14 @@
|
|||||||
},
|
},
|
||||||
handleItemClick(item, index) {
|
handleItemClick(item, index) {
|
||||||
|
|
||||||
switch (this.Status.BottomMenu.type) {
|
// switch (this.Status.BottomMenu.type) {
|
||||||
case "main":
|
// case "main":
|
||||||
|
|
||||||
break;
|
// break;
|
||||||
case "fu":
|
// case "fu":
|
||||||
|
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
this.Status.BottomMenu.activeIndex = index;
|
this.Status.BottomMenu.activeIndex = index;
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -1569,7 +1595,7 @@
|
|||||||
logicalDataView.setUint8(logicalPacketSize - 1, 0xFF);
|
logicalDataView.setUint8(logicalPacketSize - 1, 0xFF);
|
||||||
|
|
||||||
// 4. 将逻辑大包分包发送
|
// 4. 将逻辑大包分包发送
|
||||||
const CHUNK_SIZE = 20; // 每个物理包的大小
|
const CHUNK_SIZE = 500; // 每个物理包的大小
|
||||||
const totalChunks = Math.ceil(logicalPacketSize / CHUNK_SIZE);
|
const totalChunks = Math.ceil(logicalPacketSize / CHUNK_SIZE);
|
||||||
|
|
||||||
updateLoading(these, {
|
updateLoading(these, {
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">设备状态</text>
|
<text class="lbl">设备状态</text>
|
||||||
<text class="value">{{formData.statu}}</text>
|
<text class="value" :class="formData.statu === '充电中' ? 'red' : 'white'">{{formData.statu}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">蓝牙名称</text>
|
<text class="lbl">蓝牙名称</text>
|
||||||
@ -390,6 +390,7 @@
|
|||||||
}
|
}
|
||||||
if (res.deviceId == these.formData.deviceId) {
|
if (res.deviceId == these.formData.deviceId) {
|
||||||
this.formData.bleStatu = true;
|
this.formData.bleStatu = true;
|
||||||
|
// 重新连接后状态以设备上报为准
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
hideLoading(these, 1000);
|
hideLoading(these, 1000);
|
||||||
});
|
});
|
||||||
@ -406,6 +407,9 @@
|
|||||||
}
|
}
|
||||||
if (res.deviceId == these.formData.deviceId) {
|
if (res.deviceId == these.formData.deviceId) {
|
||||||
this.formData.bleStatu = false;
|
this.formData.bleStatu = false;
|
||||||
|
// 断开连接时先将充电状态复位,避免保持旧值
|
||||||
|
this.formData.statu = '未充电';
|
||||||
|
this.setBleFormData();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
hideLoading(these, 1000);
|
hideLoading(these, 1000);
|
||||||
});
|
});
|
||||||
@ -491,7 +495,10 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if ('statu' in json) {
|
if ('statu' in json) {
|
||||||
these.formData.statu = json.statu == '1' ? '充电中' : '未充电';
|
const chargingVal = json.statu;
|
||||||
|
const isCharging = chargingVal === 1 || chargingVal === '1' || chargingVal === true ||
|
||||||
|
chargingVal === '充电中';
|
||||||
|
these.formData.statu = isCharging ? '充电中' : '未充电';
|
||||||
}
|
}
|
||||||
if ('xuhang' in json) {
|
if ('xuhang' in json) {
|
||||||
these.formData.xuhang = json.xuhang;
|
these.formData.xuhang = json.xuhang;
|
||||||
|
|||||||
272
pages/common/aboutUs/ContactUs.vue
Normal file
272
pages/common/aboutUs/ContactUs.vue
Normal file
@ -0,0 +1,272 @@
|
|||||||
|
<template>
|
||||||
|
<view class="maincontent contentBg">
|
||||||
|
<view class="title">
|
||||||
|
您可以反馈App使用中的问题、产品问题、投诉、意见或建议,向我们获取使用教程,我们将在收到您的反馈后,15个工作日内答复您,请保持您的注册手机号畅通。
|
||||||
|
</view>
|
||||||
|
<view class="main">
|
||||||
|
<view class="text-content">
|
||||||
|
|
||||||
|
<textarea class="textarea" v-model="txt" auto-focus="true" placeholder-class="placehoderClass" auto-height="true"
|
||||||
|
placeholder="您需要反馈的内容" :auto-height="true" maxlength="2000" cursor-color="#BBE600" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="footBtn">
|
||||||
|
<view class="fright convert" @click.stop="Send">发送</view>
|
||||||
|
<view class="fright audioSett" @click.stop="txt=''">清空</view>
|
||||||
|
<view class="clear"></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" />
|
||||||
|
|
||||||
|
<global-loading ref="loading" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
showLoading,
|
||||||
|
hideLoading,
|
||||||
|
updateLoading
|
||||||
|
} from '@/utils/loading.js' ;
|
||||||
|
var these=null;
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
txt: "",
|
||||||
|
Status: {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(){
|
||||||
|
these=this;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
Send() {
|
||||||
|
if(!this.txt){
|
||||||
|
this.showPop({
|
||||||
|
showPop: true,
|
||||||
|
message: "请输入反馈内容",
|
||||||
|
iconUrl: "/static/images/6155/DeviceDetail/warnning.png",
|
||||||
|
borderColor: "#e034344d",
|
||||||
|
buttonBgColor: "#E03434",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showLoading(this,{text:'正在发送'});
|
||||||
|
setTimeout(()=>{
|
||||||
|
//假装联系了我们
|
||||||
|
this.showPop({
|
||||||
|
showPop: true,
|
||||||
|
message: "已收到您的反馈",
|
||||||
|
iconUrl: "/static/images/common/success.png"
|
||||||
|
});
|
||||||
|
this.txt="";
|
||||||
|
hideLoading(this);
|
||||||
|
},800);
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
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;
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.title{
|
||||||
|
margin: 50rpx 0rpx;
|
||||||
|
color: #FFFFFFDE;
|
||||||
|
|
||||||
|
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-size: 27rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 40rpx;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.footBtn .audioSett {
|
||||||
|
margin-right: 50rpx;
|
||||||
|
color: #FFFFFFDE;
|
||||||
|
|
||||||
|
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 55rpx;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footBtn .convert {
|
||||||
|
/* 组合 99 */
|
||||||
|
width: 130rpx;
|
||||||
|
height: 55rpx;
|
||||||
|
line-height: 55rpx;
|
||||||
|
border-radius: 180px;
|
||||||
|
color: #232323;
|
||||||
|
background-color: #AED600;
|
||||||
|
text-align: center;
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.maincontent {
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footBtn {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 0rpx;
|
||||||
|
border-bottom: 1rpx solid rgba(255, 255, 255, 0.36);
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placehoderClass {
|
||||||
|
color: rgba(255, 255, 255, 0.6);
|
||||||
|
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 44rpx;
|
||||||
|
letter-spacing: 0.14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-content {
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background: rgba(26, 26, 26, 1);
|
||||||
|
width: 100%;
|
||||||
|
height: 70%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.importTxt {
|
||||||
|
color: rgba(174, 214, 0, 1);
|
||||||
|
|
||||||
|
font-family: PingFang SC;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
letter-spacing: 0.14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.textarea {
|
||||||
|
|
||||||
|
overflow-y: scroll;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
}
|
}
|
||||||
.deviceTitle{
|
.deviceTitle{
|
||||||
color: rgba(255, 255, 255, 0.87);
|
color: rgba(255, 255, 255, 0.87);
|
||||||
line-height: 45mnrpx;
|
line-height: 45rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<view class="centertxt ">
|
<view class="centertxt ">
|
||||||
<view class="name" v-text="item.name"></view>
|
<view class="name" v-text="item.name"></view>
|
||||||
<view class="id">
|
<view class="id">
|
||||||
<text>信号:{{110+item.RSSI>100?100:110+item.RSSI}}%</text>
|
<text>信号:{{item.RSSI}}dBm</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rightIco center">
|
<view class="rightIco center">
|
||||||
@ -71,7 +71,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="id">
|
<view class="id">
|
||||||
<text>信号:{{110+item.RSSI>100?100:110+item.RSSI}}%</text>
|
<text>信号:{{item.RSSI}}dBm</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -377,6 +377,8 @@
|
|||||||
}
|
}
|
||||||
these.EquipMents.push(device);
|
these.EquipMents.push(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
these.EquipMents.sort((a, b) => b.RSSI - a.RSSI);//信号好的排前面,一般信号好的是目标设备
|
||||||
}
|
}
|
||||||
}, pagePath);
|
}, pagePath);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,8 +19,8 @@
|
|||||||
<view class="smallTitle">
|
<view class="smallTitle">
|
||||||
<text>{{item.createTime}}</text>
|
<text>{{item.createTime}}</text>
|
||||||
<text v-show="item.time">{{item.time}}秒</text>
|
<text v-show="item.time">{{item.time}}秒</text>
|
||||||
<image :class="{'displayNone':!item.localPath}"
|
<image :class="{'displayNone':!item.localPath}" class="img"
|
||||||
class="img" src="/static/images/100/volume.png" mode="aspectFit"
|
src="/static/images/100/volume.png" mode="aspectFit"
|
||||||
@click.stop="play(item,index)"></image>
|
@click.stop="play(item,index)"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -94,9 +94,9 @@
|
|||||||
<view class="displayNone">
|
<view class="displayNone">
|
||||||
<audio :src="cPlay.src" :id="cPlay.Id" :name="cPlay.name" author=""></audio>
|
<audio :src="cPlay.src" :id="cPlay.Id" :name="cPlay.name" author=""></audio>
|
||||||
</view>
|
</view>
|
||||||
<global-loading ref="loading" />
|
<global-loading ref="loading"></global-loading>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -72,7 +72,7 @@
|
|||||||
agreed: false,
|
agreed: false,
|
||||||
isCounting: false,
|
isCounting: false,
|
||||||
countdown: 0,
|
countdown: 0,
|
||||||
isChecked: true,
|
isChecked: false,
|
||||||
showAgreement: false, // 控制弹窗显示
|
showAgreement: false, // 控制弹窗显示
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -217,7 +217,9 @@
|
|||||||
this.showAgreement = true
|
this.showAgreement = true
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '登录中...'
|
title: '登录中...'
|
||||||
})
|
})
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
agreed: false,
|
agreed: false,
|
||||||
isCounting: false,
|
isCounting: false,
|
||||||
countdown: 0,
|
countdown: 0,
|
||||||
isChecked: true,
|
isChecked: false,
|
||||||
showAgreement: false, // 控制弹窗显示
|
showAgreement: false, // 控制弹窗显示
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -27,13 +27,18 @@
|
|||||||
<text class="title">版本更新 ({{appVersion}})</text>
|
<text class="title">版本更新 ({{appVersion}})</text>
|
||||||
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="menu-item" @click="sendCounsel">
|
||||||
|
<image src="/static/images/common/yijianfankui.png" class="icon"></image>
|
||||||
|
<text class="title">举报反馈</text>
|
||||||
|
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
||||||
|
</view>
|
||||||
<view class="menu-item" @click="aboutUs">
|
<view class="menu-item" @click="aboutUs">
|
||||||
<image src="/static/images/common/wm.png" class="icon"></image>
|
<image src="/static/images/common/guanyuwomen.png" class="icon"></image>
|
||||||
<text class="title">关于我们</text>
|
<text class="title">关于我们</text>
|
||||||
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-item" @click="logOff">
|
<view class="menu-item" @click="logOff">
|
||||||
<image src="/static/images/common/wm.png" class="icon"></image>
|
<image src="/static/images/common/zhuxiao.png" class="icon"></image>
|
||||||
<text class="title">注销账号</text>
|
<text class="title">注销账号</text>
|
||||||
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@ -160,7 +165,7 @@
|
|||||||
},
|
},
|
||||||
logOff(){
|
logOff(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/common/user/logOff'
|
url:'/pages/common/account/deleteAccount/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 关于我们
|
// 关于我们
|
||||||
@ -169,6 +174,12 @@
|
|||||||
url: '/pages/common/aboutUs/index'
|
url: '/pages/common/aboutUs/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//举报反馈、联系我们
|
||||||
|
sendCounsel(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/common/aboutUs/ContactUs'
|
||||||
|
})
|
||||||
|
},
|
||||||
// 账户安全
|
// 账户安全
|
||||||
account(){
|
account(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
logOff(){
|
logOff(){
|
||||||
let task=()=>{
|
let task=()=>{
|
||||||
return new Promise((resolve,reject)=>{
|
return new Promise((resolve,reject)=>{
|
||||||
|
//假装注销
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
resolve();
|
resolve();
|
||||||
},500)
|
},500)
|
||||||
@ -74,7 +74,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let logOut=()=>{
|
let logOut=()=>{
|
||||||
|
let phone=uni.getStorageSync('phone');
|
||||||
uni.clearStorageSync();
|
uni.clearStorageSync();
|
||||||
|
uni.setStorageSync("logOutPhone",phone)
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:'/pages/common/login/index'
|
url:'/pages/common/login/index'
|
||||||
})
|
})
|
||||||
|
|||||||
BIN
static/images/common/guanyuwomen.png
Normal file
BIN
static/images/common/guanyuwomen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/images/common/yijianfankui.png
Normal file
BIN
static/images/common/yijianfankui.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 610 B |
BIN
static/images/common/zhuxiao.png
Normal file
BIN
static/images/common/zhuxiao.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 863 B |
@ -415,37 +415,42 @@ class BleReceive {
|
|||||||
if (bytes[0] == 0xFB && bytes[1] == 0x64 && bytes.length >= 8) {
|
if (bytes[0] == 0xFB && bytes[1] == 0x64 && bytes.length >= 8) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let staticLevelByte = bytes[2];
|
|
||||||
let getName = function(type) {
|
let getName = function(type,) {
|
||||||
let name = "";
|
let name = "";
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0x02:
|
|
||||||
// name = '弱光';
|
|
||||||
name=1;
|
|
||||||
break;
|
|
||||||
case 0x04:
|
|
||||||
name = '工作光';
|
|
||||||
break;
|
|
||||||
case 0x01:
|
case 0x01:
|
||||||
// name = '强光';
|
// name = '强光';
|
||||||
name=0;
|
name=0;
|
||||||
break;
|
break;
|
||||||
|
case 0x02:
|
||||||
|
// name = '弱光';
|
||||||
|
name=1;
|
||||||
|
break;
|
||||||
case 0x03:
|
case 0x03:
|
||||||
// name = '爆闪';
|
// name = '爆闪';
|
||||||
name=2;
|
name=2;
|
||||||
break;
|
break;
|
||||||
case 0x00:
|
case 0x04:
|
||||||
|
name = 0;//泛光
|
||||||
|
break;
|
||||||
|
case 0x0A:
|
||||||
|
name = 1;//强光&泛光
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
default:
|
||||||
// name = '关闭';
|
// name = '关闭';
|
||||||
name=3;
|
name=null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
let staticLevelText = getName(staticLevelByte);
|
|
||||||
|
let staticLevelText = getName(bytes[2]);
|
||||||
|
|
||||||
// 解析照明档位
|
// 解析照明档位
|
||||||
let lightingLevelByte = bytes[3];
|
let lightingLevelText = getName(bytes[3]);
|
||||||
let lightingLevelText = getName(lightingLevelByte);
|
|
||||||
|
|
||||||
|
|
||||||
// 解析剩余电量
|
// 解析剩余电量
|
||||||
@ -470,8 +475,9 @@ class BleReceive {
|
|||||||
let mm = Math.max(0, Math.min(100, bytes[7]));
|
let mm = Math.max(0, Math.min(100, bytes[7]));
|
||||||
lightingTime = HH + "小时" + mm + "分钟";
|
lightingTime = HH + "小时" + mm + "分钟";
|
||||||
let formData = {};
|
let formData = {};
|
||||||
formData.mode = staticLevelText;
|
formData.mode = (bytes[2]===0x00 || bytes[2]===0x0B)?'fu':'main';
|
||||||
formData.fuMode = lightingLevelText;
|
formData.light=formData.mode=='fu'?lightingLevelText:staticLevelText;
|
||||||
|
|
||||||
formData.battary = batteryLevel;
|
formData.battary = batteryLevel;
|
||||||
formData.statu = warn;
|
formData.statu = warn;
|
||||||
formData.xuhang = lightingTime;
|
formData.xuhang = lightingTime;
|
||||||
@ -539,7 +545,7 @@ class BleReceive {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
console.log("str=",receive.str);
|
// console.log("str=",receive.str);
|
||||||
receiveData = JSON.parse(receive.str);
|
receiveData = JSON.parse(receive.str);
|
||||||
|
|
||||||
let recCnt = recArr.find(v => {
|
let recCnt = recArr.find(v => {
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class MqHelper {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
//订阅消息
|
//订阅消息{topic:'主题名称',callback:fn(payload,receive)}
|
||||||
subscribes(topics) {
|
subscribes(topics) {
|
||||||
return new Promise((resolve,reject)=>{
|
return new Promise((resolve,reject)=>{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user