diff --git a/App.vue b/App.vue index c17f8d1..4443e17 100644 --- a/App.vue +++ b/App.vue @@ -3,6 +3,12 @@ import { ShoproInit } from './sheep'; onLaunch(() => { + // #ifdef H5 + const script = document.createElement('script'); + script.src = 'https://res.wx.qq.com/open/js/jweixin-1.6.0.js'; + script.type = 'text/javascript'; + document.body.appendChild(script); + // #endif // 隐藏原生导航栏 使用自定义底部导航 uni.hideTabBar({ fail: () => {}, diff --git a/pages/uploadClothes/index.vue b/pages/uploadClothes/index.vue index 0dc1719..6112e59 100644 --- a/pages/uploadClothes/index.vue +++ b/pages/uploadClothes/index.vue @@ -113,6 +113,27 @@ onLoad((options) => { console.log('🚀 ~ 🐶106 ~ options: ', options); + setTimeout(() => { + window?.parent?.postMessage( + { + data: { + code: 'success', + test: '我是子页面的test!', + }, + }, + '*', + ); + wx?.miniProgram?.postMessage({ + data: { + action: 'type', + message: '1234', + timestamp: new Date().getTime(), + }, + }); + console.log(wx?.miniProgram?.postMessage); + console.log(window?.parent); + }, 2000); + if (options?.fileUrl) { isEdit.value = true; }