coupons.js
822 Bytes
// 优惠券 by acgpiano
'use strict';
const headerModel = require('../../../doraemon/models/header'), // 头部model
model = require('../models/coupons');
const index = (req, res) => {
res.render('coupons', {
module: 'home',
page: 'coupons',
pageHeader: headerModel.setNav({
navTitle: '优惠券'
}),
title: '优惠券',
pageFooter: true,
});
};
// 处理Ajax请求,status为使用状态
const couponData = (req, res, next) => {
model.couponData({
method: 'app.coupons.li',
uid: req.user.uid,
status: req.body.status || 0,
page: req.body.page || 1,
limit: 10,
}).then(result => {
res.send(result);
res.end();
}).catch(next);
};
module.exports = {
index,
couponData
};