PromotionalTableViewCell.m 1.85 KB
Newer Older
1 2 3 4 5 6 7 8 9
//
//  PromotionalTableViewCell.m
//  Lighting
//
//  Created by 曹云霄 on 2016/10/18.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "PromotionalTableViewCell.h"
10 11 12 13
#import "PromotionLuckyDrawModel.h"
#import "PromotionalGoodsModel.h"
#import "PromotionalDeductionModel.h"
#import "PromotionWeChatCardModel.h"
14 15 16 17 18 19 20 21

@implementation PromotionalTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
- (void)setPromotionModel:(JSONModel *)promotionModel
{
    _promotionModel = promotionModel;
        //微信卡劵
    if ([promotionModel isMemberOfClass:[PromotionWeChatCardModel class]]) {
        PromotionWeChatCardModel *weChatModel = (PromotionWeChatCardModel *)promotionModel;
        self.promotionalTitleLabel.text = [NSString stringWithFormat:@"使用微信卡劵: %@",weChatModel.descriptionString];
    }else if ([promotionModel isMemberOfClass:[PromotionalDeductionModel class]]) {
        //抵扣
        PromotionalDeductionModel *deductionModel = (PromotionalDeductionModel *)promotionModel;
        self.promotionalTitleLabel.text = [NSString stringWithFormat:@"抵扣: %@",deductionModel.descriptionString];
    }else if ([promotionModel isMemberOfClass:[PromotionLuckyDrawModel class]]) {
        //抽奖
        PromotionLuckyDrawModel *drawModel = (PromotionLuckyDrawModel *)promotionModel;
        self.promotionalTitleLabel.text = [NSString stringWithFormat:@"转盘抽奖: %@",drawModel.descriptionString];
    }else if ([promotionModel isMemberOfClass:[PromotionalGoodsModel class]]) {
        //送商品
        PromotionalGoodsModel *goodsModel = (PromotionalGoodsModel *)promotionModel;
        self.promotionalTitleLabel.text = [NSString stringWithFormat:@"赠送商品: %@",goodsModel.descriptionString];
    }
    self.accessoryType = UITableViewCellAccessoryCheckmark;
43 44
}

45 46 47 48




49
@end