Authored by whb

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohood.git into develop

... ... @@ -603,7 +603,7 @@ define('yohood', function(require, exports) {
exports.detailNews = function(id) {
var recom = '';
var hotVideo = '';
var lastVideo = '';
var lastNews = '';
var template = function(topic, img, url, isVideo, isTitleStyle, title, imgStyle) {
var playIcon = '';
var titleStyle = '';
... ... @@ -661,15 +661,15 @@ define('yohood', function(require, exports) {
hotVideo += template(tools.limitWords(v.title, 52), common.getImages(v.thumb, '0230x0230', 'blogimg', '1'),
'/news/detail/id/' + v.id, 2, isTitleStyle, v.title, '');
});
//最新视频
$.each(data.data.lastVideo, function(i, v) {
//最新资讯
$.each(data.data.lastNews, function(i, v) {
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
lastVideo += template(tools.limitWords(v.title, 52), common.getImages(v.thumb, '0230x0230', 'blogimg', '1'),
lastNews += template(tools.limitWords(v.title, 52), common.getImages(v.thumb, '0230x0230', 'blogimg', '1'),
'/news/detail/id/' + v.id, 2, isTitleStyle, v.title, '');
});
$(".post-list").html(recom);
$(".side-related-list").eq(0).html(hotVideo);
$(".side-related-list").eq(1).html(lastVideo);
$(".side-related-list").eq(1).html(lastNews);
if ($('.detail-body').outerHeight() > $('.detail-side').outerHeight() && navigator.userAgent.indexOf('iPad') === -1) {
//右侧相关文章定位
... ...
... ... @@ -238,7 +238,7 @@ EOT;
public function getdetailnewsAction()
{
$id = intval($this->_request->id);
$list = array('recom'=> array(), 'hotVideo'=> array(), 'lastVideo' => array());
$list = array('recom'=> array(), 'hotVideo'=> array(), 'lastNews' => array());
$tag = '视频';
$exceptTags = array('手机视频');
$recom = array();
... ... @@ -251,10 +251,10 @@ EOT;
}
$recom = array_slice(array_filter($recom + $temp2), 0, 3);
$hotVideo = array_values(Facade_News::getListByDateHits($tag, 0, 5, $exceptTags));
$lastVideo = array_values(Facade_News::getLatestNews($tag, 0, 5, $exceptTags));
$lastNews = array_values(Facade_News::getLatestNews('', 0, 5, $exceptTags));
$list['recom'] = $recom;
$list['hotVideo'] = $hotVideo;
$list['lastVideo'] = $lastVideo;
$list['lastNews'] = $lastNews;
foreach($list as $key => $listnews)
{
if(!empty($listnews))
... ...
... ... @@ -10,7 +10,7 @@ class Controller_Video extends Controller_Abstract
$total = Facade_News::getTotal($tag);
$page = new Lib_Helper_Pagination($total, 24);
list($offset, $limit) = $page->getLimit();
$list = Facade_News::getList($tag, $offset, $limit);
$list = Facade_News::getVideoList($tag, $offset, $limit);
$this->_view['pagination'] = $page->getPagination();
$this->_view['list'] = $list;
}
... ...
... ... @@ -17,15 +17,19 @@ class Facade_News
*/
public static $types = array
(
// 1 => '品牌资讯',
// 2 => '现场活动',
// 3 => '独家合作',
// 4 => '主理人',
// 5 => '明星',
// 6 =>'限量产品',
// 7 => '票务',
// 8 =>'视频',
// 9 =>'专题'
1 => '品牌资讯',
2 => '现场活动',
3 => '独家合作',
4 => '主理人',
5 => '明星',
6 =>'限量产品',
7 => '票务',
8 =>'视频',
9 =>'专题'
2 => '活动介绍',
3 => '亮点活动',
4 => '限量商品'
);
/**
... ... @@ -100,7 +104,20 @@ class Facade_News
*/
public static function getList($tag, $offset, $limit, $exceptTags = array())
{
return self::service()->getList($tag, $offset, $limit, $exceptTags);
return self::service()->getList($tag, $offset, $limit, $exceptTags,$type=0);
}
/**
* 获取视频信息
*
* @param string $tag
* @param int $offset
* @param int $limit
* @param array $exceptTags
* @return array
*/
public static function getVideoList($tag, $offset, $limit, $exceptTags = array())
{
return self::service()->getList($tag, $offset, $limit, $exceptTags,$type=1);
}
/**
... ...
... ... @@ -77,7 +77,7 @@ class Service_News extends Lib_Service
* @param array $exceptTags
* @return array
*/
public function getList($tag, $offset, $limit, $exceptTags)
public function getList($tag, $offset, $limit, $exceptTags,$type)
{
$where = '1' ;
$exceptWhere = '1';
... ... @@ -92,7 +92,11 @@ class Service_News extends Lib_Service
$tag = addslashes($tag);
$where = '`tag` like ("'.$tag.'%")' ;
}
$where = ' WHERE '.$where .' or is_video=1 AND '.$exceptWhere;
if($type==1) {
$where = ' WHERE ' . $where . ' or is_video=1 AND ' . $exceptWhere;
}else{
$where = ' WHERE ' . $where . ' AND ' . $exceptWhere;
}
return self::service(self::ROUTER)->tag(self::$_tag)->fetchAssoc('getList', array('offset' => intval($offset), 'limit' => intval($limit)), array('where' => $where));
}
... ...
... ... @@ -138,7 +138,7 @@
<div class="side-related-post">
<div class="side-related-tab clearfix">
<a class="current" href="javascript:;">最热视频</a>
<a href="javascript:;">最新宣传片</a>
<a href="javascript:;">最新资讯</a>
</div>
<div class="side-related-wrap">
<div class="side-related-list main-layout current">
... ...
... ... @@ -2,7 +2,7 @@
<?php $this->_block('main');?>
<div class="content-tab news-tab">
<ul class="clearfix">
<?php
<?php
array_unshift($this->view->tags, array('tag' => '', 'num'=> $this->view->total));
foreach ($this->view->tags as $tag):
if(empty($tag['num'])) continue;
... ...
... ... @@ -12,7 +12,9 @@ else
{
$thumb = SITE_IMG.'/pic01.png';
}
$height = ceil($thumb_size['height'] * (308 / $thumb_size['width']));
if($thumb_size['height']!=0 && $thumb_size['width']!=0) {
$height = ceil($thumb_size['height'] * (308 / $thumb_size['width']));
}
$width = 308;
?>
<div class="<?php !isset($video) ?'fluid-item':'';?>layout-item tiled">
... ...