Showing
5 changed files
with
80 additions
and
15 deletions
@@ -20,6 +20,8 @@ const needParams = ['query', 'msort', 'misort', 'gender', 'shelveTime']; | @@ -20,6 +20,8 @@ const needParams = ['query', 'msort', 'misort', 'gender', 'shelveTime']; | ||
20 | 20 | ||
21 | // 品牌页folder名称 | 21 | // 品牌页folder名称 |
22 | const brandFolderSeries = '经典系列'; | 22 | const brandFolderSeries = '经典系列'; |
23 | +const folderTitle = '经典款型'; | ||
24 | +const seriesTitle = '经典系列'; | ||
23 | 25 | ||
24 | // 经典店铺list url | 26 | // 经典店铺list url |
25 | const shopListUrl = '/product/shoplist'; | 27 | const shopListUrl = '/product/shoplist'; |
@@ -507,23 +509,37 @@ const getAdnav = (params) => { | @@ -507,23 +509,37 @@ const getAdnav = (params) => { | ||
507 | let resData = {}; | 509 | let resData = {}; |
508 | 510 | ||
509 | return Promise.all([searchApi.getBrandShopFolder(params), searchApi.getBrandShopSeries(params)]).then(result => { | 511 | return Promise.all([searchApi.getBrandShopFolder(params), searchApi.getBrandShopSeries(params)]).then(result => { |
510 | - let list = []; | 512 | + let flist = []; |
513 | + let slist = []; | ||
511 | 514 | ||
512 | if (result[0].code === 200 && result[0].data) { | 515 | if (result[0].code === 200 && result[0].data) { |
513 | - list = _.concat(list, searchHandler.handleFolderData(result[0].data, params)); | 516 | + flist = searchHandler.handleFolderData(result[0].data, params); |
514 | } | 517 | } |
515 | 518 | ||
516 | if (result[1].code === 200 && result[1].data) { | 519 | if (result[1].code === 200 && result[1].data) { |
517 | - list = _.concat(list, searchHandler.handleSeriesData(result[1].data, params)); | 520 | + slist = searchHandler.handleSeriesData(result[1].data, params); |
518 | } | 521 | } |
519 | 522 | ||
520 | - if (list.length) { | ||
521 | - Object.assign(resData, { | ||
522 | - picTitle: brandFolderSeries, | ||
523 | - list: list | ||
524 | - }); | ||
525 | - } | 523 | + if (params.shopId) { |
524 | + resData.floder = flist.length ? { | ||
525 | + picTitle: folderTitle, | ||
526 | + list: flist | ||
527 | + } : {}; | ||
528 | + | ||
529 | + resData.series = slist.length ? { | ||
530 | + picTitle: seriesTitle, | ||
531 | + list: slist | ||
532 | + } : {}; | ||
533 | + } else { | ||
534 | + let list = _.concat(flist, slist); | ||
526 | 535 | ||
536 | + if (list.length) { | ||
537 | + Object.assign(resData, { | ||
538 | + picTitle: brandFolderSeries, | ||
539 | + list: list | ||
540 | + }); | ||
541 | + } | ||
542 | + } | ||
527 | 543 | ||
528 | return resData; | 544 | return resData; |
529 | }); | 545 | }); |
@@ -223,10 +223,21 @@ $productListNav.find('h3').click(function() { | @@ -223,10 +223,21 @@ $productListNav.find('h3').click(function() { | ||
223 | url: '/product/index/getAdnav', | 223 | url: '/product/index/getAdnav', |
224 | data: adData | 224 | data: adData |
225 | }).then(function(data) { | 225 | }).then(function(data) { |
226 | + var $adBox = $('#brand-shop-ad'); | ||
227 | + var hbc; | ||
228 | + | ||
226 | if (data) { | 229 | if (data) { |
227 | - $('#brand-shop-ad').html(Handlebars.compile(html)({ | ||
228 | - picLink: data | ||
229 | - })); | 230 | + hbc = Handlebars.compile(html); |
231 | + | ||
232 | + if (adData.shopId) { | ||
233 | + $adBox.addClass('shop-ad-nav').html(hbc({ | ||
234 | + picLink: [data.series, data.floder] | ||
235 | + })); | ||
236 | + } else { | ||
237 | + $adBox.html(hbc({ | ||
238 | + picLink: data | ||
239 | + })); | ||
240 | + } | ||
230 | } | 241 | } |
231 | }); | 242 | }); |
232 | } | 243 | } |
@@ -85,10 +85,17 @@ $('.shop-query-submit').on('click', function() { | @@ -85,10 +85,17 @@ $('.shop-query-submit').on('click', function() { | ||
85 | url: '/product/index/getAdnav', | 85 | url: '/product/index/getAdnav', |
86 | data: {shopId: shopId} | 86 | data: {shopId: shopId} |
87 | }).then(function(data) { | 87 | }).then(function(data) { |
88 | + var $sellRed = $('.sell-recommend'); | ||
89 | + | ||
88 | if (data) { | 90 | if (data) { |
89 | - $adBox.parent().append($adBox); | 91 | + if ($sellRed && $sellRed.length) { |
92 | + $sellRed.before($adBox); | ||
93 | + } else { | ||
94 | + $adBox.parent().append($adBox); | ||
95 | + } | ||
96 | + | ||
90 | $adBox.html(Handlebars.compile(html)({ | 97 | $adBox.html(Handlebars.compile(html)({ |
91 | - picLink: data | 98 | + picLink: [data.series, data.floder] |
92 | })); | 99 | })); |
93 | } | 100 | } |
94 | }); | 101 | }); |
@@ -97,11 +97,23 @@ | @@ -97,11 +97,23 @@ | ||
97 | height: 35px; | 97 | height: 35px; |
98 | line-height: 35px; | 98 | line-height: 35px; |
99 | color: #000; | 99 | color: #000; |
100 | - font-weight: bold; | ||
101 | border-bottom: 1px solid #ebebeb; | 100 | border-bottom: 1px solid #ebebeb; |
102 | font-size: 12px; | 101 | font-size: 12px; |
103 | } | 102 | } |
104 | 103 | ||
104 | + .shop-ad-nav > .nav-pic-title { | ||
105 | + width: 100%; | ||
106 | + height: 25px; | ||
107 | + line-height: 25px; | ||
108 | + background: #000; | ||
109 | + font-size: 14px; | ||
110 | + color: #fff; | ||
111 | + font-family: "黑体"; | ||
112 | + padding-left: 14px; | ||
113 | + box-sizing: border-box; | ||
114 | + margin-bottom: 4px; | ||
115 | + } | ||
116 | + | ||
105 | .pic-nav { | 117 | .pic-nav { |
106 | display: block; | 118 | display: block; |
107 | 119 |
@@ -552,6 +552,25 @@ | @@ -552,6 +552,25 @@ | ||
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
555 | + .brand-shop-ad { | ||
556 | + width: 160px; | ||
557 | + margin-top: 16px; | ||
558 | + float: left; | ||
559 | + | ||
560 | + .nav-pic-title { | ||
561 | + width: 100%; | ||
562 | + height: 25px; | ||
563 | + line-height: 25px; | ||
564 | + background: #000; | ||
565 | + font-size: 14px; | ||
566 | + color: #fff; | ||
567 | + font-family: "黑体"; | ||
568 | + padding-left: 14px; | ||
569 | + box-sizing: border-box; | ||
570 | + margin-bottom: 4px; | ||
571 | + } | ||
572 | + } | ||
573 | + | ||
555 | .left-modular { | 574 | .left-modular { |
556 | width: 160px; | 575 | width: 160px; |
557 | font-size: 14px; | 576 | font-size: 14px; |
-
Please register or login to post a comment