南鑫林 5 роки тому
батько
коміт
285df9d7cf

+ 1 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/CommentList/CardContentCommentListTableViewCell.swift

@@ -112,20 +112,16 @@ extension CardContentCommentListTableViewCell : UITableViewDelegate,UITableViewD
     func numberOfSections(in tableView: UITableView) -> Int {
         if communityType == .follow {
             return communityFollowDataModel?.relateData?.postComment?.isEmpty ?? true ? 0 : 1
-
         }else {
             return communityRecommendDataModel?.comment?.isEmpty ?? true ? 0 : 1
-
         }
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         if communityType == .follow {
-            return communityFollowDataModel?.relateData?.postComment?.isEmpty ?? true ? 0 : communityFollowDataModel?.relateData?.postComment?.count ?? 0
-
+            return communityFollowDataModel?.relateData?.postComment?.isEmpty ?? true ? 0 : communityFollowDataModel?.relateData?.postComment?.prefix(2).count ?? 0
         }else {
             return communityRecommendDataModel?.comment?.isEmpty ?? true ? 0 : communityRecommendDataModel?.comment?.prefix(2).count ?? 0
-
         }
     }
     

+ 17 - 2
RainbowPlanet/RainbowPlanet/Tools/CommentInputView/CommentInputView.swift

@@ -9,8 +9,8 @@
 import UIKit
 import IQKeyboardManagerSwift
 import RxSwift
-
-class CommentInputView: UIView {
+import FWPopupView
+class CommentInputView: FWPopupView {
     
     let disposeBag = DisposeBag()
     /// 上下间距
@@ -159,6 +159,21 @@ class CommentInputView: UIView {
     
     typealias KeyboardWillHideNotificationClosure = () -> Void
     var  keyboardWillHideNotificationClosure : KeyboardWillHideNotificationClosure?
+    
+    /// 初始化
+    class func commentInputView() -> CommentInputView {
+        let view = CommentInputView(isHidden: true)
+        let vProperty = FWPopupViewProperty()
+        vProperty.popupCustomAlignment = .bottomCenter
+        vProperty.popupViewEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+        vProperty.popupAnimationType = .frame
+        vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
+        vProperty.touchWildToHide = "1"
+        view.vProperty = vProperty
+        view.show()
+        return view
+    }
+    
 }
 
 extension CommentInputView : UITextViewDelegate {

+ 0 - 2
RainbowPlanet/RainbowPlanet/Tools/CommentInputView/CommentReplyView.swift

@@ -17,8 +17,6 @@ class CommentReplyView: FWPopupView {
     var userName : String = ""
     var content : String = ""
     
-    
-    
     override init(frame: CGRect) {
         super.init(frame: frame)
     }