Authored by 毕凯

首页增加 公告

17.4 KB | W: | H:

17.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -6,6 +6,7 @@
var $ = require('jquery'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.lazyload'),
noticeScroll = require('../plugin/notice-scroll'),
$mobileWrap = $('.mobile-wrap'),
$overlay = $('.overlay'),
$sideNav = $('.side-nav'),
... ... @@ -24,6 +25,7 @@ var start = 0,
isen = true;
lazyLoad($('img.lazy'));
noticeScroll('.notice', $('.notice').data('time') * 1000);
$('.nav-btn').on('touchstart', function() {
$sideNav.css('pointer-events', 'none');
... ...
... ... @@ -17,6 +17,7 @@
@import "hot-category";
@import "home-header";
@import "thumb-row";
@import "notice";
.mobile-container{
width: 100%;
... ...
.notice-wrap {
.trend {
position: relative;
box-sizing: border-box;
float: left;
width: 170px;
height: 72px;
background: resolve('img/trend.png') no-repeat center center;
background-size: 90%;
background-color: #fff;
&:after {
content: '';
position: absolute;
right: 0;
top: 16px;
width: 1px;
height: 40px;
background: #eee;
}
}
.notice {
box-sizing: border-box;
float: left;
padding: 0 30px;
background: #fff;
width: 470px;
height: 72px;
overflow: hidden;
.notice-item {
display: block;
width: 100%;
font-size: 24px;
line-height: 72px;
color: #444;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.notice-icon {
display: inline-block;
margin-right: 10px;
width: 28px;
height: 28px;
background: url("/me/index/volume.png");
vertical-align: middle;
}
span.notice-icon {
background-repeat: no-repeat !important;
}
}
}
... ...
... ... @@ -7,6 +7,10 @@
{{# iconsEnter}}
{{> home/icons_enter}}
{{/ iconsEnter}}
{{! 首页公告}}
{{# notice}}
{{> home/notice}}
{{/ notice}}
{{! 中间banner}}
{{# banner}}
{{> home/banner}}
... ...
{{#if notice.open}}
<div class="notice-wrap clearfix">
<div class="trend">
</div>
<div class="notice" data-time="{{notice.time}}">
{{#notice.list}}
<a class="notice-item item-{{@index}}" href="{{url}}">
<span class="notice-icon"></span>
{{title}}
</a>
{{/notice.list}}
</div>
</div>
{{/if}}
... ...
... ... @@ -2,6 +2,7 @@
use Action\AbstractAction;
use Plugin\Helpers;
// use Index\UserModel as UserModel;
/**
* 男生首页
... ... @@ -29,12 +30,21 @@ class BoysController extends AbstractAction
// 显示底部TAB
$this->setNavFooterTab();
$content = Index\HomeModel::getBoysFloor();
// $content[] = array(
// 'notice' => array(
// 'open' => true,
// 'list' => UserModel::getNoticeData(),
// 'time' => 3,
// )
// );
// 渲染模板并输出
$this->_view->display('index', array(
'boysHomePage' => true,
'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
'maybeLike' => true,
'content' => Index\HomeModel::getBoysFloor(),
'content' => $content,
'pageFooter' => true,
));
}
... ...