popular-shop.js 1.41 KB
/**
 *  desc: 店铺装修----红人店铺
 */
'use strict';

const api = global.yoho.API;



/**
 *  获取红人店铺 banner
 *  doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/商品列表/店铺装修.md
 *  @param int shopId 店铺id
 */
exports.getBanner = shopId => {
    let params = {
        // method: 'app.popular.shop.banner',
        method: 'app.shop.banner', //TODO: this is mock api,use up
        shop_id: shopId,
        app_type: 0  // 0 有货 1 blk
    };

    return api.get('', params, {cache: true, code: 200});
};


/**
 *  获取店铺 品牌数据
 *  @param int shopId 店铺id
 */
exports.getShopsBrands = shopId => {
    let params = {
        method: 'app.shops.getShopsBrands',
        shop_id: shopId
    };

    return api.get('', params, {cache: true, code: 200});
};


/**
 * 获取店铺 介绍
 * @param int shopId 店铺id
 */
exports.getIntro = shopId => {
    let params = {
        // method: 'app.popular.shops.getIntro',
        method: 'app.shops.getIntro',
        shop_id: shopId,
        app_type: 0
    };

    return api.get('', params, {cache: true, code: 200});
};


/**
 *  查询红人店铺对应的装修元素
 *
 *  @param int shopId 店铺id
 */
exports.getShopsdecorator = shopId => {
    let params = {
        method: 'app.popular.shopsdecorator',
        shop_id: shopId,
        app_type: 0
    };

    return api.get('', params, {cache: true, code: 200});
};