sale.js 2.66 KB
/*
 * @Author: Targaryen
 * @Date:   2016-05-19 10:20:08
 * @Last Modified by:   Targaryen
 * @Last Modified time: 2016-05-19 11:34:38
 */

'use strict';
const library = '../../../library';
const API = require(`${library}/api`).API;
const sign = require(`${library}/sign`);
const api = new API();

/**
 * 处理 sale 首页原始数据
 * @param  {Object} origin [原始数据]
 * @return {Object}        [结果]
 */
const handleSaleData = (origin) => {
    var dest = {};

    dest = origin;
    return dest;
};

/**
 * 输出开发用假数据
 * @return {[type]} [description]
 */
exports.outputDevData = () => {
    return {
        slide: {
            list: [{
                bannerHeight: 200,
                href: 'http://www.yoho.cn',
                img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/830/h/327'
            }, {
                bannerHeight: 200,
                href: 'http://www.yoho.cn',
                img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/830/h/327'
            }, {
                bannerHeight: 200,
                href: 'http://www.yoho.cn',
                img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/830/h/327'
            }]
        },

        recommandImg: [{
            jumpUrl: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/250/h/80',
            sourceUrl: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/250/h/80'
        }, {
            jumpUrl: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/250/h/80',
            sourceUrl: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/250/h/80'
        }, {
            jumpUrl: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/250/h/80',
            sourceUrl: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/13/19/0144078a008a5dc2be52a6ec65c74c1f2c.jpg?imageView2/1/w/250/h/80'
        }],

        specialSale: {
            brandSale: {
                big: [{

                }]
            }
        }

    };
};

/**
 * 获取首页数据
 * @return {[type]} [description]
 */
exports.getSaleDate = () => {
    return api.get('', sign.apiSign({
        method: 'app.activity.get',
        sort: 2,
        plateform: 2
    })).then(result => {

        return handleSaleData(result);
    });
};