Authored by 毕凯

个人中心增加公告

... ... @@ -3,7 +3,8 @@
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/12
*/
var $ = require('jquery');
var $ = require('jquery'),
noticeScroll = require('../plugin/notice-scroll');
var $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
var myImage = new Image(),
... ... @@ -19,6 +20,8 @@ myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
noticeScroll('.notice');
$('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', function() {
$listItem.removeClass('highlight');
$(this).addClass('highlight');
... ...
/**
* 公告栏目滚动
* bikai kai.bi@yoho.cn
*/
var $ = require('jquery');
function noticeScroll(selecter, time) {
var $notice = $(selecter),
$noticeItem = $notice.find('.notice-item'),
count = $noticeItem.length,
i = 1;
selecter = selecter || '.notice';
time = time || 3000;
if (count > 1) {
setInterval(function() {
if (i >= count) {
i = 0;
}
$noticeItem.fadeOut();
$notice.find('.item-' + i).fadeIn();
i++;
}, time);
}
}
module.exports = noticeScroll;
... ...
... ... @@ -86,7 +86,6 @@
}
.my-link {
margin-bottom: pxToRem(30px);
padding: pxToRem(6px) 0;
text-align: center;
background: rgba(0,0,0,0.8);
... ... @@ -133,6 +132,34 @@
}
}
.notice {
margin-bottom: pxToRem(30px);
padding: 0 pxToRem(30px);
background: #fff;
height: pxToRem(72px);
overflow: hidden;
.notice-item {
display: block;
width: 100%;
font-size: pxToRem(24px);
line-height: pxToRem(72px);
color: #444;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.notice-icon {
display: inline-block;
margin-right: pxToRem(10px);
width: pxToRem(28px);
height: pxToRem(28px);
@include rem-sprite($index, volume);
vertical-align: middle;
}
}
.my-order {
margin-bottom: pxToRem(30px);
border-top: 1px solid #e0e0e0;
... ... @@ -206,17 +233,18 @@
padding: 0 pxToRem(30px);
font-size: 16px;
line-height: pxToRem(88px);
.opinion{
width: 1.3rem;
height: 1.3rem;
overflow: hidden;
display: inline-block;
background-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pWMVV7UkUi4URtt0hbd5ik3bPr34tyM6NnGVy16Lps1zFIWZwE4bMjQLfREMHRGXKsUyI3lCYSi6xhHhNIBwPEPF7bwGRHjjoFQobQmzwVDGU6pueKjdb5ZQTMdXcIdJNiiOdHE7y2wan6Pp/rJho3uISZD/bE03naMlgjT9QLFevNATyIWxdiEiQX5zOQ5V1nO82owQmYsa9hOZTGSQSUQyiYmylnCchikRllVAhbhHG9aFMB4TJBKDuPpMF48qOD7DlgjY1vK2S5V4NAa4DyezHCZB9ss01amKV621tttBwuAAFFcM/Z4sLTm3wWhZAAnQGLFHs6dGQpvhw+HviXzg7SY2TR/OAGaDYz6vJ/Jl4/My+DYceIYJAY+Q7SHwUekTEaXnOACstHBEX+yyoRwrwOl7k65UPVagNUhnL3mT7UlyCe7LQc8kFIe8mBl75JvR+Hykg581cCmIHPOLCJOhSeYio377v28IhpYPQIKabatNbKuZ6k+ANsvieCvmLH9xf4TepyMMb7Zluxn1J2fe91pNHLjcRsPj6WiLVyjgf8fT9d+n6CvstMX1PGADNWwbt5PxzjWfq1YTyXnO2ck4eft7zm52hCben8LTpVQTlXuwM9JxIgH8IAko1nG7bK8ucUEk5r8hIrpt6v6Xc++3GkSyGxFpDtLy30EtRBySPwIMACKUEyE6TctsAAAAAElFTkSuQmCC");
background-size:100% 100%;
@include rem-sprite($index, talk);
position: relative;
top: .36rem;
margin-right: pxToRem(12px);
}
&.highlight {
background: #eee;
}
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
$index: sprite-map("me/index/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay","yoho-coin-new", "yoho-coin-detail";
... ...
... ... @@ -33,6 +33,16 @@
<p>浏览记录</p>
</a>
</div>
{{#if notice}}
<div class="notice">
{{#notice}}
<a class="notice-item item-{{@index}}" href="{{url}}">
<span class="notice-icon"></span>
{{title}}
</a>
{{/notice}}
</div>
{{/if}}
<div class="my-order">
<a class="order-title" href="/home/orders">
我的订单
... ...
... ... @@ -51,6 +51,24 @@ class HomeController extends AbstractAction
'myIndexPage' => true,
'showDownloadApp' => true,
'navHome' => true,
'notice' => array(
array(
'title' => '1. 通知内容内容通知内容内容通知内容内容通知内容内容通知内容内容',
'url' => 'http://www.yoho.cn'
),
array(
'title' => '2. 通知内容内容通知内容内容通知内容内容通知内容内容通知内容内容',
'url' => 'http://www.yoho.cn'
),
array(
'title' => '3. 通知内容内容通知内容内容通知内容内容通知内容内容通知内容内容',
'url' => 'http://www.yoho.cn'
),
array(
'title' => '4. 通知内容内容通知内容内容通知内容内容通知内容内容通知内容内容',
'url' => 'http://www.yoho.cn'
)
),
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))),
... ... @@ -469,7 +487,7 @@ class HomeController extends AbstractAction
$info = 'userId=' . $uid . '&name=' . $this->_uname . '&memo=&hashCode=' . md5( strtoupper( rawurlencode($uid . $this->_uname . $time . '1231') ) ) . '&timestamp=' . $time;
$serviceUrl .= rawurlencode($info);
}
$this->_view->display('online-service', array(
'onlineServicePage' => true,
'pageFooter' => true,
... ...