global.js
1.05 KB
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
38
39
40
/**
* 商品促销controller
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2017/4/6
*/
'use strict';
const mRoot = '../models';
const globalModel = require(`${mRoot}/global`); // global model
/**
* 全球购列表页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.list = (req, res, next) => {
globalModel.getGlobalProductListData(req.query, req.yoho).then(result => {
res.render('list/index', Object.assign({
page: 'list',
pageClass: 'global-list-page'
}, result));
}).catch(next);
};
/**
* 全球购商品详情页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.detail = (req, res, next) => {
globalModel.getGlobalProductDetailData(req.params[0], req.yoho.channelNum,
req.yoho.channel).then(result => {
res.render('global/detail', Object.assign({
page: 'detail'
}, result));
}).catch(next);
};