分享微信不支持,使用证书打包了也没有解决
需要修改分享代码
原本代码
//分享给微信好友聊天
shareCharFriend(img) {
console.log(img);
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 2,
imageUrl: img,
success: function(res) {
uni.showToast({
title: '分享成功'
})
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
this.showChar = false;
},
修改代码
//分享给微信好友聊天
shareCharFriend(img) {
var msg = {
pictures: [img], // pictures 参数为数组 注意图片路径要是本地路径 base64也可以
type: 'image'
};
plus.share.sendWithSystem(msg, function() {
uni.showToast({
title: '分享成功'
})
}, function(e) {
console.log('分享失败:' + JSON.stringify(e));
});
this.showChar = false;
},