Authored by lore-w

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

... ... @@ -399,10 +399,8 @@ class AbstractAction extends Controller_Abstract
$header['lifeStyle'] = true;
break;
}
$this->_view->assign('pageHeader', $header);
}
/**
* 设置网站导航底部信息
*
... ...
... ... @@ -19,6 +19,8 @@ var introUrl = $('#introUrl').val(),
var sizeSwiper,
refSwiper;
require('../recommend-for-you.js');
function search() {
if (searching || end) {
return;
... ... @@ -46,6 +48,15 @@ function search() {
slidesPerView: 'auto'
});
//优选
// recommendSwiper = new Swiper('#swiper-recommend', {
// slidesPerView: 'auto',
// grabCursor: true,
// slideElement: 'li',
// lazyLoading: true,
// watchSlidesVisibility: true
// });
searching = false;
end = true;
loading.hideLoadingMask();
... ...
... ... @@ -11,6 +11,7 @@ var goodsSwiper;
require('./desc');
require('./comments-consults');
require('../recommend-for-you.js');
lazyLoad($('img.lazy'));
... ...
... ... @@ -5,14 +5,23 @@
*/
var Swiper = require('yoho.iswiper');
var Swiper = require('yoho.iswiper'),
$ = require('jquery');
var recommendSwiper;
var recommendSwiper,
$recommendForYou = $('.recommend-for-you');
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
lazyLoading: true,
watchSlidesVisibility: true
$.get('/home/preference').then(function(html) {
$recommendForYou.html(html);
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}).fail(function() {
$recommendForYou.hide();
});
\ No newline at end of file
... ...
... ... @@ -78,4 +78,31 @@
color: #b0b0b0;
padding-right: pxToRem(32px);
}
}
.systemUpdate{
width: 100%;
height: 90rem / $pxConvertRem;
overflow: hidden;
line-height: 90rem / $pxConvertRem;
display: none;
@include background-image(linear-gradient(#323232, #414141));
.systemHeader{
width: 85%;
height: 100%;
overflow: hidden;
font-size: 60em / $pxConvertRem;
color:#fff;
float: left;
text-align: center;
}
span{
width: 14%;
height: 100%;
overflow: hidden;
float: left;
text-align: center;
font-size: 80em / $pxConvertRem;
font-weight: bold;
color: #fff;
}
}
\ No newline at end of file
... ...
.my-page {
color: #444;
background: #f0f0f0;
a {
color: #444;
}
.user-info {
display: block;
position: relative;
... ... @@ -136,7 +141,7 @@
}
.iconfont {
font-size: pxToRem(60px);
font-size: pxToRem(40px);
}
}
}
... ...
... ... @@ -58,6 +58,7 @@
float: right;
margin-right: rem(30);
color: #ccc;
font-size: rem(32);
}
&:last-child {
... ... @@ -87,6 +88,7 @@
.icon-yoho-enter {
color: #ccc;
float: right;
font-size: rem(32);
}
.connect-item {
... ...
... ... @@ -342,6 +342,10 @@ $basicBtnC:#eb0313;
font-size: pxToRem(47px);
color: #444;
}
&.unfavorite{
font-size: pxToRem(34px);
color:#ccc;
}
&.favorite {
font-size: pxToRem(34px);
color: $basicBtnC;
... ... @@ -374,6 +378,10 @@ $basicBtnC:#eb0313;
font-size: pxToRem(24px);
}
}
.recommend-for-you{
margin-bottom: pxToRem(120px);
}
}
@import "comments-consults";
@import "product-description";
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@
margin-top: pxToRem(22px);
}
.detail{
background-color: $tableCellC;
&.table .inner-container{
background-color: $tableCellC;
}
... ... @@ -89,7 +90,7 @@
}
}
margin-top: pxToRem(30px);
margin-bottom: pxToRem(120px);
margin-bottom: pxToRem(30px);
}
.detail-swiper {
.swiper-wrapper {
... ...
{{> product/recommend-content}}
\ No newline at end of file
... ...
... ... @@ -2,8 +2,6 @@
<div class="good-detail-page yoho-page">
<div class="banner-container">
<div class="tag-container">
<p class="good-tag new-tag">NEW</p>
<p class="good-tag renew-tag">再到着</p>
{{# tags}}
{{# is_new}}
<p class="good-tag new-tag">NEW</p>
... ... @@ -103,8 +101,7 @@
{{/ enterStore}}
<div id="productDesc"></div>
<!-- {{>product/product-description}} -->
{{> product/recommend-for-you}}
{{#cartInfo}}
<div class="cart-bar">
... ... @@ -117,7 +114,11 @@
{{else}}
<a href="" class="sold-out">已售罄</a>
{{/if}}
<a href="" class="favorite iconfont">&#xe605;</a>
{{#if favorite}}
<a href="" class="favorite iconfont ">&#xe605;</a>
{{else}}
<a href="" class="unfavorite iconfont ">&#xe605;</a>
{{/if}}
</div>
{{/cartInfo}}
... ...
... ... @@ -12,7 +12,7 @@
<p class="good-tag sale-tag">SALE</p>
{{/ is_discount}}
{{# is_yohoood}}
<div class="good-tag yohood-tag"></div>
<p class="good-tag new-festival-tag">新品节</p>
{{/ is_yohoood}}
{{# is_limited}}
<p class="good-tag limit-tag">限量商品</p>
... ...
... ... @@ -43,4 +43,10 @@
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}}>
{{#if systemUpdate}}
<div class="systemUpdate">
<a href="systemUpdate" class="systemHeader">YOHO!BUY关于系统升级的公告</a>
<span>X</span>
</div>
{{/if}}
{{> layout/page_header}}
\ No newline at end of file
... ...
<div class="title">为您优选新品</div>
<div id="swiper-recommend" class="swiper-container">
<ul class="swiper-wrapper swiper-wrapper-recommend">
{{#recommendList}}
<li class="swiper-slide">
<img class="swiper-lazy img-box" data-src="{{thumb}}">
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}<span class="old-price">¥{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/recommendList}}
</ul>
</div>
\ No newline at end of file
... ...
{{# recommendForYou}}
<div class="recommend-for-you">
<div class="title">为您优选新品</div>
<div id="swiper-recommend" class="swiper-container">
<ul class="swiper-wrapper swiper-wrapper-recommend">
{{#recommendList}}
<li class="swiper-slide">
<img class="swiper-lazy img-box" data-src="{{thumb}}">
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}"{{salePrice}}</span>
{{#price}}<span class="old-price"{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/recommendList}}
</ul>
</div>
</div>
{{/ recommendForYou}}
\ No newline at end of file
<div class="recommend-for-you">
</div>
\ No newline at end of file
... ...
... ... @@ -51,18 +51,35 @@ class HomeController extends AbstractAction
);
$uid = $this->getUid();
if ($uid) {
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$data['isLogin'] = true;
$data += UserModel::getUserProfileData($uid);
$data += UserModel::getInfoNumData($uid);
$data['recommendForYou'] = UserModel::getPreferenceData($channel);
}
$this->_view->display('index', $data);
}
/**
* 为您优选
*/
public function preferenceAction()
{
$result = array();
if ($this->isAjax()) {
// 优选新品数据
$channel = Helpers::getChannelByCookie();
$result = UserModel::getPreferenceData($channel);
}
if (empty($result)) {
echo ' ';
} else {
$this->_view->display('recommend-content', $result);
}
}
/**
* 用户收藏的商品
*/
... ...
... ... @@ -33,5 +33,14 @@ class IndexController extends AbstractAction
'pageFooter' => true,
));
}
/**
* 设置升级公告路由
*
*/
public function systemUpdate()
{
$this->_view->display('systemUpdate','');
}
}
... ...