1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// PromotionalTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/10/18.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PromotionalTableViewCell.h"
#import "PromotionLuckyDrawModel.h"
#import "PromotionalGoodsModel.h"
#import "PromotionalDeductionModel.h"
#import "PromotionWeChatCardModel.h"
@implementation PromotionalTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setPromotionModel:(JSONModel *)promotionModel
{
_promotionModel = promotionModel;
//微信卡劵
if ([promotionModel isMemberOfClass:[PromotionWeChatCardModel class]]) {
PromotionWeChatCardModel *weChatModel = (PromotionWeChatCardModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"微信卡劵: %ld",weChatModel.total];
}else if ([promotionModel isMemberOfClass:[PromotionalDeductionModel class]]) {
//抵扣
PromotionalDeductionModel *deductionModel = (PromotionalDeductionModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"抵扣金额: %ld元",deductionModel.total];
}else if ([promotionModel isMemberOfClass:[PromotionLuckyDrawModel class]]) {
//抽奖
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"转盘抽奖: %@",self.model.descriptionString];
}else if ([promotionModel isMemberOfClass:[PromotionalGoodsModel class]]) {
//送商品
PromotionalGoodsModel *goodsModel = (PromotionalGoodsModel *)promotionModel;
self.promotionalTitleLabel.text = [NSString stringWithFormat:@"赠送商品: %@",goodsModel.goods.name];
}
self.accessoryType = UITableViewCellAccessoryCheckmark;
}
@end