|
@@ -11,8 +11,9 @@ import IQKeyboardManagerSwift
|
|
|
|
|
|
class CommunitySubCommentController: BaseViewController {
|
|
class CommunitySubCommentController: BaseViewController {
|
|
|
|
|
|
- var postId : Int?
|
|
|
|
|
|
+ var communityPostDetailModel : CommunityPostDetailModel?
|
|
var communityPostCommentModel : CommunityPostCommentModel?
|
|
var communityPostCommentModel : CommunityPostCommentModel?
|
|
|
|
+
|
|
var communityPostReplyModels = Array<CommunityPostReplyModel>()
|
|
var communityPostReplyModels = Array<CommunityPostReplyModel>()
|
|
var communityPostReplyModel : CommunityPostReplyModel?
|
|
var communityPostReplyModel : CommunityPostReplyModel?
|
|
|
|
|
|
@@ -102,7 +103,7 @@ extension CommunitySubCommentController {
|
|
|
|
|
|
func communityPostCommentApi(text:String) {
|
|
func communityPostCommentApi(text:String) {
|
|
let communityCustomCommnetModel = CommunityCustomCommnetModel()
|
|
let communityCustomCommnetModel = CommunityCustomCommnetModel()
|
|
- communityCustomCommnetModel.postId = postId ?? 0
|
|
|
|
|
|
+ communityCustomCommnetModel.postId = communityPostDetailModel?.id ?? 0
|
|
communityCustomCommnetModel.content = text
|
|
communityCustomCommnetModel.content = text
|
|
communityCustomCommnetModel.parentId = communityPostCommentModel?.id
|
|
communityCustomCommnetModel.parentId = communityPostCommentModel?.id
|
|
communityCustomCommnetModel.replyUid = communityPostReplyModel?.uid
|
|
communityCustomCommnetModel.replyUid = communityPostReplyModel?.uid
|
|
@@ -124,6 +125,15 @@ extension CommunitySubCommentController {
|
|
self?.communityPostReplyModels.insert(communityPostReplyModel, at: 0)
|
|
self?.communityPostReplyModels.insert(communityPostReplyModel, at: 0)
|
|
self?.tableView.reloadSections([1], with: UITableView.RowAnimation.none)
|
|
self?.tableView.reloadSections([1], with: UITableView.RowAnimation.none)
|
|
self?.commentInputView.sendSuccess()
|
|
self?.commentInputView.sendSuccess()
|
|
|
|
+
|
|
|
|
+ if self?.communityPostReplyModel != nil {
|
|
|
|
+ VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, communityPostCommentModel: (self?.communityPostCommentModel)!)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|