list.js
860 Bytes
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
/*
* @Author: sefon
* @Date: 2016-07-24 11:40:21
*/
'use strict';
const mRoot = '../models';
const list = require(`${mRoot}/list`);
/**
* 商品分类列表页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.index = (req, res, next) => {
let resData = {};
list.getListData(req.query).then(result => {
Object.assign(resData, result);
res.render('list/index', resData);
}).catch(next);
};
/**
* 新品到着
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.new = (req, res, next) => {
let resData = {};
list.getListNewData(req.query).then(result => {
Object.assign(resData, result);
res.render('list/index', resData);
}).catch(next);
};