returns.js
1.09 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
/**
* 个人中心 退换货
* @author 陈轩 <xuan.chen@yoho.cn>
*/
'use strict';
const cookie = global.yoho.cookie;
const returnsModel = require('../models/returns');
/*
我的退换货-列表页
*/
exports.index = (req, res, next) => {
const uid = cookie.getUid(req);
const page = req.query.page;
returnsModel.getReturnsList(uid, page /* ,limit=10*/)
.then(data => {
const viewData = Object.assign({
module: 'home',
page: 'returns',
meReturnsPage: true
}, data);
res.render('returns/returns', viewData);
})
.catch(next);
};
/*
我的订单-退货申请页
*/
exports.refundRequest = (req, res, next) => {
const orderCode = req.query.orderCode;
const uid = cookie.getUid(req);
returnsModel.getRefund()
.then(data => {
const viewData = Object.assign({
module: 'home',
page: 'returns',
me
})
res.render('resturns/returns-apply', viewData);
})
.catch(next)
};