|
@@ -21,13 +21,11 @@ class CommunityAllCommentView: FWPopupView {
|
|
|
typealias ConfirmPayBlock = (_ pType: PayType) -> Void
|
|
|
var confirmPayBlock : ConfirmPayBlock?
|
|
|
|
|
|
- var curPayType : PayType = PayType.wechatPay
|
|
|
+ var postId: Int?
|
|
|
|
|
|
- var paymentAmount:String? {
|
|
|
- didSet {
|
|
|
- tableView.reloadData()
|
|
|
- }
|
|
|
- }
|
|
|
+ // 评论
|
|
|
+ var communityPostCommentsModel : CommunityPostCommentsModel?
|
|
|
+ var communityPostCommentModels = Array<CommunityPostCommentModel>()
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
|
super.init(frame: frame)
|
|
@@ -39,6 +37,7 @@ class CommunityAllCommentView: FWPopupView {
|
|
|
addSubview(tableView)
|
|
|
|
|
|
setupLayouts()
|
|
|
+ setupData()
|
|
|
}
|
|
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
@@ -68,6 +67,17 @@ class CommunityAllCommentView: FWPopupView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ func setupData() {
|
|
|
+ tableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) {
|
|
|
+ [weak self] (page) in
|
|
|
+ self?.communityPostCommentApi(page: page)
|
|
|
+ }
|
|
|
+ tableView.addFooterWithWithHeader(withAutomaticallyRefresh: true) {
|
|
|
+ [weak self] (page) in
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private lazy var topView: UIView = {
|
|
|
let topView = UIView()
|
|
|
topView.backgroundColor = kffffffColor
|
|
@@ -148,3 +158,22 @@ extension CommunityAllCommentView : UITableViewDelegate, UITableViewDataSource {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+extension CommunityAllCommentView {
|
|
|
+ /// 评论
|
|
|
+ ///
|
|
|
+ /// - Parameters:
|
|
|
+ /// - postId: 内容id
|
|
|
+ /// - page: 分页
|
|
|
+ func communityPostCommentApi(page:Int) {
|
|
|
+ SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(postId: postId ?? 0, page: page) {
|
|
|
+ [weak self] (communityPostCommentsModel) -> (Void) in
|
|
|
+// self?.communityPostCommentsModel = communityPostCommentsModel as? CommunityPostCommentsModel
|
|
|
+// if self?.communityPostCommentsModel?.pagination?.currentPage == 1{
|
|
|
+// self?.communityPostCommentModels.removeAll()
|
|
|
+// }
|
|
|
+// self?.communityPostCommentModels = (self?.communityPostCommentModels)! + (self?.communityPostCommentsModel?.data!)!
|
|
|
+// self?.tableView.reloadData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|