router.js
2.84 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 cart
* @author: xuan.chen@yoho.cn<xuan.chen@yoho.cn>
* @date: 2016/09/26
*/
'use strict';
const router = require('express').Router(); //eslint-disable-line
const cRoot = './controllers';
const authMW = require('../../doraemon/middleware/auth');
const seckill = require(cRoot + '/seckill');
const order = require(cRoot + '/order');
const countController = require(`${cRoot}/count`);
const payController = require(`${cRoot}/pay`);
const indexController = require(`${cRoot}/index`);
// Your controller here
router.all('/index/seckill/', authMW);
router.all('/index/seckill/*', authMW);
router.get('/index/seckill/', seckill.ensure);
router.post('/index/seckill/compute', seckill.compute);
router.post('/index/seckill/submit', seckill.submit);
router.get('/index/count', countController.cartCount);
router.get('/paySuccess/payCod', payController.payCod);// 支付成功,货到付款
router.get('/index/new/pay', authMW, payController.pay);// 统一支付 URL,支持微信,支付宝
router.get('/index/new/pay/alipayresult', authMW, payController.payAli);// 支付宝付款支付成功
router.get('/index/new/orderEnsure', authMW, order.orderEnsure); // 订单结算
router.get('/index/new/fast', authMW, order.orderEnsure); // 快速结算
router.get('/index/new/selectCoupon', authMW, order.selectCoupon); // 选择优惠券 页面
router.get('/index/new/couponList', order.couponList); // [ajax]获取优惠券列表
router.post('/index/new/couponSearch', order.couponSearch); // [ajax]购物车输入优惠券码使用优惠券
router.get('/index/new/selectAddress', authMW, order.selectAddress); // 选择地址
router.get('/index/new/invoiceInfo', authMW, order.invoiceInfo); // 发票信息
router.get('/index/index', indexController.index); // 购物车
router.post('/index/add', indexController.add); // 加入购物车
router.post('/index/new/data', indexController.indexData); // 购物车
router.post('/index/new/select', indexController.select); // 选择取消购物车商品
router.post('/index/new/del', indexController.del); // 删除购物车商品
router.post('/index/new/col', indexController.col); // 删除购物车商品
router.post('/index/new/goodinfo', indexController.goodinfo); // 获取购物车商品数据,chosepanel
router.post('/index/new/modifyNum', indexController.modifyNum); // 修改购物车商品数量
router.post('/index/new/modify', indexController.modify); // 修改购物车商品数据
router.post('/index/new/modifyPriceGift', indexController.modifyPriceGift); // 修改购物车赠品、加价购商品数据
router.get('/index/new/gift', indexController.gift); // 获取购物车赠品
router.get('/index/new/advanceBuy', indexController.advanceBuy); // 获取购物车加价购
router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车加价购商品数据,chosepanel
module.exports = router;