router.js 3.81 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 help = require(cRoot + '/help');

const router = expressRouter();

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

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

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

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

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

// 退换货
router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表
router.get('/me/return/refund/detail/:applyId', refund.refundStatus); // 退换货 - 退货状态
router.get('/me/return/exchange/detail/:applyId', refund.exchangeStatus); // 退换货 - 换货状态
router.get('/me/return/status-detail', refund.statusDetail); // 退换货 - 状态详细信息
router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据

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

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

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

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

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

module.exports = router;