123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // FKVipDiscountItem.m
- // FirstLink
- //
- // Created by ascii on 2017/5/18.
- // Copyright © 2017年 FirstLink. All rights reserved.
- //
- #import "FKVipDiscountItem.h"
- #import "FKUserManager.h"
- @implementation FKVipDiscountItem
- - (instancetype)init {
- self = [super init];
- if (self) {
- _isUseVipDiscount = YES;
- }
- return self;
- }
- + (NSDictionary *)mts_mapping {
- return @{@"discount" : mts_key(discount),
- @"quantity" : mts_key(quantity),
- };
- }
- + (BOOL)mts_shouldSetUndefinedKeys {
- return NO;
- }
- - (BOOL)isVipUserWithDiscount {
- User *user = [FKUserManager sharedManager].user;
-
- NSInteger quantity = [self.quantity integerValue];
- if (quantity > 0 && [user isVipWithDiscount]) {
- return YES;
- }
- return NO;
- }
- @end
|