Browse Source

首页发布View

南鑫林 5 years ago
parent
commit
2805477f8c

+ 16 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -38,12 +38,20 @@ class CommunityViewController: BaseViewController {
         navigationBar.isHidden = true
         view.addSubview(segmentedView)
         view.addSubview(listContainerView)
+        view.addSubview(navigationBarbgView)
         view.addSubview(communityNavigationBarView)
+    
         
     }
     
     override func setupLayouts() {
         
+        navigationBarbgView.snp.makeConstraints { (make) in
+            make.top.equalTo(kSafeStatusBarHeight)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(kNavBarHeight)
+        }
+        
         communityNavigationBarView.snp.makeConstraints { (make) in
             make.top.equalTo(kSafeStatusBarHeight)
             make.left.right.equalToSuperview()
@@ -224,6 +232,8 @@ class CommunityViewController: BaseViewController {
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("CommunityPlanetH5"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
             WebViewJavascriptBridgeManager.shared.notification(notification: notification,viewController: self)
         }
+        
+        PublishUploadProgressView.publishUploadProgressView(attachedView: navigationBarbgView)
     }
     
     // 分享
@@ -314,6 +324,12 @@ class CommunityViewController: BaseViewController {
         self.listContainerView.reloadData()
         
     }
+    
+    /// navigationBar
+    private lazy var navigationBarbgView: UIView = {
+        let navigationBarbgView = UIView()
+        return navigationBarbgView
+    }()
     /// navigationBar
     private lazy var communityNavigationBarView: CommunityNavigationBarView = {
         let communityNavigationBarView = CommunityNavigationBarView()

+ 33 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishManager/PublishUploadProgressView.swift

@@ -7,7 +7,9 @@
 //  发布进度のView
 
 import UIKit
+import FWPopupView
 import RxSwift
+import RxCocoa
 
 /// 跳转方式
 ///
@@ -19,7 +21,7 @@ enum UploadStatus{
     case failure
 }
 
-class PublishUploadProgressView: BaseView {
+class PublishUploadProgressView: FWPopupView {
     
     typealias CloseViewClosure = () -> Void
     var closeViewClosure : CloseViewClosure?
@@ -36,8 +38,20 @@ class PublishUploadProgressView: BaseView {
         }
     }
     
+    let disposeBag = DisposeBag()
     
-    override func setupViews() {
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        setupViews()
+        setupLayouts()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    
+    func setupViews() {
         self.backgroundColor = kffffffColor
         addSubview(imageView)
         addSubview(progressLabel)
@@ -46,7 +60,7 @@ class PublishUploadProgressView: BaseView {
         addSubview(failedCloseButton)
     }
     
-    override func setupLayouts() {
+    func setupLayouts() {
         imageView.snp.makeConstraints { (make) in
             make.left.equalTo(14)
             make.centerY.equalToSuperview()
@@ -121,6 +135,22 @@ class PublishUploadProgressView: BaseView {
         return failedCloseButton
     }()
     
+    class func publishUploadProgressView(attachedView:UIView) -> PublishUploadProgressView {
+        let view = PublishUploadProgressView(frame: CGRect(x: 0, y: kNavBarHeight, width: kScreenWidth, height: 62))
+        view.attachedView = attachedView
+        let vProperty = FWPopupViewProperty()
+        vProperty.popupCustomAlignment = .topCenter
+        vProperty.popupViewEdgeInsets = UIEdgeInsets(top: kNavBarHeight  + 48, left: 0, bottom: 0, right: 0 )
+        vProperty.popupAnimationType = .frame
+        vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
+        vProperty.touchWildToHide = "0"
+        vProperty.maskViewColor = UIColor.clear
+        
+        view.vProperty = vProperty
+        view.show()
+        return view
+    }
+    
 }
 
 extension PublishUploadProgressView {