作者 景龙
1 个管道 的构建 通过 耗费 1 秒

增加微博分享

... ... @@ -138,6 +138,22 @@ $(function(){
$("#searchForm").submit();//处理事件
}
});
var share_url = encodeURIComponent(location.href);
var share_title = encodeURIComponent(document.title);
//分享到微博
$('.weibo').click(function(){
var param = {
url: share_url,
title: share_title,
rnd: new Date().valueOf()
};
var temp = [];
for (var p in param) {
temp.push(p + '=' + encodeURIComponent(param[p] || ''))
}
window.open('http://v.t.sina.com.cn/share/share.php?' + temp.join('&'));
});
});
//点赞收藏
... ...
... ... @@ -17,12 +17,12 @@
</notempty>
</div>
<!-- wx分享 -->
<div class="wx_go">
<div class="wx_go weixin">
<img src="__TMPL__/public/assets/starImg/bicon_04.png" alt="">
<p>168</p>
</div>
<!-- wb分享 -->
<div class="wb_go">
<div class="wb_go weibo">
<img src="__TMPL__/public/assets/starImg/bicon_05.png" alt="">
<p>168</p>
</div>
... ...
... ... @@ -190,10 +190,10 @@ $(function() {
});
//分享到微信
$('.weixin').click(function(){
var target_url = "http://qr.liantu.com/api.php?text="+share_url;
window.open(target_url, 'weixin', 'height=320, width=320');
});
// $('.weixin').click(function(){
// var target_url = "http://qr.liantu.com/api.php?text="+share_url;
// window.open(target_url, 'weixin', 'height=320, width=320');
// });
});
//弹框
... ...