...
|
...
|
@@ -70,7 +70,9 @@ |
|
|
<div id="share" class="share" cover-url="<?php
|
|
|
$thumb = empty($this->view->info['client_thumb']) ? $this->view->info['thumb'] : $this->view->info['client_thumb'];
|
|
|
echo Lib_Images::getImageUrl($thumb, 'source','fragmentimg');?>"
|
|
|
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>" wechatAppId="" wechatTimestamp="" wechatNonceStr="" wechatSignature="">
|
|
|
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>" wechatAppId="<?php echo $this->view->wechat['appId'];?>"
|
|
|
wechatTimestamp="<?php echo $this->view->wechat['timestamp'];?>" wechatNonceStr="<?php echo $this->view->wechat['nonceStr'];?>"
|
|
|
wechatSignature="<?php echo $this->view->wechat['signature'];?>">
|
|
|
<ul class="clearfix">
|
|
|
<li class="yohoo-share-button-sina"><a href="javascript:;"></a></li>
|
|
|
<li class="yohoo-share-button-qq"><a href="javascript:;"></a></li>
|
...
|
...
|
@@ -79,37 +81,7 @@ |
|
|
</div>
|
|
|
<?php $this->_endblock();?>
|
|
|
<?php $this->_block('js');?>
|
|
|
<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
var shareData = {
|
|
|
title: '',
|
|
|
desc: '',
|
|
|
imgUrl: '',
|
|
|
link: '',
|
|
|
};
|
|
|
// wx.config({
|
|
|
// debug: false,
|
|
|
// appId: '',
|
|
|
// timestamp: '',
|
|
|
// nonceStr: '',
|
|
|
// signature: '',
|
|
|
// jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ',
|
|
|
// 'onMenuShareWeibo','hideMenuItems','showMenuItems','hideAllNonBaseMenuItem','showAllNonBaseMenuItem',
|
|
|
// 'translateVoice','startRecord','stopRecord','onRecordEnd','playVoice','pauseVoice','stopVoice',
|
|
|
// 'uploadVoice','downloadVoice','chooseImage','previewImage','uploadImage','downloadImage',
|
|
|
// 'getNetworkType','openLocation','getLocation','hideOptionMenu','showOptionMenu','closeWindow',
|
|
|
// 'scanQRCode','chooseWXPay','openProductSpecificView','addCard','chooseCard','openCard'
|
|
|
// ]
|
|
|
// });
|
|
|
// // 2.1 “分享给朋友”
|
|
|
// wx.onMenuShareAppMessage(shareData);
|
|
|
// // 2.2 “分享到朋友圈”
|
|
|
// wx.onMenuShareTimeline(shareData);
|
|
|
// // 2.3 “分享到QQ”
|
|
|
// wx.onMenuShareQQ(shareData);
|
|
|
// // 2.4 “分享到微博”
|
|
|
// wx.onMenuShareWeibo(shareData);
|
|
|
|
|
|
seajs.use(['jquery', 'mobile'],function($, mobile) {
|
|
|
mobile.detail();
|
|
|
var shareUrl = $(".share").attr("data-link"),
|
...
|
...
|
@@ -120,6 +92,36 @@ |
|
|
wechatTimestamp = $(".share").attr("wechatTimestamp"),
|
|
|
wechatNonceStr = $(".share").attr("wechatNonceStr"),
|
|
|
wechatSignature = $(".share").attr("wechatSignature");
|
|
|
wx.config({
|
|
|
debug: false,
|
|
|
appId: wechatAppId,
|
|
|
timestamp: wechatTimestamp,
|
|
|
nonceStr: wechatNonceStr,
|
|
|
signature: wechatSignature,
|
|
|
jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ',
|
|
|
'onMenuShareWeibo','hideMenuItems','showMenuItems','hideAllNonBaseMenuItem','showAllNonBaseMenuItem',
|
|
|
'translateVoice','startRecord','stopRecord','onRecordEnd','playVoice','pauseVoice','stopVoice',
|
|
|
'uploadVoice','downloadVoice','chooseImage','previewImage','uploadImage','downloadImage',
|
|
|
'getNetworkType','openLocation','getLocation','hideOptionMenu','showOptionMenu','closeWindow',
|
|
|
'scanQRCode','chooseWXPay','openProductSpecificView','addCard','chooseCard','openCard'
|
|
|
]
|
|
|
});
|
|
|
wx.ready(function () {
|
|
|
var shareData = {
|
|
|
title: detailTitle,
|
|
|
desc: '',
|
|
|
imgUrl: shareCover,
|
|
|
link: shareUrl
|
|
|
};
|
|
|
// 2.1 “分享给朋友”
|
|
|
wx.onMenuShareAppMessage(shareData);
|
|
|
// 2.2 “分享到朋友圈”
|
|
|
wx.onMenuShareTimeline(shareData);
|
|
|
// 2.3 “分享到QQ”
|
|
|
wx.onMenuShareQQ(shareData);
|
|
|
// 2.4 “分享到微博”
|
|
|
wx.onMenuShareWeibo(shareData);
|
|
|
});
|
|
|
});
|
|
|
</script>
|
|
|
<?php $this->_endblock();?> |
...
|
...
|
|