router.js
3.86 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* 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`);
const ticketsConfirmController = require(`${cRoot}/ticketsConfirm`);
// 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('/shopping/pay/aliwapreturn', payController.payAli);// 支付成功,支付宝付款
router.get('/shopping/pay/payZero', payController.payZero);// 支付成功,支付为0
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.post('/index/new/orderCompute', authMW, order.orderCompute); // 结算页参数改变,重新运算
router.post('/index/new/orderSub', authMW, order.orderSub); // 结算页参数改变,重新运算
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/new/jitDetail', authMW, order.jitDetail); // JIT 拆单配送信息
router.post('/index/add', indexController.add); // 加入购物车
router.get('/index/index', indexController.index); // 购物车 TODO: 删除
router.get('/index/new', indexController.index); // 购物车(新版接口)
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
// 支付中心 URL,由于微信安全限制,在现有 URL 后追加 new ,通过 subDomain 中间件转发到此
router.get('/home/orders/paynew', authMW, payController.payCenter);
// 门票确认
router.post('/index/ticketsConfirm', authMW, ticketsConfirmController.ticketsConfirm);
// 门票下单
router.post('/index/submitTicket', ticketsConfirmController.submitTicket);
// 添加门票
router.post('/index/checkTickets', ticketsConfirmController.checkTickets);
module.exports = router;