router.js 3.25 KB
/**
 * router of sub app home
 * @author: shenzm<zhimin.shen@yoho.cn>
 * @date: 2016/07/18
 */

'use strict';

const expressRouter = require('express').Router;
const cRoot = './controllers';
const home = require(cRoot);
const favorite = require(cRoot + '/favorite');
const refund = require(cRoot + '/refund');
const order = require(cRoot + '/order');
const exchange = require(cRoot + '/exchange');

const router = expressRouter();

// Your controller here
router.get('/', home.index); // 个人中心主页

router.get('/orders', order.orders); // 订单
router.get('/order-detail', order.orderDetail); // 订单详情
router.get('/get-orders', order.getOrderData); // 获取订单数据
router.get('/get-order', order.getOrderDetailData); // 获取订单详情数据
router.get('/order-detail', order.orderDetail); // 订单详情
router.get('/order/cancel-reason', order.getCancelReason); // 获取订单原因
router.post('/cancel-order', order.cancelOrder); // 取消订单
router.post('/delete-order', order.deleteOrder); // 删除订单
router.post('/confirm-order', order.confirmOrder); // 确认订单

router.get('/mycurrency', order.coin); // yoho币
router.get('/coin-detail', order.getCoinDetail); // yoho币明细

router.get('/service', home.service) // 在线客服
router.get('/help', home.help); // 帮助中心列表页
router.get('/help-detail', home.helpDetail); // 帮助中心详情页
router.get('/feedback', home.feedback); // 个人中心-意见反馈
router.post('/save-feedback', home.saveFeedback); // 个人中心-提交意见反馈

router.get('/favorite', favorite.favorite); // 个人中心 - 收藏
router.get('/favorite/favpaging', favorite.favpaging); // 个人中心 - 收藏商品/品牌(翻页)
router.post('/del-favdel', favorite.deletefav); // 个人中心 - 收藏商品/品牌(刪除)

router.get('/refund', refund.refund); // 退换货
router.get('/refund/order', refund.order); // 查询订单数据
router.post('/refund/submit', refund.submit); // 提交信息
router.get('/refund/logistics', refund.logistics); // 退换货 - 商品寄回信息
router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄回物流信息
router.post('/refund/cancel-apply', refund.cancelApply); // 退货 - 取消申请

router.get('/exchange-status', refund.exchangeGoods); // 退换货 - 换货状态
router.get('/refund/orders', refund.refundOrders); // 退换货 - 订单列表
router.get('/refund/get-orders', refund.getRefundOrders); // 退换货 - 获取订单列表数据

// 换货
router.get('/exchange', exchange.exchange);
router.get('/exchange/order', exchange.order); // AJAX 获取订单 商品
router.get('/exchange/delivery', exchange.delivery); // AJAX 获取 退货方式
router.post('/exchange/submit', exchange.submit); // AJAX 提交换货 申请
router.post('/exchange/cancel-apply', exchange.cancelApply); // AJAX 取消换货申请

router.get('/mydetails', home.mydetails); // 个人信息
router.post('/save-mydetails', home.saveMydetails); // 保存个人信息

router.get('/about', home.about); // 个人中心 - 关于我们

router.get('/logistic', order.logistic); // 个人中心 - 退换货物流设置页面
router.get('/get-order-logistic-date', order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据

module.exports = router;