coupon.js 717 Bytes
'use strict';

const api = global.yoho.API;

/**
 * [查询商品详情页优惠券]
 * doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/促销/product_detail_page_coupon.md
 */
exports.queryProdPageCoupons = (uid, skn, brandId) => {
    const param = {
        method: 'app.coupons.queryProdPageCoupons',
        uid,
        skn,
        brandId
    };

    return api.get('', param, {cache: true});
};

/**
 *  [用户领券]
 *  doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/促销/promotion.md
 */
exports.getCoupon = (uid, couponId) => {
    const param = {
        method: 'app.promotion.getCoupon',
        uid,
        couponId
    };

    return api.post('', param);
};