瀏覽代碼

剩余6个bug都是关于发布视频的

南鑫林 5 年之前
父節點
當前提交
583ffc0653

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

@@ -338,6 +338,7 @@
 		A7B4E756228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E755228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift */; };
 		A7B4E7582282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E7572282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift */; };
 		A7B4E75A228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E759228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift */; };
+		A7BA18FD230D5B6F00E3B969 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BA18FC230D5B6F00E3B969 /* RootViewController.swift */; };
 		A7BB684F2268DCEC00AB07A2 /* SelfRecommendationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB684D2268DCEC00AB07A2 /* SelfRecommendationViewController.swift */; };
 		A7BB68552268DE8600AB07A2 /* SelfRecommendationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB68542268DE8600AB07A2 /* SelfRecommendationView.swift */; };
 		A7BB6857226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB6856226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift */; };
@@ -1068,6 +1069,7 @@
 		A7B4E755228281620012914A /* ShoppingMallSlidingLeftRightBgCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingMallSlidingLeftRightBgCollectionViewCell.swift; sourceTree = "<group>"; };
 		A7B4E7572282897B0012914A /* ProductFloorLeftHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorLeftHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
 		A7B4E759228289BB0012914A /* ProductFloorCenterHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorCenterHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
+		A7BA18FC230D5B6F00E3B969 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = "<group>"; };
 		A7BB684D2268DCEC00AB07A2 /* SelfRecommendationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfRecommendationViewController.swift; sourceTree = "<group>"; };
 		A7BB68542268DE8600AB07A2 /* SelfRecommendationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfRecommendationView.swift; sourceTree = "<group>"; };
 		A7BB6856226965C100AB07A2 /* SelfRecommendationHeaderCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfRecommendationHeaderCollectionReusableView.swift; sourceTree = "<group>"; };
@@ -3198,6 +3200,7 @@
 		A77F2C8F2231FC65001BD3F6 /* Base */ = {
 			isa = PBXGroup;
 			children = (
+				A7BA18FB230D5B4D00E3B969 /* RootViewController */,
 				A77F2C902231FC75001BD3F6 /* BaseTabbarViewController */,
 				A77F2C912231FC85001BD3F6 /* BaseNavigationController */,
 				A77F2C942231FCD2001BD3F6 /* BaseWebViewController */,
@@ -3786,6 +3789,14 @@
 			path = Floor;
 			sourceTree = "<group>";
 		};
+		A7BA18FB230D5B4D00E3B969 /* RootViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A7BA18FC230D5B6F00E3B969 /* RootViewController.swift */,
+			);
+			path = RootViewController;
+			sourceTree = "<group>";
+		};
 		A7BB68512268DCF800AB07A2 /* SelfRecommendation */ = {
 			isa = PBXGroup;
 			children = (
@@ -6072,6 +6083,7 @@
 				BD7AB83A2284288D0030646A /* ShoppingCartPayOrderFooter.swift in Sources */,
 				A719EE6E22AF441F001AAC98 /* CommunityViewController.swift in Sources */,
 				BD13B6C622BA034D008BB323 /* PublishEditTitleCell.swift in Sources */,
+				A7BA18FD230D5B6F00E3B969 /* RootViewController.swift in Sources */,
 				A72A72C522321DE000B21995 /* WKWebViewConfig.swift in Sources */,
 				A72A72BB22321DE000B21995 /* Extension+UILabel.swift in Sources */,
 				A70B2C372288177300B2449F /* ProductDetailProductLabelIconCollectionViewCell.swift in Sources */,

+ 2 - 18
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -16,19 +16,11 @@ extension AppDelegate {
     func initWindow(didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
         window = UIWindow.init(frame: UIScreen.main.bounds)
         window?.backgroundColor = UIColor.white
-        //初始化百度地图
-        BaiduMapManager.shared.initBaiduMap()
-        //百度开始定位
-        BaiduMapManager.shared.startLocation()
-        let vc = UIViewController()
-        vc.view.backgroundColor = UIColor.clear
+        let vc = RootViewController()
+        vc.launchOptions = launchOptions
         window?.rootViewController = vc
         window?.makeKeyAndVisible()
-//        MemoryManager.shared.initMemoryManager()
         //基础配置
-        SwiftMoyaNetWorkServiceConfig.shared().configApi {(data) -> (Void) in}
-        //版本更新
-        _ = UpdateVersionManager.shared
         DispatchQueue.global(qos: .default).async {
             [weak self] in
             /// 设置全局的tabbar
@@ -45,17 +37,9 @@ extension AppDelegate {
             DeliveryMethodTypeModel.shared().setModel(model: deliveryMethodTypeModel)
             //网络监听
             //        AlamofireReachabilityManager.shared.reachability()
-            //初始化友盟
-            UMManager.shared.initUM(launchOptions: launchOptions)
             //键盘处理
             IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
         }
-        //设置Tabbar
-        setTabbarController()
-        /// 引导页
-        setGuidePageView()
-        
-
     }
     
     /// 设置Tabbar

+ 83 - 0
RainbowPlanet/RainbowPlanet/Base/RootViewController/RootViewController.swift

@@ -0,0 +1,83 @@
+//
+//  RootViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/8/21.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import SnapKit
+
+class RootViewController: BaseViewController {
+    
+    var launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    override func setupViews() {
+        navigationBar.isHidden = true
+        view.backgroundColor = UIColor.clear
+        view.addSubview(iconImageView)
+        view.addSubview(titleLabel)
+    }
+    
+    override func setupLayouts() {
+        
+        iconImageView.snp.makeConstraints {(make) in
+            make.top.equalTo(244).multipliedBy(16/9)
+            make.width.equalTo(159)
+            make.height.equalTo(83)
+            make.centerX.equalToSuperview()
+        }
+        
+        titleLabel.snp.makeConstraints {(make) in
+            make.bottom.equalTo(-44)
+            make.centerX.left.right.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        SwiftMoyaNetWorkServiceConfig.shared().configApi(completion: {[weak self] (data) -> (Void) in
+            //初始化百度地图
+            BaiduMapManager.shared.initBaiduMap()
+            //百度开始定位
+            BaiduMapManager.shared.startLocation()
+            //初始化友盟
+            UMManager.shared.initUM(launchOptions: self?.launchOptions)
+            //版本更新
+            _ = UpdateVersionManager.shared
+            //设置Tabbar
+            kAppDelegate.setTabbarController()
+            /// 引导页
+            kAppDelegate.setGuidePageView()
+            self?.view?.ly_hideEmpty()
+        }) { [weak self] loadingStatus in
+            self?.iconImageView.isHidden = true
+            self?.titleLabel.isHidden = true
+            DIYEmptyView.emptyNoDataActionView(view: self?.view,imageStr: .five,detailStr: .five,btnTitleStr: .one, btnClickBlock: { [weak self] in
+                self?.setupData()
+            })
+        }
+    }
+    
+    lazy var iconImageView: UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "default_logo")
+        return iconImageView
+    }()
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.text = "Copyright © 由你 版权所有"
+        titleLabel.font = kRegularFont12
+        titleLabel.textColor = k333333Color
+        titleLabel.textAlignment = .center
+        return titleLabel
+    }()
+
+}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Manager/UpdateVersionManager/ViewModel/UpdateVersionManager.swift

@@ -41,7 +41,7 @@ class UpdateVersionManager: NSObject {
             [weak self] (notification) in
             self?.configUpGrade()
             //基础配置
-            SwiftMoyaNetWorkServiceConfig.shared().configApi {(data) -> (Void) in}
+            SwiftMoyaNetWorkServiceConfig.shared().configApi(completion: {(data) -> (Void) in}){_ in}
         })
         //程序即将退出
         observe = NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, object: nil, queue: OperationQueue.main, using: {

+ 1 - 7
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/ViewController/OrderFinishPayController.swift

@@ -67,7 +67,7 @@ class OrderFinishPayController: BaseViewController {
     override func setupData() {
         
         if !(payStatus ?? true) {
-           configPickupNodeIndexApi()
+            self.finishPayView.configModel = ConfigModel.shared.object()
         }
         
         finishPayView.tableView.addHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
@@ -157,10 +157,4 @@ class OrderFinishPayController: BaseViewController {
         }
     }
     
-    func configPickupNodeIndexApi() {
-        SwiftMoyaNetWorkServiceConfig.shared().configApi {
-            [weak self] (configModel) -> (Void) in
-            self?.finishPayView.configModel = configModel as? ConfigModel
-        }
-    }
 }

+ 2 - 1
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift

@@ -23,13 +23,14 @@ class SwiftMoyaNetWorkServiceConfig: NSObject {
     /// 前端config配置
     ///
     /// - Parameter completion: 回调
-    func configApi(completion: @escaping successCallBack) {
+    func configApi(completion: @escaping successCallBack,fail:@escaping failCallback) {
         let parameters = Dictionary<String,Any>()
         SwiftMoyaNetWorkManager.shared.requestObject(ConfigModel.self,target: MultiTarget(SwiftMoyaServiceConfigApi.configConfig(parameters: parameters)), completion: {(configModel) in
             ConfigModel.shared.saveObject(configModel: configModel as! ConfigModel)
             completion(configModel)
         }) {
             (loadingStatus) in
+            fail(loadingStatus)
         }
     }
     

+ 7 - 7
RainbowPlanet/RainbowPlanet/Supporting Files/Launch Screen.storyboard

@@ -20,12 +20,12 @@
                         <subviews>
                             <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 由你 版权所有" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
                                 <rect key="frame" x="0.0" y="837.5" width="414" height="14.5"/>
-                                <fontDescription key="fontDescription" type="system" weight="thin" pointSize="12"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_logo" translatesAutoresizingMaskIntoConstraints="NO" id="xvS-ua-mvp">
-                                <rect key="frame" x="127.5" y="278" width="159" height="83"/>
+                                <rect key="frame" x="127.5" y="244" width="159" height="83"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="159" id="Vfh-8p-ezm"/>
                                     <constraint firstAttribute="height" constant="83" id="ZXR-zb-Khl"/>
@@ -34,13 +34,13 @@
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
-                            <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
-                            <constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="SfN-ll-jLj"/>
+                            <constraint firstItem="NPT-cs-gRi" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
+                            <constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="NPT-cs-gRi" secondAttribute="leading" symbolic="YES" id="SfN-ll-jLj"/>
                             <constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="44" id="Y44-ml-fuU"/>
-                            <constraint firstItem="xvS-ua-mvp" firstAttribute="top" secondItem="Bcu-3y-fUS" secondAttribute="top" multiplier="16:9" constant="200" id="msg-sb-ZkI"/>
-                            <constraint firstItem="xvS-ua-mvp" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="sS8-sQ-56x"/>
+                            <constraint firstItem="xvS-ua-mvp" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" multiplier="16/9" constant="244" id="Zfa-KX-qFG"/>
+                            <constraint firstItem="xvS-ua-mvp" firstAttribute="centerX" secondItem="NPT-cs-gRi" secondAttribute="centerX" id="sS8-sQ-56x"/>
                         </constraints>
-                        <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
+                        <viewLayoutGuide key="safeArea" id="NPT-cs-gRi"/>
                     </view>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>

+ 15 - 0
RainbowPlanet/RainbowPlanet/Tools/EmptyView/DIYEmptyView.swift

@@ -209,5 +209,20 @@ class DIYEmptyView: LYEmptyView {
         wkWebView?.ly_emptyView = emptyView
     }
     
+    /// view上的默认图 带button
+    ///
+    /// - Parameters:
+    ///   - view: view
+    ///   - imageStr: 图片默认图
+    ///   - detailStr: 标题
+    ///   - btnTitleStr: 按钮表示
+    ///   - btnClickBlock:
+    class func emptyNoDataActionView(view:UIView?,imageStr:DIYEmptyViewImageStr = .one,detailStr:DIYEmptyViewDetailString = .one,btnTitleStr:DIYEmptyViewActionBtnString = .one,btnClickBlock: @escaping LYActionTapBlock) {
+        let emptyView = DIYEmptyView.emptyActionView(withImageStr: imageStr.rawValue, titleStr: nil, detailStr: detailStr.rawValue, btnTitleStr: btnTitleStr.rawValue,btnClick: btnClickBlock)
+        emptyView?.autoShowEmptyView = true
+        view?.ly_emptyView = emptyView
+        view?.ly_showEmpty()
+    }
+    
 
 }