2
0
Quellcode durchsuchen

朋友圈详情

桂欢 vor 2 Jahren
Ursprung
Commit
69a21fb61f

+ 16 - 0
SLAiELTS/SLAiELTS.xcodeproj/project.pbxproj

@@ -12,6 +12,9 @@
 		3D19CBF829E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBF229E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.m */; };
 		3D19CBF829E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBF229E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.m */; };
 		3D19CBF929E7ABFD0041A6B8 /* UITableView+Refresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBF329E7ABFD0041A6B8 /* UITableView+Refresh.m */; };
 		3D19CBF929E7ABFD0041A6B8 /* UITableView+Refresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBF329E7ABFD0041A6B8 /* UITableView+Refresh.m */; };
 		3D19CBFA29E7ABFD0041A6B8 /* TTTableViewPlaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBF629E7ABFD0041A6B8 /* TTTableViewPlaceView.m */; };
 		3D19CBFA29E7ABFD0041A6B8 /* TTTableViewPlaceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBF629E7ABFD0041A6B8 /* TTTableViewPlaceView.m */; };
+		3D19CBFE29E7DF6B0041A6B8 /* SLMomentsCommentVc.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CBFC29E7DF6B0041A6B8 /* SLMomentsCommentVc.m */; };
+		3D19CBFF29E7DF6B0041A6B8 /* SLMomentsCommentVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D19CBFD29E7DF6B0041A6B8 /* SLMomentsCommentVc.xib */; };
+		3D19CC0229E7E9340041A6B8 /* SLMomentDetailTableVc.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D19CC0129E7E9340041A6B8 /* SLMomentDetailTableVc.m */; };
 		3D1B986529BEAF2F0008D01A /* SLHorScrBtns.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1B986429BEAF2F0008D01A /* SLHorScrBtns.m */; };
 		3D1B986529BEAF2F0008D01A /* SLHorScrBtns.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1B986429BEAF2F0008D01A /* SLHorScrBtns.m */; };
 		3D1B986929BEAFEB0008D01A /* SLHorScrBtns.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D1B986829BEAFEB0008D01A /* SLHorScrBtns.xib */; };
 		3D1B986929BEAFEB0008D01A /* SLHorScrBtns.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D1B986829BEAFEB0008D01A /* SLHorScrBtns.xib */; };
 		3D1B987229BEB35B0008D01A /* SLHorScrBtnsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1B987029BEB35B0008D01A /* SLHorScrBtnsCell.m */; };
 		3D1B987229BEB35B0008D01A /* SLHorScrBtnsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D1B987029BEB35B0008D01A /* SLHorScrBtnsCell.m */; };
@@ -261,6 +264,11 @@
 		3D19CBF529E7ABFD0041A6B8 /* CYLTableViewPlaceHolderDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CYLTableViewPlaceHolderDelegate.h; sourceTree = "<group>"; };
 		3D19CBF529E7ABFD0041A6B8 /* CYLTableViewPlaceHolderDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CYLTableViewPlaceHolderDelegate.h; sourceTree = "<group>"; };
 		3D19CBF629E7ABFD0041A6B8 /* TTTableViewPlaceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTTableViewPlaceView.m; sourceTree = "<group>"; };
 		3D19CBF629E7ABFD0041A6B8 /* TTTableViewPlaceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTTableViewPlaceView.m; sourceTree = "<group>"; };
 		3D19CBF729E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+CYLTableViewPlaceHolder.h"; sourceTree = "<group>"; };
 		3D19CBF729E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+CYLTableViewPlaceHolder.h"; sourceTree = "<group>"; };
+		3D19CBFB29E7DF6B0041A6B8 /* SLMomentsCommentVc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLMomentsCommentVc.h; sourceTree = "<group>"; };
+		3D19CBFC29E7DF6B0041A6B8 /* SLMomentsCommentVc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLMomentsCommentVc.m; sourceTree = "<group>"; };
+		3D19CBFD29E7DF6B0041A6B8 /* SLMomentsCommentVc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLMomentsCommentVc.xib; sourceTree = "<group>"; };
+		3D19CC0029E7E9340041A6B8 /* SLMomentDetailTableVc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLMomentDetailTableVc.h; sourceTree = "<group>"; };
+		3D19CC0129E7E9340041A6B8 /* SLMomentDetailTableVc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLMomentDetailTableVc.m; sourceTree = "<group>"; };
 		3D1B986329BEAF2F0008D01A /* SLHorScrBtns.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLHorScrBtns.h; sourceTree = "<group>"; };
 		3D1B986329BEAF2F0008D01A /* SLHorScrBtns.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLHorScrBtns.h; sourceTree = "<group>"; };
 		3D1B986429BEAF2F0008D01A /* SLHorScrBtns.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLHorScrBtns.m; sourceTree = "<group>"; };
 		3D1B986429BEAF2F0008D01A /* SLHorScrBtns.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLHorScrBtns.m; sourceTree = "<group>"; };
 		3D1B986829BEAFEB0008D01A /* SLHorScrBtns.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLHorScrBtns.xib; sourceTree = "<group>"; };
 		3D1B986829BEAFEB0008D01A /* SLHorScrBtns.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLHorScrBtns.xib; sourceTree = "<group>"; };
@@ -1415,6 +1423,11 @@
 				3D5BC38C29E3F87100748197 /* SLFriensInfoVc.h */,
 				3D5BC38C29E3F87100748197 /* SLFriensInfoVc.h */,
 				3D5BC38D29E3F87100748197 /* SLFriensInfoVc.m */,
 				3D5BC38D29E3F87100748197 /* SLFriensInfoVc.m */,
 				3D5BC38E29E3F87100748197 /* SLFriensInfoVc.xib */,
 				3D5BC38E29E3F87100748197 /* SLFriensInfoVc.xib */,
+				3D19CBFB29E7DF6B0041A6B8 /* SLMomentsCommentVc.h */,
+				3D19CBFC29E7DF6B0041A6B8 /* SLMomentsCommentVc.m */,
+				3D19CBFD29E7DF6B0041A6B8 /* SLMomentsCommentVc.xib */,
+				3D19CC0029E7E9340041A6B8 /* SLMomentDetailTableVc.h */,
+				3D19CC0129E7E9340041A6B8 /* SLMomentDetailTableVc.m */,
 			);
 			);
 			path = TimeLineController;
 			path = TimeLineController;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1850,6 +1863,7 @@
 				3D24D40329DE96A700014D1C /* SLAddressBookVc.xib in Resources */,
 				3D24D40329DE96A700014D1C /* SLAddressBookVc.xib in Resources */,
 				3D1B988B29BEF1020008D01A /* SLLxTopCell.xib in Resources */,
 				3D1B988B29BEF1020008D01A /* SLLxTopCell.xib in Resources */,
 				3D25107029AD8AA9000AE530 /* SLRoleLabelViewController.xib in Resources */,
 				3D25107029AD8AA9000AE530 /* SLRoleLabelViewController.xib in Resources */,
+				3D19CBFF29E7DF6B0041A6B8 /* SLMomentsCommentVc.xib in Resources */,
 				3DB97D9A29D6ABF000B12754 /* LICENSE in Resources */,
 				3DB97D9A29D6ABF000B12754 /* LICENSE in Resources */,
 				3D1B989029BEF1AC0008D01A /* SLVocabularyCell.xib in Resources */,
 				3D1B989029BEF1AC0008D01A /* SLVocabularyCell.xib in Resources */,
 				3D1B988029BEEA670008D01A /* SLVocabularyView.xib in Resources */,
 				3D1B988029BEEA670008D01A /* SLVocabularyView.xib in Resources */,
@@ -1969,6 +1983,7 @@
 				3D2510D129AF3DC4000AE530 /* SLLoginInfo.m in Sources */,
 				3D2510D129AF3DC4000AE530 /* SLLoginInfo.m in Sources */,
 				3D8C9F8229AC57F200678283 /* ViewController.m in Sources */,
 				3D8C9F8229AC57F200678283 /* ViewController.m in Sources */,
 				3D24987429AC7909003C3AFA /* UIViewController+Extension.m in Sources */,
 				3D24987429AC7909003C3AFA /* UIViewController+Extension.m in Sources */,
+				3D19CC0229E7E9340041A6B8 /* SLMomentDetailTableVc.m in Sources */,
 				3D25105B29AC9475000AE530 /* SLForgetPWViewController.m in Sources */,
 				3D25105B29AC9475000AE530 /* SLForgetPWViewController.m in Sources */,
 				3D2510C429AF1B24000AE530 /* ZFToast.m in Sources */,
 				3D2510C429AF1B24000AE530 /* ZFToast.m in Sources */,
 				3DB97DA229D6ABF000B12754 /* MLExpressionManager.m in Sources */,
 				3DB97DA229D6ABF000B12754 /* MLExpressionManager.m in Sources */,
@@ -1977,6 +1992,7 @@
 				3DB97D4229D6A86E00B12754 /* SDTimeLineTableHeaderView.m in Sources */,
 				3DB97D4229D6A86E00B12754 /* SDTimeLineTableHeaderView.m in Sources */,
 				3D2510C729AF1D29000AE530 /* NSString+Category.m in Sources */,
 				3D2510C729AF1D29000AE530 /* NSString+Category.m in Sources */,
 				3D2DC3E729B099C90041A729 /* YMChatServiceView.m in Sources */,
 				3D2DC3E729B099C90041A729 /* YMChatServiceView.m in Sources */,
+				3D19CBFE29E7DF6B0041A6B8 /* SLMomentsCommentVc.m in Sources */,
 				3D19CBF829E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.m in Sources */,
 				3D19CBF829E7ABFD0041A6B8 /* UITableView+CYLTableViewPlaceHolder.m in Sources */,
 				3DA5AF5C29B8843C009E4925 /* SLBaseTabBarController.m in Sources */,
 				3DA5AF5C29B8843C009E4925 /* SLBaseTabBarController.m in Sources */,
 				3D2DC3E029B0991E0041A729 /* YMIMMessageCollectionView.m in Sources */,
 				3D2DC3E029B0991E0041A729 /* YMIMMessageCollectionView.m in Sources */,

+ 5 - 8
SLAiELTS/SLAiELTS/Tool/SDPhotoBrowser/SDPhotoBrowser.m

@@ -100,12 +100,7 @@
     WS(weakSelf);
     WS(weakSelf);
     [_operationLikeButton handleEvent:UIControlEventTouchUpInside withBlock:^{
     [_operationLikeButton handleEvent:UIControlEventTouchUpInside withBlock:^{
         weakSelf.operationLikeButton.selected = !weakSelf.operationLikeButton.selected;
         weakSelf.operationLikeButton.selected = !weakSelf.operationLikeButton.selected;
-        weakSelf.cellModel.isLike = weakSelf.operationLikeButton.selected;
-        [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Friend/LikeHe" parameter:@{@"friendId":weakSelf.cellModel.friendId} success:^(id responseObject) {
-            [[NSNotificationCenter defaultCenter] postNotificationName:@"SLMomentsUpdate" object:nil];
-        } failure:^(SPRequestError *error) {
-            
-        }];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"SLMomentsUpdate" object:nil userInfo:[weakSelf.cellModel mj_JSONObject]];
     }];
     }];
     _operationLikeButton.selected = self.cellModel.isLike;
     _operationLikeButton.selected = self.cellModel.isLike;
 
 
@@ -115,7 +110,8 @@
     [_operationCommentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     [_operationCommentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     [_operationCommentButton setImage:[UIImage imageNamed:@"icon_moents_chat"] forState:UIControlStateNormal];
     [_operationCommentButton setImage:[UIImage imageNamed:@"icon_moents_chat"] forState:UIControlStateNormal];
     [_operationCommentButton handleEvent:UIControlEventTouchUpInside withBlock:^{
     [_operationCommentButton handleEvent:UIControlEventTouchUpInside withBlock:^{
-        
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"SLMomentsCommentUpdate" object:nil userInfo:[weakSelf.cellModel mj_JSONObject]];
+        [weakSelf removeFromSuperview];
     }];
     }];
     
     
     [self addSubview:_operationLikeButton];
     [self addSubview:_operationLikeButton];
@@ -135,7 +131,8 @@
     
     
     UIButton *detailBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     UIButton *detailBtn = [UIButton buttonWithType:UIButtonTypeCustom];
     [detailBtn handleEvent:UIControlEventTouchUpInside withBlock:^{
     [detailBtn handleEvent:UIControlEventTouchUpInside withBlock:^{
-            
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"SLMomentsDetail" object:nil userInfo:[weakSelf.cellModel mj_JSONObject]];
+        [weakSelf removeFromSuperview];
     }];
     }];
     [detailBtn setTitle:@"详情" forState:UIControlStateNormal];
     [detailBtn setTitle:@"详情" forState:UIControlStateNormal];
     detailBtn.titleLabel.font = [UIFont systemFontOfSize:10];
     detailBtn.titleLabel.font = [UIFont systemFontOfSize:10];

+ 97 - 43
SLAiELTS/SLAiELTS/ViewControllers/TimeLine/TimeLineController/SDTimeLineTableViewController.m

@@ -38,7 +38,10 @@
 #import "UIView+SDAutoLayout.h"
 #import "UIView+SDAutoLayout.h"
 #import "LEETheme.h"
 #import "LEETheme.h"
 #import "GlobalDefines.h"
 #import "GlobalDefines.h"
+
 #import "SLMoentsChatView.h"
 #import "SLMoentsChatView.h"
+#import "SLMomentsCommentVc.h"
+#import "SLMomentDetailTableVc.h"
 
 
 #define kTimeLineTableViewCellId @"SDTimeLineCell"
 #define kTimeLineTableViewCellId @"SDTimeLineCell"
 
 
@@ -67,7 +70,6 @@ static CGFloat textFieldH = 56;
 - (void)viewDidLoad
 - (void)viewDidLoad
 {
 {
     [super viewDidLoad];
     [super viewDidLoad];
-
     if (@available(iOS 11.0, *)) {
     if (@available(iOS 11.0, *)) {
         self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
         self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
     } else {
     } else {
@@ -89,6 +91,9 @@ static CGFloat textFieldH = 56;
 
 
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardNotification:) name:UIKeyboardWillChangeFrameNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardNotification:) name:UIKeyboardWillChangeFrameNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(momentsUpdate:) name:@"SLMomentsUpdate" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(momentsUpdate:) name:@"SLMomentsUpdate" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(momentsCommentUpdate:) name:@"SLMomentsCommentUpdate" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(momentsDetail:) name:@"SLMomentsDetail" object:nil];
+
     [self creatModelsWithCount:0];
     [self creatModelsWithCount:0];
     
     
 }
 }
@@ -116,8 +121,92 @@ static CGFloat textFieldH = 56;
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 }
 
 
-- (void)momentsUpdate:(NSNotificationCenter *)conter {
-    [self creatModelsWithCount:0];
+- (void)momentsDetail:(NSNotification *)notification {
+    NSDictionary *dict = notification.userInfo;
+    SDTimeLineCellModel *model = [SDTimeLineCellModel mj_objectWithKeyValues:dict];
+    __block NSInteger i = 0;
+    __block SDTimeLineCellModel *cModel;
+    [self.dataArray enumerateObjectsUsingBlock:^(SDTimeLineCellModel * obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        if ([obj.friendId isEqualToString:model.friendId]) {
+            i = idx;
+            cModel = obj;
+            *stop = YES;
+        }
+    }];
+    SLMomentDetailTableVc *vc = [[SLMomentDetailTableVc alloc] init];
+    vc.dataArray = [NSMutableArray arrayWithObject:cModel];
+    [vc.tableView reloadData];
+    [self.rdv_tabBarController.navigationController pushViewController:vc animated:YES];
+}
+
+- (void)momentsUpdate:(NSNotification *)notification {
+    NSDictionary *dict = notification.userInfo;
+    SDTimeLineCellModel *model = [SDTimeLineCellModel mj_objectWithKeyValues:dict];
+    __block NSInteger i = 0;
+    __block SDTimeLineCellModel *cModel;
+    [self.dataArray enumerateObjectsUsingBlock:^(SDTimeLineCellModel * obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        if ([obj.friendId isEqualToString:model.friendId]) {
+            i = idx;
+            cModel = obj;
+            *stop = YES;
+        }
+    }];
+    [self updateCellLike:cModel index:[NSIndexPath indexPathForRow:i inSection:0]];
+}
+
+- (void)momentsCommentUpdate:(NSNotification *)notification {
+    NSDictionary *dict = notification.userInfo;
+    SDTimeLineCellModel *model = [SDTimeLineCellModel mj_objectWithKeyValues:dict];
+    __block NSInteger i = 0;
+    __block SDTimeLineCellModel *cModel;
+    [self.dataArray enumerateObjectsUsingBlock:^(SDTimeLineCellModel * obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        if ([obj.friendId isEqualToString:model.friendId]) {
+            i = idx;
+            cModel = obj;
+            *stop = YES;
+        }
+    }];
+    SLMomentsCommentVc *vc = [SLMomentsCommentVc loadViewControllewWithNib];
+    WS(weakSelf);
+    vc.momentsCommentBlock = ^(NSString * _Nonnull text) {
+        [self updateCommentWithModel:cModel index:[NSIndexPath indexPathForRow:i inSection:0] text:text];
+    };
+    [self.rdv_tabBarController.navigationController pushViewController:vc animated:YES];
+}
+
+- (void)updateCommentWithModel:(SDTimeLineCellModel *)model index:(NSIndexPath *)index text:(NSString *)text {
+    NSMutableArray *temp = [NSMutableArray new];
+    [temp addObjectsFromArray:model.list];
+    NSDictionary *parameter = @{@"commendId" : @"",
+                                @"friendId" : model.friendId,
+                                @"replyUserId" : @"",
+                                @"content" : text ?: @"",
+                                @"level" : @"0",
+    };
+    if (self.isReplayingComment) {
+        parameter = @{@"commendId" : self.currentCommentItemModel.commendId ?: @"",
+                      @"friendId" : self.currentCommentItemModel.friendId ?: @"",
+                      @"replyUserId" : self.currentCommentItemModel.userId ?: @"",
+                      @"content" : text ?: @"",
+                      @"level" : @"0",
+        };
+        self.isReplayingComment = NO;
+    }
+    [[SLHttpCenter SharedInstance] postWithUrl:@"/api/Friend/InsertComment" parameter:parameter success:^(id responseObject) {
+        SDTimeLineCellCommentItemModel *commentItemModel = [SDTimeLineCellCommentItemModel new];
+        SLLoginInfo *targetModel = [SLGlobalInfo SharedInstance].loginInfo;
+        commentItemModel.userName = targetModel.user.name;
+        commentItemModel.userId = targetModel.user.userId;
+        commentItemModel.replyUserName = self.currentCommentItemModel.userName;
+        commentItemModel.content = text;
+        commentItemModel.friendId = model.friendId;
+        commentItemModel.level = [parameter objectForKey:@"level"];
+        [temp addObject:commentItemModel];
+        model.list = [temp copy];
+        [self.tableView reloadRowsAtIndexPaths:@[index] withRowAnimation:UITableViewRowAnimationNone];
+    } failure:^(SPRequestError *error) {
+        
+    }];
 }
 }
 
 
 - (void)setupTextField
 - (void)setupTextField
@@ -135,39 +224,7 @@ static CGFloat textFieldH = 56;
         [weakSelf.textField resignFirstResponder];
         [weakSelf.textField resignFirstResponder];
         [weakSelf.view endEditing:YES];
         [weakSelf.view endEditing:YES];
         SDTimeLineCellModel *model = weakSelf.dataArray[weakSelf.currentEditingIndexthPath.row];
         SDTimeLineCellModel *model = weakSelf.dataArray[weakSelf.currentEditingIndexthPath.row];
-        NSMutableArray *temp = [NSMutableArray new];
-        [temp addObjectsFromArray:model.list];
-        NSDictionary *parameter = @{@"commendId" : @"",
-                                    @"friendId" : model.friendId,
-                                    @"replyUserId" : @"",
-                                    @"content" : text ?: @"",
-                                    @"level" : @"0",
-        };
-        if (weakSelf.isReplayingComment) {
-            parameter = @{@"commendId" : weakSelf.currentCommentItemModel.commendId ?: @"",
-                          @"friendId" : weakSelf.currentCommentItemModel.friendId ?: @"",
-                          @"replyUserId" : weakSelf.currentCommentItemModel.userId ?: @"",
-                          @"content" : text ?: @"",
-                          @"level" : @"0",
-            };
-            weakSelf.isReplayingComment = NO;
-        }
-        [[SLHttpCenter SharedInstance] postWithUrl:@"/api/Friend/InsertComment" parameter:parameter success:^(id responseObject) {
-            SDTimeLineCellCommentItemModel *commentItemModel = [SDTimeLineCellCommentItemModel new];
-            SLLoginInfo *targetModel = [SLGlobalInfo SharedInstance].loginInfo;
-            commentItemModel.userName = targetModel.user.name;
-            commentItemModel.userId = targetModel.user.userId;
-            commentItemModel.replyUserName = weakSelf.currentCommentItemModel.userName;
-            commentItemModel.content = text;
-            commentItemModel.friendId = model.friendId;
-            commentItemModel.level = [parameter objectForKey:@"level"];
-            [temp addObject:commentItemModel];
-            model.list = [temp copy];
-            [weakSelf.tableView reloadRowsAtIndexPaths:@[weakSelf.currentEditingIndexthPath] withRowAnimation:UITableViewRowAnimationNone];
-            
-        } failure:^(SPRequestError *error) {
-            
-        }];
+        [weakSelf updateCommentWithModel:model index:weakSelf.currentEditingIndexthPath text:text];
         weakSelf.textField.text = @"";
         weakSelf.textField.text = @"";
     };
     };
 }
 }
@@ -242,9 +299,6 @@ static CGFloat textFieldH = 56;
         }];
         }];
         
         
         [cell setDidClickCommentLabelBlock:^(NSString *commentId, CGRect rectInWindow,  NSIndexPath *indexPath1) {
         [cell setDidClickCommentLabelBlock:^(NSString *commentId, CGRect rectInWindow,  NSIndexPath *indexPath1) {
-            NSLog(@"===----%ld",indexPath.row);
-            NSLog(@"===----%ld",indexPath1.row);
-//            weakSelf.textField.placeholder = [NSString stringWithFormat:@"  回复:%@", commentId];
             weakSelf.currentEditingIndexthPath = [NSIndexPath indexPathForRow:indexPath1.row inSection:0];
             weakSelf.currentEditingIndexthPath = [NSIndexPath indexPathForRow:indexPath1.row inSection:0];
             SDTimeLineCellModel *model1 = weakSelf.dataArray[indexPath1.row];
             SDTimeLineCellModel *model1 = weakSelf.dataArray[indexPath1.row];
             [weakSelf.textField becomeFirstResponder];
             [weakSelf.textField becomeFirstResponder];
@@ -285,11 +339,8 @@ static CGFloat textFieldH = 56;
 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
 - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
 {
 {
     [_textField resignFirstResponder];
     [_textField resignFirstResponder];
-//    _textField.placeholder = nil;
 }
 }
 
 
-
-
 - (CGFloat)cellContentViewWith
 - (CGFloat)cellContentViewWith
 {
 {
     CGFloat width = [UIScreen mainScreen].bounds.size.width;
     CGFloat width = [UIScreen mainScreen].bounds.size.width;
@@ -317,8 +368,11 @@ static CGFloat textFieldH = 56;
 {
 {
     NSIndexPath *index = [self.tableView indexPathForCell:cell];
     NSIndexPath *index = [self.tableView indexPathForCell:cell];
     SDTimeLineCellModel *model = self.dataArray[index.row];
     SDTimeLineCellModel *model = self.dataArray[index.row];
+    [self updateCellLike:model index:index];
+}
+
+- (void)updateCellLike:(SDTimeLineCellModel *)model index:(NSIndexPath *)index {
     NSMutableArray *temp = [NSMutableArray arrayWithArray:model.likeItemsArray];
     NSMutableArray *temp = [NSMutableArray arrayWithArray:model.likeItemsArray];
-    
     [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Friend/LikeHe" parameter:@{@"friendId":model.friendId} success:^(id responseObject) {
     [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Friend/LikeHe" parameter:@{@"friendId":model.friendId} success:^(id responseObject) {
         
         
     } failure:^(SPRequestError *error) {
     } failure:^(SPRequestError *error) {

+ 16 - 0
SLAiELTS/SLAiELTS/ViewControllers/TimeLine/TimeLineController/SLMomentDetailTableVc.h

@@ -0,0 +1,16 @@
+//
+//  SLMomentDetailTableVc.h
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/4/13.
+//
+
+#import "SDTimeLineTableViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SLMomentDetailTableVc : SDTimeLineTableViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 50 - 0
SLAiELTS/SLAiELTS/ViewControllers/TimeLine/TimeLineController/SLMomentDetailTableVc.m

@@ -0,0 +1,50 @@
+//
+//  SLMomentDetailTableVc.m
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/4/13.
+//
+
+#import "SLMomentDetailTableVc.h"
+
+@interface SLMomentDetailTableVc ()
+
+@end
+
+@implementation SLMomentDetailTableVc
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    YMNavigationBar *navigationBar = [[YMNavigationBar alloc] initWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, kNavBarHeight)];
+    navigationBar.separatorColor = SLBgColor;
+    navigationBar.separatorHeight = 1.0f;
+    UIImage *backImage =[UIImage imageNamed:@"icon_nav_back"];
+    YMBarButtonItem *backBarButtonItem =[[YMBarButtonItem alloc]initWithImage:backImage style:YMBarButtonItemPlain target:self action:@selector(backBarButtonPressed:)];
+    backBarButtonItem.imageInsets = UIEdgeInsetsMake(0, 5, 0, 0);
+    backBarButtonItem.title = @"取消";
+    navigationBar.leftBarButtonItem = backBarButtonItem;
+    navigationBar.titleItem.title = @"详情";
+    self.tableView.tableHeaderView = navigationBar;
+}
+
+- (void)backBarButtonPressed:(id)pressed {
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (void)creatModelsWithCount:(NSInteger)count {
+
+}
+
+#pragma mark - Table view data source
+
+//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+//#warning Incomplete implementation, return the number of sections
+//    return 0;
+//}
+//
+//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+//#warning Incomplete implementation, return the number of rows
+//    return 0;
+//}
+
+@end

+ 19 - 0
SLAiELTS/SLAiELTS/ViewControllers/TimeLine/TimeLineController/SLMomentsCommentVc.h

@@ -0,0 +1,19 @@
+//
+//  SLMomentsCommentVc.h
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/4/13.
+//
+
+#import "SLBaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef void(^SLMomentsCommentBlock)(NSString *text);
+
+@interface SLMomentsCommentVc : SLBaseViewController
+
+@property (nonatomic, copy) SLMomentsCommentBlock momentsCommentBlock;
+@end
+
+NS_ASSUME_NONNULL_END

+ 57 - 0
SLAiELTS/SLAiELTS/ViewControllers/TimeLine/TimeLineController/SLMomentsCommentVc.m

@@ -0,0 +1,57 @@
+//
+//  SLMomentsCommentVc.m
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/4/13.
+//
+
+#import "SLMomentsCommentVc.h"
+#import "PlaceholderTextView.h"
+
+@interface SLMomentsCommentVc ()
+@property (weak, nonatomic) IBOutlet PlaceholderTextView *textView;
+@property (weak, nonatomic) IBOutlet UILabel *numbelLabel;
+
+@end
+
+@implementation SLMomentsCommentVc
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view from its nib.
+    self.title = @"评论";
+    self.view.backgroundColor = [UIColor whiteColor];
+    UIImage *backImage =[UIImage imageNamed:@"icon_nav_back"];
+    YMBarButtonItem *backBarButtonItem =[[YMBarButtonItem alloc]initWithImage:backImage style:YMBarButtonItemPlain target:self action:@selector(backBarButtonPressed:)];
+    backBarButtonItem.imageInsets = UIEdgeInsetsMake(0, 5, 0, 0);
+    backBarButtonItem.title = @"取消";
+    self.navigationBar.leftBarButtonItem = backBarButtonItem;
+    
+    self.textView.placeholder = @"请输入...";
+    self.textView.font = [UIFont systemFontOfSize:14];
+    self.textView.textColor = SL333Color;
+    
+    YMBarButtonItem *rightBarItem = [[YMBarButtonItem alloc] initWithTitle:@"发布  " target:self action:@selector(preserveBtnClick)];
+    rightBarItem.titleInsets = UIEdgeInsetsMake(0, 0, 0, 20);
+    self.navigationBar.rightBarButtonItem = rightBarItem;
+}
+
+- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
+    NSString *toBeString = [textView.text stringByReplacingCharactersInRange:range withString:text];
+    if (toBeString.length > 500) {
+        return NO;
+    }
+    self.numbelLabel.text = [NSString stringWithFormat:@"%ld/500",toBeString.length];
+    return YES;
+}
+
+- (void)preserveBtnClick {
+    if (self.momentsCommentBlock) {
+        self.momentsCommentBlock(self.textView.text);
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [self.navigationController popViewControllerAnimated:YES];
+        });
+    }
+}
+
+@end

+ 71 - 0
SLAiELTS/SLAiELTS/ViewControllers/TimeLine/TimeLineController/SLMomentsCommentVc.xib

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_0" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SLMomentsCommentVc">
+            <connections>
+                <outlet property="numbelLabel" destination="6o2-3n-j5s" id="p1N-43-7we"/>
+                <outlet property="textView" destination="TF7-ij-FCC" id="DHJ-dK-c9A"/>
+                <outlet property="view" destination="AOD-EN-2Gp" id="UCy-nY-guX"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="AOD-EN-2Gp">
+            <rect key="frame" x="0.0" y="0.0" width="390" height="844"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TF7-ij-FCC" customClass="PlaceholderTextView">
+                    <rect key="frame" x="16" y="97" width="358" height="160"/>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="160" id="0J3-od-tyv"/>
+                    </constraints>
+                    <connections>
+                        <outlet property="delegate" destination="-1" id="icx-Hf-OFD"/>
+                    </connections>
+                </view>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0/500" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6o2-3n-j5s">
+                    <rect key="frame" x="340" y="242.66666666666666" width="34" height="14.333333333333343"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                    <color key="textColor" systemColor="systemGray2Color"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aWc-yO-WqE" userLabel="lineView">
+                    <rect key="frame" x="16" y="260" width="358" height="1"/>
+                    <color key="backgroundColor" red="0.94901960780000005" green="0.95294117649999999" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="1" id="WJb-UQ-hdi"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="PfR-Ut-vcP"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="aWc-yO-WqE" firstAttribute="bottom" secondItem="6o2-3n-j5s" secondAttribute="bottom" constant="4" id="5U6-kg-xBk"/>
+                <constraint firstItem="PfR-Ut-vcP" firstAttribute="trailing" secondItem="TF7-ij-FCC" secondAttribute="trailing" constant="16" id="GPm-wv-QVG"/>
+                <constraint firstItem="TF7-ij-FCC" firstAttribute="leading" secondItem="PfR-Ut-vcP" secondAttribute="leading" constant="16" id="Tut-N4-XkF"/>
+                <constraint firstItem="TF7-ij-FCC" firstAttribute="top" secondItem="PfR-Ut-vcP" secondAttribute="top" constant="50" id="e35-Jz-FIx"/>
+                <constraint firstItem="6o2-3n-j5s" firstAttribute="bottom" secondItem="TF7-ij-FCC" secondAttribute="bottom" id="lx6-pJ-EqN"/>
+                <constraint firstItem="aWc-yO-WqE" firstAttribute="leading" secondItem="AOD-EN-2Gp" secondAttribute="leading" constant="16" id="pF4-AB-byY"/>
+                <constraint firstItem="6o2-3n-j5s" firstAttribute="trailing" secondItem="TF7-ij-FCC" secondAttribute="trailing" id="pnW-YD-ZLZ"/>
+                <constraint firstAttribute="trailing" secondItem="aWc-yO-WqE" secondAttribute="trailing" constant="16" id="zAY-JX-h0D"/>
+            </constraints>
+            <point key="canvasLocation" x="-1040" y="59"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemGray2Color">
+            <color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+    </resources>
+</document>