coupon-api.js 555 Bytes
/**
 * Created by TaoHuang on 2016/10/28.
 */

'use strict';

const api = global.yoho.API;

const listAsync = (bid, skn, uid) => {
    let params = {
        method: 'app.coupons.queryProdPageCoupons',
        brandId: bid,
        skn: skn
    };

    if (uid) {
        params.uid = uid;
    }

    return api.get('', params);
};

const acquireAsync = (couponId, uid) => {
    return api.get('', {
        method: 'app.promotion.getCoupon',
        couponId: couponId,
        uid: uid
    });
};


module.exports = {
    listAsync,
    acquireAsync
};