WeCenter文章分享到微信朋友圈,链接的缩略图不显示怎么解决?

检查下微信公众号是否正确配置了白名单等信息,以及系统设置中,微信公众号信息是否配置正确;如全部配置正确,找到views/default/m/footer.tpl.htm,中<?php if (in_weixin()) { ?> 部分修改替换代码代码如下:


<?php if (in_weixin()) { ?>
<script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.header').hide();

});
wx.config({
debug: false,
appId: '<?php echo get_setting("weixin_app_id"); ?>',
timestamp: '<?php echo TIMESTAMP; ?>',
nonceStr: '<?php echo $this->weixin_noncestr; ?>',
signature: '<?php echo $this->weixin_signature; ?>',
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
]
});

var WEIXIN_IMG_COVER;

if ($('.Rich_text img').length)
{
WEIXIN_IMG_COVER = $('.Rich_text img').first().attr('src');
}
else
{
WEIXIN_IMG_COVER = '<?php echo G_STATIC_URL; ?>/common/weixin_default_cover.png';
}

wx.ready(function () {
// 朋友圈
wx.onMenuShareTimeline({
title: document.title,
desc: $('meta[name="description"]').attr('content'),
link: location.href,
imgUrl: WEIXIN_IMG_COVER
});

// 朋友
wx.onMenuShareAppMessage({
title: document.title,
desc: $('meta[name="description"]').attr('content'),
link: location.href,
imgUrl: WEIXIN_IMG_COVER
});

// QQ
wx.onMenuShareQQ({
title: document.title,
desc: $('meta[name="description"]').attr('content'),
link: location.href,
imgUrl: WEIXIN_IMG_COVER
});

// 腾讯微博
wx.onMenuShareWeibo({
title: document.title,
desc:$('meta[name="description"]').attr('content'),
link: location.href,
imgUrl: WEIXIN_IMG_COVER
});
});
</script>
<?php } ?>


共有 0 个评论

要回复文章请先登录注册