瀏覽代碼

传参类型Fixed

Chris 5 年之前
父節點
當前提交
4e0f5faf5b

+ 7 - 7
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -85,7 +85,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     typealias ShareClosure = () -> Void
     var shareClosure : ShareClosure?
     
-    typealias ButtonClickClosure = (_ clickType: videoBtnClickType, _ uid: Int) -> Void
+    typealias ButtonClickClosure = (_ clickType: videoBtnClickType, _ uid: Int, _ postId: Int) -> Void
     var buttonClickClosure : ButtonClickClosure?
     
     class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> CommunityVideoCoverCollectionCell {
@@ -439,7 +439,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         commentBtn.titleLabel?.font = kRegularFont14
         commentBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
             if let buttonClickClosure = self?.buttonClickClosure {
-                buttonClickClosure(videoBtnClickType.typeComment, self?.videoItemMdl?.uid ?? 0)
+                buttonClickClosure(videoBtnClickType.typeComment, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
             }
         }).disposed(by: disposeBag)
         return commentBtn
@@ -464,7 +464,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
             }
             // 点击回调
             if let buttonClickClosure = self?.buttonClickClosure {
-                buttonClickClosure(videoBtnClickType.typeCollect, self?.videoItemMdl?.uid ?? 0)
+                buttonClickClosure(videoBtnClickType.typeCollect, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
             }
         }).disposed(by: disposeBag)
         return collectBtn
@@ -489,7 +489,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
             }
             // 点击回调
             if let buttonClickClosure = self?.buttonClickClosure {
-                buttonClickClosure(videoBtnClickType.typeLike, self?.videoItemMdl?.uid ?? 0)
+                buttonClickClosure(videoBtnClickType.typeLike, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
             }
         }).disposed(by: disposeBag)
         return likeBtn
@@ -515,7 +515,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         let textBtn = UIButton(type: UIButton.ButtonType.custom)
         textBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
             if let buttonClickClosure = self?.buttonClickClosure {
-                buttonClickClosure(videoBtnClickType.typeComment, self?.videoItemMdl?.uid ?? 0)
+                buttonClickClosure(videoBtnClickType.typeComment, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
             }
         }).disposed(by: disposeBag)
         return textBtn
@@ -569,7 +569,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         avatarButton.rx.tap.subscribe(onNext: {
             [weak self] (data) in
             if let buttonClickClosure = self?.buttonClickClosure {
-                buttonClickClosure(videoBtnClickType.typePerson, self?.videoItemMdl?.uid ?? 0)
+                buttonClickClosure(videoBtnClickType.typePerson, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
             }
         }).disposed(by: disposeBag)
         return avatarButton
@@ -590,7 +590,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         followButton.setTitleColor(kffffffColor, for: .normal)
         followButton.rx.tap.subscribe(onNext: {[weak self] (data) in
             if let buttonClickClosure = self?.buttonClickClosure {
-                buttonClickClosure(videoBtnClickType.typeFollow, self?.videoItemMdl?.uid ?? 0)
+                buttonClickClosure(videoBtnClickType.typeFollow, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
             }
         }).disposed(by: disposeBag)
         return followButton

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -136,10 +136,10 @@ extension CommunityVideoListController: UICollectionViewDelegateFlowLayout,UICol
             print("------点击了[分享]")
         }
         cell.buttonClickClosure = {
-            [weak self] (clickType, uid) in
+            [weak self] (clickType, uid, postId) in
             switch clickType {
             case videoBtnClickType.typeComment:
-                self?.showCommentView(uid: uid)
+                self?.showCommentView(postId: postId)
                 
             case videoBtnClickType.typeLike:
                 VirusViewModel.shared.praise(communityVideoItemModel: (self?.videoItemList?[indexPath.row])!)
@@ -218,9 +218,9 @@ extension CommunityVideoListController {
         }
     }
     
-    func showCommentView(uid: Int) {
+    func showCommentView(postId: Int) {
         
-        AlertSheetView.commentAlertSheetView(postId: uid, cancelClosure: {
+        AlertSheetView.commentAlertSheetView(postId: postId, cancelClosure: {
             [weak self] in
             
         }) {