Commit a9d39e4d8e646a703db2839e640aaa5b4d795a7e

Authored by liushiyu
1 parent 05e4ed9b

积分详情加缩进

CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteDetailHeaderView.m
@@ -37,12 +37,27 @@ @@ -37,12 +37,27 @@
37 self.inteLabel.attributedText = coin_string; 37 self.inteLabel.attributedText = coin_string;
38 38
39 39
40 - NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"获取:%@",[detailModel.obtainIntegral isNotBlank]?detailModel.obtainIntegral:@"0"]]; 40 + NSString * obtainString = [detailModel.obtainIntegral isNotBlank]?detailModel.obtainIntegral:@"0";
  41 + NSString * o = [NSString stringWithFormat:@"获取:%@",obtainString];
  42 + NSInteger obtain = [obtainString integerValue];
  43 + if (obtain >= 10000) {
  44 + o = [NSString stringWithFormat:@"获取:%.2fW",(float)obtain/10000];
  45 + }
  46 +
  47 + NSString * payString = [detailModel.payIntegral isNotBlank]?detailModel.payIntegral:@"0";
  48 + NSString * p = [NSString stringWithFormat:@"支出:%@",payString];
  49 + NSInteger pay = [payString integerValue];
  50 + if (pay >= 10000) {
  51 + p = [NSString stringWithFormat:@"支出:%.2fW",(float)pay/10000];
  52 + }
  53 +
  54 +
  55 + NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:o];
41 [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取:"]]; 56 [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取:"]];
42 [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取:"].location)]; 57 [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取:"].location)];
43 self.spendLabel.attributedText = spend_string; 58 self.spendLabel.attributedText = spend_string;
44 59
45 - NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"支出:%@",[detailModel.payIntegral isNotBlank]?detailModel.payIntegral:@"0"]]; 60 + NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:p];
46 [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出:"]]; 61 [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出:"]];
47 [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出:"].location)]; 62 [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出:"].location)];
48 self.obtaLabel.attributedText = obta_string; 63 self.obtaLabel.attributedText = obta_string;