...
|
...
|
@@ -70,9 +70,7 @@ |
|
|
<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="<?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'];?>">
|
|
|
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>">
|
|
|
<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>
|
...
|
...
|
@@ -82,43 +80,85 @@ |
|
|
<?php $this->_endblock();?>
|
|
|
<?php $this->_block('js');?>
|
|
|
<script type="text/javascript">
|
|
|
var shareData = {
|
|
|
//初始化config信息
|
|
|
var _weChatInterface = '<?php echo SITE_MAIN;?>/news/getwechatsignpackage';//签名等相关配置,yoho公众号
|
|
|
$.getJSON(_weChatInterface + "?pageurl=" + encodeURIComponent(location.href.split('#')[0]) + "&callback=?", function (json) {
|
|
|
if (json !== undefined && json !== '') {
|
|
|
var _appId = json.appId.toString();
|
|
|
var _timestamp = json.timestamp;
|
|
|
var _nonceStr = json.nonceStr.toString();
|
|
|
var _signature = json.signature.toString();
|
|
|
wx.config({
|
|
|
debug: true,
|
|
|
appId: _appId,
|
|
|
timestamp: _timestamp,
|
|
|
nonceStr: _nonceStr,
|
|
|
signature: _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',
|
|
|
'hideOptionMenu',
|
|
|
'showOptionMenu',
|
|
|
'closeWindow',
|
|
|
'scanQRCode',
|
|
|
'chooseWXPay',
|
|
|
'openProductSpecificView',
|
|
|
'addCard',
|
|
|
'chooseCard',
|
|
|
'openCard'
|
|
|
]
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
/*
|
|
|
* 微信分享
|
|
|
*/
|
|
|
wx.ready(function () {
|
|
|
//构造分享信息
|
|
|
var shareData = {
|
|
|
title: $('.detail-title').find('.title'),
|
|
|
desc: '',
|
|
|
imgUrl: $(".share").attr("cover-url"),
|
|
|
link: $(".share").attr("data-link")
|
|
|
};
|
|
|
var wechatAppId = $(".share").attr("wechatAppId"),
|
|
|
wechatTimestamp = $(".share").attr("wechatTimestamp"),
|
|
|
wechatNonceStr = $(".share").attr("wechatNonceStr"),
|
|
|
wechatSignature = $(".share").attr("wechatSignature");
|
|
|
wx.config({
|
|
|
debug: true,
|
|
|
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 () {
|
|
|
// 2.1 “分享给朋友”
|
|
|
link: $(".share").attr("data-link"),
|
|
|
};
|
|
|
// 2.1 “分享给朋友”
|
|
|
wx.onMenuShareAppMessage(shareData);
|
|
|
// 2.2 “分享到朋友圈”
|
|
|
wx.onMenuShareTimeline(shareData);
|
|
|
// 2.3 “分享到QQ”
|
|
|
wx.onMenuShareQQ(shareData);
|
|
|
// 2.4 “分享到微博”
|
|
|
wx.onMenuShareWeibo(shareData);
|
|
|
wx.onMenuShareWeibo(shareData);
|
|
|
|
|
|
});
|
|
|
wx.error(function (res) {
|
|
|
alert(res.errMsg);
|
|
|
});
|
|
|
alert(res.errMsg);
|
|
|
});
|
|
|
seajs.use(['jquery', 'mobile'],function($, mobile) {
|
|
|
mobile.detail();
|
|
|
});
|
...
|
...
|
|