magazine.js
1019 Bytes
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
'use strict';
const magazineModel = require('../models/magazine'); // 头部model
const headerModel = require('../../../doraemon/models/header'); // 头部model
const confirm = (req, res, next) => {
req.ctx(magazineModel).getMagazinePayment(req.user.uid, req.query).then(result => {
res.render('magazine-confirm', {
pageHeader: headerModel.setNav({
navTitle: '支付订单',
navBtn: false
}),
page: 'magazine-confirm',
localCss: true,
result: Object.assign({
sku: req.query.sku
}, result)
});
}).catch(next);
};
const compute = (req, res, next) => {
req.ctx(magazineModel).computeMagazineOrder(req.user.uid, req.body)
.then(res.json)
.catch(next);
};
const submit = (req, res, next) => {
req.ctx(magazineModel).submitMagazineOrder(req.user.uid, req.body)
.then(res.json)
.catch(next);
};
module.exports = {
confirm,
compute,
submit
};