6331前端功能初步完成,扩展msgPop支持自定义插槽
@ -17,6 +17,7 @@
|
||||
:style="{color:textColor || getTypeStyle('textColor')}"
|
||||
@click="closeClick"
|
||||
>x</view>
|
||||
|
||||
<view v-if="!visiblePrompt">
|
||||
<image
|
||||
v-if="iconUrl"
|
||||
@ -25,7 +26,10 @@
|
||||
class="popup-icon"
|
||||
:style="{ tintColor: textColor || getTypeStyle('textColor') }"
|
||||
></image>
|
||||
<view class="popup-message">{{ message }}</view>
|
||||
<view class="popup-message" :class="showSlot?'displayNone':''">{{ message }}</view>
|
||||
<view class="popup-message" :class="showSlot?'':'displayNone'">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -40,16 +44,18 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="popBtnContent">
|
||||
<view class="popBtnContent" v-show="showCancel || buttonText">
|
||||
|
||||
<view
|
||||
class="popup-button-cancel"
|
||||
|
||||
:style="{display:showCancel?'block':'none'}"
|
||||
@click="handleCancelClick"
|
||||
>{{ buttonCancelText?buttonCancelText:'取消' }}</view>
|
||||
|
||||
<view
|
||||
class="popup-button"
|
||||
:class="buttonText?'':'displayNone'"
|
||||
:style="{
|
||||
backgroundColor: buttonBgColor || getTypeStyle('buttonBgColor'),
|
||||
color: buttonTextColor || getTypeStyle('buttonTextColor')
|
||||
@ -125,6 +131,10 @@ export default {
|
||||
headerTxt:{
|
||||
type:String,
|
||||
default:""
|
||||
},
|
||||
showSlot:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -202,6 +212,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.displayNone{
|
||||
display: none !important
|
||||
}
|
||||
.message-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
||||
@ -257,6 +257,13 @@
|
||||
{
|
||||
"navigationBarTitleText" : "BJQ6331"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/6331/AudioManager",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "语音管理"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
22
pages/6331/AudioManager.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -2336,8 +2336,9 @@
|
||||
// 获取当前行文字
|
||||
const text = textLines[currentPacket - 1] || '';
|
||||
let arr = gbk.encode(text)
|
||||
console.log("arr=",arr);
|
||||
let gbkData = gbk.arr2hex(arr);
|
||||
|
||||
console.log("gbkData=",gbkData);
|
||||
|
||||
// 构建数据包
|
||||
const bufferSize = 5 + gbkData.length / 2; // 头部4字节 + 数据部分
|
||||
|
||||
@ -541,6 +541,10 @@
|
||||
// 列表跳转
|
||||
handleFile(item) {
|
||||
let url = item.detailPageUrl;
|
||||
|
||||
// url="/pages/6331/BJQ6331";
|
||||
|
||||
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
|
||||
BIN
static/images/6331/jieN.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/images/6331/jieNActive.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/images/6331/play.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/images/6331/shuXie.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/images/6331/shuxieActive.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/images/6331/upload.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
static/images/6331/volume.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/images/6331/work.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/images/6331/workActive.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
@ -135,7 +135,7 @@ class BleHelper {
|
||||
let item = this.data.LinkedList[i];
|
||||
if (deviceId && item.device) {
|
||||
if (item.device.id == deviceId) {
|
||||
console.log("找到要删除的设备", item);
|
||||
console.log("找到要删除的设备", item);
|
||||
this.data.LinkedList.splice(i, 1);
|
||||
this.disconnectDevice(item.deviceId);
|
||||
flag = true;
|
||||
@ -144,7 +144,7 @@ class BleHelper {
|
||||
|
||||
} else {
|
||||
if (bleId && item.deviceId == bleId) {
|
||||
console.log("找到要删除的设备1,", item)
|
||||
console.log("找到要删除的设备1,", item)
|
||||
this.data.LinkedList.splice(i, 1);
|
||||
this.disconnectDevice(item.deviceId);
|
||||
flag = true;
|
||||
@ -1570,7 +1570,46 @@ class BleHelper {
|
||||
////console.log("无已连接设备");
|
||||
}
|
||||
}
|
||||
//向蓝牙设备发送一个字符串的ASCII码
|
||||
sendString(deviceid, str, writeServiceId, wirteCharactId, ms) {
|
||||
if (str && str.length) {
|
||||
let buffer = new ArrayBuffer(str.length);
|
||||
let dataView = new DataView(buffer);
|
||||
|
||||
// 2. 将字符串转换为 ASCII 码并写入 DataView
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
dataView.setUint8(i, str.charCodeAt(i));
|
||||
}
|
||||
|
||||
return this.sendData(deviceid, buffer, writeServiceId, wirteCharactId, ms);
|
||||
} else {
|
||||
return Promise.resolve({
|
||||
code: 200,
|
||||
msg: "没有数据要发送"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//向蓝牙设备发送一个16进制的数组数据
|
||||
sendHexs(deviceid, array, writeServiceId, wirteCharactId, ms) {
|
||||
if (array && array.length) {
|
||||
let bufferSize = array.length;
|
||||
let buffer = new ArrayBuffer(bufferSize);
|
||||
let dataView = new DataView(buffer);
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
dataView.setUint8(i, array);
|
||||
}
|
||||
|
||||
return this.sendData(deviceid, buffer, writeServiceId, wirteCharactId, ms);
|
||||
|
||||
} else {
|
||||
return Promise.resolve({
|
||||
code: 200,
|
||||
msg: "没有数据要发送"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
//向蓝牙设备发送数据,如果没连接将自动连接后再发
|
||||
sendData(deviceid, buffer, writeServiceId, wirteCharactId, ms) {
|
||||
|
||||
|
||||