YOUPAILCBillDetailCell.m 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. //
  2. // YOUPAILCBillDetailCell.m
  3. // LiveChat
  4. //
  5. // Created by 张灿 on 2018/10/10.
  6. // Copyright © 2018年 caicai. All rights reserved.
  7. //
  8. #import "YOUPAILCBillDetailCell.h"
  9. @interface YOUPAILCBillDetailCell()
  10. @property(nonatomic,strong)UILabel* youpaipzhuanshiLabel;
  11. @property(nonatomic,strong)UILabel* youpaiptypeLabel;
  12. @property(nonatomic,strong)UILabel* youpaiptimeLab;
  13. @property(nonatomic,strong)UILabel* youpaipvalueLab;
  14. @end
  15. @implementation YOUPAILCBillDetailCell
  16. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  17. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  18. self.selectionStyle = UITableViewCellSelectionStyleNone;
  19. [self youpaifinitUI];
  20. }
  21. return self;
  22. }
  23. - (void)youpaifinitUI{
  24. self.backgroundColor = LCBkgColor;
  25. UIView *bgView = [UIView new];
  26. [self.contentView addSubview:bgView];
  27. [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.left.mas_equalTo(14);
  29. make.right.mas_equalTo(-14);
  30. make.height.mas_equalTo(94);
  31. }];
  32. bgView.layer.cornerRadius = 5;
  33. bgView.layer.masksToBounds = YES;
  34. bgView.backgroundColor = HexColorFromRGB(0x2A2935);
  35. //充值砖石
  36. UILabel* zhuanshiLabel = [[UILabel alloc]init];
  37. zhuanshiLabel.textColor = HexColorFromRGB(0xffffff);
  38. zhuanshiLabel.font = LCFont14;
  39. [bgView addSubview:zhuanshiLabel];
  40. self.youpaipzhuanshiLabel = zhuanshiLabel;
  41. [zhuanshiLabel makeConstraints:^(MASConstraintMaker *make) {
  42. make.left.equalTo(@12);
  43. make.top.equalTo(@18);
  44. }];
  45. //支付方式
  46. UILabel* typeLabel = [[UILabel alloc]init];
  47. typeLabel.textColor = HexColorFromRGB(0xffffff);
  48. typeLabel.font = LCFont14;
  49. [bgView addSubview:typeLabel];
  50. self.youpaiptypeLabel = typeLabel;
  51. [typeLabel makeConstraints:^(MASConstraintMaker *make) {
  52. make.left.equalTo(@12);
  53. make.top.equalTo(zhuanshiLabel.mas_bottom).offset(9);
  54. }];
  55. //时间
  56. UILabel* timeLab = [[UILabel alloc]init];
  57. timeLab.textColor = HexColorFromRGB(0x9F9DA5);
  58. timeLab.font = LCFont12;
  59. [bgView addSubview:timeLab];
  60. self.youpaiptimeLab = timeLab;
  61. [timeLab makeConstraints:^(MASConstraintMaker *make) {
  62. make.left.equalTo(@12);
  63. make.top.equalTo(typeLabel.bottom).offset(@9);
  64. }];
  65. //支付金额
  66. UILabel* valueLab = [[UILabel alloc]init];
  67. valueLab.textColor = HexColorFromRGB(0x999999);
  68. valueLab.font = LCFont12;
  69. [bgView addSubview:valueLab];
  70. self.youpaipvalueLab = valueLab;
  71. [valueLab makeConstraints:^(MASConstraintMaker *make) {
  72. make.right.equalTo(-12);
  73. make.centerY.equalTo(0);
  74. }];
  75. }
  76. - (void)setYoupaipbillModel:(YOUPAILCBillDetailModel *)billModel{
  77. _youpaipbillModel = billModel;
  78. self.youpaipzhuanshiLabel.text = [NSString stringWithFormat:@"充值钻石:%.0f",billModel.youpaipchange_value];
  79. self.youpaiptypeLabel.text = [NSString stringWithFormat:@"%@:%@",LCStr(word43),billModel.youpaipplatform_name];//支付方式
  80. self.youpaiptimeLab.text = billModel.youpaipcreate_time;
  81. self.youpaipvalueLab.attributedText = [LCTools setRichTextWithTitle:@"支付: ¥" subTitle:billModel.youpaiprecharge_money titleColor:[UIColor whiteColor] subTitleColor:[UIColor whiteColor] titleFontSize:14 subTitleFontSize:18];;
  82. // //头像 type //1充值 2提现 3视频 4礼物 5系统 6兑换 7私信
  83. // if (billModel.type==5||billModel.type==9||billModel.type==10) {
  84. // self.avatarImgV.image = [UIImage imageNamed:@"vqu_images_appLogo"];
  85. // }else if (billModel.type==1 || billModel.type==2 || billModel.type==6 ){
  86. // self.avatarImgV.image = [UIImage imageNamed:@"vqu_images_P_wallet"];
  87. // }else{
  88. // [self.avatarImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:billModel.icon]];
  89. // }
  90. // //账户变动值
  91. // if (billModel.change_value>0) {
  92. // if (billModel.account_type==1||billModel.account_type==2) {
  93. // self.valueLab.text = [NSString stringWithFormat:@"+%.2f元",billModel.change_value];
  94. // self.valueLab.textColor = LCRedColor;
  95. // }else{
  96. // self.valueLab.text = [NSString stringWithFormat:@"+ %.0f钻石",billModel.change_value];
  97. // self.valueLab.textColor = DecColorFromRGB(102,102,102);
  98. // }
  99. // }else{
  100. // self.valueLab.textColor = DecColorFromRGB(170,170,170);
  101. // if (billModel.account_type==1||billModel.account_type==2) {
  102. // self.valueLab.text = [NSString stringWithFormat:@"%.2f元",billModel.change_value];
  103. // }else{
  104. // self.valueLab.text = [NSString stringWithFormat:@"%.0f钻石",billModel.change_value];
  105. // }
  106. // }
  107. // //账户描述
  108. // if (billModel.type==5 || billModel.type==6||billModel.type==9||billModel.type==10 ||billModel.type == 11) {
  109. // self.descLab.text = billModel.system_str;
  110. // }else if(billModel.type==1){
  111. // if (billModel.account_type==1||billModel.account_type==2) {
  112. // self.descLab.text = @"充值余额";
  113. // }else{
  114. // self.descLab.text = @"购买钻石";
  115. // }
  116. // }else if(billModel.type==2){
  117. // self.descLab.text = @"用户提现";
  118. // }else{
  119. // NSString* text1,*text2;
  120. // if (billModel.type==3) {
  121. // text1 = @"视频";
  122. // }else if (billModel.type==4){
  123. // text1 = @"礼物";
  124. // }else if (billModel.type==7){
  125. // text1 = @"私信";
  126. // }else if (billModel.type==9){
  127. // text1 = @"守护";
  128. // }
  129. // //modify by leo v1.5.3
  130. // else if (billModel.type==10)
  131. // {
  132. // text1 = @"公会";
  133. // }else{
  134. // text1 = billModel.system_str;
  135. // }
  136. // if (billModel.change_value>0) {
  137. // text2 = @"收入来自于";
  138. // }else{
  139. // text2 = @"支出给";
  140. // }
  141. //
  142. //
  143. //
  144. // self.descLab.text = [NSString stringWithFormat:@"%@%@%@",text1,text2,billModel.from_username];
  145. // }
  146. }
  147. @end