export const myMixins ={ onLoad(option) { console.log('option',option) if(option && option.wechat_qrcode){ uni.setStorageSync('wechat_qrcode',option.wechat_qrcode) } // 分享 uni.showShareMenu({ withShareTicket: true, //设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击 menus: ["shareAppMessage", "shareTimeline"] }) }, // 分享到朋友圈 onShareTimeline() { return { title: 'CGC-ICH', type: 0, summary: "", imageUrl: "https://cgc.js-dyyj.com/uploads/20250619/172a730c88bd8894dee1e64c703795eb.jpg" } }, onShareAppMessage() { const pages = getCurrentPages(); // 获取加载的页面 const view = pages[pages.length - 1]; // 获取当前页面的对象 let url = ''; let shareParam = {} if (view.$page.fullPath) { url = view.options.fullPath; } else { url = uni.getStorageSync('webUrl'); } if (view.data && view.data.shareParam) { shareParam = view.data.shareParam } return { title: 'CGC-ICH', // 分享的名称 path: `${view.$page.fullPath}`, // 将 url 作为参数传递 imageUrl: "https://cgc.js-dyyj.com/uploads/20250619/172a730c88bd8894dee1e64c703795eb.jpg", mpId: 'wx9d68934300b1fe90', // 此处配置微信小程序的 AppId ...shareParam }; } }