Authored by 王水玲

活动页

... ... @@ -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);
// });
};
... ...
/**
* activity model
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/05/18
*/
'use strict';
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
const sign = require(`${global.library}/sign`);
const _ = require('lodash');
var api = new ServiceAPI();
exports.getSpecialData = (id) => {
return api.get('activity/staticFileManage/queryById', sign.apiSign({
id: id
})).then(result => {
if (result && result.code === 200) {
return result.data
} else {
return Promise.reject('error');
}
});
}
\ No newline at end of file
... ...
<div class="yoho-page center-content">
<p>body</p>
</div>
{{log this}}
{{{content}}}
\ No newline at end of file
... ...