...
|
...
|
@@ -6,8 +6,47 @@ |
|
|
|
|
|
'use strict';
|
|
|
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const specialModel = require('../models/special');
|
|
|
const log = require(`${global.library}/logger`);
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
const saleLogger = (err, res) => {
|
|
|
log.error('sale页面渲染错误:' + JSON.stringify(err));
|
|
|
res.send('error');
|
|
|
};
|
|
|
|
|
|
exports.special = (req, res) => {
|
|
|
let id = req.params[0] || 0;
|
|
|
|
|
|
res.send(id);
|
|
|
// headerModel.requestHeaderData()
|
|
|
// .then(response => {
|
|
|
// let data = headerModel.setHeaderData(response.data, 'girls');
|
|
|
|
|
|
// data.module = 'index';
|
|
|
// data.page = 'index';
|
|
|
// data.footerTop = true;
|
|
|
|
|
|
// res.render('girls', data);
|
|
|
// })
|
|
|
// .catch(() => {
|
|
|
// // res.render('error', {devEnv: true, pageErr: true});
|
|
|
// });
|
|
|
|
|
|
Promise.all([headerModel.requestHeaderData(), specialModel.getSpecialData(id)]).then((result) => {
|
|
|
let saleDate = _.assign(result);
|
|
|
res.send(saleDate);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
// specialModel.getSpecialData(id).then((result) => {
|
|
|
// result.module = 'index';
|
|
|
// result.page = 'index';
|
|
|
// result.footerTop = true;
|
|
|
|
|
|
// res.render('special', result);
|
|
|
// }).catch((err) => {
|
|
|
// saleLogger(err, res);
|
|
|
// });
|
|
|
}; |
...
|
...
|
|