onShareAppMessage: function (options) {
console.log(options);
const { webViewUrl } = options;
const i = webViewUrl.indexOf('?');
let search = '',
url = webViewUrl;
if(i !== -1) {
url = webViewUrl.slice(0, i);
console.log({url});
search = `${webViewUrl.slice(i + 1)}`;
console.log({search});
}
const shareObj = {
title: "这是标题",
dec:"sadasdsadasdasd",
path: `/pages/index/index?url=${url}${search ? '&' : ''}${search}`,
}
console.log({shareObj});
if (options.from == 'button') {
var data= options.target.dataset;
console.log(data.name);
}
return shareObj;
}
拼接的url进行encodeURIComponent()处理