Showing
8 changed files
with
24 additions
and
7 deletions
@@ -21,6 +21,7 @@ const shop = { | @@ -21,6 +21,7 @@ const shop = { | ||
21 | let domain = req.params.domain; | 21 | let domain = req.params.domain; |
22 | let uid = req.user.uid; | 22 | let uid = req.user.uid; |
23 | let shopId = req.query.shopId; | 23 | let shopId = req.query.shopId; |
24 | + let channel = req.query._Channel || req.cookies._Channel || 'men'; | ||
24 | let data = { | 25 | let data = { |
25 | module: 'product', | 26 | module: 'product', |
26 | page: 'shop', | 27 | page: 'shop', |
@@ -30,7 +31,7 @@ const shop = { | @@ -30,7 +31,7 @@ const shop = { | ||
30 | ShopData.getShopHeadData(domain, shopId, uid).then(result => { | 31 | ShopData.getShopHeadData(domain, shopId, uid).then(result => { |
31 | 32 | ||
32 | if (result.shopId) { | 33 | if (result.shopId) { |
33 | - let nav = [DataHelper.getChannelNav()]; | 34 | + let nav = [DataHelper.getChannelNav(channel)]; |
34 | 35 | ||
35 | nav.push({ | 36 | nav.push({ |
36 | name: result.name | 37 | name: result.name |
@@ -104,7 +105,8 @@ const shop = { | @@ -104,7 +105,8 @@ const shop = { | ||
104 | 105 | ||
105 | q.order = q.order || 's_n_desc'; | 106 | q.order = q.order || 's_n_desc'; |
106 | q.page = parseInt(q.page || 1, 10); | 107 | q.page = parseInt(q.page || 1, 10); |
107 | - q.yh_channel = channel; | 108 | + |
109 | + // q.yh_channel = channel; | ||
108 | 110 | ||
109 | ShopData.getShopHeadData(domain, shopId, uid).then(result => { | 111 | ShopData.getShopHeadData(domain, shopId, uid).then(result => { |
110 | data.banner = result; | 112 | data.banner = result; |
@@ -441,7 +441,7 @@ const helpers = { | @@ -441,7 +441,7 @@ const helpers = { | ||
441 | goodsId = goodsList[0].goodsId; | 441 | goodsId = goodsList[0].goodsId; |
442 | 442 | ||
443 | goodsList.forEach(o => { | 443 | goodsList.forEach(o => { |
444 | - o.url = `${config.siteUrl}/product/pro_${g.productId}_${o.goodsId}/${o.cnAlphabet}.html`; | 444 | + o.url = `${config.siteUrl}/product/pro_${g.productId}_${o.goodsId}/${g.cnAlphabet}.html`; |
445 | if (q && q.color && q.color === o.colorId) { | 445 | if (q && q.color && q.color === o.colorId) { |
446 | defaultImages = o.imagesUrl; | 446 | defaultImages = o.imagesUrl; |
447 | } | 447 | } |
@@ -123,6 +123,7 @@ const ShopService = { | @@ -123,6 +123,7 @@ const ShopService = { | ||
123 | getShopHeadData(domain, shopId, uid) { | 123 | getShopHeadData(domain, shopId, uid) { |
124 | return co(function*() { | 124 | return co(function*() { |
125 | let info = {}; | 125 | let info = {}; |
126 | + let favType = 'brand'; | ||
126 | 127 | ||
127 | if (shopId) { | 128 | if (shopId) { |
128 | info.shopId = shopId; | 129 | info.shopId = shopId; |
@@ -157,6 +158,7 @@ const ShopService = { | @@ -157,6 +158,7 @@ const ShopService = { | ||
157 | } | 158 | } |
158 | info.resources = resources; | 159 | info.resources = resources; |
159 | info.menus = shopMenu(domain, resources.navigationBar); | 160 | info.menus = shopMenu(domain, resources.navigationBar); |
161 | + favType = 'shop'; | ||
160 | } | 162 | } |
161 | if (info.brandId) { | 163 | if (info.brandId) { |
162 | let brandInfo = yield BrandService.getBrandInfo(info.brandId, uid); | 164 | let brandInfo = yield BrandService.getBrandInfo(info.brandId, uid); |
@@ -165,9 +167,13 @@ const ShopService = { | @@ -165,9 +167,13 @@ const ShopService = { | ||
165 | 167 | ||
166 | // info.info = brandInfo.brandIntro; | 168 | // info.info = brandInfo.brandIntro; |
167 | info.btnName = '品牌介绍'; | 169 | info.btnName = '品牌介绍'; |
170 | + if (!info.isFavorite && brandInfo.isFavorite === 'Y') { | ||
171 | + favType = 'brand'; | ||
172 | + } | ||
168 | info.isFavorite = info.isFavorite || (brandInfo.isFavorite === 'Y'); | 173 | info.isFavorite = info.isFavorite || (brandInfo.isFavorite === 'Y'); |
169 | info.banner = info.banner || info.brandBanner; | 174 | info.banner = info.banner || info.brandBanner; |
170 | } | 175 | } |
176 | + info.favType = favType; | ||
171 | return info; | 177 | return info; |
172 | })(); | 178 | })(); |
173 | } | 179 | } |
1 | {{# banner}} | 1 | {{# banner}} |
2 | - <div class="brand-banner" data-brand="{{brandId}}" data-shop="{{shopId}}"> | 2 | + <div class="brand-banner" data-brand="{{brandId}}" data-shop="{{shopId}}" data-type="{{favType}}"> |
3 | <div class="brand-img" style="height:150px; background: url('{{image banner 1150 150}}')"></div> | 3 | <div class="brand-img" style="height:150px; background: url('{{image banner 1150 150}}')"></div> |
4 | 4 | ||
5 | {{#if showShopName}} | 5 | {{#if showShopName}} |
No preview for this file type
@@ -28,11 +28,14 @@ $('#brand-fav').click(function() { | @@ -28,11 +28,14 @@ $('#brand-fav').click(function() { | ||
28 | var $banner = $(this).parents('.brand-banner'); | 28 | var $banner = $(this).parents('.brand-banner'); |
29 | var shopId = $banner.data('shop'); | 29 | var shopId = $banner.data('shop'); |
30 | var brandId = $banner.data('brand'); | 30 | var brandId = $banner.data('brand'); |
31 | + var type = $banner.data('type'); | ||
31 | var isAdd = $(this).hasClass('coled'); | 32 | var isAdd = $(this).hasClass('coled'); |
32 | 33 | ||
33 | - if (shopId) { | 34 | + if (type === 'shop') { |
34 | _favShop(shopId, isAdd); | 35 | _favShop(shopId, isAdd); |
35 | - } else if (brandId) { | 36 | + } else if (type === 'brand') { |
37 | + _favBrand(brandId, isAdd); | ||
38 | + } else { | ||
36 | _favBrand(brandId, isAdd); | 39 | _favBrand(brandId, isAdd); |
37 | } | 40 | } |
38 | }); | 41 | }); |
@@ -353,6 +353,11 @@ | @@ -353,6 +353,11 @@ | ||
353 | overflow: hidden; | 353 | overflow: hidden; |
354 | text-overflow: ellipsis; | 354 | text-overflow: ellipsis; |
355 | white-space: nowrap; | 355 | white-space: nowrap; |
356 | + | ||
357 | + a { | ||
358 | + line-height: 17px; | ||
359 | + font-size: 12px; | ||
360 | + } | ||
356 | } | 361 | } |
357 | 362 | ||
358 | .goods-price { | 363 | .goods-price { |
@@ -424,7 +429,7 @@ | @@ -424,7 +429,7 @@ | ||
424 | height: 800px; | 429 | height: 800px; |
425 | 430 | ||
426 | .tip-search { | 431 | .tip-search { |
427 | - margin-top: 100px; | 432 | + padding-top: 100px; |
428 | text-align: center; | 433 | text-align: center; |
429 | 434 | ||
430 | .iconfont { | 435 | .iconfont { |
-
Please register or login to post a comment