brand-api.js 1.09 KB
/**
 * Created by PhpStorm.
 * User: Targaryen
 * Date: 2016/7/19
 * Time: 14:02
 */
'use strict';

const yhChannel = {
    men: {
        channel: '301'
    },
    women: {
        channel: '302'
    },
    lifestyle: {
        channel: '303'
    }
};

module.exports = class extends global.yoho.BaseModel{
    constructor(ctx) {
        super(ctx);
    }

    /**
     * 从接口获取品牌列表页数据
     * @returns {*}
     */
    getBrandListOriginData(params) {

        return this.get({
            data: {
                yh_channel: params.channel ? yhChannel[params.channel].channel : '',
                method: 'app.brand.allBrandList'
            },
            param: {
                code: 200,
                cache: true
            }
        });
    }

    /**
     * 从接口获取全部分类数据
     * @returns {*}
     */
    getCateListData(params) {
        return this.get({
            data: Object.assign(params, {
                method: 'app.sort.get'
            }),
            param: {
                code: 200,
                cache: true
            }
        });
    }
};