Browse Source

视频播放页的评论 - 首条评论后列表未展示

Chris 5 years ago
parent
commit
26f51eead3

+ 2 - 18
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -4050,28 +4050,11 @@
 			sourceTree = "<group>";
 		};
 		A7DAB33122D875C0005B964E /* CommunityVideoSubCommentController */ = {
-			isa = PBXGroup;
-			children = (
-				A7DAB33722DB315E005B964E /* ViewController */,
-				A7DAB33622DB3153005B964E /* View */,
-			);
-			path = CommunityVideoSubCommentController;
-			sourceTree = "<group>";
-		};
-		A7DAB33622DB3153005B964E /* View */ = {
-			isa = PBXGroup;
-			children = (
-				BD37E38622CE200E003A14A2 /* CommunityAllCommentView.swift */,
-			);
-			path = View;
-			sourceTree = "<group>";
-		};
-		A7DAB33722DB315E005B964E /* ViewController */ = {
 			isa = PBXGroup;
 			children = (
 				BDF7C5DA22D72405007F3B79 /* CommunityVideoSubCommentController.swift */,
 			);
-			path = ViewController;
+			path = CommunityVideoSubCommentController;
 			sourceTree = "<group>";
 		};
 		A7DF50D922A556C300998908 /* BrowsePictures */ = {
@@ -4794,6 +4777,7 @@
 				BD27F0B122CC9E2A00A6514D /* CommunityVideoPlayView.swift */,
 				BD37E38222CDF5BA003A14A2 /* CommunityVideoTopicView.swift */,
 				BD37E38422CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift */,
+				BD37E38622CE200E003A14A2 /* CommunityAllCommentView.swift */,
 				BDF7C5D822D70B6E007F3B79 /* CommunityVideoMajorCommentCell.swift */,
 			);
 			path = View;

+ 9 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/View/CommunityAllCommentView.swift

@@ -4,7 +4,7 @@
 //
 //  Created by Christopher on 2019/7/4.
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  评价View
+//  视频列表页--评价View
 
 import UIKit
 import FWPopupView
@@ -288,6 +288,14 @@ extension CommunityAllCommentView {
                 communityPostCommentModel.username = UserModel.shared().getModel()?.username
                 communityPostCommentModel.uid = UserModel.shared().getModel()?.uid
                 self?.communityPostCommentModels.insert(communityPostCommentModel, at: 0)
+                
+                // 若此条评论前列表没有评论,显示table
+                let preTotalComments: Int = self?.communityPostCommentsModel?.pagination?.total ?? 0
+                if preTotalComments == 0 {
+                    self?.tableView.isHidden = false
+                    self?.noCommentsLabel.isHidden = true
+                }
+                
                 let count = 1 + (self?.communityPostCommentsModel?.pagination?.total ?? 0)
                 self?.communityPostCommentsModel?.pagination?.total = count
                 self?.titleLabel.text = "全部评论 \(count)"
@@ -320,5 +328,4 @@ extension CommunityAllCommentView {
         }
     }
     
-    
 }

RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/ViewController/CommunityVideoSubCommentController.swift → RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/CommunityVideoSubCommentController.swift