无法自定义分享微信链接
function webchatShare() {
wx.config({
debug: true,
appId:固定值,
timestamp:固定值 ,
nonceStr: 固定值,
signature: 固定值,
jsApiList: [
"onMenuShareTimeline",
"onMenuShareAppMessage",
"updateAppMessageShareData",
"updateTimelineShareData"
]
});
wx.ready(function () {
// 监听“发送给朋友”按钮点击、自定义分享内容及分享结果接口
console.log('wx ready')
const shareObject = {
title:'111',
desc:'111',
link:'https://www.baidu.com',
success:function(){
console.log('success')
},
cancel:function(){
console.log('cancel')
},
fail:function(){
console.log('fail')
}
}
wx.updateAppMessageShareData(shareObject);
// 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
// wx.updateTimelineShareData(TimelineShareData);
});
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.htmlhttps://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html