产品列表bug

This commit is contained in:
2014-09-23 16:58:53 +08:00
parent bd7ae26fd4
commit 24f9ede81c
4 changed files with 10 additions and 11 deletions
@@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>D7A72B7F-6544-436C-AC15-3ED04A1E562D</string>
<string>F9CCD56F-A331-4F6E-AB51-4F0CE7AE5C12</string>
<key>IDESourceControlProjectName</key>
<string>ManagerDemo</string>
<key>IDESourceControlProjectOriginsDictionary</key>
@@ -68,7 +68,6 @@
}
-(void)firstRefresh
{
NSLog(@"%d",_productInfoArray.count);
if ([_productInfoArray count] <= 0) {
[self headerBeginRefreshing];
}
+9 -9
View File
@@ -45,7 +45,7 @@
}
-(void)setPercent:(NSInteger) percent
{
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:20px; color:red; text-align:center; \">%d</span> %%",percent];
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:20px; color:red; text-align:center; \">%ld</span> %%",percent];
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
@@ -72,18 +72,18 @@
-(void)setInfoDic:(NSDictionary *)dic
{
self.productId = [dic objectForKey:@"id"];
self.profitLabel.text = [NSString stringWithFormat:@"%.2f%%",[[dic objectForKey:@"nhsy"] floatValue]];
self.nameLabel.text = [dic objectForKey:@"proName"];
if ([[dic objectForKey:@"tip"] isKindOfClass:[NSNull class]]) {
self.productId = [dic objectForKeyWithoutNull:@"id"];
self.profitLabel.text = [NSString stringWithFormat:@"%.2f%%",[[dic objectForKeyWithoutNull:@"nhsy"] floatValue]];
self.nameLabel.text = [dic objectForKeyWithoutNull:@"proName"];
if ([[dic objectForKeyWithoutNull:@"tip"] isKindOfClass:[NSNull class]]) {
self.typeLabel.text = @"";
}else{
self.typeLabel.text = [dic objectForKey:@"tip"];
self.typeLabel.text = [dic objectForKeyWithoutNull:@"tip"];
}
// if ([[dic objectForKey:@"state"] integerValue] == 1 ) {
[self setPercent:[[dic objectForKey:@"percent"] floatValue]];
[self setStartBuy:[[dic objectForKey:@"startBuy"] integerValue]];
NSString* timeStr = [NSString stringWithFormat:@"<span style=\" color:green;\">限</span>%@个月起",[dic objectForKey:@"timeLimit"]];
[self setPercent:[[dic objectForKeyWithoutNull:@"percent"] floatValue]];
[self setStartBuy:[[dic objectForKeyWithoutNull:@"startBuy"] integerValue]];
NSString* timeStr = [NSString stringWithFormat:@"<span style=\" color:green;\">限</span>%@个月起",[dic objectForKeyWithoutNull:@"timeLimit"]];
[self setTimeWithString:timeStr];
// }
// else if([[dic objectForKey:@"state"] integerValue] == 2){