This commit is contained in:
2014-09-04 00:34:04 +08:00
parent a168750f7d
commit 3e9a0a19c6
3 changed files with 20 additions and 5 deletions
+19 -4
View File
@@ -66,10 +66,15 @@
}
-(void)setInfoDic:(NSDictionary *)dic
{
self.profitLabel.text = [dic objectForKey:@"nhsy"];
self.nameLabel.text = [dic objectForKey:@"jjmc"];
self.typeLabel.text = [dic objectForKey:@"tip"];
if ([[dic objectForKey:@"state"] isEqualToString:@"SALE"]) {
if ([[dic objectForKey:@"tip"] isKindOfClass:[NSNull class]]) {
self.typeLabel.text = @"";
}else{
self.typeLabel.text = [dic objectForKey:@"tip"];
}
if ([[dic objectForKey:@"state"] isEqualToString:@"SALE"] ) {
[self setPercent:[[dic objectForKey:@"percent"] floatValue]];
[self setStartBuy:[[dic objectForKey:@"startBuy"] integerValue]];
NSMutableString* timeStr = [[NSMutableString alloc] initWithString:[dic objectForKey:@"jjzq"]];
@@ -79,12 +84,22 @@
}else if([[dic objectForKey:@"state"] isEqualToString:@"EFFECTED"]){
[self setTimeWithString:@"最近还款日"];
[_percentView setProgress:0 animated:NO];
NSString* htmlStr = @"  还款中";
NSString* htmlStr = [dic objectForKey:@"descValue"];
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentLeft],DTDefaultTextAlignment, nil];
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
_percentDtlabel.attributedString = percentString;
_priceLabel.text = [dic objectForKey:@"recRepayDate"];
}else if ( [[dic objectForKey:@"state"] isEqualToString:@"ENABLED"])
{
[self setPercent:[[dic objectForKey:@"percent"] floatValue]];
[self setStartBuy:[[dic objectForKey:@"startBuy"] integerValue]];
NSString* htmlStr = [dic objectForKey:@"descValue"];
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
_percentDtlabel.attributedString = percentString;
}
}
@@ -63,7 +63,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<view contentMode="scaleToFill" id="jKx-eQ-tZj" customClass="DTAttributedLabel">
<rect key="frame" x="12" y="26" width="46" height="28"/>
<rect key="frame" x="16" y="28" width="38" height="28"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
</subviews>