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: '盐都文旅', type: 0, summary: "edewdewdewf", imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg" } }, onShareAppMessage() { let app = getApp(); const pages = getCurrentPages() //获取加载的页面 const view = pages[pages.length - 1] //获取当前页面的对象 console.log(view, 'view') if (res.from === 'button') { // 来自页面内分享按钮 } return { title: '吴优游', //分享的名称 path: `${view.route}`, imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg", mpId: 'wx9e7d5346a3b09f56' //此处配置微信小程序的AppId } } }