移除商品sale相关页面、商品详情页、首页频道页、分类页、星潮教室的camelCase
Showing
27 changed files
with
205 additions
and
219 deletions
@@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
7 | const _ = require('lodash'); | 7 | const _ = require('lodash'); |
8 | const api = global.yoho.API; | 8 | const api = global.yoho.API; |
9 | const helpers = global.yoho.helpers; | 9 | const helpers = global.yoho.helpers; |
10 | -const camelCase = global.yoho.camelCase; | ||
11 | 10 | ||
12 | const genderMap = { | 11 | const genderMap = { |
13 | boys: '1,3', | 12 | boys: '1,3', |
@@ -27,7 +26,6 @@ let _processCateData = (list, channel) => { | @@ -27,7 +26,6 @@ let _processCateData = (list, channel) => { | ||
27 | }; | 26 | }; |
28 | }); | 27 | }); |
29 | 28 | ||
30 | - list = camelCase(list); | ||
31 | _.map(list, function(item, key) { | 29 | _.map(list, function(item, key) { |
32 | item.focus = key === channel; | 30 | item.focus = key === channel; |
33 | 31 | ||
@@ -36,24 +34,24 @@ let _processCateData = (list, channel) => { | @@ -36,24 +34,24 @@ let _processCateData = (list, channel) => { | ||
36 | if (firstItem.sub && firstItem.sub.length) { | 34 | if (firstItem.sub && firstItem.sub.length) { |
37 | _.map(firstItem.sub, function(secondItem) { | 35 | _.map(firstItem.sub, function(secondItem) { |
38 | secondItem.url = helpers.urlFormat('/', { | 36 | secondItem.url = helpers.urlFormat('/', { |
39 | - sort: _.get(secondItem, 'relationParameter.sort'), | ||
40 | - sort_name: secondItem.categoryName, | 37 | + sort: _.get(secondItem, 'relation_parameter.sort'), |
38 | + sort_name: secondItem.category_name, | ||
41 | gender: genderMap[key] || '' | 39 | gender: genderMap[key] || '' |
42 | }, 'list'); | 40 | }, 'list'); |
43 | }); | 41 | }); |
44 | 42 | ||
45 | firstItem.sub.unshift({ | 43 | firstItem.sub.unshift({ |
46 | - categoryName: `全部${firstItem.categoryName}`, | 44 | + category_name: `全部${firstItem.category_name}`, |
47 | url: helpers.urlFormat('/', { | 45 | url: helpers.urlFormat('/', { |
48 | - sort: _.get(firstItem, 'relationParameter.sort'), | ||
49 | - sort_name: firstItem.categoryName, | 46 | + sort: _.get(firstItem, 'relation_parameter.sort'), |
47 | + sort_name: firstItem.category_name, | ||
50 | gender: genderMap[key] || '' | 48 | gender: genderMap[key] || '' |
51 | }, 'list') | 49 | }, 'list') |
52 | }); | 50 | }); |
53 | } else { | 51 | } else { |
54 | firstItem.url = helpers.urlFormat('/', { | 52 | firstItem.url = helpers.urlFormat('/', { |
55 | - sort: _.get(firstItem, 'relationParameter.sort'), | ||
56 | - sort_name: firstItem.categoryName, | 53 | + sort: _.get(firstItem, 'relation_parameter.sort'), |
54 | + sort_name: firstItem.category_name, | ||
57 | gender: genderMap[key] || '' | 55 | gender: genderMap[key] || '' |
58 | }, 'list'); | 56 | }, 'list'); |
59 | } | 57 | } |
@@ -8,7 +8,6 @@ const utils = '../../../utils'; | @@ -8,7 +8,6 @@ const utils = '../../../utils'; | ||
8 | const contentCodeConfig = require('../../../config/content-code'); | 8 | const contentCodeConfig = require('../../../config/content-code'); |
9 | const _ = require('lodash'); | 9 | const _ = require('lodash'); |
10 | const api = global.yoho.ServiceAPI; | 10 | const api = global.yoho.ServiceAPI; |
11 | -const camelCase = global.yoho.camelCase; | ||
12 | const logger = global.yoho.logger; | 11 | const logger = global.yoho.logger; |
13 | const resourcesProcess = require(`${utils}/resources-process`); | 12 | const resourcesProcess = require(`${utils}/resources-process`); |
14 | 13 | ||
@@ -87,13 +86,12 @@ const _processSideBar = (list, choosed) => { | @@ -87,13 +86,12 @@ const _processSideBar = (list, choosed) => { | ||
87 | let offset = 0; // 分割数组用到的游标 | 86 | let offset = 0; // 分割数组用到的游标 |
88 | 87 | ||
89 | list = list || []; | 88 | list = list || []; |
90 | - list = camelCase(list); | ||
91 | 89 | ||
92 | _.forEach(list, (item, i) => { | 90 | _.forEach(list, (item, i) => { |
93 | if (item.sub) { | 91 | if (item.sub) { |
94 | item.sub.unshift({ | 92 | item.sub.unshift({ |
95 | - sortName: item.sortName, | ||
96 | - sortNameEn: item.sortNameEn, | 93 | + sort_name: item.sort_name, |
94 | + sort_name_en: item.sort_name_en, | ||
97 | back: true, | 95 | back: true, |
98 | isSelect: false, | 96 | isSelect: false, |
99 | bgColor: _getSidebarColor(choosed) | 97 | bgColor: _getSidebarColor(choosed) |
@@ -101,7 +99,7 @@ const _processSideBar = (list, choosed) => { | @@ -101,7 +99,7 @@ const _processSideBar = (list, choosed) => { | ||
101 | } | 99 | } |
102 | 100 | ||
103 | // 如果有分隔符,分割数组 | 101 | // 如果有分隔符,分割数组 |
104 | - if (item.separativeSign === 'Y') { | 102 | + if (item.separative_sign === 'Y') { |
105 | formatData.push(list.slice(offset, i)); | 103 | formatData.push(list.slice(offset, i)); |
106 | offset = i; | 104 | offset = i; |
107 | } | 105 | } |
@@ -180,16 +178,16 @@ const _getChannelList = () => { | @@ -180,16 +178,16 @@ const _getChannelList = () => { | ||
180 | 178 | ||
181 | list.channelList = []; | 179 | list.channelList = []; |
182 | list.yohood = {}; | 180 | list.yohood = {}; |
183 | - result.data.list = camelCase(result.data.list || []); | 181 | + result.data.list = result.data.list || []; |
184 | 182 | ||
185 | _.forEach(result.data.list, function(item) { | 183 | _.forEach(result.data.list, function(item) { |
186 | - const channel = channelList[item.yhChannel - 1]; | 184 | + const channel = channelList[item.yh_channel - 1]; |
187 | 185 | ||
188 | if (channel) { | 186 | if (channel) { |
189 | list.channelList.push(channel); | 187 | list.channelList.push(channel); |
190 | } | 188 | } |
191 | 189 | ||
192 | - if (_.toNumber(item.yhChannel) === 5) { | 190 | + if (_.toNumber(item.yh_channel) === 5) { |
193 | list.yohood.showYohood = true; | 191 | list.yohood.showYohood = true; |
194 | list.yohood.yohoodHref = 'http://www.yohood.cn'; | 192 | list.yohood.yohoodHref = 'http://www.yohood.cn'; |
195 | } | 193 | } |
@@ -20,9 +20,9 @@ | @@ -20,9 +20,9 @@ | ||
20 | {{# this}} | 20 | {{# this}} |
21 | <li class="p-level-item{{#if @first}} focus{{/if}}"> | 21 | <li class="p-level-item{{#if @first}} focus{{/if}}"> |
22 | {{#if url}} | 22 | {{#if url}} |
23 | - <a href={{url}}> {{categoryName}}</a> | 23 | + <a href={{url}}> {{category_name}}</a> |
24 | {{^}} | 24 | {{^}} |
25 | - {{categoryName}} | 25 | + {{category_name}} |
26 | {{/if}} | 26 | {{/if}} |
27 | </li> | 27 | </li> |
28 | {{/ this}} | 28 | {{/ this}} |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | {{# sub}} | 33 | {{# sub}} |
34 | <li> | 34 | <li> |
35 | <a href={{url}}> | 35 | <a href={{url}}> |
36 | - {{categoryName}} | 36 | + {{category_name}} |
37 | </a> | 37 | </a> |
38 | </li> | 38 | </li> |
39 | {{/ sub}} | 39 | {{/ sub}} |
@@ -2,20 +2,20 @@ | @@ -2,20 +2,20 @@ | ||
2 | {{#sideNav}} | 2 | {{#sideNav}} |
3 | <ul {{#if @first}}class="first"{{/if}}> | 3 | <ul {{#if @first}}class="first"{{/if}}> |
4 | {{#this}} | 4 | {{#this}} |
5 | - <li class="{{lowerCase sortNameEn}}"> | ||
6 | - {{#if sortUrl}} | ||
7 | - <a href="{{sortUrl}}" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | 5 | + <li class="{{lowerCase sort_name_en}}"> |
6 | + {{#if sort_url}} | ||
7 | + <a href="{{sort_url}}" style="{{#if sort_name_color}}color:{{sort_name_color}};{{/if}}"> | ||
8 | {{else}} | 8 | {{else}} |
9 | - <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | 9 | + <a href="javascript:;" style="{{#if sort_name_color}}color:{{sort_name_color}};{{/if}}"> |
10 | {{/if}} | 10 | {{/if}} |
11 | - {{# sortIco}} | 11 | + {{# sort_ico}} |
12 | <span class="nav-img" style="background-image: url({{image . 60 60}})"></span> | 12 | <span class="nav-img" style="background-image: url({{image . 60 60}})"></span> |
13 | - {{/ sortIco}} | ||
14 | - {{^ sortIco}} | 13 | + {{/ sort_ico}} |
14 | + {{^ sort_ico}} | ||
15 | <i class="nav-icon"></i> | 15 | <i class="nav-icon"></i> |
16 | - {{/ sortIco}} | ||
17 | - <em>{{sortName}}</em> | ||
18 | - <span class="title">{{sortNameEn}}</span> | 16 | + {{/ sort_ico}} |
17 | + <em>{{sort_name}}</em> | ||
18 | + <span class="title">{{sort_name_en}}</span> | ||
19 | {{# sub}} | 19 | {{# sub}} |
20 | <span class="enter-subnav iconfont"></span> | 20 | <span class="enter-subnav iconfont"></span> |
21 | {{/ sub}} | 21 | {{/ sub}} |
@@ -24,16 +24,16 @@ | @@ -24,16 +24,16 @@ | ||
24 | <ul class="sub-nav"> | 24 | <ul class="sub-nav"> |
25 | {{# sub}} | 25 | {{# sub}} |
26 | <li class="{{# isSelect}}current{{/ isSelect}}" style="background-color:{{bgColor}};"> | 26 | <li class="{{# isSelect}}current{{/ isSelect}}" style="background-color:{{bgColor}};"> |
27 | - {{#if sortUrl}} | ||
28 | - <a href="{{sortUrl}}" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | 27 | + {{#if sort_url}} |
28 | + <a href="{{sort_url}}" style="{{#if sort_name_color}}color:{{sort_name_color}};{{/if}}"> | ||
29 | {{else}} | 29 | {{else}} |
30 | - <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | 30 | + <a href="javascript:;" style="{{#if sort_name_color}}color:{{sort_name_color}};{{/if}}"> |
31 | {{/if}} | 31 | {{/if}} |
32 | {{# back}} | 32 | {{# back}} |
33 | <i class="nav-back iconfont"></i> | 33 | <i class="nav-back iconfont"></i> |
34 | {{/ back}} | 34 | {{/ back}} |
35 | - <em>{{sortName}}</em> | ||
36 | - <span class="title">{{sortNameEn}}</span> | 35 | + <em>{{sort_name}}</em> |
36 | + <span class="title">{{sort_name_en}}</span> | ||
37 | </a> | 37 | </a> |
38 | </li> | 38 | </li> |
39 | {{/ sub}} | 39 | {{/ sub}} |
@@ -11,7 +11,6 @@ const api = global.yoho.API; | @@ -11,7 +11,6 @@ const api = global.yoho.API; | ||
11 | const serviceAPI = global.yoho.ServiceAPI; | 11 | const serviceAPI = global.yoho.ServiceAPI; |
12 | const singleAPI = global.yoho.SingleAPI; | 12 | const singleAPI = global.yoho.SingleAPI; |
13 | const helpers = global.yoho.helpers; | 13 | const helpers = global.yoho.helpers; |
14 | -const camelCase = global.yoho.camelCase; | ||
15 | const _ = require('lodash'); | 14 | const _ = require('lodash'); |
16 | 15 | ||
17 | /** | 16 | /** |
@@ -102,8 +102,8 @@ const getResources = (params, options) => { | @@ -102,8 +102,8 @@ const getResources = (params, options) => { | ||
102 | 102 | ||
103 | list = { | 103 | list = { |
104 | title: res.data.title, | 104 | title: res.data.title, |
105 | - moreUrl: res.data.more_url, | ||
106 | - moreName: res.data.more_name, | 105 | + more_url: res.data.more_url, |
106 | + more_name: res.data.more_name, | ||
107 | image: res.data.image | 107 | image: res.data.image |
108 | }; | 108 | }; |
109 | 109 | ||
@@ -112,8 +112,8 @@ const getResources = (params, options) => { | @@ -112,8 +112,8 @@ const getResources = (params, options) => { | ||
112 | case 'titleFloor': | 112 | case 'titleFloor': |
113 | list = { | 113 | list = { |
114 | name: res.data.title.name, | 114 | name: res.data.title.name, |
115 | - moreUrl: res.data.title.more_url, | ||
116 | - moreName: res.data.title.more_name | 115 | + more_url: res.data.title.more_url, |
116 | + more_name: res.data.title.more_name | ||
117 | }; | 117 | }; |
118 | 118 | ||
119 | if (res.data.title.name === '热门商品') { | 119 | if (res.data.title.name === '热门商品') { |
@@ -8,7 +8,6 @@ const utils = '../../../utils'; | @@ -8,7 +8,6 @@ const utils = '../../../utils'; | ||
8 | const contentCodeConfig = require('../../../config/content-code'); | 8 | const contentCodeConfig = require('../../../config/content-code'); |
9 | const resourcesProcess = require(`${utils}/resources-process`); | 9 | const resourcesProcess = require(`${utils}/resources-process`); |
10 | const logger = global.yoho.logger; | 10 | const logger = global.yoho.logger; |
11 | -const camelCase = global.yoho.camelCase; | ||
12 | const helpers = global.yoho.helpers; | 11 | const helpers = global.yoho.helpers; |
13 | const _ = require('lodash'); | 12 | const _ = require('lodash'); |
14 | const serviceAPI = global.yoho.ServiceAPI; | 13 | const serviceAPI = global.yoho.ServiceAPI; |
@@ -49,7 +48,6 @@ const _processIndexData = (dataList) => { | @@ -49,7 +48,6 @@ const _processIndexData = (dataList) => { | ||
49 | 48 | ||
50 | let list = dataList.data || {}; | 49 | let list = dataList.data || {}; |
51 | 50 | ||
52 | - list = camelCase(list); | ||
53 | 51 | ||
54 | formatData.md5 = dataList.md5; | 52 | formatData.md5 = dataList.md5; |
55 | 53 | ||
@@ -97,8 +95,8 @@ const _processIndexData = (dataList) => { | @@ -97,8 +95,8 @@ const _processIndexData = (dataList) => { | ||
97 | title: data.title, | 95 | title: data.title, |
98 | articeTxt: data.intro, | 96 | articeTxt: data.intro, |
99 | src: data.src, | 97 | src: data.src, |
100 | - publishTime: helpers.dateFormat('MM月DD日 hh:mm', data.publishTime), | ||
101 | - viewsNum: data.viewsNum | 98 | + publish_time: helpers.dateFormat('MM月DD日 hh:mm', data.publish_time), |
99 | + views_num: data.views_num | ||
102 | }, avatar)); | 100 | }, avatar)); |
103 | }); | 101 | }); |
104 | } | 102 | } |
@@ -131,11 +129,10 @@ const _processGuangData = (list, flag) => { | @@ -131,11 +129,10 @@ const _processGuangData = (list, flag) => { | ||
131 | const formatData = []; | 129 | const formatData = []; |
132 | 130 | ||
133 | list = list || []; | 131 | list = list || []; |
134 | - list = camelCase(list); | ||
135 | 132 | ||
136 | _.forEach(list, (data, key) => { | 133 | _.forEach(list, (data, key) => { |
137 | if (flag) { | 134 | if (flag) { |
138 | - data.publishTime = helpers.dateFormat('MM月DD日 hh:mm', data.publishTime); | 135 | + data.publish_time = helpers.dateFormat('MM月DD日 hh:mm', data.publish_time); |
139 | } | 136 | } |
140 | 137 | ||
141 | if (data.isFavor === 'N') { | 138 | if (data.isFavor === 'N') { |
@@ -94,8 +94,8 @@ | @@ -94,8 +94,8 @@ | ||
94 | </div> | 94 | </div> |
95 | </div> | 95 | </div> |
96 | <div class="artice-o"> | 96 | <div class="artice-o"> |
97 | - <span class="time"><i class="iconfont time-ico"></i>{{publishTime}}</span> | ||
98 | - <span class="see"><i class="iconfont see-ico"></i>{{viewsNum}}</span> | 97 | + <span class="time"><i class="iconfont time-ico"></i>{{publish_time}}</span> |
98 | + <span class="see"><i class="iconfont see-ico"></i>{{views_num}}</span> | ||
99 | </div> | 99 | </div> |
100 | </a> | 100 | </a> |
101 | </li> | 101 | </li> |
@@ -15,8 +15,8 @@ | @@ -15,8 +15,8 @@ | ||
15 | <a href="{{url}}"><h2 class="title">{{title}}</h2></a> | 15 | <a href="{{url}}"><h2 class="title">{{title}}</h2></a> |
16 | <p class="cont-txt">{{intro}}</p> | 16 | <p class="cont-txt">{{intro}}</p> |
17 | <div class="count-area"> | 17 | <div class="count-area"> |
18 | - <span class="time"><i class="iconfont time-ico"></i>{{publishTime}}</span> | ||
19 | - <span class="see"><i class="iconfont see-ico"></i>{{viewsNum}}</span> | 18 | + <span class="time"><i class="iconfont time-ico"></i>{{publish_time}}</span> |
19 | + <span class="see"><i class="iconfont see-ico"></i>{{views_num}}</span> | ||
20 | 20 | ||
21 | {{#if share.url}} | 21 | {{#if share.url}} |
22 | <a href="{{share.url}}" class="iconfont forward"></a> | 22 | <a href="{{share.url}}" class="iconfont forward"></a> |
@@ -35,7 +35,7 @@ const _reviewStatus = (res, req, uid, status) => { | @@ -35,7 +35,7 @@ const _reviewStatus = (res, req, uid, status) => { | ||
35 | installmentOnly: { | 35 | installmentOnly: { |
36 | title: { | 36 | title: { |
37 | title: '分期专享', | 37 | title: '分期专享', |
38 | - moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { | 38 | + more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { |
39 | title: '分期专享' | 39 | title: '分期专享' |
40 | }) | 40 | }) |
41 | }, | 41 | }, |
@@ -101,7 +101,7 @@ const index = (req, res) => { | @@ -101,7 +101,7 @@ const index = (req, res) => { | ||
101 | let installmentOnly = { | 101 | let installmentOnly = { |
102 | title: { | 102 | title: { |
103 | title: '分期专享', | 103 | title: '分期专享', |
104 | - moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { | 104 | + more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', { |
105 | title: '分期专享' | 105 | title: '分期专享' |
106 | }) | 106 | }) |
107 | }, | 107 | }, |
@@ -102,6 +102,7 @@ let breakingYards = (req, res, next) => { | @@ -102,6 +102,7 @@ let breakingYards = (req, res, next) => { | ||
102 | saleModel.getBreakCodeData({ | 102 | saleModel.getBreakCodeData({ |
103 | yhChannel: params.channel | 103 | yhChannel: params.channel |
104 | }).then((result) => { | 104 | }).then((result) => { |
105 | + | ||
105 | res.render('sale/break-code', Object.assign(params.renderData, result)); | 106 | res.render('sale/break-code', Object.assign(params.renderData, result)); |
106 | }).catch(next); | 107 | }).catch(next); |
107 | }; | 108 | }; |
@@ -135,6 +136,7 @@ let discountDetail = (req, res, next) => { | @@ -135,6 +136,7 @@ let discountDetail = (req, res, next) => { | ||
135 | 136 | ||
136 | saleModel.getDiscountDetailData(id, req.yoho.channel).then((result) => { | 137 | saleModel.getDiscountDetailData(id, req.yoho.channel).then((result) => { |
137 | params.renderData.pageHeader.navTitle = result.title; | 138 | params.renderData.pageHeader.navTitle = result.title; |
139 | + | ||
138 | res.render('sale/discount-detail', Object.assign(params.renderData, result)); | 140 | res.render('sale/discount-detail', Object.assign(params.renderData, result)); |
139 | }).catch(next); | 141 | }).catch(next); |
140 | }; | 142 | }; |
@@ -193,7 +195,7 @@ let search = (req, res, next) => { | @@ -193,7 +195,7 @@ let search = (req, res, next) => { | ||
193 | } | 195 | } |
194 | 196 | ||
195 | saleModel.getSearchData(params, uid).then((result) => { | 197 | saleModel.getSearchData(params, uid).then((result) => { |
196 | - let vipLevel = result[1].curLevel; | 198 | + let vipLevel = result[1].cur_level; |
197 | let vipObj = {}; | 199 | let vipObj = {}; |
198 | 200 | ||
199 | if (req.query.saleType === '2') { | 201 | if (req.query.saleType === '2') { |
@@ -222,11 +222,11 @@ const _getLimitCodeUrl = (productCode, skn, ua) => { | @@ -222,11 +222,11 @@ const _getLimitCodeUrl = (productCode, skn, ua) => { | ||
222 | // if (origin.productPriceBo) { | 222 | // if (origin.productPriceBo) { |
223 | // let originPrice = origin.productPriceBo; | 223 | // let originPrice = origin.productPriceBo; |
224 | // let goodsPrice = { | 224 | // let goodsPrice = { |
225 | -// currentPrice: originPrice.formatSalesPrice | 225 | +// currentPrice: originPrice.format_sales_price |
226 | // }; | 226 | // }; |
227 | 227 | ||
228 | -// if (originPrice.formatMarketPrice !== originPrice.formatSalesPrice) { | ||
229 | -// goodsPrice.previousPrice = originPrice.formatMarketPrice; | 228 | +// if (originPrice.format_market_price !== originPrice.format_sales_price) { |
229 | +// goodsPrice.previousPrice = originPrice.format_market_price; | ||
230 | // } | 230 | // } |
231 | 231 | ||
232 | // dest.goodsPrice = goodsPrice; | 232 | // dest.goodsPrice = goodsPrice; |
@@ -566,12 +566,12 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -566,12 +566,12 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
566 | totalStorageNum = 0; | 566 | totalStorageNum = 0; |
567 | 567 | ||
568 | // 商品名称 | 568 | // 商品名称 |
569 | - if (!origin.productName) { | 569 | + if (!origin.product_name) { |
570 | dest.feedbacks = {}; | 570 | dest.feedbacks = {}; |
571 | return dest; | 571 | return dest; |
572 | } | 572 | } |
573 | 573 | ||
574 | - dest.goodsName = origin.productName; | 574 | + dest.goodsName = origin.product_name; |
575 | 575 | ||
576 | // 是否是虚拟商品 | 576 | // 是否是虚拟商品 |
577 | dest.virtualGoods = (origin.attribute * 1 === 3); | 577 | dest.virtualGoods = (origin.attribute * 1 === 3); |
@@ -579,12 +579,12 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -579,12 +579,12 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
579 | // 用户未登录时 | 579 | // 用户未登录时 |
580 | if (!uid) { | 580 | if (!uid) { |
581 | dest.loginUrl = helpers.urlFormat('/signin.html', { | 581 | dest.loginUrl = helpers.urlFormat('/signin.html', { |
582 | - refer: helpers.urlFormat('/product/show_' + origin.productSkn + '.html') | 582 | + refer: helpers.urlFormat('/product/show_' + origin.product_skn + '.html') |
583 | }); | 583 | }); |
584 | } | 584 | } |
585 | 585 | ||
586 | // 商品促销短语 | 586 | // 商品促销短语 |
587 | - origin.salesPhrase && (dest.goodsSubtitle = origin.salesPhrase); | 587 | + origin.sales_phrase && (dest.goodsSubtitle = origin.sales_phrase); |
588 | 588 | ||
589 | // 促销信息 TODO: 换新接口 | 589 | // 促销信息 TODO: 换新接口 |
590 | if (origin.promotionBoList) { | 590 | if (origin.promotionBoList) { |
@@ -614,11 +614,11 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -614,11 +614,11 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
614 | 614 | ||
615 | // 商品价格 | 615 | // 商品价格 |
616 | let goodsPrice = { | 616 | let goodsPrice = { |
617 | - currentPrice: origin.formatSalesPrice === '0' ? origin.formatMarketPrice : origin.formatSalesPrice | 617 | + currentPrice: origin.format_sales_price === '0' ? origin.format_market_price : origin.format_sales_price |
618 | }; | 618 | }; |
619 | 619 | ||
620 | - if (origin.formatSalesPrice !== '0' && origin.formatMarketPrice !== origin.formatSalesPrice) { | ||
621 | - goodsPrice.previousPrice = origin.formatMarketPrice; | 620 | + if (origin.format_sales_price !== '0' && origin.format_market_price !== origin.format_sales_price) { |
621 | + goodsPrice.previousPrice = origin.format_market_price; | ||
622 | } | 622 | } |
623 | 623 | ||
624 | dest.goodsPrice = goodsPrice; | 624 | dest.goodsPrice = goodsPrice; |
@@ -648,8 +648,8 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -648,8 +648,8 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
648 | }); | 648 | }); |
649 | 649 | ||
650 | } | 650 | } |
651 | - | ||
652 | // 上市期 | 651 | // 上市期 |
652 | + // TODO 接口文档,实际接口数据中都没有找到这个字段,所以不知道有什么用途 | ||
653 | origin.expectArrivalTime && (dest.periodOfMarket = `${origin.expectArrivalTime}月`); | 653 | origin.expectArrivalTime && (dest.periodOfMarket = `${origin.expectArrivalTime}月`); |
654 | 654 | ||
655 | // 商品咨询 | 655 | // 商品咨询 |
@@ -659,7 +659,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -659,7 +659,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
659 | }; | 659 | }; |
660 | 660 | ||
661 | let consultParams = { | 661 | let consultParams = { |
662 | - product_id: origin.productId | 662 | + product_id: origin.product_id |
663 | }; | 663 | }; |
664 | 664 | ||
665 | if (_.has(dest, 'feedbacks.consultsNum')) { | 665 | if (_.has(dest, 'feedbacks.consultsNum')) { |
@@ -671,20 +671,20 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -671,20 +671,20 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
671 | 671 | ||
672 | // 商品评价 | 672 | // 商品评价 |
673 | dest.feedbacks.commentsUrl = helpers.urlFormat('/product/detail/comments', { | 673 | dest.feedbacks.commentsUrl = helpers.urlFormat('/product/detail/comments', { |
674 | - product_id: origin.productId, | 674 | + product_id: origin.product_id, |
675 | }); | 675 | }); |
676 | 676 | ||
677 | // 品牌信息 | 677 | // 品牌信息 |
678 | if (origin.brand) { | 678 | if (origin.brand) { |
679 | - let extra = `?productSkn=${origin.productSkn}&brandId=${origin.brandInfo.brandId}`; | 679 | + let extra = `?productSkn=${origin.product_skn}&brandId=${origin.brand_info.brand_id}`; |
680 | 680 | ||
681 | dest.preferenceUrl = `/product/detail/preference${extra}`; | 681 | dest.preferenceUrl = `/product/detail/preference${extra}`; |
682 | } | 682 | } |
683 | 683 | ||
684 | - dest.productSkn = origin.productSkn; | 684 | + dest.productSkn = origin.product_skn; |
685 | 685 | ||
686 | // 商品信息 | 686 | // 商品信息 |
687 | - if (origin.goodsList) { | 687 | + if (origin.goods_list) { |
688 | let goodsGroup = [], | 688 | let goodsGroup = [], |
689 | sizeName = '', | 689 | sizeName = '', |
690 | colorList = [], | 690 | colorList = [], |
@@ -693,7 +693,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -693,7 +693,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
693 | colorStorageGroup = {}, | 693 | colorStorageGroup = {}, |
694 | colorStorageNum = 0; | 694 | colorStorageNum = 0; |
695 | 695 | ||
696 | - _.forEach(origin.goodsList, function(value) { | 696 | + _.forEach(origin.goods_list, function(value) { |
697 | if (value.status === 0) { | 697 | if (value.status === 0) { |
698 | return; | 698 | return; |
699 | } | 699 | } |
@@ -701,56 +701,56 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -701,56 +701,56 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
701 | colorStorageNum = 0; | 701 | colorStorageNum = 0; |
702 | 702 | ||
703 | // 商品分组 | 703 | // 商品分组 |
704 | - if (value.imagesList) { | ||
705 | - _.forEach(value.imagesList, function(good) { | 704 | + if (value.images_list) { |
705 | + _.forEach(value.images_list, function(good) { | ||
706 | goodsGroup.push({ | 706 | goodsGroup.push({ |
707 | - goodsId: value.goodsId, | ||
708 | - img: good.imageUrl | 707 | + goodsId: value.goods_id, |
708 | + img: good.image_url | ||
709 | }); | 709 | }); |
710 | }); | 710 | }); |
711 | } | 711 | } |
712 | 712 | ||
713 | // 商品的尺码列表 | 713 | // 商品的尺码列表 |
714 | - colorStorageGroup[value.productSkc] = {}; | ||
715 | - if (value.sizeList) { | ||
716 | - sizeList[value.productSkc] = []; | ||
717 | - _.forEach(value.sizeList, function(size) { | ||
718 | - sizeList[value.productSkc].push({ | ||
719 | - id: size.sizeId, | ||
720 | - skuId: size.productSku, | ||
721 | - goodsId: value.goodsId, | ||
722 | - colorId: value.colorId, | ||
723 | - name: size.sizeName, | ||
724 | - sizeNum: size.storageNumber | 714 | + colorStorageGroup[value.product_skc] = {}; |
715 | + if (value.size_list) { | ||
716 | + sizeList[value.product_skc] = []; | ||
717 | + _.forEach(value.size_list, function(size) { | ||
718 | + sizeList[value.product_skc].push({ | ||
719 | + id: size.size_id, | ||
720 | + skuId: size.product_sku, | ||
721 | + goodsId: value.goods_id, | ||
722 | + colorId: value.color_id, | ||
723 | + name: size.size_name, | ||
724 | + sizeNum: size.storage_number | ||
725 | }); | 725 | }); |
726 | 726 | ||
727 | - sizeName = size.sizeName; | 727 | + sizeName = size.size_name; |
728 | 728 | ||
729 | // 所有尺码列表,赋值用于前端展示默认尺码的时候 | 729 | // 所有尺码列表,赋值用于前端展示默认尺码的时候 |
730 | // 判断出没有库存则显示灰色 | 730 | // 判断出没有库存则显示灰色 |
731 | let build = { | 731 | let build = { |
732 | - id: size.sizeId, | ||
733 | - storage: size.storageNumber | 732 | + id: size.size_id, |
733 | + storage: size.storage_number | ||
734 | }; | 734 | }; |
735 | 735 | ||
736 | allSizeList[sizeName] = (allSizeList[sizeName] === null || | 736 | allSizeList[sizeName] = (allSizeList[sizeName] === null || |
737 | typeof allSizeList[sizeName] === 'undefined') ? build : allSizeList[sizeName]; | 737 | typeof allSizeList[sizeName] === 'undefined') ? build : allSizeList[sizeName]; |
738 | - colorStorageNum += parseInt(size.storageNumber, 10); | ||
739 | - colorStorageGroup[value.productSkc][sizeName] = parseInt(size.storageNumber, 10); | 738 | + colorStorageNum += parseInt(size.storage_number, 10); |
739 | + colorStorageGroup[value.product_skc][sizeName] = parseInt(size.storage_number, 10); | ||
740 | }); | 740 | }); |
741 | 741 | ||
742 | // 颜色分组 | 742 | // 颜色分组 |
743 | colorList.push({ | 743 | colorList.push({ |
744 | - id: value.colorId, | ||
745 | - skcId: value.productSkc, | ||
746 | - name: value.colorName, | 744 | + id: value.color_id, |
745 | + skcId: value.product_skc, | ||
746 | + name: value.color_name, | ||
747 | colorNum: colorStorageNum | 747 | colorNum: colorStorageNum |
748 | }); | 748 | }); |
749 | } | 749 | } |
750 | 750 | ||
751 | // 缩略图 | 751 | // 缩略图 |
752 | thumbImageList.push({ | 752 | thumbImageList.push({ |
753 | - img: value.colorImage | 753 | + img: value.color_image |
754 | }); | 754 | }); |
755 | 755 | ||
756 | // 商品库存总数 | 756 | // 商品库存总数 |
@@ -835,9 +835,9 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -835,9 +835,9 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
835 | dest.cartInfo = { | 835 | dest.cartInfo = { |
836 | cartUrl: helpers.urlFormat('/cart/index/index'), | 836 | cartUrl: helpers.urlFormat('/cart/index/index'), |
837 | numInCart: 0, | 837 | numInCart: 0, |
838 | - goodsInstore: origin.storageSum | 838 | + goodsInstore: origin.storage_sum |
839 | }; | 839 | }; |
840 | - let soldOut = (origin.storageSum === 0) || (totalStorageNum === 0); // status | 840 | + let soldOut = (origin.storage_sum === 0) || (totalStorageNum === 0); // status |
841 | let notForSale = origin.attribute === 2; | 841 | let notForSale = origin.attribute === 2; |
842 | 842 | ||
843 | // 显示加入购物车链接 | 843 | // 显示加入购物车链接 |
@@ -845,7 +845,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -845,7 +845,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
845 | _.orderBy(colorGroup); | 845 | _.orderBy(colorGroup); |
846 | 846 | ||
847 | Object.assign(dest.cartInfo, { | 847 | Object.assign(dest.cartInfo, { |
848 | - productId: origin.productId, | 848 | + productId: origin.product_id, |
849 | thumbs: thumbImageList, | 849 | thumbs: thumbImageList, |
850 | name: dest.goodsName ? dest.goodsName : '', | 850 | name: dest.goodsName ? dest.goodsName : '', |
851 | price: dest.goodsPrice.previousPrice ? dest.goodsPrice.previousPrice : '', | 851 | price: dest.goodsPrice.previousPrice ? dest.goodsPrice.previousPrice : '', |
@@ -869,11 +869,11 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -869,11 +869,11 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
869 | dest = _procShowStatus(dest, showStatus, isBeginSale); | 869 | dest = _procShowStatus(dest, showStatus, isBeginSale); |
870 | 870 | ||
871 | dest.cartInfo.limitProductCode = origin.limitProductCode; | 871 | dest.cartInfo.limitProductCode = origin.limitProductCode; |
872 | - dest.cartInfo.limitCodeUrl = _getLimitCodeUrl(origin.limitProductCode, origin.productSkn, ua); | 872 | + dest.cartInfo.limitCodeUrl = _getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua); |
873 | dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure'); | 873 | dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure'); |
874 | } else { | 874 | } else { |
875 | - dest.cartInfo.addToCartUrl = helpers.urlFormat('/product/buy_' + origin.productId + '_' + | ||
876 | - origin.goodsList.goodsId + '.html'); | 875 | + dest.cartInfo.addToCartUrl = helpers.urlFormat('/product/buy_' + origin.product_id + '_' + |
876 | + origin.goods_list.goods_id + '.html'); | ||
877 | } | 877 | } |
878 | } else if (notForSale) { | 878 | } else if (notForSale) { |
879 | dest.cartInfo.notForSale = true; | 879 | dest.cartInfo.notForSale = true; |
@@ -883,14 +883,14 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -883,14 +883,14 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
883 | 883 | ||
884 | // 是否收藏 | 884 | // 是否收藏 |
885 | dest.isCollect = false; | 885 | dest.isCollect = false; |
886 | - if (origin.isCollect === 'Y') { | 886 | + if (origin.is_collect === 'Y') { |
887 | dest.isCollect = true; | 887 | dest.isCollect = true; |
888 | dest.cartInfo.isCollect = true; | 888 | dest.cartInfo.isCollect = true; |
889 | } | 889 | } |
890 | 890 | ||
891 | // 底部简介URL链接 | 891 | // 底部简介URL链接 |
892 | - dest.introUrl = '/product/detail/intro/' + origin.productSkn; | ||
893 | - dest.id = origin.productId; | 892 | + dest.introUrl = '/product/detail/intro/' + origin.product_skn; |
893 | + dest.id = origin.product_id; | ||
894 | 894 | ||
895 | // 虚拟商品(门票) | 895 | // 虚拟商品(门票) |
896 | if (origin.attribute * 1 === 3) { | 896 | if (origin.attribute * 1 === 3) { |
@@ -898,7 +898,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -898,7 +898,7 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
898 | dest.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm'); | 898 | dest.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm'); |
899 | 899 | ||
900 | // 展览票 | 900 | // 展览票 |
901 | - if (origin.productSkn * 1 === SINGLE_TICKETS_SKN) { | 901 | + if (origin.product_skn * 1 === SINGLE_TICKETS_SKN) { |
902 | dest.single = true; | 902 | dest.single = true; |
903 | } else { | 903 | } else { |
904 | // 套票 | 904 | // 套票 |
@@ -1000,19 +1000,19 @@ let getProductData = (data) => { | @@ -1000,19 +1000,19 @@ let getProductData = (data) => { | ||
1000 | 1000 | ||
1001 | return api.get('', params, { | 1001 | return api.get('', params, { |
1002 | code: 200 | 1002 | code: 200 |
1003 | - }).then(global.yoho.camelCase).then(result => { | 1003 | + }).then(result => { |
1004 | if (result.code === 500 || !result.data) { | 1004 | if (result.code === 500 || !result.data) { |
1005 | return {}; | 1005 | return {}; |
1006 | } | 1006 | } |
1007 | result = result.data; | 1007 | result = result.data; |
1008 | return Promise.all([ | 1008 | return Promise.all([ |
1009 | - _getShopsInfo(result.brandInfo.brandId), | ||
1010 | - _getPromotionInfo(result.productSkn), | 1009 | + _getShopsInfo(result.brand_info.brand_id), |
1010 | + _getPromotionInfo(result.product_skn), | ||
1011 | comment.getCommentInfo({ | 1011 | comment.getCommentInfo({ |
1012 | - productId: result.productId | 1012 | + productId: result.product_id |
1013 | }), | 1013 | }), |
1014 | _getCommonConsult(), | 1014 | _getCommonConsult(), |
1015 | - comment.getConsults(result.productId, 1, 2) | 1015 | + comment.getConsults(result.product_id, 1, 2) |
1016 | ]).then((info) => { | 1016 | ]).then((info) => { |
1017 | result.promotionBoList = info[1]; | 1017 | result.promotionBoList = info[1]; |
1018 | finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua); | 1018 | finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua); |
@@ -79,8 +79,8 @@ const _convertNavData = (list) => { | @@ -79,8 +79,8 @@ const _convertNavData = (list) => { | ||
79 | _.forEach(list, (item) => { | 79 | _.forEach(list, (item) => { |
80 | formatData.push({ | 80 | formatData.push({ |
81 | id: item.id, | 81 | id: item.id, |
82 | - name: item.sortName, | ||
83 | - url: encodeURI(item.sortUrl) | 82 | + name: item.sort_name, |
83 | + url: encodeURI(item.sort_url) | ||
84 | }); | 84 | }); |
85 | }); | 85 | }); |
86 | 86 |
@@ -32,8 +32,8 @@ const getPreferenceData = (data) => { | @@ -32,8 +32,8 @@ const getPreferenceData = (data) => { | ||
32 | goods.url = helpers.urlFormat(`/product/pro_${value.productId}_${value.goodsId}/${value.cnAlphabet}.html`); | 32 | goods.url = helpers.urlFormat(`/product/pro_${value.productId}_${value.goodsId}/${value.cnAlphabet}.html`); |
33 | if (_.get(goods, 'tags[0]', null)) { | 33 | if (_.get(goods, 'tags[0]', null)) { |
34 | goods.tags = []; | 34 | goods.tags = []; |
35 | - if (goods.isNew === 'Y') { | ||
36 | - goods.tags.push({isNew: true}); | 35 | + if (goods.is_new === 'Y') { |
36 | + goods.tags.push({is_new: true}); | ||
37 | } else if (goods.isAdvance === 'Y') { | 37 | } else if (goods.isAdvance === 'Y') { |
38 | goods.tags.push({isAdvance: true}); | 38 | goods.tags.push({isAdvance: true}); |
39 | } else if (goods.isDiscount === 'Y') { | 39 | } else if (goods.isDiscount === 'Y') { |
@@ -8,7 +8,6 @@ const utils = '../../../utils'; | @@ -8,7 +8,6 @@ const utils = '../../../utils'; | ||
8 | const contentCodeConfig = require('../../../config/content-code'); | 8 | const contentCodeConfig = require('../../../config/content-code'); |
9 | 9 | ||
10 | const logger = global.yoho.logger; | 10 | const logger = global.yoho.logger; |
11 | -const camelCase = global.yoho.camelCase; | ||
12 | const resourcesProcess = require(`${utils}/resources-process`); | 11 | const resourcesProcess = require(`${utils}/resources-process`); |
13 | const productProcess = require(`${utils}/product-process`); | 12 | const productProcess = require(`${utils}/product-process`); |
14 | const processTime = require(`${utils}/time-process`); | 13 | const processTime = require(`${utils}/time-process`); |
@@ -87,7 +86,6 @@ const _processDiscount = (list) => { | @@ -87,7 +86,6 @@ const _processDiscount = (list) => { | ||
87 | let flag = true; | 86 | let flag = true; |
88 | 87 | ||
89 | list = list || []; | 88 | list = list || []; |
90 | - list = camelCase(list); | ||
91 | 89 | ||
92 | // list为1条数据是表示详情页,flag 设为false,不需要拼接跳转链接 | 90 | // list为1条数据是表示详情页,flag 设为false,不需要拼接跳转链接 |
93 | if (list.length === 1) { | 91 | if (list.length === 1) { |
@@ -96,7 +94,7 @@ const _processDiscount = (list) => { | @@ -96,7 +94,7 @@ const _processDiscount = (list) => { | ||
96 | 94 | ||
97 | _.forEach(list, (data) => { | 95 | _.forEach(list, (data) => { |
98 | if (flag === true) { | 96 | if (flag === true) { |
99 | - Object.assign(data, processTime(data.leftTime)); | 97 | + Object.assign(data, processTime(data.left_time)); |
100 | } | 98 | } |
101 | 99 | ||
102 | formatData.push(data); | 100 | formatData.push(data); |
@@ -133,8 +131,6 @@ const _processBreakingSort = (list) => { | @@ -133,8 +131,6 @@ const _processBreakingSort = (list) => { | ||
133 | const sub = []; | 131 | const sub = []; |
134 | 132 | ||
135 | list = list || []; | 133 | list = list || []; |
136 | - list = camelCase(list); | ||
137 | - | ||
138 | _.forEach(list, (data, index) => { | 134 | _.forEach(list, (data, index) => { |
139 | const allSub = []; | 135 | const allSub = []; |
140 | 136 | ||
@@ -142,12 +138,12 @@ const _processBreakingSort = (list) => { | @@ -142,12 +138,12 @@ const _processBreakingSort = (list) => { | ||
142 | sub.push(data.sub); | 138 | sub.push(data.sub); |
143 | 139 | ||
144 | _.forEach(data.sub, (dataSub) => { | 140 | _.forEach(data.sub, (dataSub) => { |
145 | - allSub.push(dataSub.sizeId); | 141 | + allSub.push(dataSub.size_id); |
146 | }); | 142 | }); |
147 | 143 | ||
148 | sort.push({ | 144 | sort.push({ |
149 | - sortName: data.sortName, | ||
150 | - sortId: data.sortId, | 145 | + sort_name: data.sort_name, |
146 | + sort_id: data.sort_id, | ||
151 | allSub: allSub | 147 | allSub: allSub |
152 | }); | 148 | }); |
153 | }); | 149 | }); |
@@ -274,7 +270,7 @@ const getSearchData = (params, uid) => { | @@ -274,7 +270,7 @@ const getSearchData = (params, uid) => { | ||
274 | }), | 270 | }), |
275 | _getUserProfile(uid).then((result) => { | 271 | _getUserProfile(uid).then((result) => { |
276 | if (result && result.code === 200) { | 272 | if (result && result.code === 200) { |
277 | - return result.data.vip_info ? camelCase(result.data.vip_info) : {}; | 273 | + return result.data.vip_info ? result.data.vip_info : {}; |
278 | } else { | 274 | } else { |
279 | logger.error('api get user info code no 200'); | 275 | logger.error('api get user info code no 200'); |
280 | return {}; | 276 | return {}; |
@@ -371,15 +367,15 @@ const getDiscountDetailData = (id, yhChannel) => { | @@ -371,15 +367,15 @@ const getDiscountDetailData = (id, yhChannel) => { | ||
371 | return _discount(param).then((result) => { | 367 | return _discount(param).then((result) => { |
372 | if (result && result.code === 200) { | 368 | if (result && result.code === 200) { |
373 | res = _processDiscount(result.data); | 369 | res = _processDiscount(result.data); |
374 | - if (res[0] && res[0].coverUrl) { | ||
375 | - res[0].coverUrl = res[0].coverUrl.replace('/extent/{width}x{height}', ''); | 370 | + if (res[0] && res[0].cover_url) { |
371 | + res[0].cover_url = res[0].cover_url.replace('/extent/{width}x{height}', ''); | ||
376 | } | 372 | } |
377 | return { | 373 | return { |
378 | title: res[0] && res[0].title, | 374 | title: res[0] && res[0].title, |
379 | - productPool: res[0] && res[0].productPool, | 375 | + product_pool: res[0] && res[0].product_pool, |
380 | activity: { | 376 | activity: { |
381 | - coverUrl: res[0] && res[0].coverUrl, | ||
382 | - leftTime: res[0] && res[0].leftTime | 377 | + cover_url: res[0] && res[0].cover_url, |
378 | + left_time: res[0] && res[0].left_time | ||
383 | } | 379 | } |
384 | }; | 380 | }; |
385 | } else { | 381 | } else { |
@@ -11,9 +11,9 @@ | @@ -11,9 +11,9 @@ | ||
11 | <ul id="list-nav" class="list-nav clearfix"> | 11 | <ul id="list-nav" class="list-nav clearfix"> |
12 | 12 | ||
13 | {{# sortData}} | 13 | {{# sortData}} |
14 | - <li data-id="{{sortId}}" data-allSub="{{allSub}}"> | 14 | + <li data-id="{{sort_id}}" data-allSub="{{allSub}}"> |
15 | <a href="javascript:void(0);"> | 15 | <a href="javascript:void(0);"> |
16 | - <span class="span-test">{{sortName}}</span> | 16 | + <span class="span-test">{{sort_name}}</span> |
17 | </a> | 17 | </a> |
18 | </li> | 18 | </li> |
19 | {{/ sortData}} | 19 | {{/ sortData}} |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | <div class="swiper-size" id="size-swiper-{{key}}" {{#if @first}}style="display:block"{{/if}}> | 31 | <div class="swiper-size" id="size-swiper-{{key}}" {{#if @first}}style="display:block"{{/if}}> |
32 | <ul class="swiper-wrapper"> | 32 | <ul class="swiper-wrapper"> |
33 | {{# this}} | 33 | {{# this}} |
34 | - <li class="swiper-slide" data-id="{{sizeId}}">{{sizeName}}</li> | 34 | + <li class="swiper-slide" data-id="{{size_id}}">{{size_name}}</li> |
35 | {{/ this}} | 35 | {{/ this}} |
36 | </ul> | 36 | </ul> |
37 | </div> | 37 | </div> |
1 | -<div class="discount-detail-page goods-page yoho-page" data-product-pool="{{productPool}}"> | 1 | +<div class="discount-detail-page goods-page yoho-page" data-product-pool="{{product_pool}}"> |
2 | {{> sale/banner}} | 2 | {{> sale/banner}} |
3 | 3 | ||
4 | <ul id="list-nav" class="list-nav clearfix"> | 4 | <ul id="list-nav" class="list-nav clearfix"> |
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | {{/content}} | 6 | {{/content}} |
7 | 7 | ||
8 | {{# activity}} | 8 | {{# activity}} |
9 | - <img src="{{image coverUrl 640 200}}"/> | ||
10 | - <p class="activity-time" data-time-s="{{leftTime}}"><i class="iconfont time-ico"></i><span></span></p> | 9 | + <img src="{{image cover_url 640 200}}"/> |
10 | + <p class="activity-time" data-time-s="{{left_time}}"><i class="iconfont time-ico"></i><span></span></p> | ||
11 | {{/ activity}} | 11 | {{/ activity}} |
12 | 12 | ||
13 | </div> | 13 | </div> |
@@ -16,9 +16,9 @@ module.exports = { | @@ -16,9 +16,9 @@ module.exports = { | ||
16 | siteUrl: '//m.yohobuy.com', | 16 | siteUrl: '//m.yohobuy.com', |
17 | assetUrl: '//localhost:5001', | 17 | assetUrl: '//localhost:5001', |
18 | domains: { | 18 | domains: { |
19 | - api: 'http://api.yoho.yohoops.org/', | ||
20 | - service: 'http://service.yoho.yohoops.org/', | ||
21 | - liveApi: 'http://api.live.yoho.cn/' | 19 | + api: 'http://api.yoho.cn/', |
20 | + service: 'http://service.yoho.cn/', | ||
21 | + liveApi: 'http://testapi.live.yohops.com:9999/' | ||
22 | }, | 22 | }, |
23 | subDomains: { | 23 | subDomains: { |
24 | host: '.m.yohobuy.com', | 24 | host: '.m.yohobuy.com', |
1 | {{# title}} | 1 | {{# title}} |
2 | <div class="floor-header-more"> | 2 | <div class="floor-header-more"> |
3 | <h2>{{#if title}}{{title}}{{else}}{{name}}{{/if}}</h2> | 3 | <h2>{{#if title}}{{title}}{{else}}{{name}}{{/if}}</h2> |
4 | - {{#if moreUrl}} | ||
5 | - <a class="more-btn iconfont" href="{{moreUrl}}"></a> | 4 | + {{#if more_url}} |
5 | + <a class="more-btn iconfont" href="{{more_url}}"></a> | ||
6 | {{/if}} | 6 | {{/if}} |
7 | </div> | 7 | </div> |
8 | {{/ title}} | 8 | {{/ title}} |
1 | {{#if this}} {{!-- 剔除值为false的项 --}} | 1 | {{#if this}} {{!-- 剔除值为false的项 --}} |
2 | - <div class="good-info {{#if @root.saleViplogin}}sale-vip{{/if}}" data-id="{{productSkn}}" data-bp-id="guang_goodList_{{productName}}_false"> | 2 | + <div class="good-info {{#if @root.saleViplogin}}sale-vip{{/if}}" data-id="{{product_skn}}" data-bp-id="guang_goodList_{{product_name}}_false"> |
3 | <div class="tag-container clearfix"> | 3 | <div class="tag-container clearfix"> |
4 | {{# tags}} | 4 | {{# tags}} |
5 | - {{# isNew}} | 5 | + {{# is_new}} |
6 | <p class="good-tag new-tag">NEW</p> | 6 | <p class="good-tag new-tag">NEW</p> |
7 | - {{/ isNew}} | ||
8 | - {{# isAdvance}} | 7 | + {{/ is_new}} |
8 | + {{# is_advance}} | ||
9 | <p class="good-tag renew-tag">再到着</p> | 9 | <p class="good-tag renew-tag">再到着</p> |
10 | - {{/ isAdvance}} | ||
11 | - {{# isDiscount}} | 10 | + {{/ is_advance}} |
11 | + {{# is_discount}} | ||
12 | <p class="good-tag sale-tag">SALE</p> | 12 | <p class="good-tag sale-tag">SALE</p> |
13 | - {{/ isDiscount}} | ||
14 | - {{# isYohood}} | 13 | + {{/ is_discount}} |
14 | + {{# is_yohood}} | ||
15 | <p class="good-tag new-festival-tag">新品节</p> | 15 | <p class="good-tag new-festival-tag">新品节</p> |
16 | - {{/ isYohood}} | ||
17 | - {{# isLimited}} | 16 | + {{/ is_yohood}} |
17 | + {{# is_limited}} | ||
18 | <p class="good-tag limit-tag">限量商品</p> | 18 | <p class="good-tag limit-tag">限量商品</p> |
19 | - {{/ isLimited}} | 19 | + {{/ is_limited}} |
20 | {{/ tags}} | 20 | {{/ tags}} |
21 | </div> | 21 | </div> |
22 | <div class="good-detail-img"> | 22 | <div class="good-detail-img"> |
23 | <a class="good-thumb" href="{{url}}"> | 23 | <a class="good-thumb" href="{{url}}"> |
24 | - <img class="lazy" data-original="{{image defaultImages 235 314}}"> | 24 | + <img class="lazy" data-original="{{image default_images 235 314}}"> |
25 | </a> | 25 | </a> |
26 | - {{# isSoonSoldOut}} | 26 | + {{# is_soon_sold_out}} |
27 | <p class="few-tag">即将售罄</p> | 27 | <p class="few-tag">即将售罄</p> |
28 | - {{/ isSoonSoldOut}} | 28 | + {{/ is_soon_sold_out}} |
29 | 29 | ||
30 | {{#if noStorage}} | 30 | {{#if noStorage}} |
31 | <div class="no-storage"> | 31 | <div class="no-storage"> |
@@ -35,22 +35,22 @@ | @@ -35,22 +35,22 @@ | ||
35 | </div> | 35 | </div> |
36 | <div class="good-detail-text"> | 36 | <div class="good-detail-text"> |
37 | <div class="name"> | 37 | <div class="name"> |
38 | - <a href="{{url}}">{{productName}}</a> | 38 | + <a href="{{url}}">{{product_name}}</a> |
39 | </div> | 39 | </div> |
40 | <div class="price"> | 40 | <div class="price"> |
41 | {{#if @root.saleViplogin}} | 41 | {{#if @root.saleViplogin}} |
42 | <i class="vip-grade vip-grade-{{@root.vipLevel}}"></i> | 42 | <i class="vip-grade vip-grade-{{@root.vipLevel}}"></i> |
43 | - <span class="sale-price {{^marketPrice}}no-price{{/marketPrice}}">¥ | ||
44 | - {{#if @root.vipPrice1}}{{round vip1Price}}{{/if}} | ||
45 | - {{#if @root.vipPrice2}}{{round vip2Price}}{{/if}} | ||
46 | - {{#if @root.vipPrice3}}{{round vip3Price}}{{/if}} | 43 | + <span class="sale-price {{^market_price}}no-price{{/market_price}}">¥ |
44 | + {{#if @root.vipPrice1}}{{round vip1_price}}{{/if}} | ||
45 | + {{#if @root.vipPrice2}}{{round vip2_price}}{{/if}} | ||
46 | + {{#if @root.vipPrice3}}{{round vip3_price}}{{/if}} | ||
47 | </span> | 47 | </span> |
48 | {{else}} | 48 | {{else}} |
49 | - <span class="sale-price {{^marketPrice}}no-price{{/marketPrice}}">¥{{round salesPrice}}</span> | 49 | + <span class="sale-price {{^market_price}}no-price{{/market_price}}">¥{{round sales_price}}</span> |
50 | {{/if}} | 50 | {{/if}} |
51 | - {{#marketPrice}} | 51 | + {{#market_price}} |
52 | <span class="market-price">¥{{round .}}</span> | 52 | <span class="market-price">¥{{round .}}</span> |
53 | - {{/marketPrice}} | 53 | + {{/market_price}} |
54 | </div> | 54 | </div> |
55 | {{#if @root.saleVip}} | 55 | {{#if @root.saleVip}} |
56 | <div class="vip-info"> | 56 | <div class="vip-info"> |
1 | {{#data}} | 1 | {{#data}} |
2 | {{> common/floor-header-more}} | 2 | {{> common/floor-header-more}} |
3 | <div class="creative-life"> | 3 | <div class="creative-life"> |
4 | - {{# bigImage}} | 4 | + {{# big_image}} |
5 | <a class="banner" href="{{url}}"> | 5 | <a class="banner" href="{{url}}"> |
6 | <img class="lazy" data-original="{{image src 640 403}}"> | 6 | <img class="lazy" data-original="{{image src 640 403}}"> |
7 | </a> | 7 | </a> |
8 | - {{/ bigImage}} | 8 | + {{/ big_image}} |
9 | <ul class="classify-list clearfix"> | 9 | <ul class="classify-list clearfix"> |
10 | {{# list}} | 10 | {{# list}} |
11 | <li class="classify"> | 11 | <li class="classify"> |
@@ -6,10 +6,10 @@ | @@ -6,10 +6,10 @@ | ||
6 | {{#list}} | 6 | {{#list}} |
7 | <li> | 7 | <li> |
8 | <a href="/product/sale/discount/detail?id={{id}}&channel={{@root.channel}}"> | 8 | <a href="/product/sale/discount/detail?id={{id}}&channel={{@root.channel}}"> |
9 | - <img class="lazy" data-original="{{image coverUrl 640 250}}" /> | 9 | + <img class="lazy" data-original="{{image cover_url 640 250}}" /> |
10 | <p class="discount-cont"> | 10 | <p class="discount-cont"> |
11 | <span class="discount-title">{{title}}</span> | 11 | <span class="discount-title">{{title}}</span> |
12 | - <span class="discount-time {{#if warnColor}}red-color{{/if}}">{{time}}</span> | 12 | + <span class="discount-time {{#if warn_color}}red-color{{/if}}">{{time}}</span> |
13 | </p> | 13 | </p> |
14 | </a> | 14 | </a> |
15 | </li> | 15 | </li> |
1 | {{#data}} | 1 | {{#data}} |
2 | {{> common/floor-header-more}} | 2 | {{> common/floor-header-more}} |
3 | <div class="goods-category"> | 3 | <div class="goods-category"> |
4 | - {{# bigImage}} | 4 | + {{# big_image}} |
5 | {{#if bigList}} | 5 | {{#if bigList}} |
6 | <div class="category-swiper"> | 6 | <div class="category-swiper"> |
7 | <ul class="swiper-wrapper"> | 7 | <ul class="swiper-wrapper"> |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | </a> | 25 | </a> |
26 | </div> | 26 | </div> |
27 | {{/if}} | 27 | {{/if}} |
28 | - {{/ bigImage}} | 28 | + {{/ big_image}} |
29 | {{#if list}} | 29 | {{#if list}} |
30 | <ul class="category-list clearfix"> | 30 | <ul class="category-list clearfix"> |
31 | {{# list}} | 31 | {{# list}} |
@@ -187,7 +187,7 @@ gulp.task('webpack-dev-server', () => { | @@ -187,7 +187,7 @@ gulp.task('webpack-dev-server', () => { | ||
187 | 187 | ||
188 | new WebpackDevServer(webpack(devConfig), { | 188 | new WebpackDevServer(webpack(devConfig), { |
189 | contentBase: '.', | 189 | contentBase: '.', |
190 | - publicPath: '//localhost:5001/', | 190 | + publicPath: 'http://localhost:5001/', |
191 | hot: true, | 191 | hot: true, |
192 | stats: { | 192 | stats: { |
193 | colors: true | 193 | colors: true |
1 | 'use strict'; | 1 | 'use strict'; |
2 | require('../app'); | 2 | require('../app'); |
3 | const _ = require('lodash'); | 3 | const _ = require('lodash'); |
4 | -const camelCase = global.yoho.camelCase; | ||
5 | const helpers = global.yoho.helpers; | 4 | const helpers = global.yoho.helpers; |
6 | 5 | ||
7 | /** | 6 | /** |
8 | * 根据性别来决定 默认图片获取字段 如果是 2、3 | 7 | * 根据性别来决定 默认图片获取字段 如果是 2、3 |
9 | * | 8 | * |
10 | - * 则优先从cover2 --》 cover1 -- 》 images_url | ||
11 | - * 否则优先从cover1 --》 cover2 -- 》 images_url | 9 | + * 则优先从cover_2 --》 cover_1 -- 》 images_url |
10 | + * 否则优先从cover_1 --》 cover_2 -- 》 images_url | ||
12 | * | 11 | * |
13 | */ | 12 | */ |
14 | const _procProductImg = (product, gender, yhChannel) => { | 13 | const _procProductImg = (product, gender, yhChannel) => { |
15 | if (gender === '2,3' || gender === '2' || gender === '3' && yhChannel === '2') { | 14 | if (gender === '2,3' || gender === '2' || gender === '3' && yhChannel === '2') { |
16 | - return product.cover2 || product.imagesUrl || product.cover1 || ''; | 15 | + return product.cover_2 || product.images_url || product.cover_1 || ''; |
17 | } | 16 | } |
18 | 17 | ||
19 | - return product.cover1 || product.imagesUrl || product.cover2 || ''; | 18 | + return product.cover_1 || product.images_url || product.cover_2 || ''; |
20 | }; | 19 | }; |
21 | 20 | ||
22 | const toArray = (obj) => { | 21 | const toArray = (obj) => { |
@@ -87,74 +86,73 @@ exports.processProductList = (list, options) => { | @@ -87,74 +86,73 @@ exports.processProductList = (list, options) => { | ||
87 | showPoint: true, | 86 | showPoint: true, |
88 | gender: '2,3' | 87 | gender: '2,3' |
89 | }, options); | 88 | }, options); |
90 | - list = camelCase(list); | ||
91 | 89 | ||
92 | _.forEach(list, (product) => { | 90 | _.forEach(list, (product) => { |
93 | // 商品信息有问题,则不显示 | 91 | // 商品信息有问题,则不显示 |
94 | - if (!product.productId || !product.goodsList || product.goodsList.length === 0) { | 92 | + if (!product.product_id || !product.goods_list || product.goods_list.length === 0) { |
95 | return; | 93 | return; |
96 | } | 94 | } |
97 | 95 | ||
98 | // 如果库存为0,显示已抢完 | 96 | // 如果库存为0,显示已抢完 |
99 | - if (product.storageNum === 0) { | 97 | + if (product.storage_num === 0) { |
100 | product.noStorage = true; | 98 | product.noStorage = true; |
101 | } | 99 | } |
102 | 100 | ||
103 | // 市场价和售价一样,则不显示市场价 | 101 | // 市场价和售价一样,则不显示市场价 |
104 | - if (product.marketPrice === product.salesPrice) { | ||
105 | - product.marketPrice = false; | 102 | + if (product.market_price === product.sales_price) { |
103 | + product.market_price = false; | ||
106 | } | 104 | } |
107 | 105 | ||
108 | // 判别默认的商品是否将默认的图片URL赋值到skn | 106 | // 判别默认的商品是否将默认的图片URL赋值到skn |
109 | let flag = false; | 107 | let flag = false; |
110 | 108 | ||
111 | // 如果设置了默认图片,就取默认的图片 | 109 | // 如果设置了默认图片,就取默认的图片 |
112 | - _.forEach(product.goodsList, (goods) => { | 110 | + _.forEach(product.goods_list, (goods) => { |
113 | if (flag) { | 111 | if (flag) { |
114 | return; | 112 | return; |
115 | } | 113 | } |
116 | - if (goods.isDefault === 'Y') { | ||
117 | - // product.defaultImages = procProductImg(goods); | ||
118 | - product.defaultImages = product.defaultImages; | 114 | + if (goods.is_default === 'Y') { |
115 | + // product.default_images = procProductImg(goods); | ||
116 | + product.default_images = product.default_images; | ||
119 | flag = true; | 117 | flag = true; |
120 | } | 118 | } |
121 | }); | 119 | }); |
122 | 120 | ||
123 | // 如果还未赋值,则取第一个skc产品的默认图片 | 121 | // 如果还未赋值,则取第一个skc产品的默认图片 |
124 | if (!flag) { | 122 | if (!flag) { |
125 | - product.defaultImages = _procProductImg(product.goodsList[0], product.gender, options.yh_channel); | 123 | + product.default_images = _procProductImg(product.goods_list[0], product.gender, options.yh_channel); |
126 | } | 124 | } |
127 | 125 | ||
128 | - product.isSoonSoldOut = product.isSoonSoldOut === 'Y'; | ||
129 | - product.url = helpers.urlFormat(`/product/pro_${product.productId}_${product.goodsList[0].goodsId}/${product.cnAlphabet}.html`); // eslint-disable-line | 126 | + product.is_soon_sold_out = product.is_soon_sold_out === 'Y'; |
127 | + product.url = helpers.urlFormat(`/product/pro_${product.product_id}_${product.goods_list[0].goods_id}/${product.cn_alphabet}.html`); // eslint-disable-line | ||
130 | 128 | ||
131 | // APP访问需要加附加的参数 | 129 | // APP访问需要加附加的参数 |
132 | // 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护 | 130 | // 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护 |
133 | if (options.isApp) { | 131 | if (options.isApp) { |
134 | - product.url += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${product.productSkn}"}}`; // eslint-disable-line | 132 | + product.url += `?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${product.product_skn}"}}`; // eslint-disable-line |
135 | } | 133 | } |
136 | 134 | ||
137 | if (options.showTags) { | 135 | if (options.showTags) { |
138 | product.tags = {}; | 136 | product.tags = {}; |
139 | 137 | ||
140 | - product.tags.isNew = options.showNew && product.isNew === 'Y'; // 新品 | ||
141 | - product.tags.isDiscount = options.showSale && product.isDiscount === 'Y'; // 在售 | ||
142 | - product.tags.isLimited = product.isLimited === 'Y'; // 限量 | ||
143 | - product.tags.isYohood = product.isYohood === 'Y'; // YOHOOD | ||
144 | - product.tags.midYear = product.midYear === 'Y'; // 年中 | ||
145 | - product.tags.yearEnd = product.yearEnd === 'Y'; // 年末 | ||
146 | - product.tags.isAdvance = product.isAdvance === 'Y'; // 再到着 | 138 | + product.tags.is_new = options.showNew && product.is_new === 'Y'; // 新品 |
139 | + product.tags.is_discount = options.showSale && product.is_discount === 'Y'; // 在售 | ||
140 | + product.tags.is_limited = product.is_limited === 'Y'; // 限量 | ||
141 | + product.tags.is_yohood = product.is_yohood === 'Y'; // YOHOOD | ||
142 | + product.tags.mid_year = product.mid_year === 'Y'; // 年中 | ||
143 | + product.tags.year_end = product.year_end === 'Y'; // 年末 | ||
144 | + product.tags.is_advance = product.is_advance === 'Y'; // 再到着 | ||
147 | 145 | ||
148 | // 打折与即将售完组合显示打折 | 146 | // 打折与即将售完组合显示打折 |
149 | - if (product.isSoonSoldOut && product.tags.isDiscount) { | ||
150 | - product.tags.isNew = false; | ||
151 | - } else if (product.tags.isDiscount && | ||
152 | - (product.tags.isNew || product.tags.isLimited || product.tags.isYohood || product.tags.isAdvance)) { | 147 | + if (product.is_soon_sold_out && product.tags.is_discount) { |
148 | + product.tags.is_new = false; | ||
149 | + } else if (product.tags.is_discount && | ||
150 | + (product.tags.is_new || product.tags.is_limited || product.tags.is_yohood || product.tags.is_advance)) { | ||
153 | // 打折与其它组合则隐藏打折 | 151 | // 打折与其它组合则隐藏打折 |
154 | - product.tags.isDiscount = false; | ||
155 | - } else if (product.tags.isYohood && product.tags.isNew) { | 152 | + product.tags.is_discount = false; |
153 | + } else if (product.tags.is_yohood && product.tags.is_new) { | ||
156 | // YOHOOD和新品组合显示YOHOOD | 154 | // YOHOOD和新品组合显示YOHOOD |
157 | - product.tags.isNew = false; | 155 | + product.tags.is_new = false; |
158 | } | 156 | } |
159 | } | 157 | } |
160 | 158 | ||
@@ -181,7 +179,7 @@ exports.processFilter = (list, options) => { | @@ -181,7 +179,7 @@ exports.processFilter = (list, options) => { | ||
181 | name: '所有品牌', | 179 | name: '所有品牌', |
182 | title: '品牌', | 180 | title: '品牌', |
183 | dataId: 'id', | 181 | dataId: 'id', |
184 | - subsName: 'brandName', | 182 | + subsName: 'brand_name', |
185 | firstSub: 0, | 183 | firstSub: 0, |
186 | dataType: 'brand', | 184 | dataType: 'brand', |
187 | sortNum: '2' | 185 | sortNum: '2' |
@@ -189,8 +187,8 @@ exports.processFilter = (list, options) => { | @@ -189,8 +187,8 @@ exports.processFilter = (list, options) => { | ||
189 | color: { | 187 | color: { |
190 | name: '所有颜色', | 188 | name: '所有颜色', |
191 | title: '颜色', | 189 | title: '颜色', |
192 | - dataId: 'colorId', | ||
193 | - subsName: 'colorName', | 190 | + dataId: 'color_id', |
191 | + subsName: 'color_name', | ||
194 | firstSub: 0, | 192 | firstSub: 0, |
195 | dataType: 'color', | 193 | dataType: 'color', |
196 | sortNum: '4' | 194 | sortNum: '4' |
@@ -216,8 +214,8 @@ exports.processFilter = (list, options) => { | @@ -216,8 +214,8 @@ exports.processFilter = (list, options) => { | ||
216 | groupSort: { | 214 | groupSort: { |
217 | name: '所有品类', | 215 | name: '所有品类', |
218 | title: '品类', | 216 | title: '品类', |
219 | - dataId: 'relationParameter', | ||
220 | - subsName: 'categoryName', | 217 | + dataId: 'relation_parameter', |
218 | + subsName: 'category_name', | ||
221 | firstSub: 0, | 219 | firstSub: 0, |
222 | dataType: 'sort', | 220 | dataType: 'sort', |
223 | sortNum: '3' | 221 | sortNum: '3' |
@@ -234,8 +232,8 @@ exports.processFilter = (list, options) => { | @@ -234,8 +232,8 @@ exports.processFilter = (list, options) => { | ||
234 | size: { | 232 | size: { |
235 | name: '所有尺码', | 233 | name: '所有尺码', |
236 | title: '尺码', | 234 | title: '尺码', |
237 | - dataId: 'sizeId', | ||
238 | - subsName: 'sizeName', | 235 | + dataId: 'size_id', |
236 | + subsName: 'size_name', | ||
239 | firstSub: 0, | 237 | firstSub: 0, |
240 | dataType: 'size', | 238 | dataType: 'size', |
241 | sortNum: '5' | 239 | sortNum: '5' |
@@ -255,7 +253,7 @@ exports.processFilter = (list, options) => { | @@ -255,7 +253,7 @@ exports.processFilter = (list, options) => { | ||
255 | gender: '1,2,3', // 默认选择的性别,默认1,2,3表示所有 | 253 | gender: '1,2,3', // 默认选择的性别,默认1,2,3表示所有 |
256 | exclude: null // 需要排除的字段 | 254 | exclude: null // 需要排除的字段 |
257 | }, options); | 255 | }, options); |
258 | - list = camelCase(list); | 256 | + |
259 | 257 | ||
260 | _.forEach(list, (item, key) => { | 258 | _.forEach(list, (item, key) => { |
261 | let classify = { | 259 | let classify = { |
@@ -266,7 +264,7 @@ exports.processFilter = (list, options) => { | @@ -266,7 +264,7 @@ exports.processFilter = (list, options) => { | ||
266 | return; | 264 | return; |
267 | } | 265 | } |
268 | 266 | ||
269 | - if ((options.hideSize && key === 'size') || (options.hideSort && key === 'groupSort')) { | 267 | + if ((options.hideSize && key === 'size') || (options.hideSort && key === 'group_sort')) { |
270 | return; | 268 | return; |
271 | } | 269 | } |
272 | 270 | ||
@@ -294,8 +292,8 @@ exports.processFilter = (list, options) => { | @@ -294,8 +292,8 @@ exports.processFilter = (list, options) => { | ||
294 | subs.dataId = sub._key; | 292 | subs.dataId = sub._key; |
295 | } else if (filtersType[key].dataId === 'key') { | 293 | } else if (filtersType[key].dataId === 'key') { |
296 | subs.dataId = index; | 294 | subs.dataId = index; |
297 | - } else if (filtersType[key].dataId === 'relationParameter') { | ||
298 | - subs.dataId = sub.relationParameter['sort']; // eslint-disable-line | 295 | + } else if (filtersType[key].dataId === 'relation_parameter') { |
296 | + subs.dataId = sub.relation_parameter['sort']; // eslint-disable-line | ||
299 | } else { | 297 | } else { |
300 | subs.dataId = sub[filtersType[key].dataId]; | 298 | subs.dataId = sub[filtersType[key].dataId]; |
301 | } | 299 | } |
1 | const _ = require('lodash'); | 1 | const _ = require('lodash'); |
2 | const processTime = require('./time-process'); | 2 | const processTime = require('./time-process'); |
3 | -const camelCase = global.yoho.camelCase; | ||
4 | 3 | ||
5 | /** | 4 | /** |
6 | * 处理楼层数据 | 5 | * 处理楼层数据 |
@@ -11,10 +10,9 @@ module.exports = (list) => { | @@ -11,10 +10,9 @@ module.exports = (list) => { | ||
11 | const formatData = []; | 10 | const formatData = []; |
12 | 11 | ||
13 | list = list || []; | 12 | list = list || []; |
14 | - list = camelCase(list); | ||
15 | 13 | ||
16 | _.forEach(list, (floor) => { | 14 | _.forEach(list, (floor) => { |
17 | - floor[_.camelCase(floor.templateName)] = true; | 15 | + floor[_.camelCase(floor.template_name)] = true; |
18 | 16 | ||
19 | // 特殊资源位处理 | 17 | // 特殊资源位处理 |
20 | // PLUS | 18 | // PLUS |
@@ -26,9 +24,9 @@ module.exports = (list) => { | @@ -26,9 +24,9 @@ module.exports = (list) => { | ||
26 | 24 | ||
27 | // 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装 | 25 | // 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装 |
28 | if (floor.recommendContentOne && floor.data) { | 26 | if (floor.recommendContentOne && floor.data) { |
29 | - if (floor.data.bigImage && floor.data.bigImage.length > 1) { | ||
30 | - floor.data.bigImage = { | ||
31 | - bigList: floor.data.bigImage | 27 | + if (floor.data.big_image && floor.data.big_image.length > 1) { |
28 | + floor.data.big_image = { | ||
29 | + bigList: floor.data.big_image | ||
32 | }; | 30 | }; |
33 | } | 31 | } |
34 | } | 32 | } |
@@ -36,14 +34,14 @@ module.exports = (list) => { | @@ -36,14 +34,14 @@ module.exports = (list) => { | ||
36 | // OUTLETS | 34 | // OUTLETS |
37 | if (floor.titleImage && floor.data) { | 35 | if (floor.titleImage && floor.data) { |
38 | if (floor.data.image) { | 36 | if (floor.data.image) { |
39 | - floor.data.bigImage = { | 37 | + floor.data.big_image = { |
40 | bigList: [floor.data.image] | 38 | bigList: [floor.data.image] |
41 | }; | 39 | }; |
42 | } | 40 | } |
43 | 41 | ||
44 | floor.data.title = { | 42 | floor.data.title = { |
45 | - moreName: floor.data.moreName, | ||
46 | - moreUrl: floor.data.moreUrl, | 43 | + more_name: floor.data.more_name, |
44 | + more_url: floor.data.more_url, | ||
47 | title: floor.data.title | 45 | title: floor.data.title |
48 | }; | 46 | }; |
49 | } | 47 | } |
-
Please register or login to post a comment