This commit is contained in:
1 2025-06-06 06:31:05 +08:00
parent 8cc5a7bcdd
commit 5aed5a6177
4 changed files with 44 additions and 25 deletions

View File

@ -7,8 +7,9 @@ import '@vant/touch-emulator';
import '../public/uni.webview.1.5.6.js';
// import '../../set-vue/src/assets/icon/iconfont.js';
import '../src/assets/icon/iconfont'
// const VConsole = require('vconsole');
// new VConsole(); // 初始化vConsole
// import '../public/jweixin-1.3.2'
const VConsole = require('vconsole');
new VConsole(); // 初始化vConsole
if (/xazn/.test(navigator.userAgent) || /uni-app/.test(navigator.userAgent)) {
// 在App中
console.log("UniAppJSBridgeReady 事件已触发");

View File

@ -48,7 +48,8 @@ export default {
]);
// 8
const permissionString = ref('00000000'); //
// const permissionString = ref('00000000'); //
const permissionString = ref('11111111');
//
const filteredMenuItems = computed(() => {

View File

@ -123,12 +123,34 @@ export default {
// );
// };
// const MQTT_send = (send_string) => {
// console.log(":", JSON.stringify(send_string));
// //
// if (typeof uni !== 'undefined' && uni.postMessage) {
// // /APP使uni.postMessage
// uni.postMessage({
// data: {
// type: 'mqtt_data',
// payload: send_string,
// timestamp: Date.now()
// }
// });
// } else {
// // H5使window.parent.postMessage
// window.parent.postMessage(
// {
// data: send_string
// },
// '*' // origin
// );
// }
// };
const MQTT_send = (send_string) => {
console.log("向父页面发送消息:", JSON.stringify(send_string));
//
if (typeof uni !== 'undefined' && uni.postMessage) {
// /APP使uni.postMessage
// 使uni.postMessage
uni.postMessage({
data: {
type: 'mqtt_data',
@ -136,19 +158,12 @@ export default {
timestamp: Date.now()
}
});
} else {
// H5使window.parent.postMessage
window.parent.postMessage(
{
data: send_string
},
'*' // origin
);
}
};
const handleMQTTMessage = (string) => {
// console.log("MQTT :" + string);
const data = JSON.parse(string);

View File

@ -225,6 +225,8 @@ export default {
const runningtime = ref("1");
const pauseduration = ref("1");
const playlist = ref([]); //
const eventplaylist = ref([]); //
const showOptionsDialog = ref(false); // Dialog
const selectedOption = ref(""); //