|
@@ -14,6 +14,7 @@ class CommunitySubCommentController: BaseViewController {
|
|
var communityPostDetailModel : CommunityPostDetailModel?
|
|
var communityPostDetailModel : CommunityPostDetailModel?
|
|
var communityPostCommentModel : CommunityPostCommentModel?
|
|
var communityPostCommentModel : CommunityPostCommentModel?
|
|
|
|
|
|
|
|
+ var communityPostReplysModel : CommunityPostReplysModel?
|
|
var communityPostReplyModels = Array<CommunityPostReplyModel>()
|
|
var communityPostReplyModels = Array<CommunityPostReplyModel>()
|
|
var communityPostReplyModel : CommunityPostReplyModel?
|
|
var communityPostReplyModel : CommunityPostReplyModel?
|
|
var keyBoardCommentView:KeyBoardCommentView?
|
|
var keyBoardCommentView:KeyBoardCommentView?
|
|
@@ -28,7 +29,7 @@ class CommunitySubCommentController: BaseViewController {
|
|
}
|
|
}
|
|
|
|
|
|
override func setupViews() {
|
|
override func setupViews() {
|
|
- navigationBar.title = "3条评论"
|
|
|
|
|
|
+ navigationBar.title = "0条评论"
|
|
view.backgroundColor = kf7f8faColor
|
|
view.backgroundColor = kf7f8faColor
|
|
|
|
|
|
view.addSubview(tableView)
|
|
view.addSubview(tableView)
|
|
@@ -108,6 +109,8 @@ extension CommunitySubCommentController {
|
|
func communityPostReplyApi(page:Int) {
|
|
func communityPostReplyApi(page:Int) {
|
|
SwiftMoyaNetWorkServiceCommunity.shared().communityPostReplyApi(postId: communityPostCommentModel?.id ?? 0, page: page) { [weak self] (communityPostReplysModel) -> (Void) in
|
|
SwiftMoyaNetWorkServiceCommunity.shared().communityPostReplyApi(postId: communityPostCommentModel?.id ?? 0, page: page) { [weak self] (communityPostReplysModel) -> (Void) in
|
|
let communityPostReplysModel = communityPostReplysModel as? CommunityPostReplysModel
|
|
let communityPostReplysModel = communityPostReplysModel as? CommunityPostReplysModel
|
|
|
|
+ self?.navigationBar.title = "\(self?.communityPostReplysModel?.pagination?.total ?? 0)条评论"
|
|
|
|
+
|
|
if communityPostReplysModel?.pagination?.currentPage ?? 1 <= communityPostReplysModel?.pagination?.totalPages ?? 1 {
|
|
if communityPostReplysModel?.pagination?.currentPage ?? 1 <= communityPostReplysModel?.pagination?.totalPages ?? 1 {
|
|
if communityPostReplysModel?.pagination?.currentPage == 1{
|
|
if communityPostReplysModel?.pagination?.currentPage == 1{
|
|
self?.communityPostReplyModels.removeAll()
|
|
self?.communityPostReplyModels.removeAll()
|
|
@@ -144,8 +147,9 @@ extension CommunitySubCommentController {
|
|
if self?.communityPostReplyModel != nil {
|
|
if self?.communityPostReplyModel != nil {
|
|
communityPostReplyModel.replyUsername = self?.communityPostReplyModel?.username
|
|
communityPostReplyModel.replyUsername = self?.communityPostReplyModel?.username
|
|
}
|
|
}
|
|
- self?.communityPostReplyModels.insert(communityPostReplyModel, at: 0)
|
|
|
|
|
|
+ self?.communityPostReplysModel?.pagination?.total = 1 + (self?.communityPostReplysModel?.pagination?.total ?? 0)
|
|
self?.tableView.reloadSections([1], with: UITableView.RowAnimation.none)
|
|
self?.tableView.reloadSections([1], with: UITableView.RowAnimation.none)
|
|
|
|
+ self?.navigationBar.title = "\(self?.communityPostReplysModel?.pagination?.total ?? 0)条评论"
|
|
if self?.communityPostReplyModel != nil {
|
|
if self?.communityPostReplyModel != nil {
|
|
VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
|
|
VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
|
|
|
|
|