|
@@ -226,6 +226,7 @@ static CGFloat textFieldH = 56;
|
|
commentItemModel.content = text;
|
|
commentItemModel.content = text;
|
|
commentItemModel.friendId = model.friendId;
|
|
commentItemModel.friendId = model.friendId;
|
|
commentItemModel.level = [parameter objectForKey:@"level"];
|
|
commentItemModel.level = [parameter objectForKey:@"level"];
|
|
|
|
+ commentItemModel.commendId = [responseObject objectForKey:@"data"];
|
|
[temp addObject:commentItemModel];
|
|
[temp addObject:commentItemModel];
|
|
model.list = [temp copy];
|
|
model.list = [temp copy];
|
|
[self.tableView reloadRowsAtIndexPaths:@[index] withRowAnimation:UITableViewRowAnimationNone];
|
|
[self.tableView reloadRowsAtIndexPaths:@[index] withRowAnimation:UITableViewRowAnimationNone];
|
|
@@ -362,14 +363,31 @@ static CGFloat textFieldH = 56;
|
|
|
|
|
|
[cell setDidClickCommentLabelBlock:^(NSString *commentId, CGRect rectInWindow, NSIndexPath *indexPath1) {
|
|
[cell setDidClickCommentLabelBlock:^(NSString *commentId, CGRect rectInWindow, NSIndexPath *indexPath1) {
|
|
weakSelf.currentEditingIndexthPath = [NSIndexPath indexPathForRow:indexPath1.row inSection:0];
|
|
weakSelf.currentEditingIndexthPath = [NSIndexPath indexPathForRow:indexPath1.row inSection:0];
|
|
- SDTimeLineCellModel *model1 = weakSelf.dataArray[indexPath1.row];
|
|
|
|
|
|
+ SDTimeLineCellModel *editModel = weakSelf.dataArray[indexPath1.row];
|
|
[weakSelf.textField becomeFirstResponder];
|
|
[weakSelf.textField becomeFirstResponder];
|
|
weakSelf.isReplayingComment = YES;
|
|
weakSelf.isReplayingComment = YES;
|
|
- weakSelf.currentCommentItemModel = [model1.list objectAtIndex:indexPath1.section];
|
|
|
|
|
|
+ weakSelf.currentCommentItemModel = [editModel.list objectAtIndex:indexPath1.section];
|
|
weakSelf.commentToUser = commentId;
|
|
weakSelf.commentToUser = commentId;
|
|
[weakSelf adjustTableViewToFitKeyboard];
|
|
[weakSelf adjustTableViewToFitKeyboard];
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
+ [cell setDidLongTouchCommentLabelBlock:^(NSString *commentId, CGRect rectInWindow, NSIndexPath *indexPath1) {
|
|
|
|
+ //indexPath1 row == table row Section == SDTimeLineCellCommentItemModel.list
|
|
|
|
+ SDTimeLineCellModel *editModel = [weakSelf.dataArray objectAtIndex:indexPath1.row];
|
|
|
|
+ if ([editModel.userId isEqualToString:[SLGlobalInfo SharedInstance].loginInfo.user.userId]) {
|
|
|
|
+ NSMutableArray *temp = [NSMutableArray new];
|
|
|
|
+ [temp addObjectsFromArray:editModel.list];
|
|
|
|
+ SDTimeLineCellCommentItemModel *commentModel = [editModel.list objectAtIndex:indexPath1.section];
|
|
|
|
+ [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Friend/DelateComment" parameter:@{@"commentId":commentModel.commendId} success:^(id responseObject) {
|
|
|
|
+ [temp removeObjectAtIndex:indexPath1.section];
|
|
|
|
+ editModel.list = [temp copy];
|
|
|
|
+ [weakSelf.tableView reloadRowsAtIndexPaths:@[indexPath1] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
|
+ } failure:^(SPRequestError *error) {
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+
|
|
cell.delegate = self;
|
|
cell.delegate = self;
|
|
}
|
|
}
|
|
|
|
|