Skip to content

Commit edf7f1a

Browse files
committed
第一&二阶段~
1 parent 63c6c0b commit edf7f1a

11 files changed

Lines changed: 188 additions & 18 deletions

File tree

Coding_iOS/Controllers/RootControllers/Project_RootViewController.m

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,20 @@ - (void)viewDidLoad
9696

9797
//添加搜索框
9898
_mySearchBar = ({
99-
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(50,0, kScreen_Width-100, 44)];
99+
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(55,0, kScreen_Width-110, 44)];
100+
// searchBar.layer.cornerRadius=22;
101+
// searchBar.layer.masksToBounds=TRUE;
100102
[searchBar sizeToFit];
101103
searchBar.delegate = self;
102-
[searchBar setPlaceholder:@"项目名称/创建人"];
104+
[searchBar setPlaceholder:@"项目、任务、讨论、冒泡等"];
103105
[searchBar setTintColor:[UIColor whiteColor]];
104106
[searchBar insertBGColor:[UIColor colorWithHexString:@"0x28303b"]];
105107
searchBar;
106108
});
107109

108110
__weak typeof(_myCarousel) weakCarousel = _myCarousel;
109-
//初始化过滤目录并加载数据
111+
112+
//初始化过滤目录
110113
_myFliterMenu = [[PopFliterMenu alloc] initWithFrame:kScreen_Bounds items:nil];
111114
__weak typeof(self) weakSelf = self;
112115
_myFliterMenu.clickBlock = ^(NSInteger pageIndex){
@@ -119,8 +122,6 @@ - (void)viewDidLoad
119122
weakSelf.selectNum=pageIndex;
120123
}
121124
};
122-
123-
[_myFliterMenu refreshMenuDate];
124125

125126

126127
//初始化弹出菜单
@@ -141,6 +142,9 @@ - (void)viewDidLoad
141142
_myPopMenu.didSelectedItemCompletion = ^(MenuItem *selectedItem){
142143
[MobClick event:kUmeng_Event_Request_ActionOfLocal label:[NSString stringWithFormat:@"快捷创建_%@", selectedItem.title]];
143144
@strongify(self);
145+
//改下显示style
146+
[self.rightNavBtn setStyle:kFRDLivelyButtonStylePlus animated:YES];
147+
if (!selectedItem) return;
144148
switch (selectedItem.index) {
145149
case 0:
146150
[self goToNewProjectVC];
@@ -216,6 +220,7 @@ - (void)viewWillAppear:(BOOL)animated{
216220
[listView refreshToQueryData];
217221
}
218222
}
223+
[_myFliterMenu refreshMenuDate];
219224
}
220225

221226
-(void)viewWillDisappear:(BOOL)animated
@@ -256,6 +261,23 @@ - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
256261

257262
DebugLog(@"\n=====%@", project.name);
258263
} tabBarHeight:CGRectGetHeight(self.rdv_tabBarController.tabBar.frame)];
264+
265+
listView.clickButtonBlock=^(EaseBlankPageType curType) {
266+
switch (curType) {
267+
case EaseBlankPageTypeProject_ALL:
268+
case EaseBlankPageTypeProject_CREATE:
269+
case EaseBlankPageTypeProject_JOIN:
270+
[weakSelf goToNewProjectVC];
271+
break;
272+
case EaseBlankPageTypeProject_WATCHED:
273+
case EaseBlankPageTypeProject_STARED:
274+
[weakSelf goToProjectSquareVC];
275+
break;
276+
default:
277+
break;
278+
}
279+
};
280+
259281
//使用新系列Cell样式
260282
listView.useNewStyle=_useNewStyle;
261283

Coding_iOS/Controllers/RootControllers/RootTabViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ - (void)setupViewControllers {
102102
}
103103

104104
- (void)customizeTabBarForController {
105+
106+
105107
UIImage *backgroundImage = [UIImage imageNamed:@"tabbar_background"];
106108
NSArray *tabBarItemImages = @[@"project", @"task", @"tweet", @"privatemessage", @"me"];
107109
NSArray *tabBarItemTitles = @[@"项目", @"任务", @"冒泡", @"消息", @""];

Coding_iOS/Models/Projects.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ - (void)configWithProjects:(Projects *)responsePros{
103103
if (self.type == ProjectsTypeToChoose) {
104104
projectList = [projectList filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"is_public == %d", NO]];
105105
}
106-
if (projectList.count <= 0) {
106+
if (!projectList) {
107107
return;
108108
}
109109

Coding_iOS/Util/OC_Category/UIView+Common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ typedef NS_ENUM(NSInteger, EaseBlankPageType)
3232
EaseBlankPageTypeOthersJoinedTopic,
3333
EaseBlankPageTypeFileTypeCannotSupport,
3434
EaseBlankPageTypeViewTips,
35+
EaseBlankPageTypeProject_ALL,
36+
EaseBlankPageTypeProject_CREATE,
37+
EaseBlankPageTypeProject_JOIN,
38+
EaseBlankPageTypeProject_WATCHED,
39+
EaseBlankPageTypeProject_STARED,
3540
};
3641

3742
typedef NS_ENUM(NSInteger, BadgePositionType) {
@@ -103,7 +108,10 @@ typedef NS_ENUM(NSInteger, BadgePositionType) {
103108
@property (strong, nonatomic) UIImageView *monkeyView;
104109
@property (strong, nonatomic) UILabel *tipLabel;
105110
@property (strong, nonatomic) UIButton *reloadButton;
111+
@property (assign, nonatomic) EaseBlankPageType curType;
106112
@property (copy, nonatomic) void(^reloadButtonBlock)(id sender);
113+
@property (copy, nonatomic) void(^loadAndShowStatusBlock)();
114+
@property (copy, nonatomic) void(^clickButtonBlock)(EaseBlankPageType curType);
107115
- (void)configWithType:(EaseBlankPageType)blankPageType hasData:(BOOL)hasData hasError:(BOOL)hasError reloadButtonBlock:(void(^)(id sender))block;
108116
@end
109117

Coding_iOS/Util/OC_Category/UIView+Common.m

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@ - (instancetype)initWithFrame:(CGRect)frame{
493493

494494
- (void)configWithType:(EaseBlankPageType)blankPageType hasData:(BOOL)hasData hasError:(BOOL)hasError reloadButtonBlock:(void (^)(id))block{
495495

496+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
497+
if (_loadAndShowStatusBlock) {
498+
_loadAndShowStatusBlock();
499+
}
500+
});
501+
502+
496503
if (hasData) {
497504
[self removeFromSuperview];
498505
return;
@@ -549,7 +556,9 @@ - (void)configWithType:(EaseBlankPageType)blankPageType hasData:(BOOL)hasData ha
549556
if (_reloadButton) {
550557
_reloadButton.hidden = YES;
551558
}
559+
552560
NSString *imageName, *tipStr;
561+
_curType=blankPageType;
553562
switch (blankPageType) {
554563
case EaseBlankPageTypeActivity://项目动态
555564
{
@@ -636,6 +645,31 @@ - (void)configWithType:(EaseBlankPageType)blankPageType hasData:(BOOL)hasData ha
636645
tipStr = @"这里没有未读的消息";
637646
}
638647
break;
648+
case EaseBlankPageTypeProject_ALL:{
649+
imageName = @"blankpage_image_Sleep";
650+
tipStr = @"您还木有项目呢,赶快起来创建吧~";
651+
}
652+
break;
653+
case EaseBlankPageTypeProject_CREATE:{
654+
imageName = @"blankpage_image_Sleep";
655+
tipStr = @"您还木有项目呢,赶快起来创建吧~";
656+
}
657+
break;
658+
case EaseBlankPageTypeProject_JOIN:{
659+
imageName = @"blankpage_image_Sleep";
660+
tipStr = @"您还木有项目呢,赶快起来创建吧~";
661+
}
662+
break;
663+
case EaseBlankPageTypeProject_WATCHED:{
664+
imageName = @"blankpage_image_Sleep";
665+
tipStr = @"您还木有项目呢,赶快起来创建吧~";
666+
}
667+
break;
668+
case EaseBlankPageTypeProject_STARED:{
669+
imageName = @"blankpage_image_Sleep";
670+
tipStr = @"您还木有项目呢,赶快起来创建吧~";
671+
}
672+
break;
639673
default://其它页面(这里没有提到的页面,都属于其它)
640674
{
641675
imageName = @"blankpage_image_Sleep";
@@ -645,6 +679,56 @@ - (void)configWithType:(EaseBlankPageType)blankPageType hasData:(BOOL)hasData ha
645679
}
646680
[_monkeyView setImage:[UIImage imageNamed:imageName]];
647681
_tipLabel.text = tipStr;
682+
683+
if ((blankPageType>=EaseBlankPageTypeProject_ALL)&&(blankPageType<=EaseBlankPageTypeProject_STARED)) {
684+
//新增按钮
685+
UIButton *actionBtn=({
686+
UIButton *button=[UIButton new];
687+
button.backgroundColor=[UIColor colorWithHexString:@"0x3BBD79"];
688+
button.titleLabel.font=[UIFont systemFontOfSize:15];
689+
[button addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside];
690+
button.layer.cornerRadius=18;
691+
button.layer.masksToBounds=TRUE;
692+
button;
693+
});
694+
[self addSubview:actionBtn];
695+
696+
[actionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
697+
make.size.mas_equalTo(CGSizeMake(125 , 36));
698+
make.top.equalTo(_tipLabel.mas_bottom).offset(15);
699+
make.centerX.equalTo(self);
700+
}];
701+
702+
NSString *titleStr;
703+
switch (blankPageType) {
704+
case EaseBlankPageTypeProject_ALL:
705+
case EaseBlankPageTypeProject_CREATE:
706+
case EaseBlankPageTypeProject_JOIN:
707+
titleStr=@"+ 创建项目";
708+
// [actionBtn setTitle:@"+ 创建项目" forState:UIControlStateNormal];
709+
break;
710+
case EaseBlankPageTypeProject_WATCHED:
711+
titleStr=@"+ 去关注";
712+
// [actionBtn setTitle:@"+ 去关注" forState:UIControlStateNormal];
713+
break;
714+
case EaseBlankPageTypeProject_STARED:
715+
titleStr=@"+ 去收藏";
716+
// [actionBtn setTitle:@"+去收藏" forState:UIControlStateNormal];
717+
break;
718+
default:
719+
break;
720+
}
721+
// NSMutableAttributedString *titleFontStr=[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"+ %@",titleStr]];
722+
// NSRange range;
723+
// range.location=0;
724+
// range.length=1;
725+
// [titleFontStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20] range:range];
726+
// [actionBtn setAttributedTitle:titleFontStr forState:UIControlStateNormal];
727+
728+
[actionBtn setTitle:titleStr forState:UIControlStateNormal];
729+
730+
}else{
731+
}
648732
}
649733
}
650734

@@ -658,6 +742,14 @@ - (void)reloadButtonClicked:(id)sender{
658742
});
659743
}
660744

745+
-(void)btnAction{
746+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
747+
if (_clickButtonBlock) {
748+
_clickButtonBlock(_curType);
749+
}
750+
});
751+
}
752+
661753
@end
662754

663755

Coding_iOS/Vendor/PopMenu/PopMenu.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (void)setup {
5959
_realTimeBlur = [[XHRealTimeBlur alloc] initWithFrame:self.bounds];
6060
_realTimeBlur.blurStyle = XHBlurStyleTranslucentWhite;
6161
_realTimeBlur.showDuration = 0.3;
62-
_realTimeBlur.disMissDuration = 0.2;
62+
_realTimeBlur.disMissDuration = 0.1;
6363
_realTimeBlur.willShowBlurViewcomplted = ^(void) {
6464
// [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
6565
weakSelf.isShowed = YES;
@@ -73,6 +73,9 @@ - (void)setup {
7373
weakSelf.didSelectedItemCompletion(weakSelf.selectedItem);
7474
weakSelf.selectedItem = nil;
7575
}
76+
}else
77+
{
78+
weakSelf.didSelectedItemCompletion(nil);
7679
}
7780
[weakSelf hidenButtons];
7881
};

Coding_iOS/Vendor/RDVTabBarController/RDVTabBarItem.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ - (void)commonInitialization {
6969

7070
_unselectedTitleAttributes = @{
7171
NSFontAttributeName: [UIFont systemFontOfSize:10],
72-
NSForegroundColorAttributeName: [UIColor colorWithHexString:@"0x999999"],
72+
NSForegroundColorAttributeName: [UIColor colorWithHexString:@"0x808080"],
7373
};
7474
_selectedTitleAttributes = @{
7575
NSFontAttributeName: [UIFont systemFontOfSize:10],
76-
NSForegroundColorAttributeName: [UIColor colorWithHexString:@"0x28303b"],
76+
NSForegroundColorAttributeName: [UIColor colorWithHexString:@"0x3BBD79"],
7777
};
7878

7979
_badgeBackgroundColor = [UIColor colorWithHexString:@"0xf75388"];

Coding_iOS/Views/Cell/ProjectAboutMeListCell.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
8383
[_setCommonBtn addTarget:self action:@selector(showSliderAction) forControlEvents:UIControlEventTouchUpInside];
8484
[_setCommonBtn mas_makeConstraints:^(MASConstraintMaker *make) {
8585
make.size.mas_equalTo(CGSizeMake(35, 20));
86-
make.right.equalTo(self).offset(-15);
87-
make.bottom.equalTo(self.projectIconView);
86+
make.right.equalTo(self).offset(-15+10);
87+
make.bottom.equalTo(self.projectIconView).offset(5);
8888
}];
8989
}
9090

@@ -156,7 +156,7 @@ - (void)setProject:(Project *)project hasSWButtons:(BOOL)hasSWButtons hasBadgeTi
156156
//hasIndicator
157157
self.accessoryType = hasIndicator? UITableViewCellAccessoryDisclosureIndicator: UITableViewCellAccessoryNone;
158158
_pinIconView.hidden=!_project.pin.boolValue;
159-
_setCommonBtn.hidden=!hasBadgeTip;
159+
_setCommonBtn.hidden=!hasSWButtons;
160160
}
161161

162162
- (NSArray *)rightButtons{

Coding_iOS/Views/PopFliterMenu.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,21 @@ - (void)refreshMenuDate
5454
- (void)setup {
5555
self.backgroundColor = [UIColor clearColor];
5656

57-
// typeof(self) __weak weakSelf = self;
5857
_realTimeBlur = [[XHRealTimeBlur alloc] initWithFrame:self.bounds];
5958
_realTimeBlur.blurStyle = XHBlurStyleTranslucentWhite;
6059
_realTimeBlur.showDuration = 0.2;
61-
_realTimeBlur.disMissDuration = 0.3;
60+
_realTimeBlur.disMissDuration = 0.1;
61+
// typeof(self) __weak weakSelf = self;
62+
6263
// _realTimeBlur.willShowBlurViewcomplted = ^(void) {
63-
// [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
64+
// [weakSelf addSubview:weakSelf.tableview];
6465
// };
65-
//
66+
////
6667
// _realTimeBlur.willDismissBlurViewCompleted = ^(void) {
6768
// [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
6869
// };
6970
// _realTimeBlur.didDismissBlurViewCompleted = ^(BOOL finished) {
70-
//// [weakSelf removeFromSuperview];
71+
// [weakSelf removeFromSuperview];
7172
// };
7273
_realTimeBlur.hasTapGestureEnable = YES;
7374

Coding_iOS/Views/TableListView/ProjectListView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ typedef void(^ProjectListViewBlock)(Project *project);
1313

1414
@interface ProjectListView : UIView<UITableViewDataSource, UITableViewDelegate>
1515
@property(nonatomic,assign)BOOL useNewStyle;
16+
@property(copy, nonatomic) void(^clickButtonBlock)(EaseBlankPageType curType);
1617

1718
- (id)initWithFrame:(CGRect)frame projects:(Projects *)projects block:(ProjectListViewBlock)block tabBarHeight:(CGFloat)tabBarHeight;
1819
- (void)setProjects:(Projects *)projects;

0 commit comments

Comments
 (0)