mirror of
https://github.com/wu736139669/ManagerDemo.git
synced 2026-08-07 06:14:48 +00:00
添加一些接口
This commit is contained in:
@@ -133,6 +133,7 @@
|
|||||||
A9C053FE19AD706C002331A5 /* ToolBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C053FD19AD706C002331A5 /* ToolBarView.m */; };
|
A9C053FE19AD706C002331A5 /* ToolBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C053FD19AD706C002331A5 /* ToolBarView.m */; };
|
||||||
A9C0540519ADBCB2002331A5 /* FundProductInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C0540319ADBCB2002331A5 /* FundProductInfoViewController.m */; };
|
A9C0540519ADBCB2002331A5 /* FundProductInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C0540319ADBCB2002331A5 /* FundProductInfoViewController.m */; };
|
||||||
A9C0540619ADBCB2002331A5 /* FundProductInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C0540419ADBCB2002331A5 /* FundProductInfoViewController.xib */; };
|
A9C0540619ADBCB2002331A5 /* FundProductInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C0540419ADBCB2002331A5 /* FundProductInfoViewController.xib */; };
|
||||||
|
A9C2E4E519B6A0C900C659B3 /* icon_email@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C2E4E419B6A0C900C659B3 /* icon_email@2x.png */; };
|
||||||
A9C69442199BB7B100B2CECE /* icon_person_take_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C69441199BB7B100B2CECE /* icon_person_take_image@2x.png */; };
|
A9C69442199BB7B100B2CECE /* icon_person_take_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C69441199BB7B100B2CECE /* icon_person_take_image@2x.png */; };
|
||||||
A9C69446199BBEB200B2CECE /* MyTotalProfitCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C69445199BBEB200B2CECE /* MyTotalProfitCellView.m */; };
|
A9C69446199BBEB200B2CECE /* MyTotalProfitCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C69445199BBEB200B2CECE /* MyTotalProfitCellView.m */; };
|
||||||
A9C69448199BC1F500B2CECE /* gray_select_arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C69447199BC1F500B2CECE /* gray_select_arrow@2x.png */; };
|
A9C69448199BC1F500B2CECE /* gray_select_arrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C69447199BC1F500B2CECE /* gray_select_arrow@2x.png */; };
|
||||||
@@ -362,6 +363,7 @@
|
|||||||
A9C0540219ADBCB2002331A5 /* FundProductInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FundProductInfoViewController.h; sourceTree = "<group>"; };
|
A9C0540219ADBCB2002331A5 /* FundProductInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FundProductInfoViewController.h; sourceTree = "<group>"; };
|
||||||
A9C0540319ADBCB2002331A5 /* FundProductInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FundProductInfoViewController.m; sourceTree = "<group>"; };
|
A9C0540319ADBCB2002331A5 /* FundProductInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FundProductInfoViewController.m; sourceTree = "<group>"; };
|
||||||
A9C0540419ADBCB2002331A5 /* FundProductInfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FundProductInfoViewController.xib; sourceTree = "<group>"; };
|
A9C0540419ADBCB2002331A5 /* FundProductInfoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FundProductInfoViewController.xib; sourceTree = "<group>"; };
|
||||||
|
A9C2E4E419B6A0C900C659B3 /* icon_email@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_email@2x.png"; sourceTree = "<group>"; };
|
||||||
A9C69441199BB7B100B2CECE /* icon_person_take_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_person_take_image@2x.png"; sourceTree = "<group>"; };
|
A9C69441199BB7B100B2CECE /* icon_person_take_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_person_take_image@2x.png"; sourceTree = "<group>"; };
|
||||||
A9C69444199BBEB200B2CECE /* MyTotalProfitCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyTotalProfitCellView.h; sourceTree = "<group>"; };
|
A9C69444199BBEB200B2CECE /* MyTotalProfitCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyTotalProfitCellView.h; sourceTree = "<group>"; };
|
||||||
A9C69445199BBEB200B2CECE /* MyTotalProfitCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyTotalProfitCellView.m; sourceTree = "<group>"; };
|
A9C69445199BBEB200B2CECE /* MyTotalProfitCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyTotalProfitCellView.m; sourceTree = "<group>"; };
|
||||||
@@ -703,6 +705,7 @@
|
|||||||
A9AF6C4D19949CAD0076C0EE /* Resource */ = {
|
A9AF6C4D19949CAD0076C0EE /* Resource */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
A9C2E4E419B6A0C900C659B3 /* icon_email@2x.png */,
|
||||||
A97F9D1C19B5931C0073E7E6 /* register_button_s@2x.png */,
|
A97F9D1C19B5931C0073E7E6 /* register_button_s@2x.png */,
|
||||||
A97F9D1D19B5931C0073E7E6 /* register_button@2x.png */,
|
A97F9D1D19B5931C0073E7E6 /* register_button@2x.png */,
|
||||||
A97F9D1819B592FD0073E7E6 /* login_button_s@2x.png */,
|
A97F9D1819B592FD0073E7E6 /* login_button_s@2x.png */,
|
||||||
@@ -966,6 +969,7 @@
|
|||||||
A988A902199A755300EB10AA /* FundListCell.xib in Resources */,
|
A988A902199A755300EB10AA /* FundListCell.xib in Resources */,
|
||||||
A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */,
|
A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */,
|
||||||
A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */,
|
A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */,
|
||||||
|
A9C2E4E519B6A0C900C659B3 /* icon_email@2x.png in Resources */,
|
||||||
A97F9D1E19B5931C0073E7E6 /* register_button_s@2x.png in Resources */,
|
A97F9D1E19B5931C0073E7E6 /* register_button_s@2x.png in Resources */,
|
||||||
A9EC95BE19B54FEC00681678 /* textField_bg@2x.png in Resources */,
|
A9EC95BE19B54FEC00681678 /* textField_bg@2x.png in Resources */,
|
||||||
A9F1E18819ACB64D00B6A441 /* DTCoreTextTableViewCell.xib in Resources */,
|
A9F1E18819ACB64D00B6A441 /* DTCoreTextTableViewCell.xib in Resources */,
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -45,4 +45,24 @@ typedef void (^FailedBlock) (NSError *error);
|
|||||||
* @return MKNetworkOperation
|
* @return MKNetworkOperation
|
||||||
*/
|
*/
|
||||||
-(MKNetworkOperation*)loginWithPhone:(NSString*)phoneNum withPassWord:(NSString*)password withCompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock;
|
-(MKNetworkOperation*)loginWithPhone:(NSString*)phoneNum withPassWord:(NSString*)password withCompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock;
|
||||||
|
/**
|
||||||
|
* 获取列表
|
||||||
|
*
|
||||||
|
* @param completionBlock 请求完成
|
||||||
|
* @param failedBlock 请求失败
|
||||||
|
* @param type 类型
|
||||||
|
* @param pageNum 页数
|
||||||
|
* @return MKNetworkOperation
|
||||||
|
*/
|
||||||
|
-(MKNetworkOperation*)productListForType:(NSString*)type withPageNum:(NSInteger)pageNum withCompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取个人信息
|
||||||
|
*
|
||||||
|
* @param completionBlock 请求完成
|
||||||
|
* @param failedBlock 请求失败
|
||||||
|
*
|
||||||
|
* @return MKNetworkOperation
|
||||||
|
*/
|
||||||
|
-(MKNetworkOperation*)getAccountInfoWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -31,12 +31,15 @@
|
|||||||
}else{
|
}else{
|
||||||
dic = [[NSMutableDictionary alloc] init];
|
dic = [[NSMutableDictionary alloc] init];
|
||||||
}
|
}
|
||||||
// [dic setObject:@"1408971073.153750" forKey:@"_"];
|
NSDate* timeDate = [NSDate dateWithTimeIntervalSinceNow:0];
|
||||||
// [dic setObject:@"211d9ede2548c40e5d18e47358835b16" forKey:@"sign"];
|
NSTimeInterval timeInterval =[timeDate timeIntervalSince1970]*1000;
|
||||||
// [dic setObject:@"MD5" forKey:@"sign_t"];
|
NSString *timeString = [NSString stringWithFormat:@"%f", timeInterval];//转为字符型
|
||||||
// [dic setObject:@"f241caa3534d751598871852a2f5205f4927fcf8" forKey:@"token"];
|
[dic setObject:timeString forKey:@"_"];
|
||||||
// [dic setObject:@"2.5.0" forKey:@"ver"];
|
[dic setObject:@"211d9ede2548c40e5d18e47358835b16" forKey:@"sign"];
|
||||||
// [dic setObject:@"IOS" forKey:@"vjson"];
|
[dic setObject:@"MD5" forKey:@"sign_t"];
|
||||||
|
[dic setObject:@"15e6c60bbdfa5d62dc7baab09cca5d19d1f32d11" forKey:@"token"];
|
||||||
|
[dic setObject:@"2.5.0" forKey:@"ver"];
|
||||||
|
[dic setObject:@"IOS" forKey:@"vjson"];
|
||||||
|
|
||||||
|
|
||||||
return [self operationWithPath:path params:dic httpMethod:@"GET" ssl:YES];
|
return [self operationWithPath:path params:dic httpMethod:@"GET" ssl:YES];
|
||||||
@@ -49,6 +52,15 @@
|
|||||||
}else{
|
}else{
|
||||||
dic = [[NSMutableDictionary alloc] init];
|
dic = [[NSMutableDictionary alloc] init];
|
||||||
}
|
}
|
||||||
|
NSDate* timeDate = [NSDate dateWithTimeIntervalSinceNow:0];
|
||||||
|
NSTimeInterval timeInterval =[timeDate timeIntervalSince1970]*1000;
|
||||||
|
NSString *timeString = [NSString stringWithFormat:@"%f", timeInterval];//转为字符型
|
||||||
|
[dic setObject:timeString forKey:@"_"];
|
||||||
|
[dic setObject:@"211d9ede2548c40e5d18e47358835b16" forKey:@"sign"];
|
||||||
|
[dic setObject:@"MD5" forKey:@"sign_t"];
|
||||||
|
[dic setObject:@"15e6c60bbdfa5d62dc7baab09cca5d19d1f32d11" forKey:@"token"];
|
||||||
|
[dic setObject:@"2.5.0" forKey:@"ver"];
|
||||||
|
[dic setObject:@"IOS" forKey:@"vjson"];
|
||||||
return [self operationWithPath:path params:dic httpMethod:@"POST" ssl:YES];
|
return [self operationWithPath:path params:dic httpMethod:@"POST" ssl:YES];
|
||||||
}
|
}
|
||||||
-(MKNetworkOperation*)getBannerInfoWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
|
-(MKNetworkOperation*)getBannerInfoWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
|
||||||
@@ -102,4 +114,38 @@
|
|||||||
return op;
|
return op;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
-(MKNetworkOperation*)productListForType:(NSString *)type withPageNum:(NSInteger)pageNum withCompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
|
||||||
|
{
|
||||||
|
NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:type, @"type",[NSNumber numberWithInteger:pageNum],@"pageNum", nil];
|
||||||
|
MKNetworkOperation* op = [self postWithPath:@"productListForType.do" params:dic];
|
||||||
|
|
||||||
|
[op addCompletionHandler:^(MKNetworkOperation *completedOperation) {
|
||||||
|
completionBlock(completedOperation.responseJSON);
|
||||||
|
|
||||||
|
} errorHandler:^(MKNetworkOperation *completedOperation, NSError *error) {
|
||||||
|
DLog(@"%@", error);
|
||||||
|
failedBlock(error);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self enqueueOperation:op forceReload:YES];
|
||||||
|
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
-(MKNetworkOperation*)getAccountInfoWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock
|
||||||
|
{
|
||||||
|
NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:[ManagerUser shareInstance].userId, @"userId",[ManagerUser shareInstance].token,@"token", nil];
|
||||||
|
MKNetworkOperation* op = [self postWithPath:@"accountIndex4.do" params:dic];
|
||||||
|
|
||||||
|
[op addCompletionHandler:^(MKNetworkOperation *completedOperation) {
|
||||||
|
completionBlock(completedOperation.responseJSON);
|
||||||
|
|
||||||
|
} errorHandler:^(MKNetworkOperation *completedOperation, NSError *error) {
|
||||||
|
DLog(@"%@", error);
|
||||||
|
failedBlock(error);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self enqueueOperation:op forceReload:YES];
|
||||||
|
|
||||||
|
return op;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -11,7 +11,11 @@
|
|||||||
@interface ManagerUser : NSObject
|
@interface ManagerUser : NSObject
|
||||||
{
|
{
|
||||||
BOOL _isLogin;
|
BOOL _isLogin;
|
||||||
|
NSString* _userId;
|
||||||
|
NSString* _token;
|
||||||
}
|
}
|
||||||
@property(nonatomic, assign)BOOL isLogin;
|
@property(nonatomic, assign)BOOL isLogin;
|
||||||
|
@property(nonatomic, strong)NSString* userId;
|
||||||
|
@property(nonatomic, strong)NSString* token;
|
||||||
+(ManagerUser*)shareInstance;
|
+(ManagerUser*)shareInstance;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -41,4 +41,10 @@
|
|||||||
|
|
||||||
+(UIImage*) buttonImageFromColor:(UIColor *)color withFrame:(CGRect)frame;
|
+(UIImage*) buttonImageFromColor:(UIColor *)color withFrame:(CGRect)frame;
|
||||||
+(UIViewController *)getCurrentRootViewController;
|
+(UIViewController *)getCurrentRootViewController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码验证
|
||||||
|
*/
|
||||||
|
+(BOOL) isValidateMobile:(NSString *)mobile;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -138,4 +138,13 @@
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*手机号码验证 MODIFIED BY HELENSONG*/
|
||||||
|
+(BOOL) isValidateMobile:(NSString *)mobile
|
||||||
|
{
|
||||||
|
//手机号以13, 15,18开头,八个 \d 数字字符
|
||||||
|
NSString *phoneRegex = @"^((13[0-9])|(15[^4,\\D])|(18[0,0-9]))\\d{8}$";
|
||||||
|
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",phoneRegex];
|
||||||
|
return [phoneTest evaluateWithObject:mobile];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -29,6 +29,6 @@
|
|||||||
-(void)setType:(NSString*)type;
|
-(void)setType:(NSString*)type;
|
||||||
-(void)setInfo:(NSString*)info;
|
-(void)setInfo:(NSString*)info;
|
||||||
-(void)setSecurityDesc:(NSString*)securityDesc;
|
-(void)setSecurityDesc:(NSString*)securityDesc;
|
||||||
-(void)setTime:(NSInteger)month withStartBuy:(NSInteger)money;
|
-(void)setTime:(NSString*)time withStartBuy:(NSInteger)money;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
progressPercent = percent;
|
progressPercent = percent;
|
||||||
[_percentView setProgress:percent duration:1.0];
|
[_percentView setProgress:percent duration:1.0];
|
||||||
//中间文字
|
//中间文字
|
||||||
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:40px; color:red; text-align:center; \">%d</span>%%",(int)percent*100];
|
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:40px; color:red; text-align:center; \">%d</span>%%",(int)(percent*100.0)];
|
||||||
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
|
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
|
||||||
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
||||||
@@ -82,15 +82,18 @@
|
|||||||
-(void)setExpect:(float)expect
|
-(void)setExpect:(float)expect
|
||||||
{
|
{
|
||||||
//预期
|
//预期
|
||||||
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:11px;text-align:center; \">四个大字<span style=\"font-size:13px; color:red;\">%.2f%%</span></span>",expect];
|
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:11px;text-align:center; \">预期年化<span style=\"font-size:13px; color:red;\">%.2f%%</span></span>",expect];
|
||||||
NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
|
NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
|
||||||
_expectLabel.attributedString = percentString;
|
_expectLabel.attributedString = percentString;
|
||||||
}
|
}
|
||||||
-(void)setTime:(NSInteger)month withStartBuy:(NSInteger)money
|
-(void)setTime:(NSString*)time withStartBuy:(NSInteger)money
|
||||||
{
|
{
|
||||||
|
|
||||||
|
NSCharacterSet* nonDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
|
||||||
|
time = [time stringByReplacingOccurrencesOfString:[time stringByTrimmingCharactersInSet:nonDigits] withString:[NSString stringWithFormat:@"<span style=\"font-size:13px; color:red;\">%@</span>",[time stringByTrimmingCharactersInSet:nonDigits]]];
|
||||||
//时间
|
//时间
|
||||||
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:11px;text-align:center; \">限<span style=\"font-size:13px; color:red;\">%d</span>个月<span style=\"font-size:13px; color:red;\">%d</span>起</span>",month,money];
|
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:11px;text-align:center; \">%@<span style=\"font-size:13px; color:red;\">%d</span>起购</span>",time,money];
|
||||||
NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
|
NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
|
||||||
_timeLabel.attributedString = percentString;
|
_timeLabel.attributedString = percentString;
|
||||||
|
|||||||
@@ -48,10 +48,11 @@
|
|||||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||||
</imageView>
|
</imageView>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="42" placeholderIntrinsicHeight="21" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1tT-kO-DcP">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="42" placeholderIntrinsicHeight="21" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1tT-kO-DcP">
|
||||||
<rect key="frame" x="0.0" y="9" width="42" height="21"/>
|
<rect key="frame" x="0.0" y="3" width="42" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<rect key="contentStretch" x="1" y="1" width="1" height="1"/>
|
<rect key="contentStretch" x="1" y="1" width="1" height="1"/>
|
||||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
|
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="12"/>
|
||||||
|
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
<size key="shadowOffset" width="0.0" height="0.0"/>
|
<size key="shadowOffset" width="0.0" height="0.0"/>
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
@property (weak, nonatomic) IBOutlet UILabel *numProfitLabel;
|
@property (weak, nonatomic) IBOutlet UILabel *numProfitLabel;
|
||||||
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
|
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
|
||||||
@property (weak, nonatomic) IBOutlet UIImageView *typeImg;
|
@property (weak, nonatomic) IBOutlet UIImageView *typeImg;
|
||||||
|
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
|
||||||
|
|
||||||
@property (weak, nonatomic) IBOutlet DTAttributedLabel *buyTypeDtLabel;
|
@property (weak, nonatomic) IBOutlet DTAttributedLabel *buyTypeDtLabel;
|
||||||
@property (weak, nonatomic) IBOutlet DTAttributedLabel *lowestPriceDtLabel;
|
@property (weak, nonatomic) IBOutlet DTAttributedLabel *lowestPriceDtLabel;
|
||||||
@@ -23,4 +24,6 @@
|
|||||||
|
|
||||||
-(void)setBuyTypeWithString:(NSString*)htmlStr;
|
-(void)setBuyTypeWithString:(NSString*)htmlStr;
|
||||||
-(void)setLowestPriceWtihCount:(NSInteger)price;
|
-(void)setLowestPriceWtihCount:(NSInteger)price;
|
||||||
|
|
||||||
|
-(void)setInfoDic:(NSDictionary*)dic;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
[self setBuyTypeWithString:@"<font color=\"green\">随</font>买随卖"];
|
[self setBuyTypeWithString:@"<font color=\"green\">随</font>买随卖"];
|
||||||
[self setLowestPriceWtihCount:1000];
|
[self setLowestPriceWtihCount:1000];
|
||||||
|
//旋转
|
||||||
|
_typeLabel.transform = CGAffineTransformMakeRotation( M_PI/4);
|
||||||
}
|
}
|
||||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
|
||||||
{
|
{
|
||||||
@@ -42,11 +44,29 @@
|
|||||||
}
|
}
|
||||||
-(void)setLowestPriceWtihCount:(NSInteger)price
|
-(void)setLowestPriceWtihCount:(NSInteger)price
|
||||||
{
|
{
|
||||||
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\" color:black; \">%ld</span>元起",price];
|
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\" color:black; \">%d</span>元起",price];
|
||||||
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentRight],DTDefaultTextAlignment,[UIColor grayColor],DTDefaultTextColor, nil];
|
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentRight],DTDefaultTextAlignment,[UIColor grayColor],DTDefaultTextColor, nil];
|
||||||
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
||||||
_lowestPriceDtLabel.attributedString = percentString;
|
_lowestPriceDtLabel.attributedString = percentString;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
-(void)setInfoDic:(NSDictionary *)dic
|
||||||
|
{
|
||||||
|
self.nameLabel.text = [dic objectForKey:@"jjmc"];
|
||||||
|
self.profitLabel.text = [NSString stringWithFormat:@"%@ + %@",[dic objectForKey:@"nhsy"],[dic objectForKey:@"fd"]];
|
||||||
|
self.totalLabel.text = [NSString stringWithFormat:@"已申购%@人",[dic objectForKey:@"ygrs"]];
|
||||||
|
self.priceLabel.text = [NSString stringWithFormat:@"%@元",[dic objectForKey:@"wfsy"]];
|
||||||
|
[self setLowestPriceWtihCount:[[dic objectForKey:@"startBuy"] integerValue]];
|
||||||
|
NSMutableString* timeStr = [[NSMutableString alloc] initWithString:[dic objectForKey:@"jjzq"]];
|
||||||
|
[timeStr insertString:@"</span>" atIndex:1];
|
||||||
|
[timeStr insertString:@"<span style=\" color:green;\">" atIndex:0];
|
||||||
|
[self setBuyTypeWithString:timeStr];
|
||||||
|
if ([[dic objectForKey:@"tip"] isKindOfClass:[NSString class]]) {
|
||||||
|
_typeImg.hidden = NO;
|
||||||
|
_typeLabel.text = [dic objectForKey:@"tip"];
|
||||||
|
}else{
|
||||||
|
_typeImg.hidden = YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3746"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||||
@@ -13,28 +13,28 @@
|
|||||||
<rect key="frame" x="0.0" y="0.0" width="320" height="108"/>
|
<rect key="frame" x="0.0" y="0.0" width="320" height="108"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我有五个字" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="jTX-Fg-izQ">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="名字" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" id="jTX-Fg-izQ">
|
||||||
<rect key="frame" x="10" y="14" width="140" height="21"/>
|
<rect key="frame" x="10" y="14" width="125" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="小名字" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iSf-Cf-gGc">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="七日年化" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iSf-Cf-gGc">
|
||||||
<rect key="frame" x="10" y="43" width="42" height="21"/>
|
<rect key="frame" x="10" y="43" width="56" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||||
<color key="textColor" red="0.25115593110000001" green="0.25115593110000001" blue="0.25115593110000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.25115593110000001" green="0.25115593110000001" blue="0.25115593110000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4Ly-0U-oSK">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4Ly-0U-oSK">
|
||||||
<rect key="frame" x="10" y="65" width="42" height="21"/>
|
<rect key="frame" x="10" y="65" width="125" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||||
<color key="textColor" red="0.94664779970000001" green="0.21506300749999999" blue="0.1431705727" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.94664779970000001" green="0.21506300749999999" blue="0.1431705727" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="已经跑了30000米" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="O3F-FR-wcE">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="已申购0人" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="O3F-FR-wcE">
|
||||||
<rect key="frame" x="143" y="13" width="120" height="21"/>
|
<rect key="frame" x="143" y="13" width="120" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||||
@@ -44,14 +44,14 @@
|
|||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="万分收益" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vsv-fO-QlW">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="万分收益" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vsv-fO-QlW">
|
||||||
<rect key="frame" x="143" y="43" width="90" height="21"/>
|
<rect key="frame" x="143" y="43" width="90" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||||
<color key="textColor" red="0.25115593110000001" green="0.25115593110000001" blue="0.25115593110000001" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.25115593110000001" green="0.25115593110000001" blue="0.25115593110000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="icb-Rm-6zW">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="icb-Rm-6zW">
|
||||||
<rect key="frame" x="143" y="65" width="90" height="21"/>
|
<rect key="frame" x="143" y="65" width="90" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="fund_cell_label_bg_blue.png" id="0hb-Ff-rGB">
|
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="fund_cell_label_bg_blue.png" id="0hb-Ff-rGB">
|
||||||
@@ -74,6 +74,13 @@
|
|||||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||||
</view>
|
</view>
|
||||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="热售" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3HE-Th-552">
|
||||||
|
<rect key="frame" x="283" y="18" width="34" height="21"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||||
|
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
</subviews>
|
</subviews>
|
||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
<connections>
|
<connections>
|
||||||
@@ -86,6 +93,7 @@
|
|||||||
<outlet property="profitLabel" destination="4Ly-0U-oSK" id="5oL-KW-9GM"/>
|
<outlet property="profitLabel" destination="4Ly-0U-oSK" id="5oL-KW-9GM"/>
|
||||||
<outlet property="totalLabel" destination="O3F-FR-wcE" id="HdC-Ik-vzk"/>
|
<outlet property="totalLabel" destination="O3F-FR-wcE" id="HdC-Ik-vzk"/>
|
||||||
<outlet property="typeImg" destination="0hb-Ff-rGB" id="XI5-40-QzE"/>
|
<outlet property="typeImg" destination="0hb-Ff-rGB" id="XI5-40-QzE"/>
|
||||||
|
<outlet property="typeLabel" destination="3HE-Th-552" id="tMz-Tx-g9T"/>
|
||||||
</connections>
|
</connections>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
</objects>
|
</objects>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import "FundListViewController.h"
|
#import "FundListViewController.h"
|
||||||
#import "FundListCell.h"
|
#import "FundListCell.h"
|
||||||
#import "FundProductInfoViewController.h"
|
#import "FundProductInfoViewController.h"
|
||||||
|
#import "MJRefresh.h"
|
||||||
@interface FundListViewController ()
|
@interface FundListViewController ()
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -30,21 +31,39 @@
|
|||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
}
|
}
|
||||||
#pragma mark MJRefreshDelegate
|
#pragma mark MJRefreshDelegate
|
||||||
-(void)headerRereshing
|
-(void)loadData
|
||||||
{
|
{
|
||||||
_count = 15;
|
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
[daiDaiTongApi productListForType:@"HW" withPageNum:_pageNum withCompletionBlock:^(id jsonRes) {
|
||||||
// 刷新表格
|
if (_pageNum == 1) {
|
||||||
[self.tableView reloadData];
|
[_productInfoArray removeAllObjects];
|
||||||
|
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
|
||||||
|
}
|
||||||
|
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
||||||
|
[_productInfoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
|
||||||
|
// 刷新表格
|
||||||
|
if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
|
||||||
|
[self.tableView removeFooter];
|
||||||
|
}
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}else{
|
||||||
|
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
||||||
|
}
|
||||||
[self headerEndRefreshing];
|
[self headerEndRefreshing];
|
||||||
});
|
[self footerEndRefreshing];
|
||||||
|
|
||||||
|
} failedBlock:^(NSError *error) {
|
||||||
|
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||||
|
[self headerEndRefreshing];
|
||||||
|
[self footerEndRefreshing];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
#pragma mark UITableViewDelegate
|
#pragma mark UITableViewDelegate
|
||||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||||
return _count;
|
return _productInfoArray.count;
|
||||||
}
|
}
|
||||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
@@ -61,7 +80,7 @@
|
|||||||
[tableView registerNib:nib forCellReuseIdentifier:loanListCell];
|
[tableView registerNib:nib forCellReuseIdentifier:loanListCell];
|
||||||
cell = (FundListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell];
|
cell = (FundListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell];
|
||||||
}
|
}
|
||||||
cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, 0, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath])];
|
[(FundListCell*)cell setInfoDic:[_productInfoArray objectAtIndex:indexPath.row]];
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
|
|||||||
@@ -11,16 +11,20 @@
|
|||||||
@interface ListViewController : UIViewController<UITableViewDelegate, UITableViewDataSource>
|
@interface ListViewController : UIViewController<UITableViewDelegate, UITableViewDataSource>
|
||||||
{
|
{
|
||||||
__weak UITableView* _tableView;
|
__weak UITableView* _tableView;
|
||||||
NSInteger _count;
|
NSInteger _pageNum;
|
||||||
|
NSMutableArray* _productInfoArray;
|
||||||
__weak UIViewController* _delegate; //保存创建的UIViewControll
|
__weak UIViewController* _delegate; //保存创建的UIViewControll
|
||||||
}
|
}
|
||||||
@property (weak, nonatomic) UIViewController* delegate;
|
@property (weak, nonatomic) UIViewController* delegate;
|
||||||
@property (weak, nonatomic) UINavigationController* listNavigationController;
|
@property (weak, nonatomic) UINavigationController* listNavigationController;
|
||||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||||
@property (assign, nonatomic)NSInteger count;
|
@property (strong, nonatomic)NSMutableArray* productInfoArray;
|
||||||
|
@property (assign, nonatomic)NSInteger pageNum;
|
||||||
- (void)headerRereshing;
|
- (void)headerRereshing;
|
||||||
- (void)footerRereshing;
|
- (void)footerRereshing;
|
||||||
- (void)headerBeginRefreshing;
|
- (void)headerBeginRefreshing;
|
||||||
- (void)headerEndRefreshing;
|
- (void)headerEndRefreshing;
|
||||||
|
- (void)footerEndRefreshing;
|
||||||
- (void)firstRefresh;
|
- (void)firstRefresh;
|
||||||
|
- (void)loadData;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
frame.size.height -= 88;
|
frame.size.height -= 88;
|
||||||
_tableView.frame = frame;
|
_tableView.frame = frame;
|
||||||
}
|
}
|
||||||
|
_productInfoArray = [[NSMutableArray alloc] init];
|
||||||
[_tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
|
[_tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
|
||||||
self.tableView.delegate = self;
|
self.tableView.delegate = self;
|
||||||
self.tableView.dataSource = self;
|
self.tableView.dataSource = self;
|
||||||
@@ -39,32 +40,22 @@
|
|||||||
self.tableView.allowsSelection = YES;
|
self.tableView.allowsSelection = YES;
|
||||||
[self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
|
[self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
|
||||||
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
|
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
|
||||||
|
_pageNum = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
#pragma mark MJRefreshDelegate
|
#pragma mark MJRefreshDelegate
|
||||||
- (void)headerRereshing
|
- (void)headerRereshing
|
||||||
{
|
{
|
||||||
|
|
||||||
// 2.2秒后刷新表格UI
|
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
||||||
// 刷新表格
|
|
||||||
[self.tableView reloadData];
|
|
||||||
|
|
||||||
// (最好在刷新表格后调用)调用endRefreshing可以结束刷新状态
|
_pageNum = 1;
|
||||||
[self.tableView headerEndRefreshing];
|
[self loadData];
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)footerRereshing
|
- (void)footerRereshing
|
||||||
{
|
{
|
||||||
// 2.2秒后刷新表格UI
|
_pageNum++;
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
[self loadData];
|
||||||
// 刷新表格
|
|
||||||
[self.tableView reloadData];
|
|
||||||
|
|
||||||
// (最好在刷新表格后调用)调用endRefreshing可以结束刷新状态
|
|
||||||
[self.tableView footerEndRefreshing];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
- (void)headerBeginRefreshing
|
- (void)headerBeginRefreshing
|
||||||
{
|
{
|
||||||
@@ -74,15 +65,19 @@
|
|||||||
{
|
{
|
||||||
[self.tableView headerEndRefreshing];
|
[self.tableView headerEndRefreshing];
|
||||||
}
|
}
|
||||||
|
-(void)footerEndRefreshing
|
||||||
|
{
|
||||||
|
[self.tableView footerEndRefreshing];
|
||||||
|
}
|
||||||
-(void)firstRefresh
|
-(void)firstRefresh
|
||||||
{
|
{
|
||||||
if (_count <= 0) {
|
if (_productInfoArray.count <= 0) {
|
||||||
[self headerBeginRefreshing];
|
[self headerBeginRefreshing];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma mark UITableViewDelegate
|
#pragma mark UITableViewDelegate
|
||||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||||
return 30;
|
return 30;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
@property (weak, nonatomic) IBOutlet DTAttributedLabel *timeDtLabel;
|
@property (weak, nonatomic) IBOutlet DTAttributedLabel *timeDtLabel;
|
||||||
@property (weak, nonatomic) IBOutlet DTAttributedLabel *percentDtlabel;
|
@property (weak, nonatomic) IBOutlet DTAttributedLabel *percentDtlabel;
|
||||||
@property (weak, nonatomic) IBOutlet MRCircularProgressView *percentView;
|
@property (weak, nonatomic) IBOutlet MRCircularProgressView *percentView;
|
||||||
|
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
|
||||||
|
|
||||||
-(void)setPercent:(NSInteger) percent;
|
-(void)setInfoDic:(NSDictionary *)dic;
|
||||||
-(void)setTimeWithString:(NSString*)htmlString;
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -40,10 +40,12 @@
|
|||||||
_percentView.wrapperColor = [UIColor clearColor];
|
_percentView.wrapperColor = [UIColor clearColor];
|
||||||
_percentView.progressColor = [UIColor redColor];
|
_percentView.progressColor = [UIColor redColor];
|
||||||
_percentDtlabel.backgroundColor = [UIColor clearColor];
|
_percentDtlabel.backgroundColor = [UIColor clearColor];
|
||||||
|
//旋转
|
||||||
|
_typeLabel.transform = CGAffineTransformMakeRotation( M_PI/4);
|
||||||
}
|
}
|
||||||
-(void)setPercent:(NSInteger) percent
|
-(void)setPercent:(NSInteger) percent
|
||||||
{
|
{
|
||||||
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:20px; color:red; text-align:center; \">%ld</span> %%",percent];
|
NSString* htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:20px; color:red; text-align:center; \">%d</span> %%",percent];
|
||||||
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
|
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
|
||||||
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
||||||
@@ -52,9 +54,38 @@
|
|||||||
}
|
}
|
||||||
-(void)setTimeWithString:(NSString*)htmlString
|
-(void)setTimeWithString:(NSString*)htmlString
|
||||||
{
|
{
|
||||||
|
|
||||||
NSData *data = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
|
NSData *data = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
|
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentLeft],DTDefaultTextAlignment, nil];
|
||||||
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
||||||
_timeDtLabel.attributedString = percentString;
|
_timeDtLabel.attributedString = percentString;
|
||||||
}
|
}
|
||||||
|
-(void)setStartBuy:(NSInteger)price
|
||||||
|
{
|
||||||
|
_priceLabel.text = [NSString stringWithFormat:@"%d元起购",price];
|
||||||
|
}
|
||||||
|
-(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"]) {
|
||||||
|
[self setPercent:[[dic objectForKey:@"percent"] floatValue]];
|
||||||
|
[self setStartBuy:[[dic objectForKey:@"startBuy"] integerValue]];
|
||||||
|
NSMutableString* timeStr = [[NSMutableString alloc] initWithString:[dic objectForKey:@"jjzq"]];
|
||||||
|
[timeStr insertString:@"</span>" atIndex:1];
|
||||||
|
[timeStr insertString:@"<span style=\" color:green;\">" atIndex:0];
|
||||||
|
[self setTimeWithString:timeStr];
|
||||||
|
}else if([[dic objectForKey:@"state"] isEqualToString:@"EFFECTED"]){
|
||||||
|
[self setTimeWithString:@"最近还款日"];
|
||||||
|
[_percentView setProgress:0 animated:NO];
|
||||||
|
NSString* htmlStr = @" 还款中";
|
||||||
|
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentLeft],DTDefaultTextAlignment, nil];
|
||||||
|
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
|
||||||
|
_percentDtlabel.attributedString = percentString;
|
||||||
|
_priceLabel.text = [dic objectForKey:@"recRepayDate"];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3746"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||||
@@ -13,15 +13,15 @@
|
|||||||
<rect key="frame" x="0.0" y="0.0" width="320" height="107"/>
|
<rect key="frame" x="0.0" y="0.0" width="320" height="107"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的名字是" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Idi-qw-ohG">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="名字" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Idi-qw-ohG">
|
||||||
<rect key="frame" x="16" y="16" width="188" height="19"/>
|
<rect key="frame" x="16" y="16" width="188" height="19"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="小名字" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="cYE-AW-FFh">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="预期年化" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="cYE-AW-FFh">
|
||||||
<rect key="frame" x="16" y="43" width="100" height="21"/>
|
<rect key="frame" x="16" y="50" width="100" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||||
<color key="textColor" red="0.25115593112244894" green="0.25115593112244894" blue="0.25115593112244894" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.25115593112244894" green="0.25115593112244894" blue="0.25115593112244894" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
@@ -35,11 +35,11 @@
|
|||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<view contentMode="scaleToFill" id="0L4-K9-Tyn" customClass="DTAttributedLabel">
|
<view contentMode="scaleToFill" id="0L4-K9-Tyn" customClass="DTAttributedLabel">
|
||||||
<rect key="frame" x="105" y="44" width="110" height="21"/>
|
<rect key="frame" x="124" y="54" width="91" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
</view>
|
</view>
|
||||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="100个超人" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gFc-RY-QUU">
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="50元起购" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gFc-RY-QUU">
|
||||||
<rect key="frame" x="104" y="73" width="100" height="21"/>
|
<rect key="frame" x="104" y="73" width="100" height="21"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
</imageView>
|
</imageView>
|
||||||
<view contentMode="scaleToFill" id="jKx-eQ-tZj" customClass="DTAttributedLabel">
|
<view contentMode="scaleToFill" id="jKx-eQ-tZj" customClass="DTAttributedLabel">
|
||||||
<rect key="frame" x="12" y="23" width="46" height="34"/>
|
<rect key="frame" x="12" y="26" width="46" height="28"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
</view>
|
</view>
|
||||||
</subviews>
|
</subviews>
|
||||||
@@ -74,6 +74,13 @@
|
|||||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
</view>
|
</view>
|
||||||
|
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="新手标" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="J9N-s5-AIQ">
|
||||||
|
<rect key="frame" x="270" y="16" width="42" height="21"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||||
|
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
</subviews>
|
</subviews>
|
||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
<connections>
|
<connections>
|
||||||
@@ -85,6 +92,7 @@
|
|||||||
<outlet property="profitLabel" destination="gnS-Tv-BcD" id="fMT-gW-cxV"/>
|
<outlet property="profitLabel" destination="gnS-Tv-BcD" id="fMT-gW-cxV"/>
|
||||||
<outlet property="timeDtLabel" destination="0L4-K9-Tyn" id="5dK-d7-zP9"/>
|
<outlet property="timeDtLabel" destination="0L4-K9-Tyn" id="5dK-d7-zP9"/>
|
||||||
<outlet property="typeImg" destination="Abj-cs-h8U" id="j1s-z7-TLe"/>
|
<outlet property="typeImg" destination="Abj-cs-h8U" id="j1s-z7-TLe"/>
|
||||||
|
<outlet property="typeLabel" destination="J9N-s5-AIQ" id="MQ3-dI-VqM"/>
|
||||||
</connections>
|
</connections>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
</objects>
|
</objects>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#import "AdjustableUILable.h"
|
#import "AdjustableUILable.h"
|
||||||
#import "LoanListCell.h"
|
#import "LoanListCell.h"
|
||||||
#import "WYDProductViewController.h"
|
#import "WYDProductViewController.h"
|
||||||
|
#import "MJRefresh.h"
|
||||||
@interface LoanListViewController ()
|
@interface LoanListViewController ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -34,21 +35,41 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
#pragma mark MJRefreshDelegate
|
#pragma mark MJRefreshDelegate
|
||||||
-(void)headerRereshing
|
-(void)loadData
|
||||||
{
|
{
|
||||||
_count = 10;
|
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
[daiDaiTongApi productListForType:@"RYT" withPageNum:_pageNum withCompletionBlock:^(id jsonRes) {
|
||||||
// 刷新表格
|
if (_pageNum == 1) {
|
||||||
[self.tableView reloadData];
|
[_productInfoArray removeAllObjects];
|
||||||
|
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
|
||||||
|
}
|
||||||
|
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
||||||
|
[_productInfoArray addObjectsFromArray:[jsonRes objectForKey:@"datas"]];
|
||||||
|
// 刷新表格
|
||||||
|
if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
|
||||||
|
[self.tableView removeFooter];
|
||||||
|
}
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}else{
|
||||||
|
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
||||||
|
}
|
||||||
[self headerEndRefreshing];
|
[self headerEndRefreshing];
|
||||||
});
|
[self footerEndRefreshing];
|
||||||
|
|
||||||
|
} failedBlock:^(NSError *error) {
|
||||||
|
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||||
|
[self headerEndRefreshing];
|
||||||
|
[self footerEndRefreshing];
|
||||||
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark UITableViewDelegate
|
#pragma mark UITableViewDelegate
|
||||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||||
return _count;
|
return _productInfoArray.count;
|
||||||
}
|
}
|
||||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
@@ -58,19 +79,17 @@
|
|||||||
}
|
}
|
||||||
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
static NSString *loanListCell = @"LoanListCell";
|
static NSString *CellIdentifier = @"LoanListCell";
|
||||||
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:loanListCell];
|
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||||
if (cell == nil) {
|
if (cell == nil) {
|
||||||
UINib *nib = [UINib nibWithNibName:@"LoanListCell" bundle:nil];
|
UINib *nib = [UINib nibWithNibName:@"LoanListCell" bundle:nil];
|
||||||
[tableView registerNib:nib forCellReuseIdentifier:loanListCell];
|
[tableView registerNib:nib forCellReuseIdentifier:CellIdentifier];
|
||||||
cell = (LoanListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell];
|
cell = (LoanListCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||||
|
|
||||||
}
|
}
|
||||||
[cell setSelectionStyle:UITableViewCellSelectionStyleDefault];
|
[cell setSelectionStyle:UITableViewCellSelectionStyleDefault];
|
||||||
[(LoanListCell*)cell setPercent:40];
|
[(LoanListCell*)cell setInfoDic:[_productInfoArray objectAtIndex:indexPath.row]];
|
||||||
NSString* htmlStr = @"<span style=\"text-align:center; color:green;\">限</span>12个月";
|
|
||||||
[(LoanListCell*)cell setTimeWithString:htmlStr];
|
|
||||||
cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, 0, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath])];
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
|
|||||||
@@ -9,8 +9,11 @@
|
|||||||
#import "OtherListViewController.h"
|
#import "OtherListViewController.h"
|
||||||
#import "FundListCell.h"
|
#import "FundListCell.h"
|
||||||
#import "OtherProductInfoViewController.h"
|
#import "OtherProductInfoViewController.h"
|
||||||
|
#import "MJRefresh.h"
|
||||||
@interface OtherListViewController ()
|
@interface OtherListViewController ()
|
||||||
|
{
|
||||||
|
NSMutableArray* _productInfoArray;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation OtherListViewController
|
@implementation OtherListViewController
|
||||||
@@ -27,24 +30,45 @@
|
|||||||
{
|
{
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
|
_productInfoArray = [[NSMutableArray alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark MJRefreshDelegate
|
#pragma mark MJRefreshDelegate
|
||||||
-(void)headerRereshing
|
-(void)headerRereshing
|
||||||
{
|
{
|
||||||
_count = 6;
|
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||||
// 刷新表格
|
[daiDaiTongApi productListForType:@"HK" withPageNum:_pageNum withCompletionBlock:^(id jsonRes) {
|
||||||
[self.tableView reloadData];
|
if (_pageNum == 1) {
|
||||||
|
[_productInfoArray removeAllObjects];
|
||||||
|
[self.tableView addFooterWithTarget:self action:@selector(footerRereshing)];
|
||||||
|
}
|
||||||
|
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
||||||
|
[_productInfoArray addObjectsFromArray: [jsonRes objectForKey:@"datas"]];
|
||||||
|
// 刷新表格
|
||||||
|
if ([[jsonRes objectForKey:@"totalPages"] integerValue] <= [[jsonRes objectForKey:@"pageNum"] integerValue]) {
|
||||||
|
[self.tableView removeFooter];
|
||||||
|
}
|
||||||
|
[self.tableView reloadData];
|
||||||
|
|
||||||
|
}else{
|
||||||
|
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
||||||
|
}
|
||||||
[self headerEndRefreshing];
|
[self headerEndRefreshing];
|
||||||
});
|
[self footerEndRefreshing];
|
||||||
|
|
||||||
|
} failedBlock:^(NSError *error) {
|
||||||
|
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||||
|
[self headerEndRefreshing];
|
||||||
|
[self footerEndRefreshing];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
#pragma mark UITableViewDelegate
|
#pragma mark UITableViewDelegate
|
||||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||||
return _count;
|
return _productInfoArray.count;
|
||||||
}
|
}
|
||||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
@@ -63,8 +87,9 @@
|
|||||||
cell = (FundListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell];
|
cell = (FundListCell *)[tableView dequeueReusableCellWithIdentifier:loanListCell];
|
||||||
|
|
||||||
}
|
}
|
||||||
[((FundListCell*)cell).totalLabel setText:@"已经有6783234人"];
|
[((FundListCell*)cell) setInfoDic:[_productInfoArray objectAtIndex:indexPath.row]];
|
||||||
cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, 0, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath])];
|
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,14 +59,16 @@
|
|||||||
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||||
[daiDaiTongApi loginWithPhone:_phoneNum withPassWord:_passwordTextField.text withCompletionBlock:^(id jsonRes) {
|
[daiDaiTongApi loginWithPhone:_phoneNum withPassWord:_passwordTextField.text withCompletionBlock:^(id jsonRes) {
|
||||||
if ([[jsonRes objectForKey:@"succ"] integerValue] != 1) {
|
if ([[jsonRes objectForKey:@"succ"] integerValue] != 1) {
|
||||||
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
// [MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
||||||
}else{
|
}else{
|
||||||
}
|
}
|
||||||
|
[ManagerUser shareInstance].isLogin = YES;
|
||||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||||
if ([self.delegate respondsToSelector:@selector(loginSuccess)]) {
|
if ([self.delegate respondsToSelector:@selector(loginSuccess)]) {
|
||||||
[self.delegate loginSuccess];
|
[self.delegate loginSuccess];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} failedBlock:^(NSError *error) {
|
} failedBlock:^(NSError *error) {
|
||||||
DLog(@"失败");
|
DLog(@"失败");
|
||||||
[MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
|
[MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
|
||||||
|
|||||||
@@ -139,11 +139,16 @@
|
|||||||
|
|
||||||
|
|
||||||
- (IBAction)sureBtnClick:(id)sender {
|
- (IBAction)sureBtnClick:(id)sender {
|
||||||
InputPassWordViewController* inputPassWordViewController = [[InputPassWordViewController alloc] init];
|
if (![ManagerUtil isValidateMobile:_phoneTextField.text]) {
|
||||||
inputPassWordViewController.hidesBottomBarWhenPushed = YES;
|
[MBProgressHUD errorHudWithView:self.view label:@"请输入正确手机号" hidesAfter:1.0];
|
||||||
inputPassWordViewController.delegate = self;
|
}else{
|
||||||
inputPassWordViewController.phoneNum = _phoneTextField.text;
|
InputPassWordViewController* inputPassWordViewController = [[InputPassWordViewController alloc] init];
|
||||||
[self.navigationController pushViewController:inputPassWordViewController animated:YES];
|
inputPassWordViewController.hidesBottomBarWhenPushed = YES;
|
||||||
|
inputPassWordViewController.delegate = self;
|
||||||
|
inputPassWordViewController.phoneNum = _phoneTextField.text;
|
||||||
|
[self.navigationController pushViewController:inputPassWordViewController animated:YES];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark InputPassWordViewControllerDelegate
|
#pragma mark InputPassWordViewControllerDelegate
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="输入您的手机号" clearsOnBeginEditing="YES" minimumFontSize="14" clearButtonMode="always" id="SX2-5w-3mj">
|
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="输入您的手机号" minimumFontSize="14" clearButtonMode="always" id="SX2-5w-3mj">
|
||||||
<rect key="frame" x="10" y="84" width="300" height="40"/>
|
<rect key="frame" x="10" y="84" width="300" height="40"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||||
|
|||||||
@@ -15,6 +15,65 @@
|
|||||||
if (self) {
|
if (self) {
|
||||||
// Initialization code
|
// Initialization code
|
||||||
self.backgroundColor = [UIColor clearColor];
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
CGSize size = self.frame.size;
|
||||||
|
|
||||||
|
//总收益标签
|
||||||
|
_totalTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, size.width/2, 30)];
|
||||||
|
_totalTitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
_totalTitleLabel.textColor = [UIColor grayColor];
|
||||||
|
_totalTitleLabel.text = @"总资产(元)";
|
||||||
|
[self addSubview:_totalTitleLabel];
|
||||||
|
//总共的钱
|
||||||
|
_totalMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, size.width/2, 30)];
|
||||||
|
_totalMoneyLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
_totalMoneyLabel.textColor = [UIColor darkGrayColor];
|
||||||
|
[_totalMoneyLabel setFont:[UIFont systemFontOfSize:25.0]];
|
||||||
|
_totalMoneyLabel.text = @"0.0";
|
||||||
|
[self addSubview:_totalMoneyLabel];
|
||||||
|
|
||||||
|
//中间的线
|
||||||
|
UIView* lineView = [[UIView alloc] initWithFrame:CGRectMake(size.width/2, 10, 1, size.height-10*2)];
|
||||||
|
lineView.backgroundColor = [UIColor colorWithWhite:0.8 alpha:1.0];
|
||||||
|
[self addSubview:lineView];
|
||||||
|
//左边三角形
|
||||||
|
UIImageView* leftImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gray_select_arrow"]];
|
||||||
|
leftImageView.frame = CGRectMake(size.width/2-20, size.height-22, 12, 12);
|
||||||
|
[self addSubview:leftImageView];
|
||||||
|
//右边三角形
|
||||||
|
UIImageView* rightImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gray_select_arrow"]];
|
||||||
|
rightImageView.frame = CGRectMake(size.width-20, size.height-22, 12, 12);
|
||||||
|
[self addSubview:rightImageView];
|
||||||
|
|
||||||
|
//累计收益标签
|
||||||
|
_profitTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0+size.width/2, 10, size.width/2, 30)];
|
||||||
|
_profitTitleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
_profitTitleLabel.textColor = [UIColor grayColor];
|
||||||
|
_profitTitleLabel.text = @"累计收益(元)";
|
||||||
|
[self addSubview:_profitTitleLabel];
|
||||||
|
|
||||||
|
//总共的收益
|
||||||
|
_profitMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(size.width/2, 40, size.width/2, 30)];
|
||||||
|
_profitMoneyLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
_profitMoneyLabel.textColor = [UIColor darkGrayColor];
|
||||||
|
[_profitMoneyLabel setFont:[UIFont systemFontOfSize:25.0]];
|
||||||
|
_profitMoneyLabel.text = @"0.0";
|
||||||
|
[self addSubview:_profitMoneyLabel];
|
||||||
|
|
||||||
|
//左边按钮。
|
||||||
|
UIButton* leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
leftBtn.backgroundColor = [UIColor clearColor];
|
||||||
|
leftBtn.frame = CGRectMake(0, 0, size.width/2, size.height);
|
||||||
|
[leftBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:leftBtn.frame] forState:UIControlStateHighlighted];
|
||||||
|
[leftBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[self addSubview:leftBtn];
|
||||||
|
//左边按钮。
|
||||||
|
UIButton* rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
rightBtn.backgroundColor = [UIColor clearColor];
|
||||||
|
rightBtn.frame = CGRectMake(size.width/2, 0, size.width/2, size.height);
|
||||||
|
[rightBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:rightBtn.frame] forState:UIControlStateHighlighted];
|
||||||
|
[rightBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[self addSubview:rightBtn];
|
||||||
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -26,64 +85,6 @@
|
|||||||
{
|
{
|
||||||
// Drawing code
|
// Drawing code
|
||||||
|
|
||||||
CGSize size = self.frame.size;
|
|
||||||
|
|
||||||
//总收益标签
|
|
||||||
_totalTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, size.width/2, 30)];
|
|
||||||
_totalTitleLabel.textAlignment = NSTextAlignmentCenter;
|
|
||||||
_totalTitleLabel.textColor = [UIColor grayColor];
|
|
||||||
_totalTitleLabel.text = @"总资产(元)";
|
|
||||||
[self addSubview:_totalTitleLabel];
|
|
||||||
//总共的钱
|
|
||||||
_totalMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, size.width/2, 30)];
|
|
||||||
_totalMoneyLabel.textAlignment = NSTextAlignmentCenter;
|
|
||||||
_totalMoneyLabel.textColor = [UIColor darkGrayColor];
|
|
||||||
[_totalMoneyLabel setFont:[UIFont systemFontOfSize:25.0]];
|
|
||||||
_totalMoneyLabel.text = @"0.0";
|
|
||||||
[self addSubview:_totalMoneyLabel];
|
|
||||||
|
|
||||||
//中间的线
|
|
||||||
UIView* lineView = [[UIView alloc] initWithFrame:CGRectMake(size.width/2, 10, 1, size.height-10*2)];
|
|
||||||
lineView.backgroundColor = [UIColor colorWithWhite:0.8 alpha:1.0];
|
|
||||||
[self addSubview:lineView];
|
|
||||||
//左边三角形
|
|
||||||
UIImageView* leftImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gray_select_arrow"]];
|
|
||||||
leftImageView.frame = CGRectMake(size.width/2-20, size.height-22, 12, 12);
|
|
||||||
[self addSubview:leftImageView];
|
|
||||||
//右边三角形
|
|
||||||
UIImageView* rightImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"gray_select_arrow"]];
|
|
||||||
rightImageView.frame = CGRectMake(size.width-20, size.height-22, 12, 12);
|
|
||||||
[self addSubview:rightImageView];
|
|
||||||
|
|
||||||
//累计收益标签
|
|
||||||
_profitTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0+size.width/2, 10, size.width/2, 30)];
|
|
||||||
_profitTitleLabel.textAlignment = NSTextAlignmentCenter;
|
|
||||||
_profitTitleLabel.textColor = [UIColor grayColor];
|
|
||||||
_profitTitleLabel.text = @"累计收益(元)";
|
|
||||||
[self addSubview:_profitTitleLabel];
|
|
||||||
|
|
||||||
//总共的收益
|
|
||||||
_profitMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(size.width/2, 40, size.width/2, 30)];
|
|
||||||
_profitMoneyLabel.textAlignment = NSTextAlignmentCenter;
|
|
||||||
_profitMoneyLabel.textColor = [UIColor darkGrayColor];
|
|
||||||
[_profitMoneyLabel setFont:[UIFont systemFontOfSize:25.0]];
|
|
||||||
_profitMoneyLabel.text = @"0.0";
|
|
||||||
[self addSubview:_profitMoneyLabel];
|
|
||||||
|
|
||||||
//左边按钮。
|
|
||||||
UIButton* leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
||||||
leftBtn.backgroundColor = [UIColor clearColor];
|
|
||||||
leftBtn.frame = CGRectMake(0, 0, size.width/2, size.height);
|
|
||||||
[leftBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:leftBtn.frame] forState:UIControlStateHighlighted];
|
|
||||||
[leftBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[self addSubview:leftBtn];
|
|
||||||
//左边按钮。
|
|
||||||
UIButton* rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
||||||
rightBtn.backgroundColor = [UIColor clearColor];
|
|
||||||
rightBtn.frame = CGRectMake(size.width/2, 0, size.width/2, size.height);
|
|
||||||
[rightBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:Touch_BackGroudColor withFrame:rightBtn.frame] forState:UIControlStateHighlighted];
|
|
||||||
[rightBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[self addSubview:rightBtn];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)leftBtnClick:(id)sender
|
-(void)leftBtnClick:(id)sender
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
#import "HomeMainView.h"
|
#import "HomeMainView.h"
|
||||||
@interface HomeViewController ()
|
@interface HomeViewController ()
|
||||||
{
|
{
|
||||||
HomeAdView* homeAdView;
|
HomeAdView* _homeAdView;
|
||||||
HomeMainView* homeMainView;
|
HomeMainView* _homeMainView;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -54,27 +54,38 @@
|
|||||||
#pragma mark MJRefreshDelegate
|
#pragma mark MJRefreshDelegate
|
||||||
- (void)headerRereshing
|
- (void)headerRereshing
|
||||||
{
|
{
|
||||||
|
|
||||||
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||||
//广告条
|
//广告条
|
||||||
[daiDaiTongApi getBannerInfoWithcompletionBlock:^(id jsonRes) {
|
[daiDaiTongApi getBannerInfoWithcompletionBlock:^(id jsonRes) {
|
||||||
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
||||||
NSMutableArray* bannerInfo = [jsonRes objectForKey:@"infos"];
|
NSMutableArray* bannerInfo = [jsonRes objectForKey:@"infos"];
|
||||||
[homeAdView setBannerInfo:bannerInfo];
|
[_homeAdView setBannerInfo:bannerInfo];
|
||||||
}
|
}
|
||||||
} failedBlock:^(NSError *error) {
|
} failedBlock:^(NSError *error) {
|
||||||
DLog(@"失败");
|
DLog(@"失败");
|
||||||
[MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
|
[MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
|
||||||
}];
|
}];
|
||||||
|
_homeMainView.hidden = YES;
|
||||||
[daiDaiTongApi getFundRecommendWithcompletionBlock:^(id jsonRes) {
|
[daiDaiTongApi getFundRecommendWithcompletionBlock:^(id jsonRes) {
|
||||||
if ([[jsonRes objectForKey:@"succ"] integerValue] != 1) {
|
if ([[jsonRes objectForKey:@"succ"] integerValue] != 1) {
|
||||||
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
[MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:0.5];
|
||||||
}else{
|
}else{
|
||||||
|
_homeMainView.hidden = NO;
|
||||||
|
[_homeMainView setName:[jsonRes objectForKey:@"name"]];
|
||||||
|
[_homeMainView setpercent:[[jsonRes objectForKey:@"percent"] floatValue]/100.0];
|
||||||
|
[_homeMainView setExpect:[[jsonRes objectForKey:@"qrsy"] floatValue]];
|
||||||
|
[_homeMainView setType:[jsonRes objectForKey:@"tip"]];
|
||||||
|
[_homeMainView setInfo:[jsonRes objectForKey:@"activityDesc"]];
|
||||||
|
[_homeMainView setSecurityDesc:[jsonRes objectForKey:@"securityDesc"]];
|
||||||
|
[_homeMainView setTime:[jsonRes objectForKey:@"jjzq"] withStartBuy:[[jsonRes objectForKey:@"startBuy"] integerValue]];
|
||||||
}
|
}
|
||||||
[self.tableView reloadData];
|
[self.tableView reloadData];
|
||||||
[self.tableView headerEndRefreshing];
|
[self.tableView headerEndRefreshing];
|
||||||
} failedBlock:^(NSError *error) {
|
} failedBlock:^(NSError *error) {
|
||||||
DLog(@"失败");
|
DLog(@"失败");
|
||||||
[MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
|
[MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0];
|
||||||
|
[self.tableView headerEndRefreshing];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,19 +134,19 @@
|
|||||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
|
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
|
||||||
switch (indexPath.row) {
|
switch (indexPath.row) {
|
||||||
case 0:{
|
case 0:{
|
||||||
homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 140)];
|
_homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 140)];
|
||||||
homeAdView.superViewController = self;
|
_homeAdView.superViewController = self;
|
||||||
[cell addSubview:homeAdView];
|
[cell addSubview:_homeAdView];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:{
|
case 1:{
|
||||||
|
|
||||||
|
|
||||||
homeMainView = [HomeMainView instanceHomeMainView];
|
_homeMainView = [HomeMainView instanceHomeMainView];
|
||||||
CGRect frame = homeMainView.frame;
|
CGRect frame = _homeMainView.frame;
|
||||||
frame.origin.x = 20;
|
frame.origin.x = 20;
|
||||||
homeMainView.frame = frame;
|
_homeMainView.frame = frame;
|
||||||
[cell addSubview:homeMainView];
|
[cell addSubview:_homeMainView];
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -56,7 +56,9 @@
|
|||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
// Do any additional setup after loading the view from its nib.
|
// Do any additional setup after loading the view from its nib.
|
||||||
|
|
||||||
[ManagerUser shareInstance].isLogin = NO;
|
[ManagerUser shareInstance].isLogin = YES;
|
||||||
|
[ManagerUser shareInstance].userId = @"8201408070536905";
|
||||||
|
[ManagerUser shareInstance].token = @"15e6c60bbdfa5d62dc7baab09cca5d19d1f32d11";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,12 @@
|
|||||||
#import "AccountInfoViewController.h"
|
#import "AccountInfoViewController.h"
|
||||||
#import "DailyIncomeViewController.h"
|
#import "DailyIncomeViewController.h"
|
||||||
@interface MyViewController ()
|
@interface MyViewController ()
|
||||||
|
{
|
||||||
|
NSDictionary* _myInfoDic;
|
||||||
|
MyTotalProfitCellView* _myTotalProfitCellView;
|
||||||
|
UILabel* _timeLabel;
|
||||||
|
UILabel* _profitLabel;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MyViewController
|
@implementation MyViewController
|
||||||
@@ -22,6 +27,7 @@
|
|||||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||||
if (self) {
|
if (self) {
|
||||||
// Custom initialization
|
// Custom initialization
|
||||||
|
_myInfoDic = nil;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -34,17 +40,18 @@
|
|||||||
[ManagerUtil SetSubViewExternNone:self];
|
[ManagerUtil SetSubViewExternNone:self];
|
||||||
|
|
||||||
//左边按钮
|
//左边按钮
|
||||||
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"左边按钮" style:UIBarButtonItemStyleDone target:self action:@selector(leftBarBtnClick:)]];
|
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"帮助" style:UIBarButtonItemStyleDone target:self action:@selector(leftBarBtnClick:)]];
|
||||||
|
|
||||||
//右边按钮。
|
//右边按钮。
|
||||||
[self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(rightBarBtnClick:)]];
|
|
||||||
|
[self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_email"] style:UIBarButtonItemStyleDone target:self action:@selector(rightBarBtnClick:)]];
|
||||||
|
|
||||||
|
|
||||||
_tableView.delegate = self;
|
_tableView.delegate = self;
|
||||||
_tableView.dataSource = self;
|
_tableView.dataSource = self;
|
||||||
_tableView.allowsSelection = YES;
|
_tableView.allowsSelection = YES;
|
||||||
[_tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
|
[_tableView addHeaderWithTarget:self action:@selector(headerRereshing)];
|
||||||
|
[self headerRereshing];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -52,33 +59,32 @@
|
|||||||
- (void)headerRereshing
|
- (void)headerRereshing
|
||||||
{
|
{
|
||||||
|
|
||||||
// 2.2秒后刷新表格UI
|
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
||||||
// 刷新表格
|
|
||||||
[self.tableView reloadData];
|
|
||||||
|
|
||||||
// (最好在刷新表格后调用)调用endRefreshing可以结束刷新状态
|
DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance];
|
||||||
[self.tableView headerEndRefreshing];
|
[daiDaiTongApi getAccountInfoWithcompletionBlock:^(id jsonRes) {
|
||||||
});
|
|
||||||
|
if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) {
|
||||||
|
_myInfoDic = [NSDictionary dictionaryWithDictionary:jsonRes];
|
||||||
|
}
|
||||||
|
[_tableView reloadData];
|
||||||
|
[_tableView headerEndRefreshing];
|
||||||
|
} failedBlock:^(NSError *error) {
|
||||||
|
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)footerRereshing
|
- (void)footerRereshing
|
||||||
{
|
{
|
||||||
|
|
||||||
// 2.2秒后刷新表格UI
|
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
||||||
// 刷新表格
|
|
||||||
[self.tableView reloadData];
|
|
||||||
|
|
||||||
// (最好在刷新表格后调用)调用endRefreshing可以结束刷新状态
|
|
||||||
[self.tableView footerEndRefreshing];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark UITableViewDelegate
|
#pragma mark UITableViewDelegate
|
||||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||||
{
|
{
|
||||||
return 5;
|
if (_myInfoDic) {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||||
{
|
{
|
||||||
@@ -114,33 +120,78 @@
|
|||||||
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
|
|
||||||
UITableViewCell* cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
|
NSString* cellIdentifier = [NSString stringWithFormat:@"cell%d%d",indexPath.section,indexPath.row];
|
||||||
|
|
||||||
|
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
|
||||||
|
if (!cell) {
|
||||||
|
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier];
|
||||||
|
switch (indexPath.section) {
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
cell.backgroundColor = [UIColor redColor];
|
||||||
|
_timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 25, 320, 30)];
|
||||||
|
_timeLabel.textColor = [UIColor whiteColor];
|
||||||
|
_timeLabel.font = Font_Black(15);
|
||||||
|
_timeLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
[cell addSubview:_timeLabel];
|
||||||
|
_profitLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 30, 320, 100)];
|
||||||
|
_profitLabel.textColor = [UIColor whiteColor];
|
||||||
|
_profitLabel.font = Font_Black(50);
|
||||||
|
_profitLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||||
|
[cell addSubview:_profitLabel];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
CGRect frmae = cell.frame;
|
||||||
|
frmae.size.height = [self tableView:tableView heightForRowAtIndexPath:indexPath];
|
||||||
|
cell.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
|
||||||
|
MyTotalProfitCellView* myTotalProfitCellView = [[MyTotalProfitCellView alloc] initWithFrame:frmae];
|
||||||
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||||
|
[cell addSubview:myTotalProfitCellView];
|
||||||
|
myTotalProfitCellView.totalMoneyLabel.text = [_myInfoDic objectForKey:@"totalAmount"];
|
||||||
|
myTotalProfitCellView.profitMoneyLabel.text = [_myInfoDic objectForKey:@"totalProfit"];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
cell.textLabel.text = @"交易记录";
|
||||||
|
cell.detailTextLabel.text = @"查看记录";
|
||||||
|
cell.textLabel.textColor = [UIColor grayColor];
|
||||||
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||||
|
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
cell.textLabel.text = @"总积分";
|
||||||
|
cell.textLabel.textColor = [UIColor grayColor];
|
||||||
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||||
|
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@分",[_myInfoDic objectForKey:@"point"]];
|
||||||
|
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
switch (indexPath.section) {
|
switch (indexPath.section) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
cell.textLabel.text = @"吴盛华";
|
cell.textLabel.text = [[_myInfoDic objectForKey:@"info"] objectForKey:@"realShowName"];
|
||||||
cell.imageView.image = [UIImage imageNamed:@"icon_person_take_image"];
|
cell.imageView.image = [UIImage imageNamed:@"icon_person_take_image"];
|
||||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||||
cell.detailTextLabel.text = @"13212312313";
|
cell.detailTextLabel.text = [[_myInfoDic objectForKey:@"info"] objectForKey:@"cell"];
|
||||||
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
cell.backgroundColor = [UIColor redColor];
|
_timeLabel.text = [NSString stringWithFormat:@"%@收益(元)",[_myInfoDic objectForKey:@"profitShowDate"]];
|
||||||
UILabel* timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 25, 320, 30)];
|
_profitLabel.text = [_myInfoDic objectForKey:@"datePofit"];
|
||||||
timeLabel.textColor = [UIColor whiteColor];
|
|
||||||
timeLabel.font = Font_Black(15);
|
|
||||||
timeLabel.textAlignment = NSTextAlignmentCenter;
|
|
||||||
timeLabel.text = @"08月12日收益(元)";
|
|
||||||
[cell addSubview:timeLabel];
|
|
||||||
UILabel* profitLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 30, 320, 100)];
|
|
||||||
profitLabel.textColor = [UIColor whiteColor];
|
|
||||||
profitLabel.font = Font_Black(50);
|
|
||||||
profitLabel.textAlignment = NSTextAlignmentCenter;
|
|
||||||
profitLabel.text = @"100.04";
|
|
||||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
||||||
[cell addSubview:profitLabel];
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -151,11 +202,14 @@
|
|||||||
MyTotalProfitCellView* myTotalProfitCellView = [[MyTotalProfitCellView alloc] initWithFrame:frmae];
|
MyTotalProfitCellView* myTotalProfitCellView = [[MyTotalProfitCellView alloc] initWithFrame:frmae];
|
||||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||||
[cell addSubview:myTotalProfitCellView];
|
[cell addSubview:myTotalProfitCellView];
|
||||||
|
myTotalProfitCellView.totalMoneyLabel.text = [_myInfoDic objectForKey:@"totalAmount"];
|
||||||
|
myTotalProfitCellView.profitMoneyLabel.text = [_myInfoDic objectForKey:@"totalProfit"];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
cell.textLabel.text = @"我是超人";
|
cell.textLabel.text = @"交易记录";
|
||||||
|
cell.detailTextLabel.text = @"查看记录";
|
||||||
cell.textLabel.textColor = [UIColor grayColor];
|
cell.textLabel.textColor = [UIColor grayColor];
|
||||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||||
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
||||||
@@ -163,10 +217,10 @@
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
cell.textLabel.text = @"我是超人";
|
cell.textLabel.text = @"总积分";
|
||||||
cell.textLabel.textColor = [UIColor grayColor];
|
cell.textLabel.textColor = [UIColor grayColor];
|
||||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||||
cell.detailTextLabel.text = @"100分";
|
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@分",[_myInfoDic objectForKey:@"point"]];
|
||||||
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
cell.selectedBackgroundView.backgroundColor = Touch_BackGroudColor;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -174,7 +228,6 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cell.selectedBackgroundView = [ManagerUtil selectBackgroudViewWithFrame:CGRectMake(0, -1, 320, [self tableView:tableView heightForRowAtIndexPath:indexPath]-2)];
|
|
||||||
|
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Reference in New Issue
Block a user