router.js
1.81 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
/**
* 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 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.orderDetail);
// 个人中心
router.get('/', homeController.index);
// 我的收藏
router.get('/favorite', favorite.favorite);
// 收藏的商品
router.get('/favProduct', favorite.favProduct);
// 收藏的品牌
router.get('/favBrand', favorite.favfavBrand);
// 取消收藏
router.post('/favoriteDel', favorite.favoriteDelete);
module.exports = router;