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

View File

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

View File

@ -123,29 +123,44 @@ export default {
// ); // );
// }; // };
const MQTT_send = (send_string) => { // const MQTT_send = (send_string) => {
console.log("向父页面发送消息:", JSON.stringify(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
);
}
};

View File

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