Blame view

apps/product/models/coupon-api.js 617 Bytes
htoooth authored
1 2 3
/**
 * Created by TaoHuang on 2016/10/28.
 */
htoooth authored
4
module.exports = class extends global.yoho.BaseModel {
htoooth authored
5 6
    constructor(ctx) {
        super(ctx);
htoooth authored
7 8
    }
htoooth authored
9 10 11 12 13 14 15
    acquireAsync(couponId, uid) {
        return this.get({data: {
            method: 'app.promotion.getCoupon',
            couponId: couponId,
            uid: uid
        }});
    }
htoooth authored
16
htoooth authored
17 18 19 20 21 22
    listAsync(bid, skn, uid) {
        let params = {
            method: 'app.coupons.queryProdPageCoupons',
            brandId: bid,
            skn: skn
        };
htoooth authored
23
htoooth authored
24 25 26
        if (uid) {
            params.uid = uid;
        }
htoooth authored
27
htoooth authored
28 29
        return this.get({data: params});
    }
htoooth authored
30
};