Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop
Showing
12 changed files
with
42 additions
and
32 deletions
@@ -8,7 +8,7 @@ Name | Path | Note | @@ -8,7 +8,7 @@ Name | Path | Note | ||
8 | 全部分类 | /cate-all | | 8 | 全部分类 | /cate-all | |
9 | 商品列表 | /product/list?sort=1 | | 9 | 商品列表 | /product/list?sort=1 | |
10 | 品牌店铺 | /product/shop/{domain} | | 10 | 品牌店铺 | /product/shop/{domain} | |
11 | -品牌店铺分享页面 | /brand/share/{domain} | | 11 | +品牌店铺分享页面 | /product/shop/{domain}/share | |
12 | 商品详情 | /product/{productId} | | 12 | 商品详情 | /product/{productId} | |
13 | 新品抢先看 | /product/new | | 13 | 新品抢先看 | /product/new | |
14 | 搜索页 | /product/search?query=xxx | | 14 | 搜索页 | /product/search?query=xxx | |
@@ -16,7 +16,7 @@ module.exports = { | @@ -16,7 +16,7 @@ module.exports = { | ||
16 | res.render('shop/index', { | 16 | res.render('shop/index', { |
17 | module: 'product', | 17 | module: 'product', |
18 | page: 'shop', | 18 | page: 'shop', |
19 | - domain: req.params[0] | 19 | + domain: req.params.domain |
20 | }); | 20 | }); |
21 | }, | 21 | }, |
22 | 22 | ||
@@ -77,7 +77,7 @@ module.exports = { | @@ -77,7 +77,7 @@ module.exports = { | ||
77 | res.render('shop/share', { | 77 | res.render('shop/share', { |
78 | module: 'product', | 78 | module: 'product', |
79 | page: 'shop-share', | 79 | page: 'shop-share', |
80 | - domain: req.params[0] | 80 | + domain: req.params.domain |
81 | }); | 81 | }); |
82 | } | 82 | } |
83 | }; | 83 | }; |
@@ -112,7 +112,7 @@ const getBrandShopGoodsData = params => { | @@ -112,7 +112,7 @@ const getBrandShopGoodsData = params => { | ||
112 | prettyFilter(subResult.data.filter); | 112 | prettyFilter(subResult.data.filter); |
113 | finalResult = { | 113 | finalResult = { |
114 | data: { | 114 | data: { |
115 | - productList: processProductList(subResult.data.product_list), | 115 | + productList: processProductList(subResult.data.product_list, {gender: params.gender}), |
116 | filter: subResult.data.filter, | 116 | filter: subResult.data.filter, |
117 | page: subResult.data.page, | 117 | page: subResult.data.page, |
118 | pageTotal: subResult.data.page_total | 118 | pageTotal: subResult.data.page_total |
@@ -33,11 +33,11 @@ router.get('/product/list.json', productList.fetchProducts); | @@ -33,11 +33,11 @@ router.get('/product/list.json', productList.fetchProducts); | ||
33 | const shop = require(`${cRoot}/shop`); | 33 | const shop = require(`${cRoot}/shop`); |
34 | 34 | ||
35 | router.get('/brand', shop.index); // 品牌 集合页 | 35 | router.get('/brand', shop.index); // 品牌 集合页 |
36 | -router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面 | ||
37 | router.get('/product/shop/info.json', shop.getShopInfo); // 店铺介绍 | 36 | router.get('/product/shop/info.json', shop.getShopInfo); // 店铺介绍 |
38 | router.get('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表 | 37 | router.get('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表 |
39 | router.post('/product/shop/collect.json', shop.collectShop); // 收藏品牌店铺 | 38 | router.post('/product/shop/collect.json', shop.collectShop); // 收藏品牌店铺 |
40 | -router.get('/product/shop/(.*)/', shop.index); // 品牌店铺页 | 39 | +router.get('/product/shop/:domain/', shop.index); // 品牌店铺页 |
40 | +router.get('/product/shop/:domain/share', shop.shopShare); // 品牌店铺页 | ||
41 | 41 | ||
42 | // 商品详情controller | 42 | // 商品详情controller |
43 | const detail = require(`${cRoot}/detail`); | 43 | const detail = require(`${cRoot}/detail`); |
@@ -51,6 +51,7 @@ router.get(/\/product\/cart-count.json/, detail.getCartCount); | @@ -51,6 +51,7 @@ router.get(/\/product\/cart-count.json/, detail.getCartCount); | ||
51 | router.get(/\/product\/search_product\.json/, detail.search); | 51 | router.get(/\/product\/search_product\.json/, detail.search); |
52 | 52 | ||
53 | // alias: TODO: 测试完成 删除一下router,并更新资源位 | 53 | // alias: TODO: 测试完成 删除一下router,并更新资源位 |
54 | +router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面 | ||
54 | router.get(/\/item\/([\d]+)(.*)\.html/, detail.index); // 商品详情routers | 55 | router.get(/\/item\/([\d]+)(.*)\.html/, detail.index); // 商品详情routers |
55 | router.get(/\/brand\/(.*)/, shop.index); // 店铺首页 | 56 | router.get(/\/brand\/(.*)/, shop.index); // 店铺首页 |
56 | 57 |
@@ -274,7 +274,8 @@ const intercept = (url) => { | @@ -274,7 +274,8 @@ const intercept = (url) => { | ||
274 | // 首页 | 274 | // 首页 |
275 | if (/\/$/.test(path)) { | 275 | if (/\/$/.test(path)) { |
276 | return yoho.goTab({ | 276 | return yoho.goTab({ |
277 | - index: 0 | 277 | + index: 0, |
278 | + url: /^(https?:)?\/\//i.test(url) ? url : origin + url | ||
278 | }); | 279 | }); |
279 | } | 280 | } |
280 | 281 |
@@ -50,7 +50,7 @@ Vue.filter('clothingGenderIdentity', (value) => { | @@ -50,7 +50,7 @@ Vue.filter('clothingGenderIdentity', (value) => { | ||
50 | * @param value brand domain | 50 | * @param value brand domain |
51 | */ | 51 | */ |
52 | Vue.filter('brandUrl', (value) => { | 52 | Vue.filter('brandUrl', (value) => { |
53 | - return `/brand/${value}`; | 53 | + return `/product/shop/${value}`; |
54 | }); | 54 | }); |
55 | 55 | ||
56 | /** | 56 | /** |
@@ -182,6 +182,8 @@ | @@ -182,6 +182,8 @@ | ||
182 | border-bottom: 1px solid #e6e6e6; | 182 | border-bottom: 1px solid #e6e6e6; |
183 | padding-left: 20px; | 183 | padding-left: 20px; |
184 | user-select: none; | 184 | user-select: none; |
185 | + white-space: nowrap; | ||
186 | + overflow-y: auto; | ||
185 | 187 | ||
186 | &.highlight { | 188 | &.highlight { |
187 | background: #eee; | 189 | background: #eee; |
@@ -7,10 +7,14 @@ | @@ -7,10 +7,14 @@ | ||
7 | </div> | 7 | </div> |
8 | <div class="filter-params"> | 8 | <div class="filter-params"> |
9 | <ul class="filter-cates"> | 9 | <ul class="filter-cates"> |
10 | - <li class="filter-cate" v-for="classify in config" v-if="showCate($key, classify)" @click="entrySub($key)"> | 10 | + <li class="filter-cate" |
11 | + v-for="classify in itemArr" | ||
12 | + v-if="config[classify] && showCate(classify, config[classify])" | ||
13 | + @click="entrySub(classify)" | ||
14 | + > | ||
11 | <i class="icon icon-right right"></i> | 15 | <i class="icon icon-right right"></i> |
12 | - <span class="filter-cate-label">{{$key | filter-en-cn }}</span> | ||
13 | - <span class="filter-cate-val">{{showLabel($key)}}</span> | 16 | + <span class="filter-cate-label">{{classify | filter-en-cn }}</span> |
17 | + <span class="filter-cate-val">{{showLabel(classify)}}</span> | ||
14 | </li> | 18 | </li> |
15 | </ul> | 19 | </ul> |
16 | </div> | 20 | </div> |
@@ -39,11 +43,9 @@ | @@ -39,11 +43,9 @@ | ||
39 | }, | 43 | }, |
40 | data: function() { | 44 | data: function() { |
41 | return { | 45 | return { |
42 | - // 选择的值 | ||
43 | - params: {}, | ||
44 | - | ||
45 | - // 确定的值 | ||
46 | - selected: {}, | 46 | + itemArr: ['gender', 'ageLevel', 'brand', 'groupSort', 'color', 'size', 'priceRange', 'discount','style'], |
47 | + params: {}, // 选择的值 | ||
48 | + selected: {}, // 确定的值 | ||
47 | 49 | ||
48 | subType: '' | 50 | subType: '' |
49 | }; | 51 | }; |
@@ -16,31 +16,31 @@ | @@ -16,31 +16,31 @@ | ||
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | 18 | ||
19 | - <div class="show-box no-padding" v-if="recommendProducts"> | 19 | + <div class="show-box no-padding" v-if="recommendProducts && recommendProducts.length"> |
20 | <h2>相关推荐</h2> | 20 | <h2>相关推荐</h2> |
21 | 21 | ||
22 | <product-list :data="recommendProducts"></product-list> | 22 | <product-list :data="recommendProducts"></product-list> |
23 | </div> | 23 | </div> |
24 | 24 | ||
25 | - <div class="brand-list show-box" v-if="brands"> | 25 | + <div class="brand-list show-box" v-if="brands && brands.length"> |
26 | <h2>相关品牌</h2> | 26 | <h2>相关品牌</h2> |
27 | <ul> | 27 | <ul> |
28 | <li v-for="item in brands"> | 28 | <li v-for="item in brands"> |
29 | - <a :href="item.url"><img :src="item.thumb"></a> | 29 | + <a :href="item.brandDomain | brandUrl"><img :src="item.thumb"></a> |
30 | </li> | 30 | </li> |
31 | </ul> | 31 | </ul> |
32 | </div> | 32 | </div> |
33 | 33 | ||
34 | - <div class="show-box" v-if="other && other.length > 0"> | 34 | + <div class="show-box" v-if="other && other.length"> |
35 | <h2>相关文章</h2> | 35 | <h2>相关文章</h2> |
36 | <div class="other-box" v-for="item in other"> | 36 | <div class="other-box" v-for="item in other"> |
37 | <div> | 37 | <div> |
38 | <div class="image-box"> | 38 | <div class="image-box"> |
39 | - <a :href="item.url"> | 39 | + <a :href="`/editorial/${item.id}.html`"> |
40 | <img :src="item.thumb | resize 213 134"/> | 40 | <img :src="item.thumb | resize 213 134"/> |
41 | </a> | 41 | </a> |
42 | </div> | 42 | </div> |
43 | - <h3><a :href="item.url">{{item.title}}</a></h3> | 43 | + <h3><a :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3> |
44 | <div class="sub-time"> | 44 | <div class="sub-time"> |
45 | <span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span> | 45 | <span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span> |
46 | </div> | 46 | </div> |
@@ -98,7 +98,6 @@ | @@ -98,7 +98,6 @@ | ||
98 | .text-block { | 98 | .text-block { |
99 | padding: 30px; | 99 | padding: 30px; |
100 | } | 100 | } |
101 | - | ||
102 | } | 101 | } |
103 | 102 | ||
104 | .other-box { | 103 | .other-box { |
@@ -2,16 +2,16 @@ | @@ -2,16 +2,16 @@ | ||
2 | <div class="top-nav"> | 2 | <div class="top-nav"> |
3 | <navbar> | 3 | <navbar> |
4 | <template slot="right"> | 4 | <template slot="right"> |
5 | - <a class="right-button" href="javascript:void(0);" @click="like()"> | 5 | + <a class="right-button no-intercept" href="javascript:void(0);" @click="like()"> |
6 | <span class="icon icon-like" :class=""></span> | 6 | <span class="icon icon-like" :class=""></span> |
7 | {{likeCount}} | 7 | {{likeCount}} |
8 | </a> | 8 | </a> |
9 | 9 | ||
10 | - <a class="right-button" href="javascript:void(0);" @click="favorite()"> | 10 | + <a class="right-button no-intercept" href="javascript:void(0);" @click="favorite()"> |
11 | <span class="icon" :class="{ 'icon-love': !isFavorite, 'icon-love-solid': isFavorite}"></span> | 11 | <span class="icon" :class="{ 'icon-love': !isFavorite, 'icon-love-solid': isFavorite}"></span> |
12 | </a> | 12 | </a> |
13 | 13 | ||
14 | - <a class="right-button" href="javascript:void(0);" @click="share()"> | 14 | + <a class="right-button no-intercept" href="javascript:void(0);" @click="share()"> |
15 | <span class="icon icon-share"></span> | 15 | <span class="icon icon-share"></span> |
16 | </a> | 16 | </a> |
17 | </template> | 17 | </template> |
@@ -75,12 +75,13 @@ | @@ -75,12 +75,13 @@ | ||
75 | }, (results)=> { | 75 | }, (results)=> { |
76 | const result = results[0], misc = results[1]; | 76 | const result = results[0], misc = results[1]; |
77 | 77 | ||
78 | - if (result && result.code === 200) { | ||
79 | - // TODO: | ||
80 | - } if (result && result.code === 403) { | 78 | + // if (result && result.code === 200) { |
79 | + // // TODO: | ||
80 | + // } | ||
81 | + if (result && result.code === 403) { | ||
81 | // 未登录 | 82 | // 未登录 |
82 | - yoho.goLogin('', function() { | ||
83 | - this.toggleFavorite(); | 83 | + yoho.goLogin('', () => { |
84 | + this.favorite(); | ||
84 | }, function() { | 85 | }, function() { |
85 | tip('登录失败'); | 86 | tip('登录失败'); |
86 | }); | 87 | }); |
@@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
86 | this.shareData = { | 86 | this.shareData = { |
87 | title: result.shopName, | 87 | title: result.shopName, |
88 | des: shareSubTitle, | 88 | des: shareSubTitle, |
89 | - url: location.origin + '/brand/share/' + $shop.data('domain'), | 89 | + url: location.origin + '/product/shop/' + $shop.data('domain')+'/share', |
90 | img: result.shopBg, | 90 | img: result.shopBg, |
91 | isBlkShop: result.isBlkShop, | 91 | isBlkShop: result.isBlkShop, |
92 | domain: locationQuery.domain, | 92 | domain: locationQuery.domain, |
@@ -35,6 +35,10 @@ const _procProductImg = (product, genderVal) => { | @@ -35,6 +35,10 @@ const _procProductImg = (product, genderVal) => { | ||
35 | module.exports = (list, options) => { | 35 | module.exports = (list, options) => { |
36 | const pruductList = []; | 36 | const pruductList = []; |
37 | 37 | ||
38 | + if (!options.gender) { | ||
39 | + options.gender = ''; | ||
40 | + } | ||
41 | + | ||
38 | options = Object.assign({ | 42 | options = Object.assign({ |
39 | showTags: true, | 43 | showTags: true, |
40 | showNew: true, | 44 | showNew: true, |
-
Please register or login to post a comment