用uni.share分享给微信好友,可以分享成功,但在app.onError里能捕获一个错误,如下
TypeError: n.index.share is not a function
at Proxy.BindShare (https://usr/app-service.js:4494:1303)
at https://usr/app-service.js:4494:1852
at wr (https://usr/app-service.js:4395:34176)
at kr (https://usr/app-service.js:4395:34255)
at Function.a (https://usr/app-service.js:4395:75165)
at f (https://lib/WASubContext.js:1:147076)
at https://lib/WASubContext.js:1:147519
at Function.<anonymous> (https://lib/WASubContext.js:1:109936)
at Function.<anonymous> (https://lib/WASubContext.js:1:142408)
at p (https://lib/WAServiceMainContext.js:1:151340)
原始代码如下:
uni.share({
provider: provider,
scene: scene,
type: type,
title: title,
summary: summary,
href: href,
imageUrl: img,
miniProgram: minip,
success: function (res) {
console.log('[Share.Success]:' + JSON.stringify(res));
},
fail: function (err) {
console.error('[Share.Fail]:' + JSON.stringify(err));
}
});
在unpackage/dist/dev/mp-weixin 里的代码如下:
common_vendor.index.share({
provider,
scene,
type,
title,
summary,
href,
imageUrl: img,
miniProgram: minip,
success: function(res) {
console.log("[Share.Success]:" + JSON.stringify(res));
},
fail: function(err) {
console.log("[Share.Fail]:" + JSON.stringify(err));
}
});
1 个回复
7***@qq.com
请问你解决了吗 我也遇到了这个问题