标题改变tab显示问题 review by guoshuai
Showing
10 changed files
with
68 additions
and
26 deletions
@@ -32,7 +32,10 @@ module.exports = class extends global.yoho.BaseModel { | @@ -32,7 +32,10 @@ module.exports = class extends global.yoho.BaseModel { | ||
32 | super(ctx); | 32 | super(ctx); |
33 | 33 | ||
34 | this.searchApi = new SearchApi(ctx); | 34 | this.searchApi = new SearchApi(ctx); |
35 | - | 35 | + this.getGoodsFloor = { |
36 | + 最新上架: 'newArrivls', | ||
37 | + 新增导航: 'newFloor' | ||
38 | + }; | ||
36 | this.floorMap = { | 39 | this.floorMap = { |
37 | slide: this._getSlideData.bind(this), | 40 | slide: this._getSlideData.bind(this), |
38 | hot: this._getHotGoodsFloorData.bind(this), | 41 | hot: this._getHotGoodsFloorData.bind(this), |
@@ -42,7 +45,8 @@ module.exports = class extends global.yoho.BaseModel { | @@ -42,7 +45,8 @@ module.exports = class extends global.yoho.BaseModel { | ||
42 | 'BOY KIDS': this._getSingleHotFloorData.bind(this), | 45 | 'BOY KIDS': this._getSingleHotFloorData.bind(this), |
43 | ACCESSORIES: this._getSingleHotFloorData.bind(this), | 46 | ACCESSORIES: this._getSingleHotFloorData.bind(this), |
44 | 优选品牌: this._getPreBrandTopData.bind(this), | 47 | 优选品牌: this._getPreBrandTopData.bind(this), |
45 | - 最新上架: this._getNewGoodsFloorData.bind(this), | 48 | + 最新上架: this._getGoodsFloorData.bind(this), |
49 | + 新增导航: this._getGoodsFloorData.bind(this), | ||
46 | ad: this._getadbannerData.bind(this), | 50 | ad: this._getadbannerData.bind(this), |
47 | category: this._getCategoryFloorData.bind(this), | 51 | category: this._getCategoryFloorData.bind(this), |
48 | accordion: this._getAccordionFloorData.bind(this), | 52 | accordion: this._getAccordionFloorData.bind(this), |
@@ -585,6 +589,25 @@ module.exports = class extends global.yoho.BaseModel { | @@ -585,6 +589,25 @@ module.exports = class extends global.yoho.BaseModel { | ||
585 | return this._getGirlsSingleHot(args, type); | 589 | return this._getGirlsSingleHot(args, type); |
586 | } | 590 | } |
587 | } | 591 | } |
592 | + _getGoodsFloorData(args) { | ||
593 | + console.log(args); | ||
594 | + let name = args[0].data.text; | ||
595 | + let floorKey = this.getGoodsFloor[name]; | ||
596 | + | ||
597 | + const data = {}; | ||
598 | + | ||
599 | + if (!_.isEmpty(args)) { | ||
600 | + data[floorKey] = { | ||
601 | + floorId: args[0].template_id, | ||
602 | + name: name === '最新上架' ? _.replace(name, '最新', '新品') : name, | ||
603 | + templateName: floorKey, | ||
604 | + navs: [] | ||
605 | + }; | ||
606 | + | ||
607 | + data[floorKey].navs = args[1] ? args[1].data : {}; | ||
608 | + } | ||
609 | + return data; | ||
610 | + } | ||
588 | 611 | ||
589 | /** | 612 | /** |
590 | * 组装最新上架楼层数据 | 613 | * 组装最新上架楼层数据 |
@@ -593,6 +616,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -593,6 +616,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
593 | * return obj | 616 | * return obj |
594 | */ | 617 | */ |
595 | _getNewGoodsFloorData(args) { | 618 | _getNewGoodsFloorData(args) { |
619 | + console.log(args); | ||
596 | const data = {}; | 620 | const data = {}; |
597 | 621 | ||
598 | if (!_.isEmpty(args)) { | 622 | if (!_.isEmpty(args)) { |
@@ -628,7 +652,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -628,7 +652,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
628 | } | 652 | } |
629 | 653 | ||
630 | if (resData.floorHeader.name.indexOf('最新上架') >= 0) { | 654 | if (resData.floorHeader.name.indexOf('最新上架') >= 0) { |
631 | - resData = this._getNewGoodsFloorData(args); | 655 | + resData = this._getGoodsFloorData(args); |
632 | } | 656 | } |
633 | return resData; | 657 | return resData; |
634 | } | 658 | } |
@@ -1215,6 +1239,7 @@ module.exports = class extends global.yoho.BaseModel { | @@ -1215,6 +1239,7 @@ module.exports = class extends global.yoho.BaseModel { | ||
1215 | * @return {Object} | 1239 | * @return {Object} |
1216 | */ | 1240 | */ |
1217 | getContent(type, isJKChannel, poolId) { | 1241 | getContent(type, isJKChannel, poolId) { |
1242 | + let that = this; | ||
1218 | let params = {new_device: 'Y'}; | 1243 | let params = {new_device: 'Y'}; |
1219 | const headerModelCtx = new HeaderModel(this.ctx); | 1244 | const headerModelCtx = new HeaderModel(this.ctx); |
1220 | 1245 | ||
@@ -1237,11 +1262,14 @@ module.exports = class extends global.yoho.BaseModel { | @@ -1237,11 +1262,14 @@ module.exports = class extends global.yoho.BaseModel { | ||
1237 | data.pageType = type; | 1262 | data.pageType = type; |
1238 | data.footerTop = true; | 1263 | data.footerTop = true; |
1239 | data.channel = processResult.floors.map(function(elem) { | 1264 | data.channel = processResult.floors.map(function(elem) { |
1265 | + let keyArr = Object.values(that.getGoodsFloor); | ||
1266 | + let tarKey = Object.keys(elem)[0]; | ||
1240 | 1267 | ||
1241 | - if (elem.newArrivls) { | ||
1242 | - elem.newArrivls.goods = res[2]; | 1268 | + if (keyArr.includes(tarKey)) { |
1269 | + console.log(tarKey); | ||
1270 | + elem[tarKey].goods = res[2]; | ||
1271 | + console.log(elem[tarKey]); | ||
1243 | } | 1272 | } |
1244 | - | ||
1245 | return elem; | 1273 | return elem; |
1246 | }); | 1274 | }); |
1247 | 1275 |
@@ -86,6 +86,10 @@ | @@ -86,6 +86,10 @@ | ||
86 | {{# newArrivls}} | 86 | {{# newArrivls}} |
87 | {{> commodity}} | 87 | {{> commodity}} |
88 | {{/ newArrivls}} | 88 | {{/ newArrivls}} |
89 | + {{! 新分类楼层}} | ||
90 | + {{# newFloor}} | ||
91 | + {{> new-category}} | ||
92 | + {{/ newFloor}} | ||
89 | {{! 七个类别列表}} | 93 | {{! 七个类别列表}} |
90 | {{# sevenCategory}} | 94 | {{# sevenCategory}} |
91 | {{> seven-product}} | 95 | {{> seven-product}} |
apps/channel/views/partial/new-category.hbs
0 → 100644
@@ -24,11 +24,11 @@ | @@ -24,11 +24,11 @@ | ||
24 | </div> | 24 | </div> |
25 | 25 | ||
26 | <div id="tab-box"> | 26 | <div id="tab-box"> |
27 | - <ul class="tabs" id="tabs"> | 27 | + {{!-- <ul class="tabs" id="tabs"> |
28 | {{# pay}} | 28 | {{# pay}} |
29 | <li{{#if selected}} class="active"{{/if}}>{{name}}</li> | 29 | <li{{#if selected}} class="active"{{/if}}>{{name}}</li> |
30 | {{/pay}} | 30 | {{/pay}} |
31 | - </ul> | 31 | + </ul> --}} |
32 | 32 | ||
33 | <ul class="tab-conbox"> | 33 | <ul class="tab-conbox"> |
34 | {{# pay}} | 34 | {{# pay}} |
@@ -52,6 +52,7 @@ const getMenuData = () => ( | @@ -52,6 +52,7 @@ const getMenuData = () => ( | ||
52 | * @return {array} 导航数组 | 52 | * @return {array} 导航数组 |
53 | */ | 53 | */ |
54 | const getNavBar = (data, type) => { | 54 | const getNavBar = (data, type) => { |
55 | + // 统一默认为boys | ||
55 | let navBars = []; | 56 | let navBars = []; |
56 | 57 | ||
57 | _.forEach(data, item => { | 58 | _.forEach(data, item => { |
@@ -59,16 +60,18 @@ const getNavBar = (data, type) => { | @@ -59,16 +60,18 @@ const getNavBar = (data, type) => { | ||
59 | let lowEn = _.camelCase(item.sort_name_en).toLowerCase(); | 60 | let lowEn = _.camelCase(item.sort_name_en).toLowerCase(); |
60 | 61 | ||
61 | Object.assign(obj, { | 62 | Object.assign(obj, { |
62 | - type: lowEn, | 63 | + // type: lowEn, |
64 | + type: 'boys', | ||
63 | link: item.sort_url, | 65 | link: item.sort_url, |
64 | cn: item.sort_name, | 66 | cn: item.sort_name, |
65 | en: item.sort_name_en, | 67 | en: item.sort_name_en, |
66 | isNewPage: item.is_new_page === 'Y' | 68 | isNewPage: item.is_new_page === 'Y' |
67 | }); | 69 | }); |
68 | 70 | ||
69 | - if (type === lowEn) { | ||
70 | - obj.active = true; | ||
71 | - } | 71 | + // if (type === lowEn) { |
72 | + // obj.active = true; | ||
73 | + // } | ||
74 | + obj.active = true; | ||
72 | 75 | ||
73 | // 奥莱频道显示图片,特殊处理 | 76 | // 奥莱频道显示图片,特殊处理 |
74 | if (lowEn === 'outlets') { | 77 | if (lowEn === 'outlets') { |
@@ -169,9 +172,11 @@ const getSubNavGroup = (data, type) => { | @@ -169,9 +172,11 @@ const getSubNavGroup = (data, type) => { | ||
169 | let lowEn = _.camelCase(it.sort_name_en).toLowerCase(); | 172 | let lowEn = _.camelCase(it.sort_name_en).toLowerCase(); |
170 | 173 | ||
171 | subNavGroup.push({ | 174 | subNavGroup.push({ |
172 | - subType: lowEn, | 175 | + // subType: lowEn, |
176 | + subType: 'boys', | ||
173 | subNav: subNav, | 177 | subNav: subNav, |
174 | - active: lowEn === type | 178 | + active: true |
179 | + // active: lowEn === type | ||
175 | }); | 180 | }); |
176 | }); | 181 | }); |
177 | 182 |
@@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
6 | <li style="{{#if bgColor}}background:{{bgColor}}{{/if}}"> | 6 | <li style="{{#if bgColor}}background:{{bgColor}}{{/if}}"> |
7 | <a href="{{url}}" rel="nofollow" target= "_blank" title="{{title}}"> | 7 | <a href="{{url}}" rel="nofollow" target= "_blank" title="{{title}}"> |
8 | {{#if @first}} | 8 | {{#if @first}} |
9 | - <img src="{{image2 src w=1150 h=450}}" alt="{{title}}-YOHO!BUY有货"> | 9 | + <img src="{{image2 src w=1125 h=420}}" alt="{{title}}-YOHO!BUY有货"> |
10 | {{^}} | 10 | {{^}} |
11 | - <img class="lazy" data-original="{{image2 src w=1150 h=450}}" alt="{{title}}-YOHO!BUY有货"> | 11 | + <img class="lazy" data-original="{{image2 src w=1125 h=420}}" alt="{{title}}-YOHO!BUY有货"> |
12 | {{/if}} | 12 | {{/if}} |
13 | </a> | 13 | </a> |
14 | {{# tips}} | 14 | {{# tips}} |
@@ -44,9 +44,7 @@ if ($.inArray(homePage, ['boys', 'girls', 'kids', 'lifestyle']) > -1) { | @@ -44,9 +44,7 @@ if ($.inArray(homePage, ['boys', 'girls', 'kids', 'lifestyle']) > -1) { | ||
44 | lazyLoad($('img.lazy')); | 44 | lazyLoad($('img.lazy')); |
45 | 45 | ||
46 | if (homePage === 'boys') { | 46 | if (homePage === 'boys') { |
47 | - $('.slide-container').slider({ | ||
48 | - pagination: '.thumb-pagination' | ||
49 | - }); | 47 | + $('.slide-container').slider(); |
50 | } else { | 48 | } else { |
51 | $('.center-col').slider(); | 49 | $('.center-col').slider(); |
52 | $('.slide-container').slider(); | 50 | $('.slide-container').slider(); |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | position: absolute; | 6 | position: absolute; |
7 | left: 0; | 7 | left: 0; |
8 | right: 0; | 8 | right: 0; |
9 | - height: 450px; | 9 | + height: 430px; |
10 | } | 10 | } |
11 | 11 | ||
12 | .slide-thumb-container { | 12 | .slide-thumb-container { |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | 15 | ||
16 | .slide-wrapper { | 16 | .slide-wrapper { |
17 | position: relative; | 17 | position: relative; |
18 | - height: 450px; | 18 | + height: 430px; |
19 | overflow: hidden; | 19 | overflow: hidden; |
20 | 20 | ||
21 | ul { | 21 | ul { |
@@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
54 | } | 54 | } |
55 | 55 | ||
56 | .slide-container-placeholder { | 56 | .slide-container-placeholder { |
57 | - height: 450px; | 57 | + height: 430px; |
58 | width: 100%; | 58 | width: 100%; |
59 | } | 59 | } |
60 | 60 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | /* 大banner */ | 5 | /* 大banner */ |
6 | .slide-container { | 6 | .slide-container { |
7 | - height: 387px; | 7 | + height: 370px; |
8 | 8 | ||
9 | img { | 9 | img { |
10 | display: block; | 10 | display: block; |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | } | 16 | } |
17 | 17 | ||
18 | .slide-container-placeholder { | 18 | .slide-container-placeholder { |
19 | - height: 387px; | 19 | + height: 370px; |
20 | } | 20 | } |
21 | 21 | ||
22 | .slide-thumb-container-placeholder { | 22 | .slide-thumb-container-placeholder { |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | 25 | ||
26 | /* 大banner大图 */ | 26 | /* 大banner大图 */ |
27 | .slide-wrapper { | 27 | .slide-wrapper { |
28 | - height: 387px; | 28 | + height: 370px; |
29 | 29 | ||
30 | li { | 30 | li { |
31 | a { | 31 | a { |
-
Please register or login to post a comment