index.js 2.98 KB
/**
 * 微信抽奖控制器
 * @author: bikai
 * @date: 2016/4/1
 */

// var lotteryModel = require('../../models/wxLottery/index');
// var errUtil = require('../../util/error');

// 星潮教室主页
exports.index = (req, res) => {

    // 传入参数给lotteryModel发送到后端,获取返回的数据
    // lotteryModel({test: 1}).then((data) => {

    //     // 接收接口返回到的数据,处理后,渲染页面或者返回 JSON
    //     res.send(data);

    // }).catch((err) => {
    //     errUtil.webError(err, res); // 抓取 Promise 链的错误
    // });
    res.render('star-classroom/index', {
        title: '星潮教室',
        module: 'star-classroom',
        version: '0.0.1',
        headTab: [
            {name: '全部', url: '#', cur: true},
            {name: '星专题', url: '#'},
            {name: '星搭配', url: '#'},
            {name: '星鲜事', url: '#'},
        ],
        bannerList: [
            {
                url:'http://feature.yoho.cn/0328/0328DAILYBOY/index.html?title=出游场景模拟变装趴&share_id=870',
                img: 'http://img11.static.yhbimg.com/yhb-img01/2016/03/28/08/01b36610904562fd3085090f55aeca66df.jpg?imageView/2/w/640/h/240'
            },
            {
                url:'http://designer.yoho.cn/bill?title=晒晒你的潮流清单&share_id=898',
                img: 'http://img11.static.yhbimg.com/yhb-img01/2016/04/01/05/010cb10578a55206faff271bceb0f22aaf.jpg?imageView/2/w/640/h/240'
            },
            {
                url:'http://feature.yoho.cn/NEWS/0331APPWEEKNEWSBOY/index.html?title=一周速报&share_id=882',
                img: 'http://img11.static.yhbimg.com/yhb-img01/2016/03/31/03/01337e43ca91484214c4b5b2becc0ef13d.jpg?imageView/2/w/640/h/240'
            },
            {
                url:'http://sale.m.yohobuy.com/?specialsale_id=14&gender=1,3',
                img: 'http://img12.static.yhbimg.com/yhb-img01/2016/04/01/08/02c78a28a9ca1dc585d614b195abff3eb1.jpg?imageView/2/w/640/h/240'
            },
            {
                url:'http://sale.m.yohobuy.com/?specialsale_id=11&gender=1,3',
                img: 'http://img12.static.yhbimg.com/yhb-img01/2016/03/28/04/02ca2b986e193f7134d2f75c74f8169ec3.jpg?imageView/2/w/640/h/240'
            }
        ]

        // wxLottery: data
    });
};

// 星潮教室签到
exports.checkIn = (req, res) => {
    res.render('star-classroom/index', {
        title: '星潮教室',
        module: 'star-classroom',
        version: '0.0.1'

        // wxLottery: data
    });
};

// 星潮教室星专题
exports.subject = (req, res) => {
    res.render('star-classroom/subject', {
        title: '星潮教室星专题',
        module: 'star-classroom',
        version: '0.0.1'

        // wxLottery: data
    });
};

// 星潮教室星搭配
exports.collocation = (req, res) => {
    res.render('star-classroom/collocation', {
        title: '星潮教室星搭配',
        module: 'star-classroom',
        version: '0.0.1'

        // wxLottery: data
    });
};