onShareAppMessage: async () => {
let shareInfo;
try {
let res = await api.reqShare();
shareInfo = {
path: "/pages/index/index",
title: res.title,
imageUrl: res.image,
};
} catch (e) {
shareInfo = {
path: "/pages/index/index",
title: "测试测试测试测试测试",
};
}
return shareInfo;
},
2 个回复
h***@vip.qq.com - I want to play a game with you.
不要在分享函数内请求,这里是有时间限制的,建议页面加载完成后先获取到分享封面的标题
h***@vip.qq.com - I want to play a game with you.
小程序端是可以传入promise参数的,但是必须三秒内响应resolve回传否则还是走默认分享
1***@qq.com (作者)
好的, 感谢
2025-02-07 18:05