Authored by yyq

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

@@ -496,7 +496,9 @@ exports.handleSaleFilterData = (origin, params) => { @@ -496,7 +496,9 @@ exports.handleSaleFilterData = (origin, params) => {
496 return o.index; 496 return o.index;
497 }); 497 });
498 498
499 - // 处理 价格 筛选数据 499 + // 处理价格筛选数据
  500 + let priceRangechecked = false;
  501 +
500 if (!_.isEmpty(origin.priceRange)) { 502 if (!_.isEmpty(origin.priceRange)) {
501 _.forEach(origin.priceRange, (value, key) => { 503 _.forEach(origin.priceRange, (value, key) => {
502 let price = { 504 let price = {
@@ -509,6 +511,20 @@ exports.handleSaleFilterData = (origin, params) => { @@ -509,6 +511,20 @@ exports.handleSaleFilterData = (origin, params) => {
509 }); 511 });
510 } 512 }
511 513
  514 + // 处理用户自主填写的价格区间
  515 + if (!priceRangechecked && params.price) {
  516 + let customPrice = _.split(params.price, ',');
  517 +
  518 + dest.customPrice = {
  519 + min: customPrice[0],
  520 + max: customPrice[1]
  521 + };
  522 + dest.checkedConditions.conditions.push({
  523 + name: '¥ ' + customPrice[0] + '-' + customPrice[1],
  524 + href: handleFilterUrl(params, {price: ''})
  525 + });
  526 + }
  527 +
512 // 处理性别数据 528 // 处理性别数据
513 dest.gender = [ 529 dest.gender = [
514 { 530 {
@@ -83,7 +83,7 @@ exports.handleSaleActivityData = (origin, channel) => { @@ -83,7 +83,7 @@ exports.handleSaleActivityData = (origin, channel) => {
83 _.forEach(origin, function(value, key) { 83 _.forEach(origin, function(value, key) {
84 let activity = { 84 let activity = {
85 link: helpers.urlFormat('/product/sale/discount/detail', {id: value.id, channel: channel}), 85 link: helpers.urlFormat('/product/sale/discount/detail', {id: value.id, channel: channel}),
86 - img: value.cover_url, 86 + img: value.web_cover_url,
87 time: processTime(parseInt(value.left_time, 10) * 1000), 87 time: processTime(parseInt(value.left_time, 10) * 1000),
88 brand: value.logo_url, 88 brand: value.logo_url,
89 title: value.title 89 title: value.title
@@ -86,19 +86,27 @@ exports.getSaleGoodsData = (params) => { @@ -86,19 +86,27 @@ exports.getSaleGoodsData = (params) => {
86 86
87 switch (userInfo.curLevel) { 87 switch (userInfo.curLevel) {
88 case '1': 88 case '1':
89 - finalResult.goods[key].salePrice = value.vip1Price;  
90 - finalResult.goods[key].vip1 = true; 89 + finalResult.goods[key] = {
  90 + salePrice: value.vip1Price,
  91 + vip1: true
  92 + };
91 break; 93 break;
92 case '2': 94 case '2':
93 - finalResult.goods[key].salePrice = value.vip2Price;  
94 - finalResult.goods[key].vip2 = true; 95 + finalResult.goods[key] = {
  96 + salePrice: value.vip2Price,
  97 + vip2: true
  98 + };
95 break; 99 break;
96 case '3': 100 case '3':
97 - finalResult.goods[key].salePrice = value.vip3Price;  
98 - finalResult.goods[key].vip3 = true; 101 + finalResult.goods[key] = {
  102 + salePrice: value.vip3Price,
  103 + vip3: true
  104 + };
99 break; 105 break;
100 default: 106 default:
101 - finalResult.goods[key].vip = true; 107 + finalResult.goods[key] = {
  108 + vip: true
  109 + };
102 delete finalResult.goods[key].salesPrice; 110 delete finalResult.goods[key].salesPrice;
103 break; 111 break;
104 } 112 }
@@ -285,6 +293,8 @@ exports.getSaleOthersData = (params, channel) => { @@ -285,6 +293,8 @@ exports.getSaleOthersData = (params, channel) => {
285 delete finalResult.goods[key].tags.isSale;// 屏蔽 sale 标签 293 delete finalResult.goods[key].tags.isSale;// 屏蔽 sale 标签
286 delete finalResult.goods[key].discount; // 屏蔽折扣信息 294 delete finalResult.goods[key].discount; // 屏蔽折扣信息
287 }); 295 });
  296 + } else {
  297 + logger.error('goods list api code no 200');
288 } 298 }
289 299
290 // 获取焦点图数据 300 // 获取焦点图数据
@@ -317,19 +327,27 @@ exports.getSaleOthersData = (params, channel) => { @@ -317,19 +327,27 @@ exports.getSaleOthersData = (params, channel) => {
317 327
318 switch (userInfo.curLevel) { 328 switch (userInfo.curLevel) {
319 case '1': 329 case '1':
320 - finalResult.goods[key].salePrice = value.vip1_price;  
321 - finalResult.goods[key].vip1 = true; 330 + finalResult.goods[key] = {
  331 + salePrice: value.vip1_price,
  332 + vip1: true
  333 + };
322 break; 334 break;
323 case '2': 335 case '2':
324 - finalResult.goods[key].salePrice = value.vip2_price;  
325 - finalResult.goods[key].vip2 = true; 336 + finalResult.goods[key] = {
  337 + salePrice: value.vip2_price,
  338 + vip2: true
  339 + };
326 break; 340 break;
327 case '3': 341 case '3':
328 - finalResult.goods[key].salePrice = value.vip3_price;  
329 - finalResult.goods[key].vip3 = true; 342 + finalResult.goods[key] = {
  343 + salePrice: value.vip3_price,
  344 + vip3: true
  345 + };
330 break; 346 break;
331 default: 347 default:
332 - finalResult.goods[key].vip = true; 348 + finalResult.goods[key] = {
  349 + vip: true
  350 + };
333 delete finalResult.goods[key].salesPrice; 351 delete finalResult.goods[key].salesPrice;
334 break; 352 break;
335 } 353 }
@@ -378,10 +396,11 @@ exports.getSaleDiscountData = (params, channel) => { @@ -378,10 +396,11 @@ exports.getSaleDiscountData = (params, channel) => {
378 finalResult.saleTitle = saleHandler.handleDiscountTitleData(result[2].data[0]); 396 finalResult.saleTitle = saleHandler.handleDiscountTitleData(result[2].data[0]);
379 if (result[2].data[0].web_url) { 397 if (result[2].data[0].web_url) {
380 finalResult.topBanner = { 398 finalResult.topBanner = {
381 - list: []  
382 - };  
383 - finalResult.topBanner.list[0] = {  
384 - img: result[2].data[0].web_url 399 + list: [
  400 + {
  401 + img: result[2].data[0].web_url
  402 + }
  403 + ]
385 }; 404 };
386 } else { 405 } else {
387 logger.error('discount activity data[0] web_url empty'); 406 logger.error('discount activity data[0] web_url empty');