Showing
12 changed files
with
45 additions
and
48 deletions
@@ -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 | } |
@@ -130,6 +128,8 @@ const _getChannelResource = (params) => { | @@ -130,6 +128,8 @@ const _getChannelResource = (params) => { | ||
130 | params.new_device = true; // eslint-disable-line | 128 | params.new_device = true; // eslint-disable-line |
131 | } | 129 | } |
132 | 130 | ||
131 | + params.new_device = true; | ||
132 | + | ||
133 | return api.get('operations/api/v5/resource/home', params, { | 133 | return api.get('operations/api/v5/resource/home', params, { |
134 | cache: true | 134 | cache: true |
135 | }).then(result => { | 135 | }).then(result => { |
@@ -180,16 +180,16 @@ const _getChannelList = () => { | @@ -180,16 +180,16 @@ const _getChannelList = () => { | ||
180 | 180 | ||
181 | list.channelList = []; | 181 | list.channelList = []; |
182 | list.yohood = {}; | 182 | list.yohood = {}; |
183 | - result.data.list = camelCase(result.data.list || []); | 183 | + result.data.list = result.data.list || []; |
184 | 184 | ||
185 | _.forEach(result.data.list, function(item) { | 185 | _.forEach(result.data.list, function(item) { |
186 | - const channel = channelList[item.yhChannel - 1]; | 186 | + const channel = channelList[item.yh_channel - 1]; |
187 | 187 | ||
188 | if (channel) { | 188 | if (channel) { |
189 | list.channelList.push(channel); | 189 | list.channelList.push(channel); |
190 | } | 190 | } |
191 | 191 | ||
192 | - if (_.toNumber(item.yhChannel) === 5) { | 192 | + if (_.toNumber(item.yh_channel) === 5) { |
193 | list.yohood.showYohood = true; | 193 | list.yohood.showYohood = true; |
194 | list.yohood.yohoodHref = 'http://www.yohood.cn'; | 194 | list.yohood.yohoodHref = 'http://www.yohood.cn'; |
195 | } | 195 | } |
@@ -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 sortNameColor}}color:{{sortNameColor}};{{/if}}"> | ||
8 | {{else}} | 8 | {{else}} |
9 | <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | 9 | <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/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 sortNameColor}}color:{{sortNameColor}};{{/if}}"> | ||
29 | {{else}} | 29 | {{else}} |
30 | <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | 30 | <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/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}} |
@@ -87,7 +87,6 @@ const _processDiscount = (list) => { | @@ -87,7 +87,6 @@ const _processDiscount = (list) => { | ||
87 | let flag = true; | 87 | let flag = true; |
88 | 88 | ||
89 | list = list || []; | 89 | list = list || []; |
90 | - list = camelCase(list); | ||
91 | 90 | ||
92 | // list为1条数据是表示详情页,flag 设为false,不需要拼接跳转链接 | 91 | // list为1条数据是表示详情页,flag 设为false,不需要拼接跳转链接 |
93 | if (list.length === 1) { | 92 | if (list.length === 1) { |
@@ -96,7 +95,7 @@ const _processDiscount = (list) => { | @@ -96,7 +95,7 @@ const _processDiscount = (list) => { | ||
96 | 95 | ||
97 | _.forEach(list, (data) => { | 96 | _.forEach(list, (data) => { |
98 | if (flag === true) { | 97 | if (flag === true) { |
99 | - Object.assign(data, processTime(data.leftTime)); | 98 | + Object.assign(data, processTime(data.left_time)); |
100 | } | 99 | } |
101 | 100 | ||
102 | formatData.push(data); | 101 | formatData.push(data); |
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 | {{#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,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
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 warnColor}}red-color{{/if}}">{{time}}</span> |
1 | {{#data}} | 1 | {{#data}} |
2 | {{> common/floor-header-more}} | 2 | {{> common/floor-header-more}} |
3 | <div class="fresh-only"> | 3 | <div class="fresh-only"> |
4 | - {{# bannerImage}} | 4 | + {{# banner_image}} |
5 | <div class="fresh-swiper"> | 5 | <div class="fresh-swiper"> |
6 | <a href="{{url}}"> | 6 | <a href="{{url}}"> |
7 | <img class="lazy" data-original="{{image src 640 200}}"> | 7 | <img class="lazy" data-original="{{image src 640 200}}"> |
8 | </a> | 8 | </a> |
9 | </div> | 9 | </div> |
10 | - {{/ bannerImage}} | 10 | + {{/ banner_image}} |
11 | <div class="fresh-list-swiper"> | 11 | <div class="fresh-list-swiper"> |
12 | <ul class="clearfix swiper-wrapper"> | 12 | <ul class="clearfix swiper-wrapper"> |
13 | {{# list}} | 13 | {{# list}} |
14 | <li class="swiper-slide"> | 14 | <li class="swiper-slide"> |
15 | <div class="img-box"> | 15 | <div class="img-box"> |
16 | <a href="{{url}}"> | 16 | <a href="{{url}}"> |
17 | - <img class="swiper-lazy" data-src="{{image defaultImages 235 314}}" alt=""> | 17 | + <img class="swiper-lazy" data-src="{{image default_images 235 314}}" alt=""> |
18 | </a> | 18 | </a> |
19 | <div class="swiper-lazy-preloader"></div> | 19 | <div class="swiper-lazy-preloader"></div> |
20 | </div> | 20 | </div> |
21 | <div class="fresh-info"> | 21 | <div class="fresh-info"> |
22 | - <p class="fresh-name"><a href="{{url}}">{{productName}}</a></p> | 22 | + <p class="fresh-name"><a href="{{url}}">{{product_name}}</a></p> |
23 | <p class="price"> | 23 | <p class="price"> |
24 | - <span class="cur-price">¥{{salesPrice}}</span> | ||
25 | - {{# marketPrice}} | 24 | + <span class="cur-price">¥{{sales_price}}</span> |
25 | + {{# market_price}} | ||
26 | <span class="old-price">¥{{.}}</span> | 26 | <span class="old-price">¥{{.}}</span> |
27 | - {{/marketPrice}} | 27 | + {{/market_price}} |
28 | </p> | 28 | </p> |
29 | <span class="fresh-icon">新人价</span> | 29 | <span class="fresh-icon">新人价</span> |
30 | </div> | 30 | </div> |
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}} |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | <p class="title">{{title}}</p> | 14 | <p class="title">{{title}}</p> |
15 | <p class="time"> | 15 | <p class="time"> |
16 | <span class="iconfont time-icon"></span> | 16 | <span class="iconfont time-icon"></span> |
17 | - <span>{{publishTime}}</span> | 17 | + <span>{{publish_time}}</span> |
18 | </p> | 18 | </p> |
19 | </div> | 19 | </div> |
20 | </a> | 20 | </a> |
@@ -12,9 +12,9 @@ | @@ -12,9 +12,9 @@ | ||
12 | <h3 class="recommend-title">推荐搭配</h3> | 12 | <h3 class="recommend-title">推荐搭配</h3> |
13 | <div class="recommend-swiper"> | 13 | <div class="recommend-swiper"> |
14 | <ul class="recommend-list swiper-wrapper clearfix"> | 14 | <ul class="recommend-list swiper-wrapper clearfix"> |
15 | - {{# recommendCollocation}} | 15 | + {{# recommend_collocation}} |
16 | <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{image src 140 140}}" alt="" /></a></li> | 16 | <li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{image src 140 140}}" alt="" /></a></li> |
17 | - {{/ recommendCollocation}} | 17 | + {{/ recommend_collocation}} |
18 | </ul> | 18 | </ul> |
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
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,7 +34,7 @@ module.exports = (list) => { | @@ -36,7 +34,7 @@ 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 | } |
@@ -51,7 +49,7 @@ module.exports = (list) => { | @@ -51,7 +49,7 @@ module.exports = (list) => { | ||
51 | // 折扣专场 | 49 | // 折扣专场 |
52 | if (floor.discountActivity && floor.data && floor.data.list.length) { | 50 | if (floor.discountActivity && floor.data && floor.data.list.length) { |
53 | _.map(floor.data.list, (item) => { | 51 | _.map(floor.data.list, (item) => { |
54 | - Object.assign(item, processTime(item.leftTime)); | 52 | + Object.assign(item, processTime(item.left_time)); |
55 | }); | 53 | }); |
56 | } | 54 | } |
57 | 55 |
-
Please register or login to post a comment