1
0
forked from dyf/APP

6331前端功能初步完成,扩展msgPop支持自定义插槽

This commit is contained in:
liub
2025-10-17 17:29:08 +08:00
parent b114f6690d
commit 90cee62df1
16 changed files with 574 additions and 1031 deletions

View File

@ -17,6 +17,7 @@
:style="{color:textColor || getTypeStyle('textColor')}" :style="{color:textColor || getTypeStyle('textColor')}"
@click="closeClick" @click="closeClick"
>x</view> >x</view>
<view v-if="!visiblePrompt"> <view v-if="!visiblePrompt">
<image <image
v-if="iconUrl" v-if="iconUrl"
@ -25,7 +26,10 @@
class="popup-icon" class="popup-icon"
:style="{ tintColor: textColor || getTypeStyle('textColor') }" :style="{ tintColor: textColor || getTypeStyle('textColor') }"
></image> ></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> </view>
@ -40,16 +44,18 @@
/> />
</view> </view>
<view class="popBtnContent"> <view class="popBtnContent" v-show="showCancel || buttonText">
<view <view
class="popup-button-cancel" class="popup-button-cancel"
:style="{display:showCancel?'block':'none'}" :style="{display:showCancel?'block':'none'}"
@click="handleCancelClick" @click="handleCancelClick"
>{{ buttonCancelText?buttonCancelText:'取消' }}</view> >{{ buttonCancelText?buttonCancelText:'取消' }}</view>
<view <view
class="popup-button" class="popup-button"
:class="buttonText?'':'displayNone'"
:style="{ :style="{
backgroundColor: buttonBgColor || getTypeStyle('buttonBgColor'), backgroundColor: buttonBgColor || getTypeStyle('buttonBgColor'),
color: buttonTextColor || getTypeStyle('buttonTextColor') color: buttonTextColor || getTypeStyle('buttonTextColor')
@ -125,6 +131,10 @@ export default {
headerTxt:{ headerTxt:{
type:String, type:String,
default:"" default:""
},
showSlot:{
type:Boolean,
default:false
} }
}, },
data() { data() {
@ -202,6 +212,9 @@ export default {
</script> </script>
<style> <style>
.displayNone{
display: none !important
}
.message-popup { .message-popup {
position: fixed; position: fixed;
top: 0; top: 0;

View File

@ -257,6 +257,13 @@
{ {
"navigationBarTitleText" : "BJQ6331" "navigationBarTitleText" : "BJQ6331"
} }
},
{
"path" : "pages/6331/AudioManager",
"style" :
{
"navigationBarTitleText" : "语音管理"
}
} }

View File

@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

View File

@ -2336,8 +2336,9 @@
// 获取当前行文字 // 获取当前行文字
const text = textLines[currentPacket - 1] || ''; const text = textLines[currentPacket - 1] || '';
let arr = gbk.encode(text) let arr = gbk.encode(text)
console.log("arr=",arr);
let gbkData = gbk.arr2hex(arr); let gbkData = gbk.arr2hex(arr);
console.log("gbkData=",gbkData);
// 构建数据包 // 构建数据包
const bufferSize = 5 + gbkData.length / 2; // 头部4字节 + 数据部分 const bufferSize = 5 + gbkData.length / 2; // 头部4字节 + 数据部分

View File

@ -541,6 +541,10 @@
// 列表跳转 // 列表跳转
handleFile(item) { handleFile(item) {
let url = item.detailPageUrl; let url = item.detailPageUrl;
// url="/pages/6331/BJQ6331";
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success: (res) => { success: (res) => {

BIN
static/images/6331/jieN.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/images/6331/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/images/6331/work.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1570,7 +1570,46 @@ class BleHelper {
////console.log("无已连接设备"); ////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) { sendData(deviceid, buffer, writeServiceId, wirteCharactId, ms) {