66 lines
2.3 KiB
Objective-C
Executable File
66 lines
2.3 KiB
Objective-C
Executable File
//
|
|
// DDCaiMyRecordCell.m
|
|
// romantic
|
|
//
|
|
// Created by bj_szd on 2023/7/19.
|
|
// Copyright © 2023 romantic. All rights reserved.
|
|
//
|
|
|
|
#import "DDCaiMyRecordCell.h"
|
|
#import "NSString+Time.h"
|
|
|
|
@implementation DDCaiMyRecordCell
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
|
|
}
|
|
|
|
- (void)setModel:(DDCaiAllRecordModel *)model {
|
|
_model = model;
|
|
|
|
self.timeLab.text = [NSString timestampToMDHM:model.add_time];
|
|
|
|
NSMutableArray *typeArr = [[NSMutableArray alloc] init];
|
|
for (NSDictionary *dict in model.win_type_data) {
|
|
[typeArr addObject:[dict safeStringForKey:@"type_name"]];
|
|
}
|
|
self.winLab.text = [typeArr componentsJoinedByString:@","];
|
|
|
|
self.giftView_1.hidden = self.giftView_2.hidden = self.statusLab.hidden = YES;
|
|
for (NSInteger i = 0; i < model.win_gift_list.count; i++) {
|
|
NSDictionary *dict = model.win_gift_list[i];
|
|
if (i == 0) {
|
|
self.giftView_1.hidden = NO;
|
|
[self.giftImgV_1 sd_setImageWithURL:[NSURL URLWithString:[dict safeStringForKey:@"base_image"]]];
|
|
self.giftNumLab_1.text = [dict safeStringForKey:@"num"];
|
|
self.giftNumWidthCon_1.constant = YBFontW(YBBoldFont(9), [dict safeStringForKey:@"num"]) + 10;
|
|
}else if (i == 1) {
|
|
self.giftView_2.hidden = NO;
|
|
[self.giftImgV_2 sd_setImageWithURL:[NSURL URLWithString:[dict safeStringForKey:@"base_image"]]];
|
|
self.giftNumLab_2.text = [dict safeStringForKey:@"num"];
|
|
self.giftNumWidthCon_2.constant = YBFontW(YBBoldFont(9), [dict safeStringForKey:@"num"]) + 10;
|
|
}
|
|
}
|
|
//1中奖 2未中奖 3未参与
|
|
if (model.is_join == 2) {
|
|
self.statusLab.hidden = NO;
|
|
self.statusLab.text = @"未中奖";
|
|
}else if (model.is_join == 3) {
|
|
self.statusLab.hidden = NO;
|
|
self.statusLab.text = @"未参与";
|
|
}
|
|
|
|
NSMutableArray *joinArr = [[NSMutableArray alloc] init];
|
|
for (NSDictionary *dict in model.join_data) {
|
|
[joinArr addObject:[NSString stringWithFormat:@"%@x%@", dict[@"type_name"], dict[@"num"]]];
|
|
}
|
|
if (joinArr.count > 0) {
|
|
self.joinLab.text = [NSString stringWithFormat:@"我的弹奏:%@", [joinArr componentsJoinedByString:@","]];
|
|
}else {
|
|
self.joinLab.text = @"我的弹奏:无";
|
|
}
|
|
}
|
|
|
|
@end
|