uniapp - 右上角分享
onLoad同级,有图片就用图片,没图片就直接用屏幕截图
onShareAppMessage() {
let that = this;
let pages = getCurrentPages();
let route = pages[pages.length - 1].$page.fullPath;
let imageUrl = that.shareUrl || '';
if (imageUrl != '') {
return {
title: 'XXX',
path: route,
imageUrl: imageUrl,
};
} else {
return {
title: 'XXX',
path: route,
};
}
},