router.js
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* router of sub app product
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/05/06
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
// 商品详情controller
const detail = require(`${cRoot}/detail`);
// 收藏品牌,商品,店铺
const favorite = require(`${cRoot}/favorite`);
// 商品促销controller
const sale = require(`${cRoot}/sale`);
// 奥特莱斯controller
const outlets = require(`${cRoot}/outlets`);
// 商品促销routers
router.get('/sale', sale.index); // sale 首页
router.get('/sale/discount/detail', sale.discount); // 折扣专场详情页
router.get('/sale/vip', sale.vip); // VIP 活动专区
router.get('/sale/breakingYards', sale.breakingYards); // 断码区
router.get('/sale/newSale', sale.newSale); // 最新降价
router.get('/sale/goods', sale.getGoodsList); // ajax 获取商品列表
// 奥特莱斯routers
router.get('/outlets/index', outlets.index);
router.get('/outlets/special/detail', outlets.special);
router.get('/outlets/:channel', outlets.channel);
// 商品详情routers
router.get('/detail/:id/:gid', detail.showMain);
// 商品评论
router.get('/detail/comment', detail.indexComment);
// 商品咨询
router.get('/detail/consult', detail.indexConsult);
router.post('/detail/consult', detail.createConsult);
// 商品热图
router.get('/detail/hotarea', detail.indexHotArea);
// 收藏品牌
router.post('/index/favoriteBrand', favorite.changeFavoriteBrand);
router.post('/item/togglecollect', favorite.collectProduct);
module.exports = router;