diff --git a/ManagerDemo.xcodeproj/project.pbxproj b/ManagerDemo.xcodeproj/project.pbxproj index 18522c8..0595aa1 100644 --- a/ManagerDemo.xcodeproj/project.pbxproj +++ b/ManagerDemo.xcodeproj/project.pbxproj @@ -12,6 +12,9 @@ A90BEC02199DDA9E00230242 /* WYDProductViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90BEC00199DDA9E00230242 /* WYDProductViewController.xib */; }; A90BEC05199DDACA00230242 /* WYDInfoHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = A90BEC04199DDACA00230242 /* WYDInfoHeadView.m */; }; A90BEC07199DDAFB00230242 /* WYDInfoHeadView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90BEC06199DDAFB00230242 /* WYDInfoHeadView.xib */; }; + A91C6D4019AB8E9C00AEBF4D /* p2c_alert@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A91C6D3D19AB8E9C00AEBF4D /* p2c_alert@2x.png */; }; + A91C6D4119AB8E9C00AEBF4D /* p2c_datesum@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A91C6D3E19AB8E9C00AEBF4D /* p2c_datesum@2x.png */; }; + A91C6D4219AB8E9C00AEBF4D /* p2c_safeicon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A91C6D3F19AB8E9C00AEBF4D /* p2c_safeicon@2x.png */; }; A9233E64199CA44700DA80D8 /* more_icon_5@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9233E63199CA44700DA80D8 /* more_icon_5@2x.png */; }; A93F87741999AA8300875287 /* ManagerUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F87731999AA8300875287 /* ManagerUtil.m */; }; A93F877C1999ACF600875287 /* MBProgressHUD+Util.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F877B1999ACF600875287 /* MBProgressHUD+Util.m */; }; @@ -107,6 +110,7 @@ A9E76DD519AB378A00C0D232 /* hk_home_icon1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E76DD219AB378A00C0D232 /* hk_home_icon1@2x.png */; }; A9E76DD619AB378A00C0D232 /* hk_home_icon2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E76DD319AB378A00C0D232 /* hk_home_icon2@2x.png */; }; A9E76DD719AB378A00C0D232 /* hk_home_icon3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E76DD419AB378A00C0D232 /* hk_home_icon3@2x.png */; }; + A9E8589D19AC2AAE001996DF /* DaiDaiTongApi.m in Sources */ = {isa = PBXBuildFile; fileRef = A9E8589C19AC2AAE001996DF /* DaiDaiTongApi.m */; }; A9EAA035199857F5001A872A /* HomeMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9EAA034199857F5001A872A /* HomeMainView.m */; }; A9EAA04019985EDE001A872A /* HomeMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA03F19985EDE001A872A /* HomeMainView.xib */; }; A9EAA04519986DC3001A872A /* fund_cell_label_bg_blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04119986DC3001A872A /* fund_cell_label_bg_blue@2x.png */; }; @@ -120,6 +124,8 @@ A9EAA052199879CC001A872A /* pie_chart_center@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA051199879CC001A872A /* pie_chart_center@2x.png */; }; A9EAA05619988C55001A872A /* MRCircularProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9EAA05519988C55001A872A /* MRCircularProgressView.m */; }; A9EAA05F1998BB82001A872A /* about_dot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA05E1998BB82001A872A /* about_dot@2x.png */; }; + A9F1E18619ACB63100B6A441 /* DTCoreTextTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A9F1E18519ACB63100B6A441 /* DTCoreTextTableViewCell.m */; }; + A9F1E18819ACB64D00B6A441 /* DTCoreTextTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9F1E18719ACB64D00B6A441 /* DTCoreTextTableViewCell.xib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -140,6 +146,9 @@ A90BEC03199DDACA00230242 /* WYDInfoHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WYDInfoHeadView.h; sourceTree = ""; }; A90BEC04199DDACA00230242 /* WYDInfoHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WYDInfoHeadView.m; sourceTree = ""; }; A90BEC06199DDAFB00230242 /* WYDInfoHeadView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WYDInfoHeadView.xib; sourceTree = ""; }; + A91C6D3D19AB8E9C00AEBF4D /* p2c_alert@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "p2c_alert@2x.png"; sourceTree = ""; }; + A91C6D3E19AB8E9C00AEBF4D /* p2c_datesum@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "p2c_datesum@2x.png"; sourceTree = ""; }; + A91C6D3F19AB8E9C00AEBF4D /* p2c_safeicon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "p2c_safeicon@2x.png"; sourceTree = ""; }; A9233E63199CA44700DA80D8 /* more_icon_5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "more_icon_5@2x.png"; sourceTree = ""; }; A93F87721999AA8300875287 /* ManagerUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagerUtil.h; sourceTree = ""; }; A93F87731999AA8300875287 /* ManagerUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ManagerUtil.m; sourceTree = ""; }; @@ -271,6 +280,8 @@ A9E76DD219AB378A00C0D232 /* hk_home_icon1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "hk_home_icon1@2x.png"; sourceTree = ""; }; A9E76DD319AB378A00C0D232 /* hk_home_icon2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "hk_home_icon2@2x.png"; sourceTree = ""; }; A9E76DD419AB378A00C0D232 /* hk_home_icon3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "hk_home_icon3@2x.png"; sourceTree = ""; }; + A9E8589B19AC2AAE001996DF /* DaiDaiTongApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaiDaiTongApi.h; sourceTree = ""; }; + A9E8589C19AC2AAE001996DF /* DaiDaiTongApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DaiDaiTongApi.m; sourceTree = ""; }; A9EAA033199857F5001A872A /* HomeMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeMainView.h; sourceTree = ""; }; A9EAA034199857F5001A872A /* HomeMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeMainView.m; sourceTree = ""; }; A9EAA03F19985EDE001A872A /* HomeMainView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeMainView.xib; sourceTree = ""; }; @@ -286,6 +297,9 @@ A9EAA05419988C55001A872A /* MRCircularProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRCircularProgressView.h; sourceTree = ""; }; A9EAA05519988C55001A872A /* MRCircularProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRCircularProgressView.m; sourceTree = ""; }; A9EAA05E1998BB82001A872A /* about_dot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "about_dot@2x.png"; sourceTree = ""; }; + A9F1E18419ACB63100B6A441 /* DTCoreTextTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTCoreTextTableViewCell.h; sourceTree = ""; }; + A9F1E18519ACB63100B6A441 /* DTCoreTextTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTCoreTextTableViewCell.m; sourceTree = ""; }; + A9F1E18719ACB64D00B6A441 /* DTCoreTextTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DTCoreTextTableViewCell.xib; sourceTree = ""; }; C7B3792862C24377B1ACD469 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -524,6 +538,8 @@ A9AF6C4A19949B510076C0EE /* Common */ = { isa = PBXGroup; children = ( + A9F1E18319ACB24500B6A441 /* CustomCell */, + A9E8589A19AC2940001996DF /* DaiDaiTongApi */, A96F2A79199D007700608237 /* UIButtonUtil */, A988A8F9199A50B600EB10AA /* UIViewShape */, A93F87C71999E4DA00875287 /* AttributedString */, @@ -541,6 +557,9 @@ A9AF6C4D19949CAD0076C0EE /* Resource */ = { isa = PBXGroup; children = ( + A91C6D3D19AB8E9C00AEBF4D /* p2c_alert@2x.png */, + A91C6D3E19AB8E9C00AEBF4D /* p2c_datesum@2x.png */, + A91C6D3F19AB8E9C00AEBF4D /* p2c_safeicon@2x.png */, A9E76DD219AB378A00C0D232 /* hk_home_icon1@2x.png */, A9E76DD319AB378A00C0D232 /* hk_home_icon2@2x.png */, A9E76DD419AB378A00C0D232 /* hk_home_icon3@2x.png */, @@ -641,6 +660,15 @@ path = MyView; sourceTree = ""; }; + A9E8589A19AC2940001996DF /* DaiDaiTongApi */ = { + isa = PBXGroup; + children = ( + A9E8589B19AC2AAE001996DF /* DaiDaiTongApi.h */, + A9E8589C19AC2AAE001996DF /* DaiDaiTongApi.m */, + ); + path = DaiDaiTongApi; + sourceTree = ""; + }; A9EAA05319988C55001A872A /* MRCircularProgressView */ = { isa = PBXGroup; children = ( @@ -650,6 +678,16 @@ path = MRCircularProgressView; sourceTree = ""; }; + A9F1E18319ACB24500B6A441 /* CustomCell */ = { + isa = PBXGroup; + children = ( + A9F1E18419ACB63100B6A441 /* DTCoreTextTableViewCell.h */, + A9F1E18519ACB63100B6A441 /* DTCoreTextTableViewCell.m */, + A9F1E18719ACB64D00B6A441 /* DTCoreTextTableViewCell.xib */, + ); + path = CustomCell; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -741,6 +779,7 @@ A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */, A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */, A9AF6CA61994D0660076C0EE /* ad4@2x.png in Resources */, + A9F1E18819ACB64D00B6A441 /* DTCoreTextTableViewCell.xib in Resources */, A9C69456199BD14D00B2CECE /* more_icon_8@2x.png in Resources */, A9AF6C48199498D10076C0EE /* MoreViewController.xib in Resources */, A9C69451199BD14D00B2CECE /* more_icon_2@2x.png in Resources */, @@ -748,6 +787,7 @@ A9AF6C6119949CD30076C0EE /* icon_dock_mine@2x.png in Resources */, A9AF6CA51994D0660076C0EE /* ad3@2x.png in Resources */, A9EAA04819986DC3001A872A /* fund_cell_label_bg_red@2x.png in Resources */, + A91C6D4219AB8E9C00AEBF4D /* p2c_safeicon@2x.png in Resources */, A9C6945A199BD16000B2CECE /* more_icon_1@2x.png in Resources */, A9EAA05F1998BB82001A872A /* about_dot@2x.png in Resources */, A9AF6C5E19949CD30076C0EE /* icon_dock_home_actived@2x.png in Resources */, @@ -766,6 +806,7 @@ A9AF6C6519949CD30076C0EE /* icon_dock_service@2x.png in Resources */, A9AF6CA01994D0210076C0EE /* ad1@2x.png in Resources */, A93F87821999BB1D00875287 /* red_line_and_shadow@2x.png in Resources */, + A91C6D4019AB8E9C00AEBF4D /* p2c_alert@2x.png in Resources */, A9AF6C6019949CD30076C0EE /* icon_dock_mine_actived@2x.png in Resources */, A9AF6C8F1994C5700076C0EE /* MJRefresh.bundle in Resources */, A9E76DD619AB378A00C0D232 /* hk_home_icon2@2x.png in Resources */, @@ -774,6 +815,7 @@ A9AF6C791994B5890076C0EE /* tabbarShadowImage@2x.png in Resources */, A9E76DD519AB378A00C0D232 /* hk_home_icon1@2x.png in Resources */, A9C69453199BD14D00B2CECE /* more_icon_4@2x.png in Resources */, + A91C6D4119AB8E9C00AEBF4D /* p2c_datesum@2x.png in Resources */, A9C69442199BB7B100B2CECE /* icon_person_take_image@2x.png in Resources */, A9C69457199BD14D00B2CECE /* more_icon_9@2x.png in Resources */, A90BEC07199DDAFB00230242 /* WYDInfoHeadView.xib in Resources */, @@ -859,6 +901,7 @@ A9AF6C3D199486CA0076C0EE /* ProductListViewController.m in Sources */, A93F87741999AA8300875287 /* ManagerUtil.m in Sources */, A9AF6C941994C5700076C0EE /* UIScrollView+Extension.m in Sources */, + A9E8589D19AC2AAE001996DF /* DaiDaiTongApi.m in Sources */, A96F2A7C199D008200608237 /* UIButton+Bootstrap.m in Sources */, A9AF6C47199498D10076C0EE /* MoreViewController.m in Sources */, A96F2A7F199D01C000608237 /* NSString+FontAwesome.m in Sources */, @@ -871,6 +914,7 @@ A9AF6BFD19947DD00076C0EE /* AppDelegate.m in Sources */, A9AF6C911994C5700076C0EE /* MJRefreshConst.m in Sources */, A9AF6C931994C5700076C0EE /* MJRefreshHeaderView.m in Sources */, + A9F1E18619ACB63100B6A441 /* DTCoreTextTableViewCell.m in Sources */, A9AF6BF919947DD00076C0EE /* main.m in Sources */, A90BEC05199DDACA00230242 /* WYDInfoHeadView.m in Sources */, A93F877C1999ACF600875287 /* MBProgressHUD+Util.m in Sources */, diff --git a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate index 85fe232..5c1efbc 100644 Binary files a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate and b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.h b/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.h new file mode 100644 index 0000000..27c1175 --- /dev/null +++ b/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.h @@ -0,0 +1,13 @@ +// +// DTCoreTextTableViewCell.h +// ManagerDemo +// +// Created by xmfish on 14-8-26. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface DTCoreTextTableViewCell : UITableViewCell + +@end diff --git a/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.m b/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.m new file mode 100644 index 0000000..7ae6557 --- /dev/null +++ b/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.m @@ -0,0 +1,34 @@ +// +// DTCoreTextTableViewCell.m +// ManagerDemo +// +// Created by xmfish on 14-8-26. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import "DTCoreTextTableViewCell.h" + +@implementation DTCoreTextTableViewCell + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + } + return self; +} + +- (void)awakeFromNib +{ + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.xib b/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.xib new file mode 100644 index 0000000..05e599d --- /dev/null +++ b/ManagerDemo/Common/CustomCell/DTCoreTextTableViewCell.xib @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/ManagerDemo/Common/DaiDaiTongApi/DaiDaiTongApi.h b/ManagerDemo/Common/DaiDaiTongApi/DaiDaiTongApi.h new file mode 100644 index 0000000..1e47254 --- /dev/null +++ b/ManagerDemo/Common/DaiDaiTongApi/DaiDaiTongApi.h @@ -0,0 +1,37 @@ +// +// DaiDaiTongApi.h +// ManagerDemo +// +// Created by xmfish on 14-8-26. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import "MKNetworkEngine.h" + +@interface DaiDaiTongApi : MKNetworkEngine + +typedef void (^CompletionBlock) (id jsonRes); +typedef void (^FailedBlock) (NSError *error); + ++(DaiDaiTongApi*)shareInstance; + +/** + * 获取首页广告 + * + * @param completionBlock 请求完成 + * @param failedBlock 请求失败 + * + * @return MKNetworkOperation + */ +-(MKNetworkOperation*)getBannerInfoWithcompletionBlock:(CompletionBlock) completionBlock failedBlock:(FailedBlock)failedBlock; + +/** + * 获取首页推荐 + * + * @param completionBlock 请求完成 + * @param failedBlock 请求失败 + * + * @return MKNetworkOperation + */ +-(MKNetworkOperation*)getFundRecommendWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock; +@end diff --git a/ManagerDemo/Common/DaiDaiTongApi/DaiDaiTongApi.m b/ManagerDemo/Common/DaiDaiTongApi/DaiDaiTongApi.m new file mode 100644 index 0000000..921e05f --- /dev/null +++ b/ManagerDemo/Common/DaiDaiTongApi/DaiDaiTongApi.m @@ -0,0 +1,67 @@ +// +// DaiDaiTongApi.m +// ManagerDemo +// +// Created by xmfish on 14-8-26. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import "DaiDaiTongApi.h" + +@implementation DaiDaiTongApi + ++(DaiDaiTongApi*)shareInstance +{ + static DaiDaiTongApi* shareInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSMutableDictionary *postHeaderFields = [NSMutableDictionary dictionary]; + [postHeaderFields setValue:@"application/json;charset=utf-8" forKey:@"Content-Type"]; + [postHeaderFields setValue:@"gzip,deflate" forKey:@"Accept-Encoding"]; + shareInstance = [[super alloc] initWithHostName:DaiDaiTong_API_URL customHeaderFields:postHeaderFields]; + }); + return shareInstance; +} + +-(MKNetworkOperation*)getWithPath:(NSString*)path params:(NSDictionary *)params +{ + return [self operationWithPath:path params:params httpMethod:@"GET" ssl:YES]; +} +-(MKNetworkOperation*)postWithPath:(NSString*)path params:(NSDictionary *)params +{ + return [self operationWithPath:path params:params httpMethod:@"POST" ssl:YES]; +} +-(MKNetworkOperation*)getBannerInfoWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock +{ + MKNetworkOperation* op = [self postWithPath:@"bannerInfo.do" params:nil]; + + [op addCompletionHandler:^(MKNetworkOperation *completedOperation) { + completionBlock(completedOperation.responseJSON); + + } errorHandler:^(MKNetworkOperation *completedOperation, NSError *error) { + DLog(@"%@", error); + failedBlock(error); + }]; + + [self enqueueOperation:op forceReload:YES]; + + return op; +} + +-(MKNetworkOperation*)getFundRecommendWithcompletionBlock:(CompletionBlock)completionBlock failedBlock:(FailedBlock)failedBlock +{ + MKNetworkOperation* op = [self postWithPath:@"fundRecommend.do" params:nil]; + + [op addCompletionHandler:^(MKNetworkOperation *completedOperation) { + completionBlock(completedOperation.responseJSON); + + } errorHandler:^(MKNetworkOperation *completedOperation, NSError *error) { + DLog(@"%@", error); + failedBlock(error); + }]; + + [self enqueueOperation:op forceReload:YES]; + + return op; +} +@end diff --git a/ManagerDemo/Common/ManagerConstants.h b/ManagerDemo/Common/ManagerConstants.h index 163f548..68e5050 100644 --- a/ManagerDemo/Common/ManagerConstants.h +++ b/ManagerDemo/Common/ManagerConstants.h @@ -9,6 +9,12 @@ #ifndef ManagerDemo_ManagerConstants_h #define ManagerDemo_ManagerConstants_h + +/** + * 接口地址 + */ + +#define DaiDaiTong_API_URL @"mobi.yingyinglicai.com:8443/front" /** * 系统版本 */ diff --git a/ManagerDemo/Common/ManagerUtil.h b/ManagerDemo/Common/ManagerUtil.h index 263f9f7..dda2b88 100644 --- a/ManagerDemo/Common/ManagerUtil.h +++ b/ManagerDemo/Common/ManagerUtil.h @@ -31,5 +31,5 @@ +(UIView*)selectBackgroudViewWithFrame:(CGRect)frame; -+ (UIImage *) buttonImageFromColor:(UIColor *)color withFrame:(CGRect)frame; ++(UIImage*) buttonImageFromColor:(UIColor *)color withFrame:(CGRect)frame; @end diff --git a/ManagerDemo/MainView/HomeView/HomeAdView.h b/ManagerDemo/MainView/HomeView/HomeAdView.h index 914b9ed..3085566 100644 --- a/ManagerDemo/MainView/HomeView/HomeAdView.h +++ b/ManagerDemo/MainView/HomeView/HomeAdView.h @@ -10,5 +10,7 @@ #import "ImagePlayerView.h" @interface HomeAdView : UIView { + NSMutableArray* _bannerInfo; } +@property(nonatomic,strong)NSMutableArray* bannerInfo; @end diff --git a/ManagerDemo/MainView/HomeView/HomeAdView.m b/ManagerDemo/MainView/HomeView/HomeAdView.m index 11fe64c..0c1e54b 100644 --- a/ManagerDemo/MainView/HomeView/HomeAdView.m +++ b/ManagerDemo/MainView/HomeView/HomeAdView.m @@ -7,9 +7,10 @@ // #import "HomeAdView.h" +#import @implementation HomeAdView { - NSArray *imageArray; + ImagePlayerView* imagePlayerView; } - (id)initWithFrame:(CGRect)frame @@ -18,34 +19,35 @@ if (self) { // Initialization code } - imageArray=@[[UIImage imageNamed:@"ad1"],[UIImage imageNamed:@"ad2"],[UIImage imageNamed:@"ad3"],[UIImage imageNamed:@"ad4"]]; - NSMutableArray* imageViewArray = [[NSMutableArray alloc] init]; - for (int i=0; i9%"; - NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; - NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil]; - NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil]; - _percentLabel.attributedString = percentString; - //预期 - htmlStr = @"四个大字10.20%"; - data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; - percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; - _expectLabel.attributedString = percentString; - - //时间 - htmlStr = [NSString stringWithFormat:@"%d个月%d",15,50]; - data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; - percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; - _timeLabel.attributedString = percentString; } @@ -77,6 +59,49 @@ DLog(@"确认"); } +-(void)setName:(NSString *)name +{ + [_nameLabel setText:name]; +} +-(void)setpercent:(float)percent +{ + progressPercent = percent; + [_percentView setProgress:percent duration:1.0]; + //中间文字 + NSString* htmlStr = [NSString stringWithFormat:@"%d%%",(int)percent*100]; + NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; + NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil]; + NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil]; + _percentLabel.attributedString = percentString; +} +-(void)setExpect:(float)expect +{ + //预期 + NSString* htmlStr = [NSString stringWithFormat:@"四个大字%.2f%%",expect]; + NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; + NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; + _expectLabel.attributedString = percentString; +} +-(void)setTime:(NSInteger)month withStartBuy:(NSInteger)money +{ + //时间 + NSString* htmlStr = [NSString stringWithFormat:@"%d个月%d",month,money]; + NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; + NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; + _timeLabel.attributedString = percentString; +} +-(void)setType:(NSString *)type +{ + [_typeLabel setText:type]; +} +-(void)setInfo:(NSString *)info +{ + [_infoLabel setText:info]; +} +-(void)setSecurityDesc:(NSString *)securityDesc +{ + [_securityDescLabel setText:securityDesc]; +} #pragma mark - CABasicAnimationDelegate - (void)animationDidStart:(CAAnimation *)theAnimation diff --git a/ManagerDemo/MainView/HomeView/HomeMainView.xib b/ManagerDemo/MainView/HomeView/HomeMainView.xib index f569fe5..fc4c186 100644 --- a/ManagerDemo/MainView/HomeView/HomeMainView.xib +++ b/ManagerDemo/MainView/HomeView/HomeMainView.xib @@ -1,7 +1,7 @@ - + - + @@ -30,7 +30,7 @@ - \ No newline at end of file + diff --git a/ManagerDemo/MainView/ProductView/WYDInfoHeadView.m b/ManagerDemo/MainView/ProductView/WYDInfoHeadView.m index 9392195..b4423fd 100644 --- a/ManagerDemo/MainView/ProductView/WYDInfoHeadView.m +++ b/ManagerDemo/MainView/ProductView/WYDInfoHeadView.m @@ -25,7 +25,7 @@ - (void)drawRect:(CGRect)rect { // Drawing code - _progressView.transform = CGAffineTransformMakeScale(1.0f,5.0f); + _progressView.transform = CGAffineTransformMakeScale(1.0f,8.0f); _hasPercent.backgroundColor = [UIColor clearColor]; _leftMoney.backgroundColor = [UIColor clearColor]; [self setProgress:0.336]; diff --git a/ManagerDemo/MainView/ProductView/WYDInfoHeadView.xib b/ManagerDemo/MainView/ProductView/WYDInfoHeadView.xib index 50d0b9d..bb43096 100644 --- a/ManagerDemo/MainView/ProductView/WYDInfoHeadView.xib +++ b/ManagerDemo/MainView/ProductView/WYDInfoHeadView.xib @@ -11,99 +11,125 @@ - + + - + - + - + - - + + - - + + - - + + + + + + + + + @@ -115,6 +141,9 @@ - + + + + diff --git a/ManagerDemo/MainView/ProductView/WYDProductViewController.m b/ManagerDemo/MainView/ProductView/WYDProductViewController.m index 928597c..a03d212 100644 --- a/ManagerDemo/MainView/ProductView/WYDProductViewController.m +++ b/ManagerDemo/MainView/ProductView/WYDProductViewController.m @@ -31,8 +31,6 @@ _tableView.delegate = self; _tableView.dataSource = self; NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"WYDInfoHeadView" owner:self options:nil]; - - WYDInfoHeadView* wydInfoHedaView = (WYDInfoHeadView*)[nib objectAtIndex:0]; _tableView.tableHeaderView = wydInfoHedaView; } @@ -40,7 +38,7 @@ #pragma mark UITableViewDelegate -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 5; + return 4; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -49,16 +47,103 @@ -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { - return 60; + return 40; } - return 60; + switch (indexPath.section) { + case 0: + return 40; + break; + case 1: + return 80; + break; + case 2: + return 40; + break; + case 3: + return 40; + break; + default: + break; + } + return 0; } -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell* cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; - cell.textLabel.text = @"我是一个好人"; + NSString* cellIDentifier = [NSString stringWithFormat:@"CellIDentifier%d-%d",indexPath.section,indexPath.row]; + DTAttributedTextCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIDentifier]; + if (!cell) { + cell = [[DTAttributedTextCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIDentifier]; + + } + switch (indexPath.section) { + case 0: + { + cell.textLabel.font = [UIFont systemFontOfSize:12.0]; + cell.textLabel.text = @"已投标人数:"; + cell.detailTextLabel.font = [UIFont systemFontOfSize:12.0]; + cell.detailTextLabel.text = @"255人"; + } + break; + case 1: + { + [cell setHTMLString:@"活动期间,新手首次申购,买50元及以上送20元现金红包。
注:新手特指从未申购过稳盈贷产品的用户;每个新手只享受一次20元现金红包奖励;红包奖励将在募集成功后下一个工作日发放到账户余额。"]; + cell.attributedTextContextView.edgeInsets = UIEdgeInsetsMake(5, 15, 5, 15); + } + break; + case 2: + { + [cell setHTMLString:@"上海**金属制品有限公司法定代表人为资金周转,以个人名义申请借款。"]; + cell.attributedTextContextView.edgeInsets = UIEdgeInsetsMake(5, 15, 5, 15); + } + break; + case 3: + { + [cell setHTMLString:@"浙江巨业担保有限公司全额本息保证"]; + cell.attributedTextContextView.edgeInsets = UIEdgeInsetsMake(15, 15, 5, 15); + } + break; + default: + break; + } return cell; +} +-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section +{ + UIView* view = [ManagerUtil lineWithColor:Touch_BackGroudColor withAlpha:1.0 withFrame:CGRectMake(0, 0, 320, 30)]; + UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, view.frame.size.width-10, view.frame.size.height)]; + label.font = [UIFont systemFontOfSize:13]; + switch (section) { + case 0: + label.text = @"投标情况"; + break; + case 1: + label.text = @"申购奖励"; + break; + case 2: + label.text = @"项目描述"; + break; + case 3: + label.text = @"资金保障"; + break; + default: + break; + } + [view addSubview:label]; + return view; +} +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section +{ + return 30.0; +} +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section +{ + return 1.0; +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + } - (void)didReceiveMemoryWarning { diff --git a/ManagerDemo/MainView/ProductView/WYDProductViewController.xib b/ManagerDemo/MainView/ProductView/WYDProductViewController.xib index 6d04338..3192689 100644 --- a/ManagerDemo/MainView/ProductView/WYDProductViewController.xib +++ b/ManagerDemo/MainView/ProductView/WYDProductViewController.xib @@ -1,7 +1,7 @@ - + - + @@ -16,14 +16,40 @@ - + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/ManagerDemo/MainViewControll/HomeViewController.m b/ManagerDemo/MainViewControll/HomeViewController.m index 96798ea..4709133 100644 --- a/ManagerDemo/MainViewControll/HomeViewController.m +++ b/ManagerDemo/MainViewControll/HomeViewController.m @@ -11,7 +11,10 @@ #import "HomeAdView.h" #import "HomeMainView.h" @interface HomeViewController () - +{ + HomeAdView* homeAdView; + HomeMainView* homeMainView; +} @end @implementation HomeViewController @@ -44,21 +47,36 @@ // [_tableView addFooterWithTarget:self action:@selector(footerRereshing)]; [_tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; + [_tableView headerBeginRefreshing]; } #pragma mark MJRefreshDelegate - (void)headerRereshing { - - // 2.2秒后刷新表格UI - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - // 刷新表格 + DaiDaiTongApi* daiDaiTongApi = [DaiDaiTongApi shareInstance]; + //广告条 + [daiDaiTongApi getBannerInfoWithcompletionBlock:^(id jsonRes) { + if ([[jsonRes objectForKey:@"succ"] integerValue] == 1) { + NSMutableArray* bannerInfo = [jsonRes objectForKey:@"infos"]; + [homeAdView setBannerInfo:bannerInfo]; + } + } failedBlock:^(NSError *error) { + DLog(@"失败"); + [MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0]; + }]; + [daiDaiTongApi getFundRecommendWithcompletionBlock:^(id jsonRes) { + if ([[jsonRes objectForKey:@"succ"] integerValue] != 1) { + [MBProgressHUD errorHudWithView:nil label:[jsonRes objectForKey:@"err_msg"] hidesAfter:1.0]; + }else{ + + } [self.tableView reloadData]; - - // (最好在刷新表格后调用)调用endRefreshing可以结束刷新状态 [self.tableView headerEndRefreshing]; - }); + } failedBlock:^(NSError *error) { + DLog(@"失败"); + [MBProgressHUD errorHudWithView:nil label:@"网络出错" hidesAfter:1.0]; + }]; } - (void)footerRereshing @@ -98,28 +116,34 @@ } -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell* cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; + NSString* cellIdentifier = [NSString stringWithFormat:@"cell%d",indexPath.row]; + UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + + + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; + switch (indexPath.row) { + case 0:{ + homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 140)]; + [cell addSubview:homeAdView]; + } + break; + case 1:{ + NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"HomeMainView" owner:self options:nil]; + + homeMainView = (HomeMainView*)[nib objectAtIndex:0]; + CGRect frame = homeMainView.frame; + frame.origin.x = 20; + homeMainView.frame = frame; + [cell addSubview:homeMainView]; + } + default: + break; + } + } cell.selectionStyle = UITableViewCellSelectionStyleNone; - switch (indexPath.row) { - case 0:{ - HomeAdView* homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 140)]; - [cell addSubview:homeAdView]; - } - break; - case 1:{ - NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"HomeMainView" owner:self options:nil]; - - HomeMainView* homeMainView = (HomeMainView*)[nib objectAtIndex:0]; - CGRect frame = homeMainView.frame; - frame.origin.x = 20; - homeMainView.frame = frame; - [cell addSubview:homeMainView]; - } - default: - break; - } - + return cell; } #pragma mark - UIBarButtonClick 导航条两边按钮 diff --git a/ManagerDemo/MainViewControll/HomeViewController.xib b/ManagerDemo/MainViewControll/HomeViewController.xib index a7cedbc..7ff6118 100644 --- a/ManagerDemo/MainViewControll/HomeViewController.xib +++ b/ManagerDemo/MainViewControll/HomeViewController.xib @@ -1,7 +1,7 @@ - + - + @@ -26,4 +26,4 @@ - \ No newline at end of file + diff --git a/ManagerDemo/MainViewControll/ProductListViewController.m b/ManagerDemo/MainViewControll/ProductListViewController.m index 1a8c6f7..d718d6d 100644 --- a/ManagerDemo/MainViewControll/ProductListViewController.m +++ b/ManagerDemo/MainViewControll/ProductListViewController.m @@ -85,7 +85,7 @@ - (void)slideSwitchView:(QCSlideSwitchView *)view didselectTab:(NSUInteger)number { - DLog(@"%ld",number); + DLog(@"%d",number); _nowSelectTab = number; //进行第一次刷新 [(ListViewController*)[listViewContrllerArray objectAtIndex:number] firstRefresh]; diff --git a/ManagerDemo/ManagerDemo-Prefix.pch b/ManagerDemo/ManagerDemo-Prefix.pch index 331f1c4..02ca315 100644 --- a/ManagerDemo/ManagerDemo-Prefix.pch +++ b/ManagerDemo/ManagerDemo-Prefix.pch @@ -20,4 +20,7 @@ #import "MBProgressHUD.h" #import "ManagerUtil.h" #import "MBProgressHUD+Util.h" + #import "DaiDaiTongApi.h" + #import + #import #endif diff --git a/ManagerDemo/Resource/p2c_alert@2x.png b/ManagerDemo/Resource/p2c_alert@2x.png new file mode 100644 index 0000000..44c1f15 Binary files /dev/null and b/ManagerDemo/Resource/p2c_alert@2x.png differ diff --git a/ManagerDemo/Resource/p2c_datesum@2x.png b/ManagerDemo/Resource/p2c_datesum@2x.png new file mode 100644 index 0000000..8dab6fb Binary files /dev/null and b/ManagerDemo/Resource/p2c_datesum@2x.png differ diff --git a/ManagerDemo/Resource/p2c_safeicon@2x.png b/ManagerDemo/Resource/p2c_safeicon@2x.png new file mode 100644 index 0000000..e38d966 Binary files /dev/null and b/ManagerDemo/Resource/p2c_safeicon@2x.png differ