diff --git a/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout b/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout index 137675d..f6462b3 100644 --- a/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout +++ b/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout @@ -5,7 +5,7 @@ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier - 3E677CDE-75A6-4743-AF24-784741DBFA26 + 7DF83542-E9D0-478B-AF8C-E271ADCDB5F5 IDESourceControlProjectName ManagerDemo IDESourceControlProjectOriginsDictionary diff --git a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate index 3207c09..04e48f2 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/MainView/HomeView/HomeMainView.h b/ManagerDemo/MainView/HomeView/HomeMainView.h index f131bc8..0c49e3f 100644 --- a/ManagerDemo/MainView/HomeView/HomeMainView.h +++ b/ManagerDemo/MainView/HomeView/HomeMainView.h @@ -17,6 +17,10 @@ @property (strong, nonatomic)NSString* fundCode; @property (weak, nonatomic) IBOutlet UILabel *typeLabel; @property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *progressLabel; +@property (weak, nonatomic) IBOutlet UIButton *sureBtn; +@property (weak, nonatomic) IBOutlet UILabel *baoLabel; +@property (weak, nonatomic) IBOutlet UIProgressView *progressView; @property (weak, nonatomic) IBOutlet MRCircularProgressView *percentView; - (IBAction)percentBtnClick:(id)sender; @property (weak, nonatomic) IBOutlet DTAttributedLabel *percentLabel; diff --git a/ManagerDemo/MainView/HomeView/HomeMainView.m b/ManagerDemo/MainView/HomeView/HomeMainView.m index a5e9772..97dcb40 100644 --- a/ManagerDemo/MainView/HomeView/HomeMainView.m +++ b/ManagerDemo/MainView/HomeView/HomeMainView.m @@ -29,7 +29,13 @@ } -(void)awakeFromNib{ [super awakeFromNib]; + _sureBtn.layer.cornerRadius = 8.0; + _sureBtn.layer.masksToBounds = YES; + _baoLabel.layer.cornerRadius = 5.0; + _baoLabel.layer.masksToBounds = YES; + + _progressView.transform = CGAffineTransformMakeScale(1.0f,4.0f); } // Only override drawRect: if you perform custom drawing. @@ -45,6 +51,8 @@ _percentView.progressColor = [UIColor redColor]; _percentView.progressArcWidth = 10.0f; + _sureBtn.layer.contentsScale = 8.0; + _sureBtn.layer.masksToBounds = YES; //旋转 _typeLabel.transform = CGAffineTransformMakeRotation( M_PI/4 ); } @@ -74,6 +82,8 @@ { progressPercent = percent; [_percentView setProgress:percent duration:1.0]; + [_progressView setProgress:percent animated:YES]; + _progressLabel.text = [NSString stringWithFormat:@"%.1f%%",percent*100]; //中间文字 NSString* htmlStr = [NSString stringWithFormat:@"%d%%",(int)(percent*100.0)]; NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; @@ -84,20 +94,27 @@ -(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; + NSString* htmlStr = [NSString stringWithFormat:@"%d.%d%d%%",(int)(expect),(int)(expect-(int)expect)*10,(int)(expect-(int)expect)*100%10]; + 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)setTime:(NSString*)time withStartBuy:(NSInteger)money { + + NSString* htmlStr = [NSString stringWithFormat:@"投资期限%@个月",time]; + NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; + NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; + _expectLabel.attributedString = percentString; + NSCharacterSet* nonDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet]; time = [time stringByReplacingOccurrencesOfString:[time stringByTrimmingCharactersInSet:nonDigits] withString:[NSString stringWithFormat:@"限%@个月",[time stringByTrimmingCharactersInSet:nonDigits]]]; //时间 - NSString* htmlStr = [NSString stringWithFormat:@"%@%ld元起购",time,money]; - NSData* data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; - NSAttributedString* percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; + htmlStr = [NSString stringWithFormat:@"%ld元 起投",money]; + data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding]; + percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; _timeLabel.attributedString = percentString; } -(void)setType:(NSString *)type @@ -106,11 +123,22 @@ } -(void)setInfo:(NSString *)info { - [_infoLabel setText:info]; +// [_infoLabel setText:info]; } -(void)setSecurityDesc:(NSString *)securityDesc { + [_securityDescLabel setText:securityDesc]; + + CGSize labelSize = [_securityDescLabel.text sizeWithFont:_securityDescLabel.font + + constrainedToSize:CGSizeMake(FLT_MAX,FLT_MAX) + + lineBreakMode:NSLineBreakByWordWrapping]; + CGRect frame = _baoLabel.frame; + frame.origin.x -= labelSize.width; + _baoLabel.frame = frame; + } -(void)setTipColor:(NSString*)tipColor { diff --git a/ManagerDemo/MainView/HomeView/HomeMainView.xib b/ManagerDemo/MainView/HomeView/HomeMainView.xib index 4ece33e..20398d5 100644 --- a/ManagerDemo/MainView/HomeView/HomeMainView.xib +++ b/ManagerDemo/MainView/HomeView/HomeMainView.xib @@ -1,5 +1,5 @@ - + @@ -10,12 +10,12 @@ - + - - + @@ -40,7 +40,7 @@ - + @@ -60,40 +60,41 @@ - + - + - - + + - + + + + + + + + + + + + diff --git a/ManagerDemo/MainViewControll/HomeViewController.m b/ManagerDemo/MainViewControll/HomeViewController.m index eeabb9d..232fca7 100644 --- a/ManagerDemo/MainViewControll/HomeViewController.m +++ b/ManagerDemo/MainViewControll/HomeViewController.m @@ -132,7 +132,7 @@ CGFloat height = 0.0; switch (indexPath.row) { case 0: - height = 160.0; + height = 148.0; break; case 1: height = 280.0; @@ -145,7 +145,7 @@ } -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - NSString* cellIdentifier = [NSString stringWithFormat:@"cell%d",indexPath.row]; + NSString* cellIdentifier = [NSString stringWithFormat:@"cell%ld",indexPath.row]; UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; @@ -153,7 +153,7 @@ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; switch (indexPath.row) { case 0:{ - _homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 140)]; + _homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 128)]; _homeAdView.superViewController = self; [cell addSubview:_homeAdView]; } diff --git a/ManagerDemo/MainViewControll/MainViewController.m b/ManagerDemo/MainViewControll/MainViewController.m index 3aebcdd..b3a89dc 100644 --- a/ManagerDemo/MainViewControll/MainViewController.m +++ b/ManagerDemo/MainViewControll/MainViewController.m @@ -34,13 +34,13 @@ //第四页 _myMoreNavigationController = [[UINavigationController alloc] initWithRootViewController:[[MoreViewController alloc] init]]; if (IOS7_OR_LATER) { - [_homeNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"首页" image:[UIImage imageNamed:@"tab_home_bg"] selectedImage:[UIImage imageNamed:@"tab_home_p_bg"]]]; + [_homeNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"理财精选" image:[UIImage imageNamed:@"tab_home_bg"] selectedImage:[UIImage imageNamed:@"tab_home_p_bg"]]]; [_produciListNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"产品列表" image:[UIImage imageNamed:@"tab_fund_list_bg"] selectedImage:[UIImage imageNamed:@"tab_fund_list_p_bg"]]]; - [_myNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"我的贷贷" image:[UIImage imageNamed:@"tab_mine_bg"] selectedImage:[UIImage imageNamed:@"tab_mine_p_bg"]]]; + [_myNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"我的资产" image:[UIImage imageNamed:@"tab_mine_bg"] selectedImage:[UIImage imageNamed:@"tab_mine_p_bg"]]]; - [_myMoreNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"更多" image:[UIImage imageNamed:@"tab_more_bg"] selectedImage:[UIImage imageNamed:@"tab_more_p_bg"]]]; + [_myMoreNavigationController setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"更多服务" image:[UIImage imageNamed:@"tab_more_bg"] selectedImage:[UIImage imageNamed:@"tab_more_p_bg"]]]; } self.viewControllers = @[_homeNavigationController, _produciListNavigationController, _myNavigationController, _myMoreNavigationController];