index.js
2.86 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
/**
* 组件demo页controller
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/6/30
*/
'use strict';
const index = (req, res) => {
var pageNum = req.query.page || 1;
res.display('index', {
module: 'partial',
page: 'index',
title: 'Yoho!buy有货',
content: {
checkbox: [
{
place: 'hello world' // just for placehodler
},
{
checked: true
}
],
radio: [
{
place: 'hello world' // just for placehodler
},
{
checked: true
}
],
paginationOpts: {
page: pageNum, // current page: http://host/?page=2
limit: 10, // per_page records' number
total: 100, // total page number
queryParams: req.query
},
goods: {
img: 'http://placehold.it/274x366',
link: '',
name: 'Fred Perry Bomber jacket',
price: '1015.00'
},
navPath: {
nav: [
{
link: '#',
pathTitle: '',
name: 'MEN首页'
},
{
link: '#',
pathTitle: '',
name: '咨询'
},
{
link: '#',
pathTitle: '',
name: '咨询'
}
]
},
floor: {
floorEn: 'NEW ARRIVALS',
floorZh: '新品抢鲜看'
},
hook: [
{
solid: true
},
{
solid: false
}
],
warn: [
{
round: true
},
{
round: false
}
],
share: {
shareImg: 'hjchsk',
shareDesc: 'wjhdfwe',
weixinUrl: 'http://www.baidu.com'
},
genders: [
{
name: '男',
value: '1,3',
checked: true
},
{
name: '女',
value: '2,3'
}
]
},
helpers: {
// import component, path depends on your project
pagination: require('../../../doraemon/components/pagination/pagination').createPagination
}
});
};
module.exports = {
index // 组件demo页
};