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) => { @@ -425,7 +425,7 @@ const getPreBrandTopData = (args, type) => {
425 preferenceBrands: { 425 preferenceBrands: {
426 name: title, 426 name: title,
427 imgBrand: [], 427 imgBrand: [],
428 - brandUrl: helpers.urlFormat('getbrandFloorDataAjax?channelType=' + type) 428 + brandUrl: '/getbrandFloorDataAjax?channelType=' + type
429 } 429 }
430 }; 430 };
431 431
@@ -794,7 +794,7 @@ const requestContent = type => { @@ -794,7 +794,7 @@ const requestContent = type => {
794 limit: 1000 794 limit: 1000
795 }); 795 });
796 796
797 - return serviceApi.get('/operations/api/v5/resource/home', data).then(res => { 797 + return serviceApi.get('operations/api/v5/resource/home', data).then(res => {
798 if (res.code === 200) { 798 if (res.code === 200) {
799 return res; 799 return res;
800 } else { 800 } else {
@@ -89,7 +89,7 @@ exports.getOutletsGoodsList = (params) => { @@ -89,7 +89,7 @@ exports.getOutletsGoodsList = (params) => {
89 let tempChannel = _.isEmpty(params.channel) ? 'boys' : params.channel; 89 let tempChannel = _.isEmpty(params.channel) ? 'boys' : params.channel;
90 90
91 let tempParams = { 91 let tempParams = {
92 - method: 'app.search.li', 92 + method: 'app.search.category',
93 query: _.isEmpty(params.query) ? null : params.query, 93 query: _.isEmpty(params.query) ? null : params.query,
94 p_d: _.isEmpty(params.p_d) ? null : params.p_d, 94 p_d: _.isEmpty(params.p_d) ? null : params.p_d,
95 limit: _.isEmpty(params.limit) ? '60' : params.limit, 95 limit: _.isEmpty(params.limit) ? '60' : params.limit,
@@ -12,27 +12,7 @@ const queryString = require('querystring'); @@ -12,27 +12,7 @@ const queryString = require('querystring');
12 * NL2R图片轮播 12 * NL2R图片轮播
13 */ 13 */
14 const nl2r = (data) => { 14 const nl2r = (data) => {
15 - const result = {  
16 - left: [],  
17 - right: []  
18 - };  
19 -  
20 - // 左侧  
21 - _.forEach(data.left, (value) => {  
22 - result.left.push({  
23 - img: value.src,  
24 - url: value.url  
25 - });  
26 - });  
27 -  
28 - // 右侧  
29 - _.forEach(data.right, (value) => {  
30 - result.right.push({  
31 - img: value.src,  
32 - url: value.url  
33 - });  
34 - });  
35 - return result; 15 + return {topBanner: data};
36 }; 16 };
37 17
38 /** 18 /**
@@ -347,7 +347,8 @@ exports.handleSaleOptsData = (params, total) => { @@ -347,7 +347,8 @@ exports.handleSaleOptsData = (params, total) => {
347 347
348 // 商品开始结束数 348 // 商品开始结束数
349 dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1; 349 dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1;
350 - dest.end = parseInt(dest.start, 10) + paramsLimit - 1; 350 + dest.end = (dest.pageCount === parseInt(params.page, 10)) ?
  351 + total : parseInt(dest.start, 10) + paramsLimit - 1;
351 352
352 return dest; 353 return dest;
353 }; 354 };
@@ -513,7 +513,8 @@ exports.handleSaleOptsData = (params, total, extra) => { @@ -513,7 +513,8 @@ exports.handleSaleOptsData = (params, total, extra) => {
513 513
514 // 商品开始结束数 514 // 商品开始结束数
515 dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1; 515 dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1;
516 - dest.end = parseInt(dest.start, 10) + paramsLimit - 1; 516 + dest.end = (dest.pageCount === parseInt(params.page, 10)) ?
  517 + total : parseInt(dest.start, 10) + paramsLimit - 1;
517 518
518 return dest; 519 return dest;
519 }; 520 };
@@ -217,6 +217,12 @@ exports.getSaleOthersData = (params, channel) => { @@ -217,6 +217,12 @@ exports.getSaleOthersData = (params, channel) => {
217 // 获取商品数据 217 // 获取商品数据
218 if (result[1].code === 200) { 218 if (result[1].code === 200) {
219 finalResult.goods = productProcess.processProductList(result[1].data.product_list); 219 finalResult.goods = productProcess.processProductList(result[1].data.product_list);
  220 +
  221 + // 处理所有商品标题数据
  222 + finalResult.saleTitle = {};
  223 +
  224 + finalResult.saleTitle.name = '所有商品';
  225 + finalResult.saleTitle.count = result[1].data.total;
220 } 226 }
221 227
222 // 获取焦点图数据 228 // 获取焦点图数据
@@ -237,12 +243,6 @@ exports.getSaleOthersData = (params, channel) => { @@ -237,12 +243,6 @@ exports.getSaleOthersData = (params, channel) => {
237 finalResult.opts = saleHandler.handleSaleOptsData(params, result[3].data.total); 243 finalResult.opts = saleHandler.handleSaleOptsData(params, result[3].data.total);
238 finalResult.totalCount = result[3].data.total; 244 finalResult.totalCount = result[3].data.total;
239 finalResult.pager = saleHandler.handleSalePagerData(result[3].data.total, params); 245 finalResult.pager = saleHandler.handleSalePagerData(result[3].data.total, params);
240 -  
241 - // 处理所有商品标题数据  
242 - finalResult.saleTitle = {};  
243 -  
244 - finalResult.saleTitle.name = '所有商品';  
245 - finalResult.saleTitle.count = finalResult.totalCount;  
246 } 246 }
247 247
248 if (!_.isEmpty(result[4])) { 248 if (!_.isEmpty(result[4])) {
@@ -370,18 +370,18 @@ exports.getSalebreakingYardsData = (params, channel) => { @@ -370,18 +370,18 @@ exports.getSalebreakingYardsData = (params, channel) => {
370 finalResult.totalCount = subResult[0].data.total; 370 finalResult.totalCount = subResult[0].data.total;
371 finalResult.pager = saleHandler.handleSalePagerData(subResult[0].data.total, params); 371 finalResult.pager = saleHandler.handleSalePagerData(subResult[0].data.total, params);
372 372
373 - // 处理所有商品标题数据  
374 - finalResult.saleTitle = {};  
375 -  
376 - finalResult.saleTitle.name = '所有商品';  
377 - finalResult.saleTitle.count = finalResult.totalCount;  
378 -  
379 } 373 }
380 374
381 // 处理商品数据 375 // 处理商品数据
382 if (subResult[1].code === 200) { 376 if (subResult[1].code === 200) {
383 finalResult.goods = productProcess.processProductList(subResult[1].data.product_list); 377 finalResult.goods = productProcess.processProductList(subResult[1].data.product_list);
384 378
  379 + // 处理所有商品标题数据
  380 + finalResult.saleTitle = {};
  381 +
  382 + finalResult.saleTitle.name = '所有商品';
  383 + finalResult.saleTitle.count = subResult[1].data.count;
  384 +
385 _.forEach(finalResult.goods, (value, key) => { 385 _.forEach(finalResult.goods, (value, key) => {
386 finalResult.goods[key].tags.isNew = false; // 屏蔽 new 标签 386 finalResult.goods[key].tags.isNew = false; // 屏蔽 new 标签
387 }); 387 });
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 <div class="outlets-page product-page yoho-page"> 2 <div class="outlets-page product-page yoho-page">
3 {{> common/main-banner}} 3 {{> common/main-banner}}
4 <div class="center-content"> 4 <div class="center-content">
  5 + {{#if column}}
5 <ul class="column-img-tab"> 6 <ul class="column-img-tab">
6 {{# column}} 7 {{# column}}
7 <li> 8 <li>
@@ -9,6 +10,8 @@ @@ -9,6 +10,8 @@
9 </li> 10 </li>
10 {{/ column}} 11 {{/ column}}
11 </ul> 12 </ul>
  13 + {{/if}}
  14 +
12 {{> outlets/limited-buy}} 15 {{> outlets/limited-buy}}
13 16
14 {{> outlets/near-over}} 17 {{> outlets/near-over}}
1 -{{!-- <pre>{{resultShow}}</pre> --}}  
2 <div class="outlets-special-page product-page yoho-page"> 1 <div class="outlets-special-page product-page yoho-page">
3 {{> common/main-banner}} 2 {{> common/main-banner}}
  3 +
4 <div class="center-content clearfix"> 4 <div class="center-content clearfix">
5 {{> common/special-head}} 5 {{> common/special-head}}
6 <div class="list-left left"> 6 <div class="list-left left">
1 {{# result}} 1 {{# result}}
2 <div class="sale-discount-page yoho-page center-content .new-sale-page"> 2 <div class="sale-discount-page yoho-page center-content .new-sale-page">
3 3
4 - {{#topBanner}}  
5 {{> sale/sale-banner}} 4 {{> sale/sale-banner}}
6 - {{/topBanner}}  
7 -  
8 - <div class="center-content clearfix">  
9 - {{#saleTitle}}  
10 - <div class="sale-title">  
11 - <span class="title">{{title}}</span>  
12 - {{#if discount}}  
13 - <span class="discount">{{discount}}</span>  
14 - {{/if}}  
15 - {{#if up}}  
16 -  
17 - {{/if}}  
18 - <div class="time pull-right">  
19 - <span class="iconfont">&#xe60a;</span>  
20 - <label class="time-calculate hidden" data="{{time}}"></label>  
21 - </div>  
22 - </div>  
23 - {{/saleTitle}}  
24 - <ul class="sort">  
25 - <li class="title">分类:</li>  
26 - {{#leftContent}}  
27 - {{#allSort}}  
28 - {{#list}}  
29 - <li class="{{#if checked}}active{{/if}}"><a href="{{href}}">{{name}} {{#if num}}({{num}}){{/if}}</a></li>  
30 - {{/list}}  
31 - {{/allSort}}  
32 - {{/leftContent}}  
33 - </ul>  
34 - </div>  
35 5
36 {{> sale/discount-center-content}} 6 {{> sale/discount-center-content}}
37 7
@@ -10,9 +10,8 @@ @@ -10,9 +10,8 @@
10 {{> sale/activity-entry}} 10 {{> sale/activity-entry}}
11 {{> sale/brand-sale}} 11 {{> sale/brand-sale}}
12 12
13 - <div class="home-page"> 13 +
14 {{> sale/sale-box}} 14 {{> sale/sale-box}}
15 - </div>  
16 15
17 </div> 16 </div>
18 {{/ result}} 17 {{/ result}}
1 -<div class="sale-list-banner"> 1 +{{# topBanner}}
  2 + {{#if list}}
  3 + <div class="sale-list-banner" style="height: 360px;">
2 <ul> 4 <ul>
3 {{# list}} 5 {{# list}}
4 <li class="banner-img" style="background:url({{image img 1920 360}}) no-repeat top center;"></li> 6 <li class="banner-img" style="background:url({{image img 1920 360}}) no-repeat top center;"></li>
5 {{/ list}} 7 {{/ list}}
6 </ul> 8 </ul>
7 -</div> 9 + </div>
  10 + {{/if}}
  11 +{{/topBanner}}
1 {{#saleCategory}} 1 {{#saleCategory}}
  2 + {{#if navItem}}
2 <div class="sale-box"> 3 <div class="sale-box">
3 <div class="floor-header clearfix"> 4 <div class="floor-header clearfix">
4 <h2 class="floor-title">{{title}}</h2> 5 <h2 class="floor-title">{{title}}</h2>
5 </div> 6 </div>
6 - <ul class="sale-nav" urlLocation="{{urlLocation}}" cursor:pointer> 7 + <ul class="sale-nav" urlLocation="{{urlLocation}}">
7 {{#navItem}} 8 {{#navItem}}
8 <li class="{{#vip}}green{{/vip}} {{#incompleteSize}}yellow{{/incompleteSize}} {{#newDiscount}}red{{/newDiscount}} {{#if @first}}active first{{/if}} {{#if @last}}last{{/if}}" urlLocation='{{urlLocation}}'>{{title}}</li> 9 <li class="{{#vip}}green{{/vip}} {{#incompleteSize}}yellow{{/incompleteSize}} {{#newDiscount}}red{{/newDiscount}} {{#if @first}}active first{{/if}} {{#if @last}}last{{/if}}" urlLocation='{{urlLocation}}'>{{title}}</li>
9 {{/navItem}} 10 {{/navItem}}
@@ -13,4 +14,5 @@ @@ -13,4 +14,5 @@
13 </ul> 14 </ul>
14 </div> 15 </div>
15 </div> 16 </div>
  17 + {{/if}}
16 {{/saleCategory}} 18 {{/saleCategory}}
1 -<div id="slider" class="slide-container {{#if pagination}}slide-thumb-container{{/if}}"> 1 +{{#topBanner}}
  2 + <div id="slider" class="slide-container {{#if pagination}}slide-thumb-container{{/if}}">
2 <div class="slide-wrapper"> 3 <div class="slide-wrapper">
3 <ul> 4 <ul>
4 {{# list}} 5 {{# list}}
@@ -33,5 +34,6 @@ @@ -33,5 +34,6 @@
33 </ul> 34 </ul>
34 </div> 35 </div>
35 {{/if}} 36 {{/if}}
36 -</div>  
37 -<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div> 37 + </div>
  38 + <div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
  39 +{{/topBanner}}
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 {{/if}} 21 {{/if}}
22 {{/ checkedConditions}} 22 {{/ checkedConditions}}
23 23
  24 + {{#if ../goods}}
24 {{#if channel}} 25 {{#if channel}}
25 <div class="channel section"> 26 <div class="channel section">
26 <span class="title">频道:</span> 27 <span class="title">频道:</span>
@@ -287,4 +288,5 @@ @@ -287,4 +288,5 @@
287 </div> 288 </div>
288 </div> 289 </div>
289 {{/if}} 290 {{/if}}
  291 + {{/if}}
290 </div> 292 </div>
This diff could not be displayed because it is too large.
@@ -7,28 +7,40 @@ exports.init = function(selector) { @@ -7,28 +7,40 @@ exports.init = function(selector) {
7 var $imgBrand = $(selector); 7 var $imgBrand = $(selector);
8 var slider = $imgBrand.unslider({ 8 var slider = $imgBrand.unslider({
9 autoplay: true, 9 autoplay: true,
10 - delay: 3000,  
11 - arrows: {  
12 -  
13 - },  
14 - nav: false,  
15 - animate: 'fade' 10 + delay: 5000,
  11 + arrows: false,
  12 + nav: false
16 }); 13 });
17 var imgBrandNum = $imgBrand.find('li').length; 14 var imgBrandNum = $imgBrand.find('li').length;
18 - var rows = imgBrandNum / 3; 15 + var cols = imgBrandNum / 3;
  16 + var changeSliderTimeout;
19 17
20 if (!($imgBrand.find('li').length % 3)) { 18 if (!($imgBrand.find('li').length % 3)) {
21 - rows -= 1; 19 + cols -= 1;
22 } 20 }
23 21
24 $imgBrand.find('li:nth-child(3n)').css('margin-right', 0); 22 $imgBrand.find('li:nth-child(3n)').css('margin-right', 0);
25 23
26 slider.on('unslider.change', function(event, index) { 24 slider.on('unslider.change', function(event, index) {
27 - if (index > rows) {  
28 - slider.unslider('animate:' + imgBrandNum); 25 + clearTimeout(changeSliderTimeout);
  26 + if (index >= cols) {
  27 + changeSliderTimeout = setTimeout(function() {
29 slider.unslider('animate:first'); 28 slider.unslider('animate:first');
  29 + }, 4999);
30 } 30 }
31 }); 31 });
32 32
33 - // TODO: 手动点击左右 33 + $('.img-brand-switch').on('click', '.prev', function() {
  34 + if (slider.data('unslider').current > cols || slider.data('unslider').current <= 0) {
  35 + slider.unslider('animate:' + cols);
  36 + } else {
  37 + slider.unslider('prev');
  38 + }
  39 + }).on('click', '.next', function() {
  40 + if (slider.data('unslider').current >= cols) {
  41 + slider.unslider('animate:first');
  42 + } else {
  43 + slider.unslider('next');
  44 + }
  45 + });
34 }; 46 };
@@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
75 .title { 75 .title {
76 font-size: 16px; 76 font-size: 16px;
77 margin: 28px 0 14px; 77 margin: 28px 0 14px;
  78 + padding: 0 8px;
78 font-weight: bold; 79 font-weight: bold;
79 } 80 }
80 81
@@ -149,6 +150,17 @@ @@ -149,6 +150,17 @@
149 .good-item { 150 .good-item {
150 padding: 15px; 151 padding: 15px;
151 } 152 }
  153 +
  154 + .good-item > a {
  155 + width: 90px;
  156 + height: 120px;
  157 + display: inline-block;
  158 + }
  159 +
  160 + .good-item > img {
  161 + width: 100%;
  162 + height: 100%;
  163 + }
152 } 164 }
153 165
154 .item-text { 166 .item-text {