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
|
|
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: 'Epic Soul交响',
|
|
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 = '';
|
|
if (view.options.url) {
|
|
url = view.options.url;
|
|
} else {
|
|
url = uni.getStorageSync('webUrl');
|
|
}
|
|
|
|
console.log(111,url,`${view.route}?url=${url}`)
|
|
return {
|
|
title: 'Epic Soul交响', // 分享的名称
|
|
path: `${view.route}?url=${url}`, // 将 url 作为参数传递
|
|
// imageUrl: "https://cgc.js-dyyj.com/uploads/20250619/172a730c88bd8894dee1e64c703795eb.jpg",
|
|
mpId: 'wx8954209bb3ad489e' // 此处配置微信小程序的 AppId
|
|
};
|
|
}
|
|
}
|