Skip to content

Commit 9228368

Browse files
张达棣张达棣
authored andcommitted
更新个人主页
1 parent bd9f23e commit 9228368

File tree

68 files changed

+1595
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1595
-112
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 87 additions & 31 deletions
Large diffs are not rendered by default.

Coding_iOS.xcworkspace/xcshareddata/Coding_iOS.xcscmblueprint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "433ECD69-91E4-4E60-9763-B27EA86C3648",
1212
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
13-
"0BE8B4916C79C0D6BC415A5C19AC33B37D62A706" : "Coding-iOS\/Coding_iOS\/Resources\/webview\/",
13+
"0BE8B4916C79C0D6BC415A5C19AC33B37D62A706" : "Coding-iOS--826169105\/Coding_iOS\/Resources\/webview\/",
1414
"B810104048DF61B07FF1F2922D434EA5073F4362" : "Coding_iOS",
15-
"9F3660E5AC46AAE96CC141F90EBB3A671D67F2C2" : "Coding-iOS\/"
15+
"9F3660E5AC46AAE96CC141F90EBB3A671D67F2C2" : "Coding-iOS--826169105\/"
1616
},
1717
"DVTSourceControlWorkspaceBlueprintNameKey" : "Coding_iOS",
1818
"DVTSourceControlWorkspaceBlueprintVersion" : 204,

Coding_iOS/.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS/Coding_iOS-Prefix.pch.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#import <ReactiveCocoa/RACEXTScope.h>
3939
#import "UIImageView+WebCache.h"
4040
#import <Masonry/Masonry.h>
41+
#import "UIView+SDAutoLayout.h"
42+
#import "UITableView+SDAutoTableViewCellHeight.h"
4143

4244
#import "BaseNavigationController.h"
4345
#import "BaseViewController.h"
@@ -193,4 +195,4 @@
193195
/** defines a weak `self` named `__weakSelf` */
194196
#define ESWeakSelf ESWeak(self, __weakSelf);
195197
/** defines a strong `self` named `_self` from `__weakSelf` */
196-
#define ESStrongSelf ESStrong(__weakSelf, _self);
198+
#define ESStrongSelf ESStrong(__weakSelf, _self);

Coding_iOS/Controllers/MeDisplayViewController.m

Lines changed: 85 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#import "SVPullToRefresh.h"
2020
#import "Coding_NetAPIManager.h"
2121
#import "SettingMineInfoViewController.h"
22-
22+
#import "EaseUserInfoCell.h"
23+
#import "UserActiveGraphCell.h"
2324

2425
@interface MeDisplayViewController ()
25-
@property (strong, nonatomic) UIView *tableHeaderView;
2626
@property (strong, nonatomic) EaseUserHeaderView *eaV;
2727
@property (strong, nonatomic) UIView *sectionHeaderView;
2828

@@ -31,13 +31,13 @@ @interface MeDisplayViewController ()
3131
@property (strong, nonatomic) NSMutableArray *dataList;//特指「话题列表」的数据
3232
@property (assign, nonatomic) BOOL canLoadMore, willLoadMore, isLoading;
3333
@property (nonatomic, assign) NSInteger curPage;
34-
34+
@property (nonatomic, strong) EaseUserInfoCell *userInfoCell;
35+
@property (nonatomic, strong) ActivenessModel *activenessModel;
3536
@end
3637

3738
@implementation MeDisplayViewController
3839

3940
- (void)viewDidLoad{
40-
_curUser = [Login curLoginUser];
4141
_dataIndex = 0;
4242
_dataList = @[].mutableCopy;
4343
_canLoadMore = YES;
@@ -47,30 +47,39 @@ - (void)viewDidLoad{
4747
[super viewDidLoad];
4848
self.title = @"个人主页";
4949
[self.myTableView registerClass:[CSTopicCell class] forCellReuseIdentifier:kCellIdentifier_TopicCell];
50+
[self.myTableView registerClass:[UserActiveGraphCell class] forCellReuseIdentifier:kCellIdentifier_UserActiveGraphCell];
5051
[self setupHeaderV];
5152
}
5253

54+
- (void)viewWillAppear:(BOOL)animated {
55+
[super viewWillAppear:animated];
56+
_curUser = [Login curLoginUser];
57+
[self.myTableView reloadData];
58+
59+
}
60+
5361
- (void)setupHeaderV{
5462
__weak typeof(self) weakSelf = self;
55-
if (!_tableHeaderView) {
56-
_eaV = [EaseUserHeaderView userHeaderViewWithUser:_curUser image:[StartImagesManager shareManager].curImage.image];
57-
_eaV.userIconClicked = ^(){
58-
[weakSelf userIconClicked];
59-
};
60-
_eaV.fansCountBtnClicked = ^(){
61-
[weakSelf fansCountBtnClicked];
62-
};
63-
_eaV.followsCountBtnClicked = ^(){
64-
[weakSelf followsCountBtnClicked];
65-
};
66-
_eaV.nameBtnClicked = ^(){
67-
[weakSelf goToSettingInfo];
68-
};
69-
_eaV.clipsToBounds = YES;
70-
_tableHeaderView = [[UIView alloc] initWithFrame:_eaV.bounds];
71-
[_tableHeaderView addSubview:_eaV];
72-
self.myTableView.tableHeaderView = _tableHeaderView;
73-
}
63+
_userInfoCell = [[EaseUserInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellIdentifier_EaseUserInfoCell];
64+
_userInfoCell.userIconClicked = ^(){
65+
[weakSelf userIconClicked]; //用户头像点击
66+
};
67+
_userInfoCell.fansCountBtnClicked = ^(){
68+
[weakSelf fansCountBtnClicked]; //粉丝
69+
};
70+
_userInfoCell.followsCountBtnClicked = ^(){
71+
[weakSelf followsCountBtnClicked]; //关注
72+
};
73+
_userInfoCell.editButtonClicked = ^(){
74+
[weakSelf goToSettingInfo]; //编辑
75+
};
76+
77+
[[Coding_NetAPIManager sharedManager] request_Users_activenessWithGlobalKey:_curUser.global_key andBlock:^(ActivenessModel *data, NSError *error) {
78+
weakSelf.activenessModel = data;
79+
[weakSelf.myTableView reloadData];
80+
}];
81+
82+
7483
if (!_sectionHeaderView) {
7584
_sectionHeaderView = [[XTSegmentControl alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, 44.0) Items:@[@"冒泡", @"话题"] selectedBlock:^(NSInteger index) {
7685
weakSelf.dataIndex = index;
@@ -93,6 +102,13 @@ - (void)setDataIndex:(NSInteger)dataIndex{
93102

94103
- (void)refresh{
95104
if (_dataIndex == 0) {
105+
_curUser = [Login curLoginUser];
106+
[self.myTableView reloadData];
107+
__weak typeof(self) weakSelf = self;
108+
[[Coding_NetAPIManager sharedManager] request_Users_activenessWithGlobalKey:_curUser.global_key andBlock:^(ActivenessModel *data, NSError *error) {
109+
weakSelf.activenessModel = data;
110+
[weakSelf.myTableView reloadData];
111+
}];
96112
[super refresh];
97113
}else{
98114
if (!_isLoading) {
@@ -133,7 +149,9 @@ - (void)requestTopicsMore:(BOOL)loadMore{
133149
[weakSelf.myTableView reloadData];
134150
weakSelf.myTableView.showsInfiniteScrolling = hasMoreData;
135151
}
136-
[weakSelf.view configBlankPage:EaseBlankPageTypeMyJoinedTopic hasData:weakSelf.dataList.count > 0 hasError:error != nil offsetY:[_eaV originalHeight] + 60 reloadButtonBlock:^(id sender) {
152+
153+
CGFloat offsetY = _userInfoCell.frame.size.height + [UserActiveGraphCell cellHeight] + 100;
154+
[weakSelf.view configBlankPage:EaseBlankPageTypeMyJoinedTopic hasData:weakSelf.dataList.count > 0 hasError:error != nil offsetY:offsetY reloadButtonBlock:^(id sender) {
137155
[weakSelf refresh];
138156
}];
139157

@@ -173,15 +191,38 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView{
173191
}
174192

175193
#pragma mark TableM
194+
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
195+
return 3;
196+
}
197+
176198
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
199+
if (section < 2) {
200+
return nil;
201+
}
177202
return self.sectionHeaderView;
203+
178204
}
179205

180206
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
207+
if (section < 2) {
208+
return 0.0;
209+
}
181210
return 44.0;
182211
}
183212

213+
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
214+
if (section < 2) {
215+
return 20;
216+
}
217+
218+
return 0;
219+
}
220+
221+
184222
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
223+
if (section < 2) {
224+
return 1;
225+
}
185226
if (_dataIndex == 0) {
186227
return [super tableView:tableView numberOfRowsInSection:section];
187228
}else{
@@ -190,9 +231,18 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
190231
}
191232

192233
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
193-
if (_dataIndex == 0) {
234+
if (indexPath.section == 0) {
235+
EaseUserInfoCell *cell = self.userInfoCell;
236+
cell.user = _curUser;
237+
return cell;
238+
} else if (indexPath.section == 1) {
239+
UserActiveGraphCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_UserActiveGraphCell forIndexPath:indexPath];
240+
cell.activenessModel = _activenessModel;
241+
return cell;
242+
243+
} else if (_dataIndex == 0) {
194244
return [super tableView:tableView cellForRowAtIndexPath:indexPath];
195-
}else{
245+
} else{
196246
NSDictionary *topic = _dataList[indexPath.row];
197247
CSTopicCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TopicCell forIndexPath:indexPath];
198248
[cell updateDisplayByTopic:topic];
@@ -202,7 +252,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
202252
}
203253

204254
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
205-
if (_dataIndex == 0) {
255+
if (indexPath.section == 0) {
256+
return [tableView cellHeightForIndexPath:indexPath model:_curUser keyPath:@"user" cellClass:[EaseUserInfoCell class] contentViewWidth:kScreen_Width];
257+
258+
} else if (indexPath.section == 1) {
259+
return [UserActiveGraphCell cellHeight];
260+
} else if (_dataIndex == 0) {
206261
return [super tableView:tableView heightForRowAtIndexPath:indexPath];
207262
}else{
208263
NSDictionary *topic = _dataList[indexPath.row];
@@ -211,6 +266,9 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
211266
}
212267

213268
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
269+
if (indexPath.section < 2) {
270+
return;
271+
}
214272
if (_dataIndex == 0) {
215273
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
216274
}else{

Coding_iOS/Controllers/RootControllers/MyTask_RootViewController.m

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "Coding_NetAPIManager.h"
1212
#import "EditTaskViewController.h"
1313
#import "RDVTabBarController.h"
14+
#import "TaskSelectionView.h"
1415

1516
@interface MyTask_RootViewController ()
1617

@@ -20,6 +21,12 @@ @interface MyTask_RootViewController ()
2021

2122
@property (strong, nonatomic) XTSegmentControl *mySegmentControl;
2223
@property (strong, nonatomic) iCarousel *myCarousel;
24+
25+
@property (strong, nonatomic) UIButton *titleBtn;
26+
@property (nonatomic,assign) NSInteger selectNum; //筛选状态
27+
@property (nonatomic, strong) TaskSelectionView *myFliterMenu;
28+
29+
2330
@end
2431

2532
@implementation MyTask_RootViewController
@@ -46,7 +53,7 @@ - (void)viewDidLoad
4653
{
4754
[super viewDidLoad];
4855
// Do any additional setup after loading the view.
49-
self.title = @"我的任务";
56+
[self setupTitleBtn];
5057

5158
_myProjects = [Projects projectsWithType:ProjectsTypeAll andUser:nil];
5259
_myProTksDict = [[NSMutableDictionary alloc] initWithCapacity:1];
@@ -69,6 +76,20 @@ - (void)viewDidLoad
6976
icarousel;
7077
});
7178
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"addBtn_Nav"] style:UIBarButtonItemStylePlain target:self action:@selector(addItemClicked:)];
79+
80+
81+
82+
//初始化过滤目录
83+
_myFliterMenu = [[TaskSelectionView alloc] initWithFrame:CGRectMake(0, 64, kScreen_Width, kScreen_Height - 64) items:nil];
84+
__weak typeof(self) weakSelf = self;
85+
_myFliterMenu.clickBlock = ^(NSInteger pageIndex){
86+
[weakSelf.titleBtn setTitle:weakSelf.myFliterMenu.items[pageIndex] forState:UIControlStateNormal];
87+
};
88+
_myFliterMenu.closeBlock=^(){
89+
[weakSelf.myFliterMenu dismissMenu];
90+
};
91+
92+
7293
}
7394

7495
- (void)addItemClicked:(id)sender{
@@ -194,4 +215,40 @@ - (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel{
194215
}];
195216
}
196217

218+
- (void)setupTitleBtn{
219+
if (!_titleBtn) {
220+
_titleBtn = [UIButton new];
221+
[_titleBtn setTitleColor:kColorNavTitle forState:UIControlStateNormal];
222+
[_titleBtn.titleLabel setFont:[UIFont systemFontOfSize:kNavTitleFontSize]];
223+
[_titleBtn addTarget:self action:@selector(fliterClicked:) forControlEvents:UIControlEventTouchUpInside];
224+
self.navigationItem.titleView = _titleBtn;
225+
[self setTitleBtnStr:@"我的任务"];
226+
}
227+
}
228+
229+
- (void)setTitleBtnStr:(NSString *)titleStr{
230+
if (_titleBtn) {
231+
CGFloat titleWidth = [titleStr getWidthWithFont:_titleBtn.titleLabel.font constrainedToSize:CGSizeMake(kScreen_Width, 30)];
232+
CGFloat imageWidth = 12;
233+
CGFloat btnWidth = titleWidth +imageWidth;
234+
_titleBtn.frame = CGRectMake((kScreen_Width-btnWidth)/2, (44-30)/2, btnWidth, 30);
235+
_titleBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWidth, 0, imageWidth);
236+
_titleBtn.imageEdgeInsets = UIEdgeInsetsMake(0, titleWidth, 0, -titleWidth);
237+
[_titleBtn setTitle:titleStr forState:UIControlStateNormal];
238+
[_titleBtn setImage:[UIImage imageNamed:@"btn_fliter_down"] forState:UIControlStateNormal];
239+
}
240+
}
241+
242+
-(void)fliterClicked:(id)sender{
243+
if (_myFliterMenu.showStatus) {
244+
[_myFliterMenu dismissMenu];
245+
}else {
246+
[_myFliterMenu showMenuAtView:kKeyWindow];
247+
}
248+
249+
250+
}
251+
252+
253+
197254
@end

0 commit comments

Comments
 (0)