Authored by 陈轩

rewrite router

... ... @@ -8,7 +8,7 @@ Name | Path | Note
全部分类 | /cate-all |
商品列表 | /product/list?sort=1 |
品牌店铺 | /product/shop/{domain} |
品牌店铺分享页面 | /brand/share/{domain} |
品牌店铺分享页面 | /product/shop/{domain}/share |
商品详情 | /product/{productId} |
新品抢先看 | /product/new |
搜索页 | /product/search?query=xxx |
... ...
... ... @@ -16,7 +16,7 @@ module.exports = {
res.render('shop/index', {
module: 'product',
page: 'shop',
domain: req.params[0]
domain: req.params.domain
});
},
... ... @@ -77,7 +77,7 @@ module.exports = {
res.render('shop/share', {
module: 'product',
page: 'shop-share',
domain: req.params[0]
domain: req.params.domain
});
}
};
... ...
... ... @@ -33,11 +33,11 @@ router.get('/product/list.json', productList.fetchProducts);
const shop = require(`${cRoot}/shop`);
router.get('/brand', shop.index); // 品牌 集合页
router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面
router.get('/product/shop/info.json', shop.getShopInfo); // 店铺介绍
router.get('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表
router.post('/product/shop/collect.json', shop.collectShop); // 收藏品牌店铺
router.get('/product/shop/(.*)/', shop.index); // 品牌店铺页
router.get('/product/shop/:domain/', shop.index); // 品牌店铺页
router.get('/product/shop/:domain/share', shop.shopShare); // 品牌店铺页
// 商品详情controller
const detail = require(`${cRoot}/detail`);
... ... @@ -51,6 +51,7 @@ router.get(/\/product\/cart-count.json/, detail.getCartCount);
router.get(/\/product\/search_product\.json/, detail.search);
// alias: TODO: 测试完成 删除一下router,并更新资源位
router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面
router.get(/\/item\/([\d]+)(.*)\.html/, detail.index); // 商品详情routers
router.get(/\/brand\/(.*)/, shop.index); // 店铺首页
... ...
... ... @@ -50,7 +50,7 @@ Vue.filter('clothingGenderIdentity', (value) => {
* @param value brand domain
*/
Vue.filter('brandUrl', (value) => {
return `/brand/${value}`;
return `/product/shop/${value}`;
});
/**
... ...
... ... @@ -86,7 +86,7 @@
this.shareData = {
title: result.shopName,
des: shareSubTitle,
url: location.origin + '/brand/share/' + $shop.data('domain'),
url: location.origin + '/product/shop/' + $shop.data('domain')+'/share',
img: result.shopBg,
isBlkShop: result.isBlkShop,
domain: locationQuery.domain,
... ...