You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
7 months ago
|
|
||
|
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() {
|
||
|
const pages = getCurrentPages(); // 获取加载的页面
|
||
|
const view = pages[pages.length - 1]; // 获取当前页面的对象
|
||
|
let url = '';
|
||
|
if (view.options.url) {
|
||
|
url = view.options.url;
|
||
|
} else {
|
||
|
url = uni.getStorageSync('webUrl');
|
||
|
}
|
||
|
|
||
|
console.log(111,url,`${view.route}?url=${url}`)
|
||
|
return {
|
||
|
title: '智游常熟', // 分享的名称
|
||
|
path: `${view.route}?url=${url}`, // 将 url 作为参数传递
|
||
|
imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg",
|
||
|
mpId: 'wxb8f15afe2765976d' // 此处配置微信小程序的 AppId
|
||
|
};
|
||
|
}
|
||
|
}
|