coupon-api.js 617 Bytes
/**
 * Created by TaoHuang on 2016/10/28.
 */
module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
    }

    acquireAsync(couponId, uid) {
        return this.get({data: {
            method: 'app.promotion.getCoupon',
            couponId: couponId,
            uid: uid
        }});
    }

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

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

        return this.get({data: params});
    }
};