router.js
3.77 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* router of sub app product
* @author: weiqingting<qingting.wei@yoho.cn>
* @date: 2016/05/06
*/
'use strict';
const express = require('express');
const router = express.Router(); // eslint-disable-line
const auth = require('../../doraemon/middleware/auth');
const cRoot = './controllers';
const personalController = require(`${cRoot}/qrcode`);
const homeController = require(`${cRoot}/index`);
const addressController = require(`${cRoot}/address`);
const favorite = require(`${cRoot}/favorite`);
const orderController = require(`${cRoot}/order`);
const orderDetailController = require(`${cRoot}/orderDetail`);
const currencyController = require(`${cRoot}/myCurrency`);
const coupons = require(`${cRoot}/coupons`);
const help = require(`${cRoot}/help`);
const suggest = require(`${cRoot}/suggest`);
const message = require(`${cRoot}/message`);
const onlineService = require(`${cRoot}/onlineService`);
// const myDetail = require(`${cRoot}/myDetail);
// 查看二维码
router.get('/QRcode/:id', personalController.QRcode);
/* 个人中心地址管理相关路由 */
router.get('/address', auth, addressController.address); // 地址管理页面
router.get('/addressAct', auth, addressController.addressAct); // 地址添加页面
router.get('/addressAct/:id', addressController.addressAct); // 地址添加修改页面
router.post('/saveAddress', addressController.saveAddress); // 新增或者保存地址
router.post('/defaultAddress', addressController.defaultAddress); // 设置默认地址
router.post('/delAddress', addressController.delAddress); // 删除地址
router.get('/locationList', addressController.locationList); // 异步获取三级地址数据
/* 个人中心订单相关路由 */
router.get('/orders', orderController.order); // 订单列表
router.get('/getOrders', orderController.getOrders); // 获取订单列表数据
router.get('/orderDetail', orderDetailController.orderDetailData); // 订单详情页
router.get('/delOrder', orderDetailController.delOrder); // 删除订单
router.get('/readd', orderDetailController.readdData); // 再次购买
router.get('/cancelOrder', orderDetailController.cancelOrder); // 取消订单
router.get('/', homeController.index); // 个人中心首页
router.get('/mydetails', homeController.myDetails); // 个人基本资料页面
router.get('/grade', homeController.grade); // 会员等级页
router.get('/privilege', homeController.preferential); // 会员特权列表页
router.get('/mycurrency', currencyController.myCurrency); // yoho币总数
router.get('/currencyDetail', currencyController.currencyDetail); // yoho币列表
router.post('/ajaxCurrencyDetail', currencyController.ajaxCurrencyDetail); // yoho币列表
router.get('/record', homeController.record); // 浏览记录
router.get('/recordContent', homeController.recordContent); // 浏览记录
router.get('/delRecord', homeController.delRecord); // 删除浏览记录
// 我的收藏
router.get('/favorite', favorite.favorite);
// 收藏的商品
router.get('/favProduct', favorite.favProduct);
// 收藏的品牌
router.get('/favBrand', favorite.favfavBrand);
// 取消收藏
router.post('/favoriteDel', favorite.favoriteDelete);
// 优惠券
router.use('/coupons', coupons.index);
// 帮助中心
router.get('/help', help.index);
router.get('/helpDetail', help.helpDetail);
// 意见反馈
router.get('/suggest', suggest.suggestData);
router.post('/upAndDown', suggest.upAndDown);
router.get('/suggestSub', suggest.suggestSub);
router.post('/savesuggest', suggest.saveSuggest);
// 消息
router.use('/message', message.index);
router.post('/ajaxDelMes', message.ajaxDelMes);
router.post('/pickCoupon', message.pickCoupon);
// 在线客服
router.get('/onlineservice', onlineService.getOnlineServiceInfo);
router.get('/onlineservicedetail', onlineService.getOnlineServiceDetail);
module.exports = router;