...
|
...
|
@@ -6,17 +6,64 @@ |
|
|
|
|
|
'use strict';
|
|
|
|
|
|
// const mRoot = '../models';
|
|
|
|
|
|
const mRoot = '../models';
|
|
|
const cookie = require('../../../library/cookie');
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const log = require('../../../library/logger');
|
|
|
const sale = require(`${mRoot}/sale`);
|
|
|
|
|
|
// sale model
|
|
|
// const sale = require(`${mRoot}/sale`);
|
|
|
const saleLogger = (err, res) => {
|
|
|
log.error('sale页面渲染错误:' + JSON.stringify(err));
|
|
|
res.send('error');
|
|
|
};
|
|
|
|
|
|
exports.index = (req, res) => {
|
|
|
res.render('sale', {
|
|
|
devEnv: true,
|
|
|
pageHeader: headerModel.setNavHeader('SALE'),
|
|
|
let headerData = headerModel.setNavHeader('SALE');
|
|
|
let renderData = {
|
|
|
module: 'product',
|
|
|
page: 'sale',
|
|
|
pageHeader: headerData,
|
|
|
pageFooter: true
|
|
|
};
|
|
|
|
|
|
// res.render('sale', renderData);
|
|
|
|
|
|
sale.getSaleDate({
|
|
|
uid: cookie.getUid(req)
|
|
|
}).then(result => {
|
|
|
result = {
|
|
|
headerBanner: {
|
|
|
list: [
|
|
|
{
|
|
|
url: '',
|
|
|
src: 'http://img11.static.yhbimg.com/yhb-img01/2016/04/18/06/01abda0859d64f9af63a434ca281d213c5.jpg?imageView2/2/w/640/h/240'
|
|
|
},
|
|
|
{
|
|
|
url: '',
|
|
|
src: 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/0239e814b8121913aa67b9ad509bd4e310.jpg?imageView2/2/w/640/h/240'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
smallPic: {
|
|
|
data: [
|
|
|
{
|
|
|
url: '',
|
|
|
src: 'http://img11.static.yhbimg.com/yhb-img01/2016/05/12/15/011684760312d139ac2429c3678951ebd0.jpg?imageView2/2/w/640/h/403'
|
|
|
},
|
|
|
{
|
|
|
url: '',
|
|
|
src: 'http://img11.static.yhbimg.com/yhb-img01/2016/05/12/15/011684760312d139ac2429c3678951ebd0.jpg?imageView2/2/w/640/h/403'
|
|
|
},
|
|
|
{
|
|
|
url: '',
|
|
|
src: 'http://img11.static.yhbimg.com/yhb-img01/2016/05/12/15/011684760312d139ac2429c3678951ebd0.jpg?imageView2/2/w/275/h/160'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
};
|
|
|
|
|
|
res.render('sale', Object.assign(renderData, result));
|
|
|
}).catch((err) => {
|
|
|
saleLogger(err, res);
|
|
|
});
|
|
|
}; |
...
|
...
|
|