Authored by 王水玲

Merge branch 'feature/camelCase' of git.yoho.cn:fe/yohobuywap-node into feature/camelCase

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 var api = global.yoho.API; 3 var api = global.yoho.API;
4 4
5 -const camelCase = global.yoho.camelCase; 5 +// const camelCase = global.yoho.camelCase;
6 const helpers = global.yoho.helpers; 6 const helpers = global.yoho.helpers;
7 const _ = require('lodash'); 7 const _ = require('lodash');
8 8
@@ -16,7 +16,7 @@ const getPreferenceData = (data) => { @@ -16,7 +16,7 @@ const getPreferenceData = (data) => {
16 16
17 let list = data.data || {}; 17 let list = data.data || {};
18 18
19 - list = camelCase(list); 19 + // list = camelCase(list);
20 20
21 let distGoods = []; 21 let distGoods = [];
22 22
@@ -27,20 +27,33 @@ const getPreferenceData = (data) => { @@ -27,20 +27,33 @@ const getPreferenceData = (data) => {
27 } 27 }
28 value.goodsId = value.goodsList[0].goodsId; 28 value.goodsId = value.goodsList[0].goodsId;
29 29
30 - let goods = value; 30 + // let goods = value;
  31 +
  32 + let goods = [];
  33 +
  34 + goods.push({
  35 + productSkn: value.product_skn,
  36 + productName: value.product_name,
  37 + defaultImages: value.default_images,
  38 + isSoonSoldOut: value.is_soon_sold_out,
  39 + url: helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`),
  40 + marketPrice: value.market_price,
  41 + salesPrice: value.sales_price
  42 + });
  43 +
  44 + // goods.url = helpers.urlFormat(`/product/pro_${value.product_id}_${value.goodsId}/${value.cn_alphabet}.html`);
31 45
32 - goods.url = helpers.urlFormat(`/product/pro_${value.productId}_${value.goodsId}/${value.cnAlphabet}.html`);  
33 if (_.get(goods, 'tags[0]', null)) { 46 if (_.get(goods, 'tags[0]', null)) {
34 goods.tags = []; 47 goods.tags = [];
35 if (goods.isNew === 'Y') { 48 if (goods.isNew === 'Y') {
36 - goods.tags.push({isNew: true});  
37 - } else if (goods.isAdvance === 'Y') { 49 + goods.tags.push({is_new: true});
  50 + } else if (goods.is_advance === 'Y') {
38 goods.tags.push({isAdvance: true}); 51 goods.tags.push({isAdvance: true});
39 - } else if (goods.isDiscount === 'Y') { 52 + } else if (goods.is_discount === 'Y') {
40 goods.tags.push({isDiscount: true}); 53 goods.tags.push({isDiscount: true});
41 - } else if (goods.isYohoood === 'Y') { 54 + } else if (goods.is_yohoood === 'Y') {
42 goods.tags.push({isYohoood: true}); 55 goods.tags.push({isYohoood: true});
43 - } else if (goods.isLimited === 'Y') { 56 + } else if (goods.is_limited === 'Y') {
44 goods.tags.push({isLimited: true}); 57 goods.tags.push({isLimited: true});
45 } 58 }
46 } 59 }
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 line-height: 1; 44 line-height: 1;
45 45
46 .sale-price { 46 .sale-price {
47 - display: block; 47 + /*display: block;*/
48 margin-right: 8px; 48 margin-right: 8px;
49 color: #d9134f; 49 color: #d9134f;
50 } 50 }