plusstar.js
2.21 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
/**
* 潮流优选
* @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
* @date: 2016/08/04
*/
'use strict';
const mRoot = '../models';
const _ = require('lodash');
const plusstarModel = require(`${mRoot}/plusstar`);
/**
* 潮流优选首页
*/
exports.index = (req, res, next) => {
plusstarModel.getAllChannels({}).then(result => {
res.render('plusstar/index', {
page: 'plusstar-index',
result: result,
title: '潮流优选'
});
}).catch(next);
};
/**
* 潮流优选首页-资源位
*/
exports.resources = (req, res, next) => {
let code = req.query.code || '';
// let data = [{
// 'bgColor': '',
// 'src': 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/06/02f043ae44ccf0e49fdddd7db39649a889.jpg?imageView2/{mode}/w/{width}/h/{height}',
// 'title': '11111',
// 'url': 'http://cdn.yoho.cn/huodong/0418SALEGIRL/index.html?title=IN季精选&share_id=832'
// }, {
// 'bgColor': '',
// 'src': 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/06/02f043ae44ccf0e49fdddd7db39649a889.jpg?imageView2/{mode}/w/{width}/h/{height}',
// 'title': '2222',
// 'url': 'http://cdn.yoho.cn/huodong/0418SALEGIRL/index.html?title=IN季精选&share_id=832'
// }, {
// 'bgColor': '',
// 'src': 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/06/02f043ae44ccf0e49fdddd7db39649a889.jpg?imageView2/{mode}/w/{width}/h/{height}',
// 'title': '33333',
// 'url': 'http://cdn.yoho.cn/huodong/0418SALEGIRL/index.html?title=IN季精选&share_id=832'
// }
// ];
plusstarModel.getResources({
content_code: code
}).then(result => {
res.render('plusstar/index', {
page: 'plusstar-index',
result: result,
title: '潮流优选'
});
}).catch(next);
};