Authored by tmq

分享

... ... @@ -580,22 +580,21 @@ define('yohood', function(require, exports) {
shareCover = $(".share").attr("cover-url");
detailTitle = $('.detail-title').find('h2');
detailSubtitle = $('.detail-title').find('h3');
detailImage = $('.detail-slide-body').find('img');
//分享
share.init({
shareUrl: shareUrl,
img: shareCover,
sinaText: 'detailImage +【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '@YOHO!潮流志',
sinaText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '@YOHO!潮流志',
fbTextFunction: function() {
return {
des: 'detailImage +【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
name: 'detailImage +【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
caption: 'detailImage +【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
des: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
name: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
caption: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YO’HOOD 2016',
url: location.href
}
},
tweetText: 'detailImage +【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: 'detailImage +【YO’HOOD 2016】' + detailTitle.text() + ' ' + detailSubtitle.text() + shareUrl,
tweetText: '【YO’HOOD 2016】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【YO’HOOD 2016】' + detailTitle.text() + ' ' + detailSubtitle.text() + shareUrl,
});
}
... ...
... ... @@ -203,6 +203,7 @@ EOT;
return $this->_redirect('news/index');
}
$info = Facade_News::getOneById($id);
if (!$info)
{
return $this->_redirect('news/index');
... ... @@ -229,6 +230,26 @@ EOT;
$this->_view['banners'] = Facade_Index::getIndex(4);
$this->_view['news'] = $news;
}
/**
* 详情页
*/
public function shareAction()
{
$id = intval($this->_request->id);
if (empty($id))
{
return $this->_redirect('news/index');
}
$info = Facade_News::getOneById($id);
$thumb= Lib_Images::getImageUrl($info['thumb'], 'source','fragmentimg');
if (!$info)
{
return $this->_redirect('news/index');
}
$this->_view['info'] = $info;
$this->_view['thumb'] = $thumb;
}
/**
* 详情页相关新闻
... ...
... ... @@ -165,7 +165,7 @@
<span>分享到微信朋友圈</span>
</div>
<div class="wx-popup-bd">
<img src="http://qr.liantu.com/api.php?text=<?php echo SITE_MAIN;?>/news/detail/id/<?php echo $this->view->info['id'];?>">
<img src="http://qr.liantu.com/api.php?text=<?php echo SITE_MAIN;?>/news/share/id/<?php echo $this->view->info['id'];?>">
</div>
<div class="wx-popup-ft">点击底部的“发现”,使用<br>“扫一扫”即可分享。</div>
</div>
... ...
<?php $this->_extends('layout/default_layout');?>
<?php $this->_block('main');?>
<div>
<ul>
<li><?php echo $this->view->thumb?></li>
<li>【YO’HOOD 2016】</li>
<li><?php echo $this->view->info['title']?></li>
</ul>
</div>
<?php $this->_endblock();?>
\ No newline at end of file
... ...