微信分享链接时,怎样才能带上带缩略图和简介?

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
// alert(location.href.split('#')[0])
  $(function(){
var timestamps;
var nonceStrs;
var signatures;
var url = encodeURIComponent(location.href.split('#')[0]);
$.ajax({  
async: false,  
url: 'http://sunadver.tunnel.2bdata.com/jimitd/jsSdk/getJsSdk', 
type: "get",
dataType: "json",  
data:{url:url},
success: function(data){ 
timestamps = data.timestamp;
nonceStrs = data.nonceStr;
signatures = data.signature;
},
error: function(xhr){
alert("error");
 }
        }); 

wx.config({  
debug: false,  
appId:'xxxxxxxx',  
timestamp:timestamps,  
nonceStr:nonceStrs,  
signature:signatures,  
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone'] 
// 功能列表,我们要使用JS-SDK的什么功能  
}); 
wx.ready(function(){
wx.onMenuShareAppMessage({
title: '吉米壹號 私人定制', // 分享标题
desc: '您专属的,长白山下一亩田', // 分享描述
link: 'https:xxxx?appid=xxxxx&redirect_uri=xxx&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect', 
imgUrl: xxx/logo2.png', // 分享图标 
});
wx.onMenuShareTimeline({
title: '吉米壹號  私人定制', // 分享标题
link: xxx?appid=xxx&redirect_uri=xxx&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect', // 分享链接
imgUrl: 'xxxx/logo2.png', // 分享图标  
}); 
   
});

}); 
 
</script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值