Browse Source

准备整理播放页面

南鑫林 5 years ago
parent
commit
0a45a446ce

+ 4 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -439,6 +439,7 @@
 		A7E19FAE22BA2D16009BCCE1 /* SearchContentListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E19FAD22BA2D16009BCCE1 /* SearchContentListViewController.swift */; };
 		A7E19FB122BA3A0D009BCCE1 /* SearchTopicListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E19FB022BA3A0D009BCCE1 /* SearchTopicListTableViewCell.swift */; };
 		A7EF3E0C23013EDE001E4D26 /* CommunityImageAuthModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7EF3E0B23013EDE001E4D26 /* CommunityImageAuthModel.swift */; };
+		A7EF3E0E2302D031001E4D26 /* CommunityVideoBottomActionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7EF3E0D2302D031001E4D26 /* CommunityVideoBottomActionView.swift */; };
 		A7F2D6BD22B09F930093000B /* CommunityNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6BC22B09F930093000B /* CommunityNavigationBarView.swift */; };
 		A7F2D6C122B0D1CB0093000B /* CommunityFollowTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6C022B0D1CB0093000B /* CommunityFollowTableHeaderView.swift */; };
 		A7F2D6C622B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6C522B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift */; };
@@ -1166,6 +1167,7 @@
 		A7E19FAD22BA2D16009BCCE1 /* SearchContentListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchContentListViewController.swift; sourceTree = "<group>"; };
 		A7E19FB022BA3A0D009BCCE1 /* SearchTopicListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTopicListTableViewCell.swift; sourceTree = "<group>"; };
 		A7EF3E0B23013EDE001E4D26 /* CommunityImageAuthModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityImageAuthModel.swift; sourceTree = "<group>"; };
+		A7EF3E0D2302D031001E4D26 /* CommunityVideoBottomActionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoBottomActionView.swift; sourceTree = "<group>"; };
 		A7F2D6BC22B09F930093000B /* CommunityNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityNavigationBarView.swift; sourceTree = "<group>"; };
 		A7F2D6C022B0D1CB0093000B /* CommunityFollowTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityFollowTableHeaderView.swift; sourceTree = "<group>"; };
 		A7F2D6C522B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityCommonSectionHeaderView.swift; sourceTree = "<group>"; };
@@ -5132,6 +5134,7 @@
 			isa = PBXGroup;
 			children = (
 				BD27F0AF22CC929800A6514D /* CommunityVideoCoverCollectionCell.swift */,
+				A7EF3E0D2302D031001E4D26 /* CommunityVideoBottomActionView.swift */,
 				BD27F0B122CC9E2A00A6514D /* CommunityVideoPlayView.swift */,
 				BD37E38222CDF5BA003A14A2 /* CommunityVideoTopicView.swift */,
 				BD37E38422CDF91A003A14A2 /* CommunityVideoSelTopicCell.swift */,
@@ -6333,6 +6336,7 @@
 				A7AA9F5A22C5FB1E0086498B /* SwiftMoyaNetWorkServiceVirus.swift in Sources */,
 				A7A98E2D22801642005306E9 /* SwiftMoyaServiceCMSApi.swift in Sources */,
 				A70B2C402288312900B2449F /* ProductDetailSectionHeader.swift in Sources */,
+				A7EF3E0E2302D031001E4D26 /* CommunityVideoBottomActionView.swift in Sources */,
 				A770E60022D6203F00CBD0A4 /* CommunityShareActivityViewController.swift in Sources */,
 				A7A98E3122801B10005306E9 /* ShoppingMallListView.swift in Sources */,
 				BD1DC6C6228CFD0B00B89C57 /* SwiftMoyaServiceOrderApi.swift in Sources */,

+ 15 - 0
RainbowPlanet/RainbowPlanet/Manager/WebViewJavascriptBridgeManager/WebViewJavascriptBridgeManager.swift

@@ -24,6 +24,21 @@ class WebViewJavascriptBridgeManager: NSObject {
         bridge?.callHandler("h5", data: UserModel.shared().getH5UserInfo())
     }
     
+    /// 刷新
+    ///
+    /// - Parameters:
+    ///   - bridge: 交互对象
+    ///   - force: 是否强制
+    func callHandlerH5Refresh(bridge: WebViewJavascriptBridge?,force:Bool?) {
+        //获取当前时间
+        let refreshModel = WVJBRefreshModel()
+        refreshModel.type = WVJBRefreshModelType.planet.rawValue
+        var refreshDic = Dictionary<String,Any>()
+        refreshDic.updateValue("refresh", forKey: "type")
+        refreshDic.updateValue(refreshModel.toJSON() as Any, forKey: "params")
+        bridge?.callHandler("h5", data: refreshDic)
+    }
+    
     
     /// 注册回调
     ///

+ 35 - 0
RainbowPlanet/RainbowPlanet/Model/WVJBModel/WVJBModel.swift

@@ -150,3 +150,38 @@ class WVJBPayloadModel:NSObject,Mappable {
     }
     
 }
+
+
+/// APP原生页面跳转类型
+///
+/// - none: 没有
+/// - publist: 发布
+/// - join: feed流
+/// - account: 账户(绑定微信)
+/// - exchange: 兑换商城
+/// - planet: 星球
+enum WVJBRefreshModelType : String {
+    case none = ""
+    case planet = "planet"
+    
+}
+
+class WVJBRefreshModel: NSObject, Mappable{
+    
+    var force : Bool?
+    var type : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return WVJBRefreshModel()
+    }
+    required init?(map: Map){}
+    override init(){}
+    
+    func mapping(map: Map)
+    {
+        force <- map["force"]
+        type <- map["type"]
+    }
+    
+}

+ 6 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift

@@ -57,11 +57,12 @@ class CommunityPlanetViewController: BaseJSWebViewController {
 
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("CommunityModulePlanetTop"), object: nil, queue: OperationQueue.main, using: {
             [weak self] (notification) in
-            if self?.wkWebView.scrollView.contentOffset == CGPoint(x: 0, y: 0) {
-               WebViewJavascriptBridgeManager.shared.callHandlerH5(bridge: self?.bridge)
-            }else {
-                self?.wkWebView.scrollToTop()
-            }
+//            if self?.wkWebView.scrollView.contentOffset == CGPoint(x: 0, y: 0) {
+//                WebViewJavascriptBridgeManager.shared.callHandlerH5Refresh(bridge: self?.bridge, force: true)
+//            }else {
+//            }
+            WebViewJavascriptBridgeManager.shared.callHandlerH5Refresh(bridge: self?.bridge, force: false)
+
         })
         
         

+ 46 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoBottomActionView.swift

@@ -0,0 +1,46 @@
+//
+//  CommunityVideoBottomActionView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/8/13.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class CommunityVideoBottomActionView: BaseView {
+
+    override func setupViews() {
+        
+    }
+    
+    override func setupLayouts() {
+        
+    }
+    
+    override func setupData() {
+        
+    }
+    
+//    bottomCommentView.addSubview(commentBtn)
+//    bottomCommentView.addSubview(collectBtn)
+//    bottomCommentView.addSubview(likeBtn)
+//    bottomCommentView.addSubview(commentView)
+//    commentView.addSubview(commentLabel)
+//    commentView.addSubview(textBtn)
+//    collectBtn.imageView?.addSubview(collectAnimationView)
+//    likeBtn.imageView?.addSubview(praiseAnimationView)
+    
+    lazy var commentNameButton: UIButton = {
+        let commentNameButton = UIButton(type: UIButton.ButtonType.custom)
+        commentNameButton.setTitle("添加评论...", for: UIControl.State.normal)
+        commentNameButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        commentNameButton.titleLabel?.font = kRegularFont14
+        commentNameButton.titleLabel?.x = 15
+        commentNameButton.contentHorizontalAlignment = .left
+        commentNameButton.cornerRadius = 14
+        commentNameButton.masksToBounds = true
+        return commentNameButton
+    }()
+
+}

+ 4 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -161,7 +161,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         bottomCommentView.snp.makeConstraints { (make) in
             make.bottom.equalTo(-kSafeTabBarHeight)
             make.left.right.equalToSuperview()
-            make.height.equalTo(60)
+            make.height.equalTo(60 + kSafeTabBarHeight)
         }
         bottomSepView.snp.makeConstraints { (make) in
             make.left.right.equalToSuperview()
@@ -197,10 +197,10 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         }
         
         commentView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
+            make.top.equalTo(16)
             make.left.equalToSuperview().offset(14)
             make.right.equalTo(likeBtn.snp_left).offset(-10)
-            make.height.equalTo(30)
+            make.height.equalTo(28)
         }
         commentLabel.snp.makeConstraints { (make) in
             make.left.equalTo(15)
@@ -590,7 +590,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     private lazy var commentView: UIView = {
         let commentView = UIView()
         commentView.backgroundColor = kffffffColor.withAlphaComponent(0.3)
-        commentView.cornerRadius = 15
+        commentView.cornerRadius = 14
         commentView.masksToBounds = true
         return commentView
     }()
@@ -613,7 +613,6 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
                     buttonClickClosure(videoBtnClickType.typeComment, self?.videoItemMdl?.uid ?? 0, self?.videoItemMdl?.id ?? 0)
                 }
             }
-
         }).disposed(by: disposeBag)
         return textBtn
     }()

+ 3 - 3
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -29,9 +29,9 @@ public func kApiDataPrefix() -> String {
 }
 
 let kVirusPersonalService = false
-let kVirusDevelopSever = false
+let kVirusDevelopSever = true
 let kVirusBetaSever = false
-let kVirusProductSever = true
+let kVirusProductSever = false
 
 
 // MARK: - Virus
@@ -61,7 +61,7 @@ let kH5ProductSever = false
 // MARK: - H5
 public func kApiH5Prefix() -> String {
     if kH5PersonalService /** 接口前缀-个人服务器*/ {
-        return ""
+        return "http://192.168.23.238:8820"
     }else if kH5DevelopSever /** 接口前缀-开发服务器*/ {
         return "http://h5.dev.caihongxingqiu.com"
     } else if kH5BetaSever /** 接口前缀-测试服务器*/{