shop-api.js 964 Bytes
/**
 * Created by TaoHuang on 2016/6/28.
 */
'use strict';

const api = global.yoho.API;
const config = global.yoho.config;

/**
 * 获取店铺装修的所有资源接口
 */
exports.shopsDecoratorListAsync = shopId => {
    return api.get('', {
        method: 'app.shopsdecorator.getList',
        shop_id: shopId
    }, config.apiCache);
};

/**
 * 获取店铺优惠券接口
 */
exports.shopCouponListAsync = (shopId, uid) => {
    let extra = {
        code: 200
    };

    if (!uid) {
        extra.cache = true;
    }

    return api.get('', {
        method: 'shop.coupons.list',
        shop_id: shopId,
        uid: uid
    }, extra);
};

exports.shopBannerAsync = (shopId) => {
    return api.get('', {
        method: 'app.shop.banner',
        shop_id: shopId
    });
};

exports.queryShopsByBrandId = (sid, bid) => {
    return api.get('', {
        method: 'app.product.queryShopsInfoById',
        brand_id: bid,
        shop_id: sid
    });
};