Skip to content

Commit d2b99a3

Browse files
committed
Merge remote-tracking branch 'coding/master' into dev
Conflicts: Podfile
2 parents f6dee54 + 12df6e7 commit d2b99a3

35 files changed

Lines changed: 1661 additions & 829 deletions

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
4E5C06E81AC2B34800F427C5 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E5C06E71AC2B34800F427C5 /* [email protected] */; };
7878
4E5C06EB1AC4009100F427C5 /* CannotLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5C06EA1AC4009100F427C5 /* CannotLoginViewController.m */; };
7979
4E5C06EE1AC4405300F427C5 /* PasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5C06ED1AC4405300F427C5 /* PasswordViewController.m */; };
80+
4E5F39021AC951060010515D /* TaskCommentCCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5F39011AC951060010515D /* TaskCommentCCell.m */; };
81+
4E5F39051ACA958C0010515D /* TopicCommentCCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5F39041ACA958C0010515D /* TopicCommentCCell.m */; };
82+
4E5F39071ACBFDCD0010515D /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E5F39061ACBFDCD0010515D /* [email protected] */; };
8083
4E66EE261A28226000DA1B3E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E66EE211A28226000DA1B3E /* [email protected] */; };
8184
4E66EE271A28226000DA1B3E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E66EE221A28226000DA1B3E /* [email protected] */; };
8285
4E66EE281A28226000DA1B3E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E66EE231A28226000DA1B3E /* [email protected] */; };
@@ -704,6 +707,11 @@
704707
4E5C06EA1AC4009100F427C5 /* CannotLoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CannotLoginViewController.m; sourceTree = "<group>"; };
705708
4E5C06EC1AC4405300F427C5 /* PasswordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasswordViewController.h; sourceTree = "<group>"; };
706709
4E5C06ED1AC4405300F427C5 /* PasswordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PasswordViewController.m; sourceTree = "<group>"; };
710+
4E5F39001AC951060010515D /* TaskCommentCCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskCommentCCell.h; sourceTree = "<group>"; };
711+
4E5F39011AC951060010515D /* TaskCommentCCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskCommentCCell.m; sourceTree = "<group>"; };
712+
4E5F39031ACA958C0010515D /* TopicCommentCCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopicCommentCCell.h; sourceTree = "<group>"; };
713+
4E5F39041ACA958C0010515D /* TopicCommentCCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopicCommentCCell.m; sourceTree = "<group>"; };
714+
4E5F39061ACBFDCD0010515D /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
707715
4E66EE211A28226000DA1B3E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
708716
4E66EE221A28226000DA1B3E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
709717
4E66EE231A28226000DA1B3E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -2237,6 +2245,7 @@
22372245
8E97CE561A0A3424006F9AD7 /* keyboard */ = {
22382246
isa = PBXGroup;
22392247
children = (
2248+
4E5F39061ACBFDCD0010515D /* [email protected] */,
22402249
8E97CE6B1A0B243B006F9AD7 /* [email protected] */,
22412250
8E97CE571A0A3424006F9AD7 /* [email protected] */,
22422251
8E97CE581A0A3424006F9AD7 /* [email protected] */,
@@ -2927,6 +2936,10 @@
29272936
8EF6436019FF7E2900F7EEB0 /* TweetMediaItemSingleCCell.m */,
29282937
8EF6436119FF7E2900F7EEB0 /* TweetSendImageCCell.h */,
29292938
8EF6436219FF7E2900F7EEB0 /* TweetSendImageCCell.m */,
2939+
4E5F39001AC951060010515D /* TaskCommentCCell.h */,
2940+
4E5F39011AC951060010515D /* TaskCommentCCell.m */,
2941+
4E5F39031ACA958C0010515D /* TopicCommentCCell.h */,
2942+
4E5F39041ACA958C0010515D /* TopicCommentCCell.m */,
29302943
);
29312944
path = CCell;
29322945
sourceTree = "<group>";
@@ -3279,6 +3292,7 @@
32793292
8EA6D18319E240C40076D59C /* [email protected] in Resources */,
32803293
8EA6D19719E240C40076D59C /* [email protected] in Resources */,
32813294
8E97CEB91A0C7E26006F9AD7 /* [email protected] in Resources */,
3295+
4E5F39071ACBFDCD0010515D /* [email protected] in Resources */,
32823296
4E76D4DE1A5A7B4A0094A35E /* [email protected] in Resources */,
32833297
8E7612F21A08A4EB005BE797 /* code.html in Resources */,
32843298
4E96E7E41A1B537E0037C098 /* [email protected] in Resources */,
@@ -3532,6 +3546,7 @@
35323546
4E03ACA61A5D2060002B000B /* UIVerticalAlignmentLabel.m in Sources */,
35333547
4E6BA2DF1A1EE6AF005FD721 /* AFURLRequestSerialization.m in Sources */,
35343548
8EA6D1CD19E240C40076D59C /* UIUnderlinedButton.m in Sources */,
3549+
4E5F39021AC951060010515D /* TaskCommentCCell.m in Sources */,
35353550
4ECE8AD91A3943E80021E29C /* UIViewController+DownMenu.m in Sources */,
35363551
8EA6D23819E240C40076D59C /* ProjectTasksView.m in Sources */,
35373552
8EA6D13019E240C40076D59C /* LikersViewController.m in Sources */,
@@ -3634,6 +3649,7 @@
36343649
8E64ED7C19ED0CE3006E99DA /* QBAssetsCollectionFooterView.m in Sources */,
36353650
8E6F1C951A03BD6000BF79C8 /* ProjectMemberActivityListViewController.m in Sources */,
36363651
8EA6D13619E240C40076D59C /* BaseViewController.m in Sources */,
3652+
4E5F39051ACA958C0010515D /* TopicCommentCCell.m in Sources */,
36373653
4E15C7D61A271A6300FB8DAD /* EaseToolBar.m in Sources */,
36383654
4E6BA2D81A1EE6AF005FD721 /* AFHTTPRequestOperationManager.m in Sources */,
36393655
4ECE8AE21A3943E80021E29C /* UIColor+expanded.m in Sources */,

Coding_iOS/AppDelegate.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
6161
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
6262
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
6363

64+
//sd加载的数据类型
65+
[[[SDWebImageManager sharedManager] imageDownloader] setValue:@"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" forHTTPHeaderField:@"Accept"];
66+
6467
//设置导航条样式
6568
[self customizeInterface];
6669

67-
6870
if ([Login isLogin]) {
6971
[self setupTabViewController];
7072
}else{

Coding_iOS/Coding_iOS-Prefix.pch.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,15 @@
8181
#define kHigher_iOS_6_1_DIS(_X_) ([[NSNumber numberWithBool:kHigher_iOS_6_1] intValue] * _X_)
8282
#define kNotHigher_iOS_6_1_DIS(_X_) (-([[NSNumber numberWithBool:kHigher_iOS_6_1] intValue]-1) * _X_)
8383

84+
#define kDevice_Is_iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
8485
#define kDevice_Is_iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
8586
#define kDevice_Is_iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
8687

8788
#define kScreen_Bounds [UIScreen mainScreen].bounds
8889
#define kScreen_Height [UIScreen mainScreen].bounds.size.height
8990
#define kScreen_Width [UIScreen mainScreen].bounds.size.width
9091
#define kPaddingLeftWidth 15.0
92+
#define kLoginPaddingLeftWidth 18.0
9193
#define kMySegmentControl_Height 44.0
9294
#define kMySegmentControlIcon_Height 70.0
9395

Coding_iOS/Controllers/ConversationViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ - (void)viewDidLoad
5858
// _refreshControl = [[ODRefreshControl alloc] initInScrollView:self.myTableView];
5959
// [_refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
6060

61-
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewTypeMedia placeHolder:@"请输入私信内容"];
62-
_myMsgInputView.contentType = UIMessageInputViewContentTypePriMsg;
61+
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewContentTypePriMsg placeHolder:@"请输入私信内容"];
6362
_myMsgInputView.isAlwaysShow = YES;
6463
_myMsgInputView.delegate = self;
6564

Coding_iOS/Controllers/EditTaskViewController.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ - (void)viewDidLoad
5555
_myCopyTask = [Task taskWithTask:_myTask];
5656

5757
//评论
58-
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewTypeSimple];
59-
_myMsgInputView.contentType = UIMessageInputViewContentTypeTask;
58+
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewContentTypeTask];
6059
_myMsgInputView.isAlwaysShow = YES;
6160
_myMsgInputView.delegate = self;
6261

@@ -82,6 +81,7 @@ - (void)viewDidLoad
8281
[tableView registerClass:[TaskContentCell class] forCellReuseIdentifier:kCellIdentifier_TaskContent];
8382
[tableView registerClass:[LeftImage_LRTextCell class] forCellReuseIdentifier:kCellIdentifier_LeftImage_LRText];
8483
[tableView registerClass:[TaskCommentCell class] forCellReuseIdentifier:kCellIdentifier_TaskComment];
84+
[tableView registerClass:[TaskCommentCell class] forCellReuseIdentifier:kCellIdentifier_TaskComment_Media];
8585
[tableView registerClass:[TaskCommentBlankCell class] forCellReuseIdentifier:kCellIdentifier_TaskCommentBlank];
8686
[tableView registerClass:[TaskCommentTopCell class] forCellReuseIdentifier:kCellIdentifier_TaskCommentTop];
8787
[tableView registerClass:[TaskDescriptionCell class] forCellReuseIdentifier:kCellIdentifier_TaskDescriptionCell];
@@ -371,8 +371,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
371371
return cell;
372372
}else{
373373
if ([self hasComment]) {
374-
TaskCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TaskComment forIndexPath:indexPath];
375374
TaskComment *curComment = [_myCopyTask.commentList objectAtIndex:indexPath.row-1];
375+
TaskCommentCell *cell;
376+
if (curComment.htmlMedia.imageItems.count > 0) {
377+
cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TaskComment_Media forIndexPath:indexPath];
378+
}else{
379+
cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TaskComment forIndexPath:indexPath];
380+
}
376381
cell.curComment = curComment;
377382
cell.backgroundColor = kColorTableBG;
378383
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:20];

Coding_iOS/Controllers/RootControllers/BaseViewController.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#import "EditTaskViewController.h"
1818
#import "ProjectViewController.h"
1919
#import "NProjectViewController.h"
20+
#import "UserTweetsViewController.h"
2021
#import "Coding_NetAPIManager.h"
2122
#import "AppDelegate.h"
2223
#import "WebViewController.h"
@@ -139,6 +140,7 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr{
139140
UIViewController *analyseVC = nil;
140141

141142
NSString *userRegexStr = @"/u/([^/]+)$";
143+
NSString *userTweetRegexStr = @"/u/([^/]+)/bubble$";
142144
NSString *ppRegexStr = @"/u/([^/]+)/pp/([0-9]+)$";
143145
NSString *topicRegexStr = @"/u/([^/]+)/p/([^/]+)/topic/(\\d+)";
144146
NSString *taskRegexStr = @"/u/([^/]+)/p/([^/]+)/task/(\\d+)";
@@ -152,6 +154,12 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr{
152154
UserInfoViewController *vc = [[UserInfoViewController alloc] init];
153155
vc.curUser = [User userWithGlobalKey:user_global_key];
154156
analyseVC = vc;
157+
}else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex:userTweetRegexStr]).count > 0){
158+
//某人的冒泡
159+
UserTweetsViewController *vc = [[UserTweetsViewController alloc] init];
160+
NSString *user_global_key = matchedCaptures[1];
161+
vc.curTweets = [Tweets tweetsWithUser:[User userWithGlobalKey:user_global_key]];
162+
analyseVC = vc;
155163
}else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex:ppRegexStr]).count > 0){
156164
//冒泡
157165
NSString *user_global_key = matchedCaptures[1];

Coding_iOS/Controllers/RootControllers/Tweet_RootViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ - (void)viewDidLoad
107107
[_refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
108108

109109
//评论
110-
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewTypeSimple];
111-
_myMsgInputView.contentType = UIMessageInputViewContentTypeTweet;
110+
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewContentTypeTweet];
112111
_myMsgInputView.delegate = self;
113112

114113
[self refreshFirst];

Coding_iOS/Controllers/TopicDetailViewController.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ - (void)viewDidLoad
5858
tableView.dataSource = self;
5959
[tableView registerClass:[TopicContentCell class] forCellReuseIdentifier:kCellIdentifier_TopicContent];
6060
[tableView registerClass:[TopicCommentCell class] forCellReuseIdentifier:kCellIdentifier_TopicComment];
61+
[tableView registerClass:[TopicCommentCell class] forCellReuseIdentifier:kCellIdentifier_TopicComment_Media];
6162
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
6263
[self.view addSubview:tableView];
6364
[tableView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -70,8 +71,7 @@ - (void)viewDidLoad
7071

7172
//评论
7273
__weak typeof(self) weakSelf = self;
73-
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewTypeSimple];
74-
_myMsgInputView.contentType = UIMessageInputViewContentTypeTopic;
74+
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewContentTypeTopic];
7575
_myMsgInputView.isAlwaysShow = YES;
7676
_myMsgInputView.delegate = self;
7777

@@ -254,8 +254,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
254254
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0];
255255
return cell;
256256
}else{
257-
TopicCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TopicComment forIndexPath:indexPath];
258257
ProjectTopic *toComment = [_curTopic.comments.list objectAtIndex:indexPath.row-1];
258+
259+
TopicCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:toComment.htmlMedia.imageItems.count > 0? kCellIdentifier_TopicComment_Media: kCellIdentifier_TopicComment forIndexPath:indexPath];
259260
cell.toComment = toComment;
260261
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:45];
261262
return cell;

Coding_iOS/Controllers/TweetDetailViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ - (void)viewDidLoad
7272
[_refreshControl addTarget:self action:@selector(refreshTweet) forControlEvents:UIControlEventValueChanged];
7373

7474
//评论
75-
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewTypeSimple];
76-
_myMsgInputView.contentType = UIMessageInputViewContentTypeTweet;
75+
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewContentTypeTweet];
7776
_myMsgInputView.isAlwaysShow = YES;
7877
_myMsgInputView.delegate = self;
7978

Coding_iOS/Controllers/UserTweetsViewController.m

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ - (void)viewDidLoad
7171

7272
//评论
7373
__weak typeof(self) weakSelf = self;
74-
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewTypeSimple];
75-
_myMsgInputView.contentType = UIMessageInputViewContentTypeTweet;
74+
_myMsgInputView = [UIMessageInputView messageInputViewWithType:UIMessageInputViewContentTypeTweet];
7675
_myMsgInputView.delegate = self;
7776

7877
[_myTableView addInfiniteScrollingWithActionHandler:^{
@@ -176,6 +175,11 @@ - (void)sendRequest{
176175
[self.view beginLoading];
177176
}
178177
__weak typeof(self) weakSelf = self;
178+
if (_curTweets.curUser.name.length <= 0) {
179+
[self refreshCurUser];
180+
return;
181+
}
182+
179183
[[Coding_NetAPIManager sharedManager] request_Tweets_WithObj:_curTweets andBlock:^(id data, NSError *error) {
180184
[weakSelf.refreshControl endRefreshing];
181185
[weakSelf.view endLoading];
@@ -191,6 +195,24 @@ - (void)sendRequest{
191195
}];
192196
}
193197

198+
199+
- (void)refreshCurUser{
200+
__weak typeof(self) weakSelf = self;
201+
[[Coding_NetAPIManager sharedManager] request_UserInfo_WithObj:_curTweets.curUser andBlock:^(id data, NSError *error) {
202+
if (data) {
203+
weakSelf.curTweets.curUser = data;
204+
weakSelf.title = weakSelf.curTweets.curUser.name;
205+
[weakSelf sendRequest];
206+
}else{
207+
[weakSelf.view endLoading];
208+
[weakSelf.view configBlankPage:([[Login curLoginUser] isSameToUser:self.curTweets.curUser]? EaseBlankPageTypeTweet: EaseBlankPageTypeTweetOther) hasData:(weakSelf.curTweets.list.count > 0) hasError:YES reloadButtonBlock:^(id sender) {
209+
[weakSelf sendRequest];
210+
}];
211+
}
212+
}];
213+
}
214+
215+
194216
#pragma mark TableM
195217
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
196218
if (_curTweets && _curTweets.list) {

0 commit comments

Comments
 (0)