diff --git a/src/main.js b/src/main.js index 5ff4093..2d394b5 100644 --- a/src/main.js +++ b/src/main.js @@ -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 事件已触发"); diff --git a/src/views/home/home.vue b/src/views/home/home.vue index c6dd4e9..bccdef4 100644 --- a/src/views/home/home.vue +++ b/src/views/home/home.vue @@ -48,7 +48,8 @@ export default { ]); // 从父页面接收的权限控制字符串(8位二进制) - const permissionString = ref('00000000'); // 默认全部隐藏 + // const permissionString = ref('00000000'); // 默认全部隐藏 + const permissionString = ref('11111111'); // 计算属性:过滤出需要显示的菜单项 const filteredMenuItems = computed(() => { diff --git a/src/views/system-info/info.vue b/src/views/system-info/info.vue index 0a9f6b7..70cfe65 100644 --- a/src/views/system-info/info.vue +++ b/src/views/system-info/info.vue @@ -123,29 +123,44 @@ export default { // ); // }; - const MQTT_send = (send_string) => { - console.log("向父页面发送消息:", JSON.stringify(send_string)); + // 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)); + + // 统一使用uni.postMessage方法发送消息 + uni.postMessage({ + data: { + type: 'mqtt_data', + payload: send_string, + timestamp: Date.now() + } + }); +}; + - // 统一的消息发送方法,兼容各平台 - 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,生产环境应替换为具体的父页面域名 - ); - } - }; diff --git a/src/views/voice/voiceset.vue b/src/views/voice/voiceset.vue index 4d4bc9a..5418da8 100644 --- a/src/views/voice/voiceset.vue +++ b/src/views/voice/voiceset.vue @@ -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(""); // 用于指示哪个列表要被添加