测试连接:http://greenstar.vmi31.com/index.php?m=default&c=article&a=info&aid=55&u=6
debug:true的时候 所有的反馈信息都正常。
config ok
sendmessage ok
success ok
但是分享到的内容 就是少了自定义内容
分享代码如下~~但是分享到朋友圈和发给朋友 自定义的图片和描述都失效了
var shareline = ‘{$share_link}’;
var sharehref= shareline==’’?location.href:shareline;
var shareTitle = “{$share_title}”;
var shareDesc = “{$share_description}”;
var sharePic ="{$share_pic}";
// 分享内容
var shareContent = {
title: shareTitle,
desc: shareDesc,
link: sharehref,
imgUrl: sharePic,
};
$(function(){
var url = window.location.href;
var jsConfig = {
debug: false,
jsApiList: [
‘onMenuShareTimeline’,
‘onMenuShareAppMessage’,
‘onMenuShareQQ’,
‘onMenuShareQZone’
]
};
$.post("{:url(‘api/jssdk’)}", {url: url}, function (res) {
if(res.status == 200){
jsConfig.appId = res.data.appId;
jsConfig.timestamp = res.data.timestamp;
jsConfig.nonceStr = res.data.nonceStr;
jsConfig.signature = res.data.signature;
// 配置注入
wx.config(jsConfig);
// 事件注入
wx.ready(function () {
wx.onMenuShareTimeline(shareContent);
wx.onMenuShareAppMessage(shareContent);
wx.onMenuShareQQ(shareContent);
wx.onMenuShareQZone(shareContent);
});
}
}, ‘json’);
})