brand.js
1.24 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/7/19
* Time: 10:03
*/
'use strict';
// const _ = require('lodash');
// const helpers = global.yoho.helpers;
const mRoot = '../models';
const brandModel = require(`${mRoot}/brand`);
/**
* 品牌,品类,店铺相关页面
*/
module.exports = {
/* 品牌店铺页面 */
index: (req, res) => {
let params = req.query;
brandModel.getBrandData(params).then(result => {
res.render('brand/index', {
module: 'channel',
page: 'brand',
result: result
});
});
},
/* 品牌列表页 */
brandList: (req, res) => {
res.render('brand/brand-list', {
module: 'channel',
page: 'brand-list'
});
},
getBrandList: (req, res) => {
brandModel.getBrandListData().then(result => {
res.json(result);
});
},
/* 全部分类 */
cate: (req, res) => {
let params = req.query;
brandModel.getCateListData(params).then(result => {
res.render('brand/cate', {
module: 'channel',
page: 'cate',
result: result
});
});
},
};