自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容?
发布于 4 年前 作者 xiaolei 10392 次浏览 来自 官方Issues

请问H5如何调起分享到朋友圈?请教各位,谢谢了。

详情是一个h5页面,通过微信api分享到朋友圈,

怎么调起有两个按钮,一个是分享给朋友、一个是朋友圈?

appId是

wxd0002dae3cf14818

wx.config配置正确

wx.ready()也已经执行了。

function share() {

let that = this;


   alert("ready...");
   var shareData = {
title: '这是我做的作品~大家一起来体验一下吧!',
       desc: '${projectDescription}',
       link: '$http://www.uufind.com/${projectUrl}',
       imgUrl: 'http://bj-feiyuantu.oss-cn-beijing.aliyuncs.com/creative/vcg/veer/800water/veer-120563514.jpg',
       success: function (res) {
alert('已分享');
       },
       cancel: function (res) {
}
};
   wx.updateTimelineShareData({
title: "详情分享分享!", // 分享标题
       link: 'http://www.uufind.com/${projectUrl}', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
       imgUrl: "http://bj-feiyuantu.oss-cn-beijing.aliyuncs.com/creative/vcg/veer/800water/veer-120563514.jpg",
       success: function () {
// 设置成功
           console("ok");
       }


});
   wx.updateTimelineShareData(shareData);

}


1 回复

分享只能右上角,你可以设置分享的参数,H5分享不能像小程序一样啊https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#112

回到顶部