index.js 2.86 KB
/**
 * 组件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: '//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页
};