瀏覽代碼

1.解决相册问题

wenweiwei 3 年之前
父節點
當前提交
4fac209977

二進制
BFFramework/Assets/base/icon_authorError@2x.png


+ 16 - 3
BFFramework/Classes/Base/Controller/PQPhotoAlbumController.swift

@@ -45,7 +45,7 @@ class PQPhotoAlbumController: PQBaseViewController {
         let emptyRemindView = PQEmptyRemindView(frame: albaumCollectionView.bounds)
         emptyRemindView.isHidden = true
         albaumCollectionView.addSubview(emptyRemindView)
-        emptyRemindView.backgroundColor = UIColor.hexColor(hexadecimal: "#242424")
+        emptyRemindView.backgroundColor = PQBFConfig.shared.styleBackGroundColor
         emptyRemindView.fullRefreshBloc = { [weak self] _, _ in
             if emptyRemindView.refreshBtn.currentTitle == "授予权限" {
                 openAppSetting()
@@ -61,13 +61,14 @@ class PQPhotoAlbumController: PQBaseViewController {
         anthorEmptyData.summary = "要挑选相册素材,请先授予相册使用权限"
         anthorEmptyData.emptyImage = "icon_authorError"
         anthorEmptyData.isRefreshHidden = false
+        anthorEmptyData.refreshBgColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
         emptyRemindView.emptyData = anthorEmptyData
         return emptyRemindView
     }()
 
     lazy var albaumView: UIView = {
         let albaumView = UIView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height))
-        let ges = UITapGestureRecognizer(target: self, action: #selector(dismissCategoryView))
+        let ges = UITapGestureRecognizer(target: self, action: #selector(gesTagClick))
         albaumView.addGestureRecognizer(ges)
         return albaumView
     }()
@@ -180,6 +181,16 @@ extension PQPhotoAlbumController {
         }
     }
 
+    /// 点击隐藏view
+    /// - Returns: <#description#>
+    @objc func gesTagClick() {
+        if selectedHandle != nil {
+            selectedHandle!(nil)
+        }
+        albaumCollectionView.reloadData()
+        dismissCategoryView()
+    }
+
     @objc func dismissCategoryView() {
         if isTopShow {
             UIView.animate(withDuration: 0.3, animations: {
@@ -189,7 +200,6 @@ extension PQPhotoAlbumController {
                 self.albaumView.isHidden = true
                 self.view.isHidden = true
             }
-
         } else {
             albaumCollectionView.dismissViewAnimate { [weak self] _ in
                 self?.view.isHidden = true
@@ -251,6 +261,9 @@ extension PQPhotoAlbumController: UICollectionViewDelegate, UICollectionViewData
 
     func scrollViewDidScroll(_ scrollView: UIScrollView) {
         if (!isTopShow && (scrollView.contentOffset.y < -cDefaultMargin * 7)) || (isTopShow && scrollView.contentOffset.y > ((scrollView.contentSize.height - scrollView.frame.height) + cDefaultMargin * 10)) {
+            if selectedHandle != nil {
+                selectedHandle!(nil)
+            }
             dismissCategoryView()
         }
     }

+ 2 - 0
BFFramework/Classes/Base/Controller/PQPhotoMaterialController.swift

@@ -81,6 +81,8 @@ class PQPhotoMaterialController: PQBaseViewController {
         anthorEmptyData.title = "挑选相册素材"
         anthorEmptyData.summary = "要挑选相册素材,请先授予相册使用权限"
         anthorEmptyData.emptyImage = "icon_authorError"
+        anthorEmptyData.isRefreshHidden = false
+        anthorEmptyData.refreshBgColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
         return anthorEmptyData
     }()
 

+ 4 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMaterialController.swift

@@ -271,8 +271,11 @@ public class PQStuckPointMaterialController: PQBaseViewController {
     /// - Parameter seletedData: <#seletedData description#>
     /// - Returns: <#description#>
     func albumSelectedHandle(seletedData: PQUploadModel?) {
-        changeCollecBtn.setTitle(seletedData?.title ?? "全部", for: .normal)
         changeCollecBtn.isSelected = false
+        if seletedData == nil {
+            return
+        }
+        changeCollecBtn.setTitle(seletedData?.title ?? "全部", for: .normal)
         changeCollecBtn.imagePosition(at: .right, space: cDefaultMargin / 2)
         photoMaterialVc.assetCollection = seletedData?.assetCollection
         photoMaterialVc.msgType = photoMaterialVc.msgType

+ 1 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMaterialDetailController.swift

@@ -80,7 +80,7 @@ class PQStuckPointMaterialDetailController: PQBaseViewController {
     lazy var playBtn: UIButton = {
         let playBtn = UIButton(type: .custom)
         playBtn.frame = CGRect(x: (preImageView.frame.width - cDefaultMargin * 5) / 2, y: (preImageView.frame.height - cDefaultMargin * 5) / 2, width: cDefaultMargin * 5, height: cDefaultMargin * 5)
-        playBtn.setImage(UIImage().BF_Image(named: "icon_video_play_big"), for: .normal)
+        playBtn.setImage(UIImage().BF_Image(named: "icon_video_play"), for: .normal)
         playBtn.isUserInteractionEnabled = false
         playBtn.isHidden = true
         // playBtn.addTarget(self, action: #selector(btnClick(sender:)), for: .touchUpInside)