outlets.js
9.83 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
/**
* 商品促销controller
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/5/19
*/
'use strict';
// const headerModel = require('../../../doraemon/models/header');
// 开发用模拟数据
const outletsSimulation = require('../models/simulation');
/**
* outlets 首页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.index = (req, res) => {
let data = {};
data.module = 'product';
data.page = 'outlets';
data.footerTop = true;
data.devEnv = true;
data.banner = [
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}
];
data.column = [
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}
];
data.limitedBuy = {
name: '限时嗨购',
topic: [
{
href: '#',
img: 'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
},
{
href: '#',
img: 'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
},
{
href: '#',
img: 'http://img11.static.yhbimg.com/yhb-img01/2016/05/25/11/01d71a4867ac110b1894504da65b5cf596.jpg?imageView2/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
}
],
extra: {
sourceImg: {
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/04/13/01/023d062b8384103df7a8dfada98afaf204.jpg?imageView2/1/w/{width}/h/{height}'
},
hotType: {
title: '热销推荐',
classify: [
{
href: '#',
name: '上衣'
},
{
href: '#',
name: 'T恤'
},
{
href: '#',
name: '裤子'
}
]
},
trendGood: {
title: '潮品推荐',
goods: [
{
href: '#',
img: 'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}',
name: 'Life·After Life 像素风sneaker印花长袖衬衫',
market: '¥260',
sale: '¥203',
discount: '2'
},
{
href: '#',
img: 'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}',
name: 'Life·After Life 像素风sneaker印花长袖衬衫',
market: '¥260',
sale: '¥203',
discount: '2'
},
{
href: '#',
img: 'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}',
name: 'Life·After Life 像素风sneaker印花长袖衬衫',
market: '¥260',
sale: '¥203',
discount: '2'
},
{
href: '#',
img: 'http://img13.static.yhbimg.com/goodsimg/2015/08/04/10/02129fcc058455de1615ce770d3a4555a6.jpg?imageView/1/w/{width}/h/{height}',
name: 'Life·After Life 像素风sneaker印花长袖衬衫',
market: '¥260',
sale: '¥203',
discount: '2'
}
]
}
}
};
data.nearOver = {
name: '即将结束',
topic: [
{
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
},
{
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
},
{
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
},
{
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
discount: '7.5',
title: '多元化潮流风格',
limit: '1500'
}
]
};
data.goodsBoard = {
goodsMenu: {
title: '最新折扣',
menuList: [
{
name: 'T恤',
href: '#',
cur: true
},
{
name: '衬衫',
href: '#'
},
{
name: '休闲裤',
href: '#'
},
{
name: '连衣裙',
href: '#'
}
],
more: '#'
},
sort: {
sortType: [
{
name: '最新',
active: true,
href: '',
hasSortOrient: true
}
]
},
list: [
{
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
price: '¥340',
discount: '7.5',
title: '多元化潮流风格'
},
{
href: '#',
img: 'http://img12.static.yhbimg.com/yhb-img01/2016/02/05/08/02bb2c8efb12319cf50f247bae13d60dde.jpg?imageView/1/w/{width}/h/{height}',
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
price: '¥340',
discount: '7.5',
title: '多元化潮流风格'
}
]
};
res.render('outlets/index', data);
};
/**
* outlets 频道页
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.channel = (req, res) => {
let channel = {
boys: 'true',
girls: 'true',
kids: '',
lifestyle: ''
};
let response = {
module: 'product',
page: 'outlets',
footerTop: true,
devEnv: true
};
if (!channel[req.params.channel]) {
response.pageErr = true;
}
// 假数据输出
res.render('outlets/channel', Object.assign(response, outletsSimulation.outletBanner()));
// res.render('outlets/channel', response);
};