Authored by 张丽霞

Merge branch 'release/4.6' of http://git.yoho.cn/fe/yohobuy-node into release/4.6

# Conflicts:
#	apps/product/views/action/outlets/channel.hbs
... ... @@ -425,7 +425,7 @@ const getPreBrandTopData = (args, type) => {
preferenceBrands: {
name: title,
imgBrand: [],
brandUrl: helpers.urlFormat('getbrandFloorDataAjax?channelType=' + type)
brandUrl: '/getbrandFloorDataAjax?channelType=' + type
}
};
... ... @@ -794,7 +794,7 @@ const requestContent = type => {
limit: 1000
});
return serviceApi.get('/operations/api/v5/resource/home', data).then(res => {
return serviceApi.get('operations/api/v5/resource/home', data).then(res => {
if (res.code === 200) {
return res;
} else {
... ...
... ... @@ -89,7 +89,7 @@ exports.getOutletsGoodsList = (params) => {
let tempChannel = _.isEmpty(params.channel) ? 'boys' : params.channel;
let tempParams = {
method: 'app.search.li',
method: 'app.search.category',
query: _.isEmpty(params.query) ? null : params.query,
p_d: _.isEmpty(params.p_d) ? null : params.p_d,
limit: _.isEmpty(params.limit) ? '60' : params.limit,
... ...
... ... @@ -12,27 +12,7 @@ const queryString = require('querystring');
* NL2R图片轮播
*/
const nl2r = (data) => {
const result = {
left: [],
right: []
};
// 左侧
_.forEach(data.left, (value) => {
result.left.push({
img: value.src,
url: value.url
});
});
// 右侧
_.forEach(data.right, (value) => {
result.right.push({
img: value.src,
url: value.url
});
});
return result;
return {topBanner: data};
};
/**
... ...
... ... @@ -347,7 +347,8 @@ exports.handleSaleOptsData = (params, total) => {
// 商品开始结束数
dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1;
dest.end = parseInt(dest.start, 10) + paramsLimit - 1;
dest.end = (dest.pageCount === parseInt(params.page, 10)) ?
total : parseInt(dest.start, 10) + paramsLimit - 1;
return dest;
};
... ...
... ... @@ -513,7 +513,8 @@ exports.handleSaleOptsData = (params, total, extra) => {
// 商品开始结束数
dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1;
dest.end = parseInt(dest.start, 10) + paramsLimit - 1;
dest.end = (dest.pageCount === parseInt(params.page, 10)) ?
total : parseInt(dest.start, 10) + paramsLimit - 1;
return dest;
};
... ...
... ... @@ -217,6 +217,12 @@ exports.getSaleOthersData = (params, channel) => {
// 获取商品数据
if (result[1].code === 200) {
finalResult.goods = productProcess.processProductList(result[1].data.product_list);
// 处理所有商品标题数据
finalResult.saleTitle = {};
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = result[1].data.total;
}
// 获取焦点图数据
... ... @@ -237,12 +243,6 @@ exports.getSaleOthersData = (params, channel) => {
finalResult.opts = saleHandler.handleSaleOptsData(params, result[3].data.total);
finalResult.totalCount = result[3].data.total;
finalResult.pager = saleHandler.handleSalePagerData(result[3].data.total, params);
// 处理所有商品标题数据
finalResult.saleTitle = {};
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = finalResult.totalCount;
}
if (!_.isEmpty(result[4])) {
... ... @@ -370,18 +370,18 @@ exports.getSalebreakingYardsData = (params, channel) => {
finalResult.totalCount = subResult[0].data.total;
finalResult.pager = saleHandler.handleSalePagerData(subResult[0].data.total, params);
// 处理所有商品标题数据
finalResult.saleTitle = {};
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = finalResult.totalCount;
}
// 处理商品数据
if (subResult[1].code === 200) {
finalResult.goods = productProcess.processProductList(subResult[1].data.product_list);
// 处理所有商品标题数据
finalResult.saleTitle = {};
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = subResult[1].data.count;
_.forEach(finalResult.goods, (value, key) => {
finalResult.goods[key].tags.isNew = false; // 屏蔽 new 标签
});
... ...
... ... @@ -2,6 +2,7 @@
<div class="outlets-page product-page yoho-page">
{{> common/main-banner}}
<div class="center-content">
{{#if column}}
<ul class="column-img-tab">
{{# column}}
<li>
... ... @@ -9,6 +10,8 @@
</li>
{{/ column}}
</ul>
{{/if}}
{{> outlets/limited-buy}}
{{> outlets/near-over}}
... ...
{{!-- <pre>{{resultShow}}</pre> --}}
<div class="outlets-special-page product-page yoho-page">
{{> common/main-banner}}
<div class="center-content clearfix">
{{> common/special-head}}
<div class="list-left left">
... ...
{{# result}}
<div class="sale-discount-page yoho-page center-content .new-sale-page">
{{#topBanner}}
{{> sale/sale-banner}}
{{/topBanner}}
<div class="center-content clearfix">
{{#saleTitle}}
<div class="sale-title">
<span class="title">{{title}}</span>
{{#if discount}}
<span class="discount">{{discount}}</span>
{{/if}}
{{#if up}}
{{/if}}
<div class="time pull-right">
<span class="iconfont">&#xe60a;</span>
<label class="time-calculate hidden" data="{{time}}"></label>
</div>
</div>
{{/saleTitle}}
<ul class="sort">
<li class="title">分类:</li>
{{#leftContent}}
{{#allSort}}
{{#list}}
<li class="{{#if checked}}active{{/if}}"><a href="{{href}}">{{name}} {{#if num}}({{num}}){{/if}}</a></li>
{{/list}}
{{/allSort}}
{{/leftContent}}
</ul>
</div>
{{> sale/discount-center-content}}
... ...
... ... @@ -10,9 +10,8 @@
{{> sale/activity-entry}}
{{> sale/brand-sale}}
<div class="home-page">
{{> sale/sale-box}}
</div>
</div>
{{/ result}}
... ...
<div class="sale-list-banner">
{{# topBanner}}
{{#if list}}
<div class="sale-list-banner" style="height: 360px;">
<ul>
{{# list}}
<li class="banner-img" style="background:url({{image img 1920 360}}) no-repeat top center;"></li>
{{/ list}}
</ul>
</div>
</div>
{{/if}}
{{/topBanner}}
\ No newline at end of file
... ...
{{#saleCategory}}
{{#if navItem}}
<div class="sale-box">
<div class="floor-header clearfix">
<h2 class="floor-title">{{title}}</h2>
</div>
<ul class="sale-nav" urlLocation="{{urlLocation}}" cursor:pointer>
<ul class="sale-nav" urlLocation="{{urlLocation}}">
{{#navItem}}
<li class="{{#vip}}green{{/vip}} {{#incompleteSize}}yellow{{/incompleteSize}} {{#newDiscount}}red{{/newDiscount}} {{#if @first}}active first{{/if}} {{#if @last}}last{{/if}}" urlLocation='{{urlLocation}}'>{{title}}</li>
{{/navItem}}
... ... @@ -13,4 +14,5 @@
</ul>
</div>
</div>
{{/if}}
{{/saleCategory}}
... ...
<div id="slider" class="slide-container {{#if pagination}}slide-thumb-container{{/if}}">
{{#topBanner}}
<div id="slider" class="slide-container {{#if pagination}}slide-thumb-container{{/if}}">
<div class="slide-wrapper">
<ul>
{{# list}}
... ... @@ -33,5 +34,6 @@
</ul>
</div>
{{/if}}
</div>
<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
</div>
<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
{{/topBanner}}
... ...
... ... @@ -21,6 +21,7 @@
{{/if}}
{{/ checkedConditions}}
{{#if ../goods}}
{{#if channel}}
<div class="channel section">
<span class="title">频道:</span>
... ... @@ -287,4 +288,5 @@
</div>
</div>
{{/if}}
{{/if}}
</div>
... ...
This diff could not be displayed because it is too large.
... ... @@ -7,28 +7,40 @@ exports.init = function(selector) {
var $imgBrand = $(selector);
var slider = $imgBrand.unslider({
autoplay: true,
delay: 3000,
arrows: {
},
nav: false,
animate: 'fade'
delay: 5000,
arrows: false,
nav: false
});
var imgBrandNum = $imgBrand.find('li').length;
var rows = imgBrandNum / 3;
var cols = imgBrandNum / 3;
var changeSliderTimeout;
if (!($imgBrand.find('li').length % 3)) {
rows -= 1;
cols -= 1;
}
$imgBrand.find('li:nth-child(3n)').css('margin-right', 0);
slider.on('unslider.change', function(event, index) {
if (index > rows) {
slider.unslider('animate:' + imgBrandNum);
clearTimeout(changeSliderTimeout);
if (index >= cols) {
changeSliderTimeout = setTimeout(function() {
slider.unslider('animate:first');
}, 4999);
}
});
// TODO: 手动点击左右
$('.img-brand-switch').on('click', '.prev', function() {
if (slider.data('unslider').current > cols || slider.data('unslider').current <= 0) {
slider.unslider('animate:' + cols);
} else {
slider.unslider('prev');
}
}).on('click', '.next', function() {
if (slider.data('unslider').current >= cols) {
slider.unslider('animate:first');
} else {
slider.unslider('next');
}
});
};
... ...
... ... @@ -75,6 +75,7 @@
.title {
font-size: 16px;
margin: 28px 0 14px;
padding: 0 8px;
font-weight: bold;
}
... ... @@ -149,6 +150,17 @@
.good-item {
padding: 15px;
}
.good-item > a {
width: 90px;
height: 120px;
display: inline-block;
}
.good-item > img {
width: 100%;
height: 100%;
}
}
.item-text {
... ...