export default {
install(app) {
app.mixin({
onLoad() {
const page = getCurrentPages().pop()
if (page) {
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline'],
})
}
},
// 添加朋友圈分享支持
methods: {
// 好友分享
onShareAppMessage() {
return {
title: '分享标题',
path: '/pages/login',
imageUrl: 'https://example.com/share-image.jpg'
}
},
// 朋友圈分享
onShareTimeline() {
return {
title: '分享到朋友圈的标题',
query: '', // 朋友圈分享不支持带参数
imageUrl: 'https://example.com/timeline-image.jpg' // 自定义分享图
}
}
}
})
}
}
求大佬帮忙解决 实在不知道里的问题了