南鑫林 il y a 5 ans
Parent
commit
8621e87a14
28 fichiers modifiés avec 211 ajouts et 191 suppressions
  1. 9 3
      RainbowPlanet/Podfile
  2. 5 5
      RainbowPlanet/Podfile.lock
  3. 1 1
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  4. 0 6
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+HandleOpen.swift
  5. 33 19
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  6. 1 13
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift
  7. 2 0
      RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h
  8. 2 2
      RainbowPlanet/RainbowPlanet/Manager/WebViewJavascriptBridgeManager/WebViewJavascriptBridgeManager.swift
  9. 2 0
      RainbowPlanet/RainbowPlanet/Model/WVJBModel/WVJBModel.swift
  10. 1 7
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift
  11. 13 0
      RainbowPlanet/RainbowPlanet/Modules/H5Modules/H5Common/ViewController/H5CommonViewController.swift
  12. 7 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/AccountSecurity/ViewController/AccountSecurityViewController.swift
  13. 3 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/ViewController/SetViewController.swift
  14. 6 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoCommonFile/Tools/MediaConfig/AliyunMediaConfig.m
  15. 6 6
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/FilterAbout/AliyunEffectFilterView.m
  16. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoUploadManager.h
  17. 5 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoUploadManager.m
  18. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AliyunPublishService.h
  19. 7 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/Controller/AliyunCoverPickViewController.m
  20. 19 12
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/View/AliyunCoverPickView.m
  21. 11 19
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m
  22. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.h
  23. 35 32
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m
  24. 16 13
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m
  25. 2 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListCell.swift
  26. 5 6
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift
  27. 8 19
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift
  28. 6 6
      RainbowPlanet/RainbowPlanet/Tools/SwiftProgressHUD/SwiftProgressHUD.swift

+ 9 - 3
RainbowPlanet/Podfile

@@ -67,7 +67,7 @@ target 'RainbowPlanet' do
   pod 'MLeaksFinder'
 
 
-  #======================第三方平台===========
+#======================第三方平台===========
   #======================友盟===========
   # UM基础库
   pod 'UMCCommon'
@@ -94,12 +94,18 @@ target 'RainbowPlanet' do
   pod 'BaiduMapKit'
   
   #=====================AliyunVideoSDK===========
-  pod 'AliyunVideoSDKStd'
+  pod 'AliyunVideoSDKPro'
   pod 'QuCore-ThirdParty'
   pod 'VODUpload'
   pod 'AliyunOSSiOS'
   pod 'AlivcConan'
-  
+#  # 短视频
+#  pod 'AliyunVideoSDKPro'
+#  # 上传
+#  pod 'VODUpload'
+#  # 播放器
+#  pod 'AliPlayerSDK_iOS'
+
   pod 'AFNetworking', '~> 3.0'
   pod 'JSONModel','~> 1.7.0'
   pod 'ZipArchive','1.4.0'

+ 5 - 5
RainbowPlanet/Podfile.lock

@@ -19,7 +19,7 @@ PODS:
     - AlivcConan/AlivcConan (= 0.9.5)
   - AlivcConan/AlivcConan (0.9.5)
   - AliyunOSSiOS (2.10.7)
-  - AliyunVideoSDKStd (3.11.0)
+  - AliyunVideoSDKPro (3.11.0)
   - BaiduMapKit (4.4.2)
   - BMKLocationKit (1.5.0)
   - Cache (5.2.0)
@@ -102,7 +102,7 @@ DEPENDENCIES:
   - Alamofire
   - AlivcConan
   - AliyunOSSiOS
-  - AliyunVideoSDKStd
+  - AliyunVideoSDKPro
   - BaiduMapKit
   - BMKLocationKit (= 1.5.0)
   - Cache
@@ -155,7 +155,7 @@ SPEC REPOS:
     - Alamofire
     - AlivcConan
     - AliyunOSSiOS
-    - AliyunVideoSDKStd
+    - AliyunVideoSDKPro
     - BaiduMapKit
     - BMKLocationKit
     - Cache
@@ -207,7 +207,7 @@ SPEC CHECKSUMS:
   Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
   AlivcConan: 9dccc32986024768bb5f50e14ad54490123903c7
   AliyunOSSiOS: 602b6a4e70e62a5f0a6431c20496343141d7e66f
-  AliyunVideoSDKStd: 96820a4ea72acb90586fa888a711848ddf689ec1
+  AliyunVideoSDKPro: da710c1e7fb93b1e9a741b3619814c6608780b4b
   BaiduMapKit: 11acde2e7c06e31b7de60b323880a5eb7c4dccb6
   BMKLocationKit: 40d267478acd8704ddebd0e9deaddc727b13df9f
   Cache: 807c5d86d01a177f06ede9865add3aea269bbfd4
@@ -254,6 +254,6 @@ SPEC CHECKSUMS:
   YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
   ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
 
-PODFILE CHECKSUM: 61302a018e8ab6f53eaeab9932dedca81a9bb160
+PODFILE CHECKSUM: ed6220d45b5ce5b4b43a51e5b290058ffc8f7511
 
 COCOAPODS: 1.7.4

+ 1 - 1
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -5596,8 +5596,8 @@
 			isa = PBXGroup;
 			children = (
 				BD61225022C31EED00D3F513 /* VideoRecord */,
-				BD0FAA5722C4C2E400DDFB37 /* VideoCrop */,
 				BD61224F22C31EE400D3F513 /* VideoEdit */,
+				BD0FAA5722C4C2E400DDFB37 /* VideoCrop */,
 				BD0FAA4B22C474A500DDFB37 /* VideoCoverPick */,
 				BD61226222C3592C00D3F513 /* Common */,
 			);

+ 0 - 6
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+HandleOpen.swift

@@ -62,12 +62,6 @@ extension AppDelegate {
 
     /// 获取设备的 DeviceToken
     func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
-        var tokenString = ""
-        for byte in deviceToken {
-            let hexString = String(format: "%02x", byte)
-            tokenString += hexString
-        }
-        NXLLog("获取设备的 DeviceToken:\(tokenString)")
         UMessage.registerDeviceToken(deviceToken)
     }
 }

+ 33 - 19
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -11,33 +11,47 @@ import SwiftyMediator
 
 extension AppDelegate {
 
-    func initWindow() {
-        
+    func initWindow(didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
         window = UIWindow.init(frame: UIScreen.main.bounds)
         window?.backgroundColor = UIColor.white
-        window?.makeKeyAndVisible()
         let vc = UIViewController()
         vc.view.backgroundColor = UIColor.clear
         window?.rootViewController = vc
-
-        /// 城市转换
-        setBaiduToCityFactory()
-        /// 设置全局的tabbar
-        setTabbarAppearence()
-        /// 设置全局的navigation
-        setNavBarAppearence()
-        /// 设置全局的TableView
-        setTableViewAppearance()
-        /// 设置默认为快递
-        let deliveryMethodTypeModel = DeliveryMethodTypeModel.shared()
-        deliveryMethodTypeModel.deliveryMethodType = "2"
-        DeliveryMethodTypeModel.shared().setModel(model: deliveryMethodTypeModel)
-        //基础配置
-        SwiftMoyaNetWorkServiceConfig.shared().configApi {(data) -> (Void) in}
+        window?.makeKeyAndVisible()
+        DispatchQueue.global(qos: .default).async {
+            [weak self] in
+            /// 设置全局的tabbar
+            self?.setTabbarAppearence()
+            /// 设置全局的navigation
+            self?.setNavBarAppearence()
+            /// 设置全局的TableView
+            self?.setTableViewAppearance()
+            /// 城市转换
+            self?.setBaiduToCityFactory()
+            /// 设置默认为快递
+            let deliveryMethodTypeModel = DeliveryMethodTypeModel.shared()
+            deliveryMethodTypeModel.deliveryMethodType = "2"
+            DeliveryMethodTypeModel.shared().setModel(model: deliveryMethodTypeModel)
+            //基础配置
+            SwiftMoyaNetWorkServiceConfig.shared().configApi {(data) -> (Void) in}
+            //版本更新
+            _ = UpdateVersionManager.shared
+            //网络监听
+            //        AlamofireReachabilityManager.shared.reachability()
+            //初始化百度地图
+            BaiduMapManager.shared.initBaiduMap()
+            //百度开始定位
+            BaiduMapManager.shared.startLocation()
+            //初始化友盟
+            UMManager.shared.initUM(launchOptions: launchOptions)
+            //键盘处理
+            IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
+        }
         //设置Tabbar
         setTabbarController()
         /// 引导页
         setGuidePageView()
+        
 
     }
     
@@ -48,7 +62,7 @@ extension AppDelegate {
         if (UserModel.shared().getModel()?.token) != nil { //是否已经登录
             SwiftMoyaNetWorkServiceUser.shared().userRefreshApi {
                 [weak self] _ in
-                
+
                 if(UserModel.shared().getModel()?.isFollowSuggestTopic == 0 || UserModel.shared().getModel()?.isFollowSuggestTopic == nil ) {//设置性别话题
                     self?.setLoginOut()
                 }else {

+ 1 - 13
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -15,19 +15,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
         //初始化窗口
-        initWindow()
-        //版本更新
-        _ = UpdateVersionManager.shared
-        //网络监听
-//        AlamofireReachabilityManager.shared.reachability()
-        //初始化百度地图
-        BaiduMapManager.shared.initBaiduMap()
-        //百度开始定位
-        BaiduMapManager.shared.startLocation()
-        //初始化友盟
-        UMManager.shared.initUM(launchOptions: launchOptions)
-        //键盘处理
-        IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
+        initWindow(didFinishLaunchingWithOptions: launchOptions)
         return true
     }
 }

+ 2 - 0
RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h

@@ -76,6 +76,8 @@
 #import "AVAsset+VideoInfo.h"
 #import "AliyunPathManager.h"
 
+#import <AliyunVideoSDKPro/AliyunVideoSDKPro.h>
+
 // 阿里云一建登录
 #import "ATAuthSDK/ATAuthSDK.h"
 

+ 2 - 2
RainbowPlanet/RainbowPlanet/Manager/WebViewJavascriptBridgeManager/WebViewJavascriptBridgeManager.swift

@@ -29,10 +29,10 @@ class WebViewJavascriptBridgeManager: NSObject {
     /// - Parameters:
     ///   - bridge: 交互对象
     ///   - force: 是否强制
-    func callHandlerH5Refresh(bridge: WebViewJavascriptBridge?,force:Bool?) {
+    func callHandlerH5Refresh(bridge: WebViewJavascriptBridge?,refreshModelType:WVJBRefreshModelType?) {
         //获取当前时间
         let refreshModel = WVJBRefreshModel()
-        refreshModel.type = WVJBRefreshModelType.planet.rawValue
+        refreshModel.type = refreshModelType?.rawValue
         var refreshDic = Dictionary<String,Any>()
         refreshDic.updateValue("refresh", forKey: "type")
         refreshDic.updateValue(refreshModel.toJSON() as Any, forKey: "params")

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

@@ -160,9 +160,11 @@ class WVJBPayloadModel:NSObject,Mappable {
 /// - account: 账户(绑定微信)
 /// - exchange: 兑换商城
 /// - planet: 星球
+/// - task: 任务
 enum WVJBRefreshModelType : String {
     case none = ""
     case planet = "planet"
+    case task = "task"
     
 }
 

+ 1 - 7
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift

@@ -57,15 +57,9 @@ 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.callHandlerH5Refresh(bridge: self?.bridge, force: true)
-//            }else {
-//            }
-            WebViewJavascriptBridgeManager.shared.callHandlerH5Refresh(bridge: self?.bridge, force: false)
-
+            WebViewJavascriptBridgeManager.shared.callHandlerH5Refresh(bridge: self?.bridge, refreshModelType: .planet)
         })
         
-        
     }
 }
 

+ 13 - 0
RainbowPlanet/RainbowPlanet/Modules/H5Modules/H5Common/ViewController/H5CommonViewController.swift

@@ -16,7 +16,12 @@ class H5CommonViewController: BaseJSWebBaseViewController {
     
     deinit {
         NXLLog("deinit")
+        if observe != nil {
+            NotificationCenter.default.removeObserver(observe!)
+        }
     }
+    weak var observe : NSObjectProtocol?
+
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -39,11 +44,19 @@ class H5CommonViewController: BaseJSWebBaseViewController {
     /// 加载数据
     override func setupData() {
         super.setupData()
+        
         WebViewJavascriptBridgeManager.shared.callHandlerH5(bridge: bridge)
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("WVJBRefresh"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            let refreshModelType = notification.object as? WVJBRefreshModelType
+            WebViewJavascriptBridgeManager.shared.callHandlerH5Refresh(bridge: self?.bridge, refreshModelType: refreshModelType)
+        })
+        
         WebViewJavascriptBridgeManager.shared.registerHandlerApp(bridge: bridge) {
            [weak self] (wvjbModel) in
             WebViewJavascriptBridgeManager.shared.jump(wvjbModel: wvjbModel,viewController: self)
         }
+        
     }
     
 }

+ 7 - 2
RainbowPlanet/RainbowPlanet/Modules/MineModule/AccountSecurity/ViewController/AccountSecurityViewController.swift

@@ -99,8 +99,11 @@ class AccountSecurityViewController: BaseViewController {
         
         if loginType == .weixin {
             if userModel?.bindWeixinUserModel?.unionId == nil ||  userModel?.bindWeixinUserModel?.unionId == "" { //绑定微信
-                UMManager.shared.loginGetUserInfo(platformType: UMSocialPlatformType.wechatSession) { (wxLoginModel) -> (Void) in
+                UMManager.shared.loginGetUserInfo(platformType: UMSocialPlatformType.wechatSession) {
+                    [weak self] (wxLoginModel) -> (Void) in
                     SwiftMoyaNetWorkServiceUser.shared().userIsBindTripartiteBindApi(loginType:loginType,umLoginModel: wxLoginModel, completion: { [weak self] (data) -> (Void) in
+                        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "WVJBRefresh"), object: WVJBRefreshModelType.task)
+
                         self?.accountSecurityView.tableView.reloadData()
                         
                     })
@@ -113,8 +116,10 @@ class AccountSecurityViewController: BaseViewController {
             }
         }else if loginType == .qq {
             if userModel?.bindQQUserModel?.unionId == nil ||  userModel?.bindQQUserModel?.unionId == "" { //绑定QQ
-                UMManager.shared.loginGetUserInfo(platformType: UMSocialPlatformType.QQ) { (wxLoginModel) -> (Void) in
+                UMManager.shared.loginGetUserInfo(platformType: UMSocialPlatformType.QQ) { [weak self] (wxLoginModel) -> (Void) in
                     SwiftMoyaNetWorkServiceUser.shared().userIsBindTripartiteBindApi(loginType:loginType,umLoginModel: wxLoginModel, completion: { [weak self] (data) -> (Void) in
+                        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "WVJBRefresh"), object: WVJBRefreshModelType.task)
+
                         self?.accountSecurityView.tableView.reloadData()
                         
                     })

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/ViewController/SetViewController.swift

@@ -39,8 +39,9 @@ class SetViewController: BaseViewController {
                 switch indexPath.row {
                 // 帐号绑定
                 case 0:
-                   let vc = AccountSecurityViewController()
-                   self?.navigationController?.pushViewController(vc, animated: true)
+
+                   Mediator.present(MineRouterModuleType.pushAccountSecurity)
+
                     break
                 default:
                    showSwiftProgressHUDInfo()

+ 6 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoCommonFile/Tools/MediaConfig/AliyunMediaConfig.m

@@ -52,10 +52,11 @@
 
 + (instancetype)defaultConfig{
     AliyunMediaConfig *config = [[AliyunMediaConfig alloc] init];
-    config.outputSize = CGSizeMake(720, 1280);
+    config.outputSize = CGSizeMake(540, 960);
     config.videoQuality = AliyunMediaQualityHight;
-    config.gop = 250;
-    config.fps = 30;
+    config.gop = 5;
+    config.fps = 25;
+    config.bitrate = 1000000;
     return config;
 }
 
@@ -64,7 +65,8 @@
     if (self) {
         _fps = 25;
         _gop = 5;
-        _videoQuality = 1;
+        _bitrate = 1000000;
+        _videoQuality = AliyunMediaQualityHight;
         _backgroundColor = [UIColor blackColor];
     }
     return self;

+ 6 - 6
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/FilterAbout/AliyunEffectFilterView.m

@@ -113,20 +113,20 @@
     if (_selectIndex == -1) {
         _selectIndex = 0; //默认是不选中
     }
-    
+    __weak typeof(self) weakSelf = self;
     [_dbHelper queryResourceWithEffecInfoType:eType success:^(NSArray *infoModelArray) {
         for (AliyunEffectMvGroup *mvGroup in infoModelArray) {
-            [_dataArray addObject:mvGroup];
-            if (_selectedEffect) {
-                if (mvGroup.eid == _selectedEffect.eid) {
-                    _selectIndex = [infoModelArray indexOfObject:mvGroup] + 1;
+            [weakSelf.dataArray addObject:mvGroup];
+            if (weakSelf.selectedEffect) {
+                if (mvGroup.eid == weakSelf.selectedEffect.eid) {
+                    weakSelf.selectIndex = [infoModelArray indexOfObject:mvGroup] + 1;
                 }
             }
         }
         
         if (eType != AliyunEffectTypeSpecialFilter) {
             dispatch_async(dispatch_get_main_queue(), ^{
-                [_collectionView reloadData];
+                [weakSelf.collectionView reloadData];
             });
         }
        

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoUploadManager.h

@@ -7,7 +7,7 @@
 //  上传管理器
 
 #import <Foundation/Foundation.h>
-#import <AliyunVideoSDKPro/AliyunPublishManager.h>
+#import "AliyunVideoSDKPro/AliyunVideoSDKPro.h"
 
 @class AliyunUploadSVideoInfo;
 @class AlivcShortVideoUploadManager;

+ 5 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoUploadManager.m

@@ -199,12 +199,13 @@ static AliyunVodPublishManager *_uploadManager = nil;
 
 - (void)publishManager:(AliyunVodPublishManager *)manager uploadFailedWithCode:(NSString *)code message:(NSString *)message {
     NSLog(@"upload failed code:%@, message:%@", code, message);
+    __weak typeof(self) weakSelf = self;
     dispatch_async(dispatch_get_main_queue(), ^{
-        _newStatus = AlivcUploadStatusFailure;
-        if (_managerDelegate &&
-            [_managerDelegate respondsToSelector:@selector(uploadManager:
+        weakSelf.newStatus = AlivcUploadStatusFailure;
+        if (weakSelf.managerDelegate &&
+            [weakSelf.managerDelegate respondsToSelector:@selector(uploadManager:
                                                            uploadStatusChangedTo:)]) {
-            [_managerDelegate uploadManager:self
+            [weakSelf.managerDelegate uploadManager:self
                       uploadStatusChangedTo:AlivcUploadStatusFailure];
         }
     });

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AliyunPublishService.h

@@ -7,7 +7,7 @@
 //
 
 #import <Foundation/Foundation.h>
-#import <AliyunVideoSDKPro/AliyunPublishManager.h>
+#import "AliyunVideoSDKPro/AliyunVideoSDKPro.h"
 
 @interface AliyunPublishService : NSObject
 

+ 7 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/Controller/AliyunCoverPickViewController.m

@@ -21,24 +21,28 @@
 
 @implementation AliyunCoverPickViewController
 
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     [self setupSubviews];
     
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
              ^{
-               [self.pickView loadThumbnailData];
+        [self.pickView loadThumbnailData];
     });
 }
 
 - (void)viewWillAppear:(BOOL)animated {
     //禁用侧滑手势
     self.navigationController.interactivePopGestureRecognizer.enabled = NO;
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
 }
 
 - (void)viewWillDisappear:(BOOL)animated {
     //禁用侧滑手势
     self.navigationController.interactivePopGestureRecognizer.enabled = YES;
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
 }
 
 - (BOOL)prefersStatusBarHidden
@@ -113,8 +117,9 @@
 #pragma mark - pick view delegate
 
 - (void)pickViewDidUpdateImage:(UIImage *)image {
+    __weak typeof(self) weakSelf = self;
   dispatch_async(dispatch_get_main_queue(), ^{
-    _coverView.image = image;
+    weakSelf.coverView.image = image;
   });
 }
 - (BOOL)shouldAutorotate {

+ 19 - 12
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/View/AliyunCoverPickView.m

@@ -43,14 +43,14 @@
     followLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
 
     _collectionView = [[UICollectionView alloc]
-             initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame),
+             initWithFrame:CGRectMake(0, 0, ScreenWidth-28,
                                       CGRectGetHeight(self.frame))
       collectionViewLayout:followLayout];
     _collectionView.dataSource = (id<UICollectionViewDataSource>)self;
     [_collectionView registerClass:[UICollectionViewCell class]
       forCellWithReuseIdentifier:@"cell"];
     [self addSubview:_collectionView];
-    UIView *view = [[UIView alloc] initWithFrame:self.bounds];
+    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth-28, CGRectGetHeight(self.frame))];
     view.backgroundColor = [UIColor clearColor];
     [self addSubview:view];
     
@@ -88,6 +88,8 @@
   array[0] = [NSValue valueWithCMTime:CMTimeMake(0.1 * 1000, 1000)];
 
   __block int index = 0;
+    
+    __weak typeof(self) weakSelf = self;
   [self.imageGenerator
       generateCGImagesAsynchronouslyForTimes:array
                            completionHandler:^(
@@ -99,11 +101,11 @@
                                UIImage *img =
                                    [[UIImage alloc] initWithCGImage:image];
                                dispatch_async(dispatch_get_main_queue(), ^{
-                                 [_imagesArray addObject:img];
+                                 [weakSelf.imagesArray addObject:img];
                                  NSIndexPath *indexPath =
                                      [NSIndexPath indexPathForItem:index
                                                          inSection:0];
-                                 [_collectionView
+                                 [weakSelf.collectionView
                                      insertItemsAtIndexPaths:@[ indexPath ]];
                                  index++;
                                });
@@ -167,11 +169,13 @@
     percent = 1;
   }
   CMTime time = CMTimeMake(percent * _duration * 1000, 1000);
+    __weak typeof(self) weakSelf = self;
+
   dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
                  ^{
-                   _selectedImage = [self coverImageAtTime:time];
-                   [_delegate pickViewDidUpdateImage:_selectedImage];
-                   _imageCaptured = YES;
+                   weakSelf.selectedImage = [weakSelf coverImageAtTime:time];
+                   [weakSelf.delegate pickViewDidUpdateImage:weakSelf.selectedImage];
+                     weakSelf.imageCaptured = YES;
                  });
   self.progressView.center = CGPointMake(CGRectGetWidth(self.frame) * percent,
                                          CGRectGetHeight(self.frame) / 2);
@@ -189,11 +193,13 @@
   CMTime time = CMTimeMake(percent * _duration * 1000, 1000);
   if (_imageCaptured) {
     _imageCaptured = NO;
+      __weak typeof(self) weakSelf = self;
+
     dispatch_async(
         dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-          _selectedImage = [self coverImageAtTime:time];
-          [_delegate pickViewDidUpdateImage:_selectedImage];
-          _imageCaptured = YES;
+          weakSelf.selectedImage = [self coverImageAtTime:time];
+          [weakSelf.delegate pickViewDidUpdateImage:weakSelf.selectedImage];
+          weakSelf.imageCaptured = YES;
         });
   }
   self.progressView.center = CGPointMake(CGRectGetWidth(self.frame) * percent,
@@ -210,10 +216,11 @@
     percent = 1;
   }
   CMTime time = CMTimeMake(percent * _duration * 1000, 1000);
+    __weak typeof(self) weakSelf = self;
   dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
                  ^{
-                   _selectedImage = [self coverImageAtTime:time];
-                   [_delegate pickViewDidUpdateImage:_selectedImage];
+                    weakSelf.selectedImage = [weakSelf coverImageAtTime:time];
+                   [weakSelf.delegate pickViewDidUpdateImage:weakSelf.selectedImage];
                  });
   self.progressView.center = CGPointMake(CGRectGetWidth(self.frame) * percent,
                                          CGRectGetHeight(self.frame) / 2);

+ 11 - 19
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m

@@ -9,10 +9,8 @@
 #import "AliyunCropViewController.h"
 #import <AVFoundation/AVFoundation.h>
 #import "AVAsset+VideoInfo.h"
-#import <AliyunVideoSDKPro/AliyunCrop.h>
-#import <AliyunVideoSDKPro/AliyunImageCrop.h>
-#import <AliyunVideoSDKPro/AliyunErrorCode.h>
-#import <AliyunVideoSDKPro/AliyunImporter.h>
+
+#import "AliyunVideoSDKPro/AliyunVideoSDKPro.h"
 #import "AliyunCropThumbnailView.h"
 #import "AliyunCycleProgressView.h"
 #import "AliyunCropViewBottomView.h"
@@ -109,6 +107,10 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     return YES;
 }
 
+- (UIStatusBarStyle)preferredStatusBarStyle {
+    return UIStatusBarStyleLightContent;
+}
+
 // 支持设备自动旋转
 - (BOOL)shouldAutorotate
 {
@@ -174,17 +176,18 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
         requestOptions.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
         requestOptions.synchronous = YES;
         requestOptions.networkAccessAllowed = YES;//打开网络获取iCloud的图片的功能
+        __weak typeof(self) weakSelf = self;
         [[PHImageManager defaultManager] requestImageForAsset:_cutInfo.phAsset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault options:requestOptions resultHandler:^(UIImage * _Nullable result, NSDictionary * _Nullable info) {
             if (result.imageOrientation == UIImageOrientationUp)  { //fix:iOS8下图片会旋转的问题
-                _stillImage = result;
-                _stillImageLayer.contents = (__bridge id _Nullable)(result.CGImage);
+                weakSelf.stillImage = result;
+                weakSelf.stillImageLayer.contents = (__bridge id _Nullable)(result.CGImage);
             } else {
                 UIGraphicsBeginImageContextWithOptions(result.size, NO, result.scale);
                 [result drawInRect:(CGRect){0, 0, result.size}];
                 UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext();
                 UIGraphicsEndImageContext();
-                _stillImage = normalizedImage;
-                _stillImageLayer.contents = (__bridge id _Nullable)(normalizedImage.CGImage);
+                weakSelf.stillImage = normalizedImage;
+                weakSelf.stillImageLayer.contents = (__bridge id _Nullable)(normalizedImage.CGImage);
             }
         }];
     }
@@ -284,7 +287,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
 #pragma mark - AliyunCropDelegate
 
 - (void)cropTaskOnProgress:(float)progress {
-    NSLog(@"~~~~~progress:%@", @(progress));
     if (_isCancel) {
         return;
     } else {
@@ -293,7 +295,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
 }
 
 - (void)cropOnError:(int)error {
-    NSLog(@"~~~~~~~crop error:%@", @(error));
     //裁剪退后台,sdk会报-314或者-310.这个是正常的,不需要弹窗
     if (_isCancel || error == -314 || error == -310 || error == ERROR_TRANS_BACKGROUND) {
         _isCancel = NO;
@@ -451,23 +452,14 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     _cutPanel.startTime = _cutInfo.startTime;
     _cutPanel.endTime = _cutInfo.endTime;
     
-//    _cutPanel.startTime = 0;
-//    _cutPanel.endTime = 5;
-    
-    _cutPanel.fadeDuration = 0;
-    _cutPanel.gop = _cutInfo.gop;
-    _cutPanel.fps = _cutInfo.fps;
-    _cutPanel.videoQuality = (AliyunVideoQuality)_cutInfo.videoQuality;
     if (_cutInfo.encodeMode == AliyunEncodeModeHardH264) {
         _cutPanel.encodeMode = 1;
     }else if (_cutInfo.encodeMode == AliyunEncodeModeSoftFFmpeg) {
         _cutPanel.encodeMode = 0;
     }
-    NSLog(@"裁剪编码方式:%d",_cutPanel.encodeMode);
     _cutPanel.fillBackgroundColor = _cutInfo.backgroundColor;
     _cutPanel.useHW = _cutInfo.gpuCrop;
     
-    NSLog(@"TestLog, %@:%@", @"log_crop_start_time", @([NSDate date].timeIntervalSince1970));
 
     int res = [_cutPanel startCrop];
     if (res == -100002){

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.h

@@ -32,10 +32,10 @@
 @property (nonatomic, strong) AlivcEditUIConfig *uiConfig;
 
 
-/**
- 完成的回调
- */
-@property (nonatomic, copy) AlivcEditFinishBlock finishBlock;
+///**
+// 完成的回调
+// */
+//@property (nonatomic, copy) AlivcEditFinishBlock finishBlock;
 
 
 /**

+ 35 - 32
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m

@@ -106,8 +106,8 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 // 配乐のView
 @property (nonatomic, strong) PublishMusicChooseView *musicView;
 
-@property (nonatomic, assign) CGFloat originAudioVolumn;
-@property (nonatomic, assign) CGFloat backAudioVolumn;
+@property (nonatomic, assign) int originAudioVolumn;
+@property (nonatomic, assign) int backAudioVolumn;
 
 /**
  当前控制器是否可见
@@ -192,15 +192,14 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
         AliyunClip *clip = [[AliyunClip alloc] initWithVideoPath:_videoPath animDuration:0];
         [importer addMediaClip:clip];
         [importer generateProjectConfigure];
-        NSLog(@"---------->clip.duration:%f",clip.duration);
         _config.outputPath = [[_taskPath stringByAppendingPathComponent:[AliyunPathManager randomString]] stringByAppendingPathExtension:@"mp4"];
     }
     _tryResumeWhenBack = NO;
     
     //防size异常奔溃处理
     if (_outputSize.height == 0 || _outputSize.width == 0) {
-        _outputSize.width = 720;
-        _outputSize.height = 1280;
+        _outputSize.width = 540;
+        _outputSize.height = 960;
         NSAssert(false, @"调试的时候崩溃,_outputSize分辨率异常处理");
     }
     //默认的ui配置
@@ -362,7 +361,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     self.isAppear = YES;
-    [[UIApplication sharedApplication] setStatusBarHidden:YES];
     if (_tryResumeWhenBack) {
         if (!_prePlaying) {
             [self resume];
@@ -392,7 +390,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
          respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
         self.navigationController.interactivePopGestureRecognizer.enabled = YES;
     };
-    [[UIApplication sharedApplication] setStatusBarHidden:NO];
     //停止编辑
     [self.editor stopEdit];
 }
@@ -654,12 +651,16 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadMusicAndCombineNoti:) name:@"DownloadMusicAndCombineNoti" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeAudioVolumn:) name:@"ChangeAudioVolumnNoti" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(musicViewDidClose:) name:@"EditCloseMusicChooseViewNoti" object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumnDidClose) name:@"EditCloseChooseVolumnNoti" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumnDidClose:) name:@"EditCloseChooseVolumnNoti" object:nil];
 
 }
 
-- (void)volumnDidClose {
-    [self hiddenButtonisHidden:false];
+- (void)volumnDidClose:(NSNotification *)noti {
+    if ([noti.object isEqual: @"1"]) {
+        [self hiddenButtonisHidden:false];
+    }else {
+        [self musicButtonClicked];
+    }
 }
 
 - (void)removeNotifications {
@@ -691,11 +692,11 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 
 - (void)changeAudioVolumn:(NSNotification *)noti {
     NSDictionary *paraDic = noti.object;
-    self.originAudioVolumn = [paraDic[@"origin"] floatValue];
-    self.backAudioVolumn   = [paraDic[@"back"] floatValue];
-
-    [self.editor setMainStreamsAudioWeight:_originAudioVolumn];
-    [self.editor setAudioWeight:_backAudioVolumn streamId:_curEffectVid];
+    self.originAudioVolumn = [paraDic[@"origin"] intValue];
+    self.backAudioVolumn   = [paraDic[@"back"] intValue];
+    
+    [self.editor setAudioWeight:self.backAudioVolumn streamId:self.curEffectVid];
+    [self.editor setMainStreamsAudioWeight:self.originAudioVolumn];
     [self hiddenButtonisHidden:false];
 }
 
@@ -782,26 +783,28 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
         
     } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
         // filePath就是你下载文件的位置,你可以解压,也可以直接拿来使用
-        
+
         NSString *musicFilePath = [filePath path];// 将NSURL转成NSString
-        NSLog(@"\n------下载音乐成功!path == %@", musicFilePath);
         
-        
-        AVURLAsset *asset = [AVURLAsset assetWithURL:[NSURL fileURLWithPath:musicFilePath]];
-        CGFloat musicDuration = [asset avAssetVideoTrackDuration];
-        
-        //如果录制的时候有音乐 编辑的时候重新音乐 则播放新的音乐
-        if (self.hasRecordMusic) {
-            [self.editor setAudioMixWeight:100];
+        if (musicFilePath == nil) {
+            [[SwiftProgressHUD shared] showText:@"音乐加载失败" textAlignment:(NSTextAlignmentLeft)];
+        }else {
+            AVURLAsset *asset = [AVURLAsset assetWithURL:[NSURL fileURLWithPath:musicFilePath]];
+            CGFloat musicDuration = [asset avAssetVideoTrackDuration];
+            
+            //如果录制的时候有音乐 编辑的时候重新音乐 则播放新的音乐
+            if (self.hasRecordMusic) {
+                [self.editor setAudioMixWeight:100];
+            }
+            [self.editor removeMusics];
+            AliyunEffectMusic *effectMusic =[[AliyunEffectMusic alloc] initWithFile:musicFilePath];
+            effectMusic.startTime = 0;
+            effectMusic.duration = musicDuration;
+            [self.editor applyMusic:effectMusic];
+            self.curEffectVid = [effectMusic effectVid];
+            
+            [self resume];
         }
-        [self.editor removeMusics];
-        AliyunEffectMusic *effectMusic =[[AliyunEffectMusic alloc] initWithFile:musicFilePath];
-        effectMusic.startTime = 0;
-        effectMusic.duration = musicDuration;
-        self.curEffectVid = [effectMusic effectVid];
-        [self.editor applyMusic:effectMusic];
-        
-        [self resume];
     }];
     
     // 开始执行下载

+ 16 - 13
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m

@@ -7,17 +7,16 @@
 //
 
 #import "AliyunMagicCameraViewController.h"
-#import <AliyunVideoSDKPro/AliyunIRecorder.h>
-#import "AliyunMagicCameraView.h"
 #import <AVFoundation/AVFoundation.h>
 #import <AVFoundation/AVCaptureSession.h>
-#import <AliyunVideoSDKPro/AliyunEffectFilter.h>
 #import <CoreMotion/CoreMotion.h>
+#import <AssetsLibrary/AssetsLibrary.h>
+#import "AliyunMagicCameraView.h"
+#import "AliyunVideoSDKPro/AliyunVideoSDKPro.h"
 #import "AliyunPathManager.h"
 #import "MBProgressHUD.h"
 #import "AliyunEffectResourceModel.h"
 #import "AVC_ShortVideo_Config.h"
-#import <AssetsLibrary/AssetsLibrary.h>
 #import "AlivcUIConfig.h"
 #import "AliyunReachability.h"
 #import "AliyunDBHelper.h"
@@ -29,11 +28,10 @@
 #import "UIView+AlivcHelper.h"
 #import "AlivcMacro.h"
 #import "AFNetworking.h"
-
 #import "RainbowPlanet-Swift.h"
 
 
-@interface AliyunMagicCameraViewController () <UIGestureRecognizerDelegate, UIAlertViewDelegate, AliyunIRecorderDelegate, AliyunEffectFilter2ViewDelegate>
+@interface AliyunMagicCameraViewController () <UIGestureRecognizerDelegate, UIAlertViewDelegate, AliyunIRecorderDelegate, AliyunEffectFilter2ViewDelegate,JXSegmentedListContainerViewListDelegate>
 {
     NSURLSessionDownloadTask *_downloadTask;
 }
@@ -142,7 +140,7 @@
 
 - (BOOL)prefersStatusBarHidden
 {
-    return YES;
+    return true;
 }
 
 - (void)viewDidLoad {
@@ -167,7 +165,7 @@
     if (CGSizeEqualToSize(size, CGSizeMake(320, 480)) || CGSizeEqualToSize(size, CGSizeMake(480, 320))) {
         _belowiPhone4s = YES;
     }
-    [self updateUIWithVideoSize:_quVideo.outputSize];
+    [self updateUIWithVideoSize:self.quVideo.outputSize];
     self.view.backgroundColor = [UIColor blackColor];
     
     //清除之前生成的录制路径
@@ -199,6 +197,7 @@
     _recorder.outputPath = _quVideo.outputPath?_quVideo.outputPath:videoSavePath;
     _recorder.taskPath = taskPath;
     _recorder.beautifyStatus = YES;
+    _recorder.beautifyValue = 100;
     
     _recorder.bitrate = _quVideo.bitrate;
     
@@ -221,6 +220,7 @@
     
     
     [self.dbHelper openResourceDBSuccess:nil failure:nil];
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
 }
 
 /**
@@ -255,8 +255,9 @@
         preFrame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
     }
     
+    __weak typeof(self) weakSelf = self;
     [UIView animateWithDuration:0.2 animations:^{
-        _magicCameraView.previewView.frame = preFrame;
+        weakSelf.magicCameraView.previewView.frame = preFrame;
     }];
     
     y = CGRectGetMaxY(_magicCameraView.previewView.frame);
@@ -824,6 +825,8 @@
     }
     if ([self.motionManager isDeviceMotionAvailable]) {
         self.motionManager.deviceMotionUpdateInterval =1;
+        __weak typeof(self) weakSelf = self;
+
         [self.motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion * _Nullable motion, NSError * _Nullable error) {
             // Gravity 获取手机的重力值在各个方向上的分量,根据这个就可以获得手机的空间位置,倾斜角度等
             double gravityX = motion.gravity.x;
@@ -831,16 +834,16 @@
             double xyTheta = atan2(gravityX,gravityY)/M_PI*180.0;//手机旋转角度。
             if (xyTheta >= -45 && xyTheta <= 45) {
                 //down
-                _cameraRotate =180;
+                weakSelf.cameraRotate =180;
             } else if (xyTheta > 45 && xyTheta < 135) {
                 //left
-                _cameraRotate = 90;
+                weakSelf.cameraRotate = 90;
             } else if ((xyTheta >= 135 && xyTheta < 180) || (xyTheta >= -180 && xyTheta < -135)) {
                 //up
-                _cameraRotate = 0;
+                weakSelf.cameraRotate = 0;
             } else if (xyTheta >= -135 && xyTheta < -45) {
                 //right
-                _cameraRotate = 270;
+                weakSelf.cameraRotate = 270;
             }
         }];
     }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListCell.swift

@@ -137,8 +137,8 @@ class PublishMusicListCell: UITableViewCell {
         let useButton = UIButton(type: UIButton.ButtonType.custom)
         useButton.setTitle("使用", for: UIControl.State.normal)
         useButton.titleLabel?.font = kRegularFont13
-        useButton.setBackgroundImage(UIImage.imageWithColor(color: k62CC74Color), for: UIControl.State.normal)
-        useButton.setTitleColor(kEnabledTitleColor, for: UIControl.State.normal)
+        useButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
+        useButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
         useButton.layer.cornerRadius = 13
         useButton.layer.masksToBounds = true
         useButton.rx.tap.subscribe(onNext: { [weak self] in

+ 5 - 6
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift

@@ -241,7 +241,7 @@ class PublishMusicVolumnView: FWPopupView {
         view.show()
         
         view.cancelButton.rx.tap.subscribe(onNext: { (data) in
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseChooseVolumnNoti"), object: nil)
+            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseChooseVolumnNoti"), object: "1")
             view.hide()
             
         }).disposed(by: view.disposeBag)
@@ -255,11 +255,10 @@ class PublishMusicVolumnView: FWPopupView {
             view.hide()
         }).disposed(by: view.disposeBag)
         
-        view.musicButton.rx.tap.subscribe(onNext: { (data) in            
-//            view.hide(popupDidDisappearBlock: { (view1) in
-//                _ = PublishMusicChooseView.publishMusicChooseView(attachedView: attachedView)
-//            })
-            
+        view.musicButton.rx.tap.subscribe(onNext: {[weak view] (data) in
+            view?.hide(popupDidDisappearBlock: { _ in
+                NotificationCenter.default.post(name: NSNotification.Name(rawValue: "EditCloseChooseVolumnNoti"), object: "0")
+            })
         }).disposed(by: view.disposeBag)
         
         view.volumnButton.rx.tap.subscribe(onNext: { (data) in

+ 8 - 19
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -28,23 +28,17 @@ public func kApiDataPrefix() -> String {
     }
 }
 
-let kVirusPersonalService = false
-let kVirusDevelopSever = true
-let kVirusBetaSever = false
-let kVirusProductSever = false
-
-
 // MARK: - Virus
 public func kApiVirusPrefix() -> String {
-    if kVirusPersonalService /** 接口前缀-个人服务器*/ {
+    if kPersonalService /** 接口前缀-个人服务器*/ {
         return ""
-    }else if kVirusDevelopSever /** 接口前缀-开发服务器*/ {
+    }else if kDevelopSever /** 接口前缀-开发服务器*/ {
         return ((ConfigModel.shared.object()?.virusUrl ?? "https://api.dev.caihongxingqiu.com/virus") + "/v2")
 //        return "https://api.dev.caihongxingqiu.com/virus/v2"
-    } else if kVirusBetaSever /** 接口前缀-测试服务器*/{
+    } else if kBetaSever /** 接口前缀-测试服务器*/{
         return ((ConfigModel.shared.object()?.virusUrl ?? "https://api.dev.caihongxingqiu.com/beta/virus") + "/v2")
 //        return "https://api.dev.caihongxingqiu.com/beta/virus/v2"
-    }else if kVirusProductSever /** 接口前缀-生产服务器*/ {
+    }else if kProductSever /** 接口前缀-生产服务器*/ {
         return ((ConfigModel.shared.object()?.virusUrl ?? "https://api.virus.caihongxingqiu.net") + "/v2")
 //        return "https://api.virus.caihongxingqiu.net"
     }else {
@@ -53,20 +47,15 @@ public func kApiVirusPrefix() -> String {
     
 }
 
-let kH5PersonalService = false
-let kH5DevelopSever = true
-let kH5BetaSever = false
-let kH5ProductSever = false
-
 // MARK: - H5
 public func kApiH5Prefix() -> String {
-    if kH5PersonalService /** 接口前缀-个人服务器*/ {
+    if kPersonalService /** 接口前缀-个人服务器*/ {
         return "http://192.168.23.238:8820"
-    }else if kH5DevelopSever /** 接口前缀-开发服务器*/ {
+    }else if kDevelopSever /** 接口前缀-开发服务器*/ {
         return "http://h5.dev.caihongxingqiu.com"
-    } else if kH5BetaSever /** 接口前缀-测试服务器*/{
+    } else if kBetaSever /** 接口前缀-测试服务器*/{
         return "http://h5.beta.caihongxingqiu.com"
-    }else if kH5ProductSever /** 接口前缀-生产服务器*/ {
+    }else if kProductSever /** 接口前缀-生产服务器*/ {
         return "http://h5.uptoyo.com"
     }else {
         return ""

+ 6 - 6
RainbowPlanet/RainbowPlanet/Tools/SwiftProgressHUD/SwiftProgressHUD.swift

@@ -8,7 +8,7 @@
 
 import UIKit
 
-class SwiftProgressHUD: NSObject {
+@objc class SwiftProgressHUD: NSObject {
     
     private static let _sharedInstance = SwiftProgressHUD()
 
@@ -36,7 +36,7 @@ class SwiftProgressHUD: NSObject {
 
     private let afterDelay = 1
 
-    class func shared() -> SwiftProgressHUD {
+    @objc class func shared() -> SwiftProgressHUD {
         return _sharedInstance
     }
 
@@ -74,7 +74,7 @@ class SwiftProgressHUD: NSObject {
     /// 只显示文本
     ///
     /// - Parameter title: 显示的标题
-    func showText(_ title: String = "",textAlignment :NSTextAlignment = .center) {
+    @objc func showText(_ title: String = "",textAlignment :NSTextAlignment = .center) {
         let hud = MBProgressHUD.showAdded(to: viewToShow(), animated: true)
         hud.mode = .text
         hud.detailsLabel.text = title
@@ -94,7 +94,7 @@ class SwiftProgressHUD: NSObject {
     /// 只显示文本
     ///
     /// - Parameter title: 显示的标题
-    func showText(_ title: String = "",view:UIView,textAlignment :NSTextAlignment = .center) {
+    @objc func showText(_ title: String = "",view:UIView,textAlignment :NSTextAlignment = .center) {
         let hud = MBProgressHUD.showAdded(to: view, animated: true)
         hud.mode = .text
         hud.detailsLabel.text = title
@@ -115,7 +115,7 @@ class SwiftProgressHUD: NSObject {
     /// 显示成功消息
     ///
     /// - Parameter title: 成功的提示语
-    func showSuccess(_ title: String = "",_ imageName: String = "success") {
+    @objc func showSuccess(_ title: String = "",_ imageName: String = "success") {
         let hud = MBProgressHUD.showAdded(to: viewToShow(), animated: true)
         hud.mode = .customView //模式设置为自定义视图
         hud.customView = UIImageView(image: UIImage(named: imageName)) //自定义视图显示图片
@@ -128,7 +128,7 @@ class SwiftProgressHUD: NSObject {
     /// 显示警告消息
     ///
     /// - Parameter title: 警告的提示语
-    func showWarning(_ title: String = "",_ imageName: String = "warning") {
+    @objc func showWarning(_ title: String = "",_ imageName: String = "warning") {
         let hud = MBProgressHUD.showAdded(to: viewToShow(), animated: true)
         hud.mode = .customView //模式设置为自定义视图
         hud.customView = UIImageView(image: UIImage(named: imageName)) //自定义视图显示图片