Browse Source

Merge branch 'feature/dev_Chris' into develop

Chris 5 years ago
parent
commit
ef1f73a49b

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

@@ -464,6 +464,12 @@
 		BD7AB841228438C80030646A /* OrderPaySelfPickAddressCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB840228438C80030646A /* OrderPaySelfPickAddressCell.swift */; };
 		BD7AB8432284390B0030646A /* OrderPaySelfPickInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB8422284390B0030646A /* OrderPaySelfPickInfoCell.swift */; };
 		BD7AB8452284398A0030646A /* OrderPaySelfPickAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB8442284398A0030646A /* OrderPaySelfPickAddInfoCell.swift */; };
+		BD929CC222B8C3A50098C139 /* testVideoRecordVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CC122B8C3A50098C139 /* testVideoRecordVc.swift */; };
+		BD929CCA22B8CFB10098C139 /* AliyunPathManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BD929CC822B8CFB10098C139 /* AliyunPathManager.m */; };
+		BD929CCE22B904A30098C139 /* PublishViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CCD22B904A30098C139 /* PublishViewController.swift */; };
+		BD929CD222B906AA0098C139 /* PublishMediaPickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD122B906AA0098C139 /* PublishMediaPickerController.swift */; };
+		BD929CD422B906C10098C139 /* PublishVideoRecorderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */; };
+		BD929CD622B906D10098C139 /* PublishTakePhotoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD522B906D10098C139 /* PublishTakePhotoController.swift */; };
 		BDAA40F7228E947500CF841D /* OrderApplyRefundAccountCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40F6228E947500CF841D /* OrderApplyRefundAccountCell.swift */; };
 		BDAA40F9228E9ADA00CF841D /* OrderApplyRefundReasonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40F8228E9ADA00CF841D /* OrderApplyRefundReasonCell.swift */; };
 		BDAA40FB228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40FA228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift */; };
@@ -1007,6 +1013,13 @@
 		BD7AB8422284390B0030646A /* OrderPaySelfPickInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPaySelfPickInfoCell.swift; sourceTree = "<group>"; };
 		BD7AB8442284398A0030646A /* OrderPaySelfPickAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPaySelfPickAddInfoCell.swift; sourceTree = "<group>"; };
 		BD9052C044FD3AE4E62D3929 /* Pods-RainbowPlanet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RainbowPlanet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet.debug.xcconfig"; sourceTree = "<group>"; };
+		BD929CC122B8C3A50098C139 /* testVideoRecordVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = testVideoRecordVc.swift; sourceTree = "<group>"; };
+		BD929CC822B8CFB10098C139 /* AliyunPathManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunPathManager.m; sourceTree = "<group>"; };
+		BD929CC922B8CFB10098C139 /* AliyunPathManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunPathManager.h; sourceTree = "<group>"; };
+		BD929CCD22B904A30098C139 /* PublishViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishViewController.swift; sourceTree = "<group>"; };
+		BD929CD122B906AA0098C139 /* PublishMediaPickerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMediaPickerController.swift; sourceTree = "<group>"; };
+		BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishVideoRecorderController.swift; sourceTree = "<group>"; };
+		BD929CD522B906D10098C139 /* PublishTakePhotoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishTakePhotoController.swift; sourceTree = "<group>"; };
 		BDAA40F6228E947500CF841D /* OrderApplyRefundAccountCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundAccountCell.swift; sourceTree = "<group>"; };
 		BDAA40F8228E9ADA00CF841D /* OrderApplyRefundReasonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundReasonCell.swift; sourceTree = "<group>"; };
 		BDAA40FA228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundNoteInfoCell.swift; sourceTree = "<group>"; };
@@ -3613,6 +3626,10 @@
 		BD12B67122B4E96100AEB10B /* PublishModule */ = {
 			isa = PBXGroup;
 			children = (
+				BD929CCD22B904A30098C139 /* PublishViewController.swift */,
+				BD929CD122B906AA0098C139 /* PublishMediaPickerController.swift */,
+				BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */,
+				BD929CD522B906D10098C139 /* PublishTakePhotoController.swift */,
 				BD12B67222B4E99800AEB10B /* PublishMediaPicker */,
 				BD28077422B72175002AB976 /* PublishEditController */,
 			);
@@ -3915,6 +3932,9 @@
 			isa = PBXGroup;
 			children = (
 				BD3AA45722AE63EC00EF4F20 /* MessageMainViewController.swift */,
+				BD929CC922B8CFB10098C139 /* AliyunPathManager.h */,
+				BD929CC822B8CFB10098C139 /* AliyunPathManager.m */,
+				BD929CC122B8C3A50098C139 /* testVideoRecordVc.swift */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -4351,6 +4371,7 @@
 				A7931E1622AFAEF500297D0A /* TopicSelectionModel.swift in Sources */,
 				BDF47D7E22827C3F00941AB9 /* ProductSlidingTopBottomCollectionViewCell.swift in Sources */,
 				BD108C9522A60C2100837DAB /* HGImageCollectionViewCell.swift in Sources */,
+				BD929CD222B906AA0098C139 /* PublishMediaPickerController.swift in Sources */,
 				A7FF1589228C854900A85748 /* OrderDetailBottomView.swift in Sources */,
 				BD1FC1A722B1075F00D55081 /* UIColor+Expanded.m in Sources */,
 				BD12203122AF4A010051C7C2 /* MessageMainItemView.swift in Sources */,
@@ -4432,6 +4453,7 @@
 				A70B2C35228815F700B2449F /* ProductDetailProductSkuLabelCollectionViewCell.swift in Sources */,
 				A7931E0522AF827600297D0A /* ESTabBarItemContainer.swift in Sources */,
 				A70B2C60228870CE00B2449F /* ShopSectionHeaderView.swift in Sources */,
+				BD929CC222B8C3A50098C139 /* testVideoRecordVc.swift in Sources */,
 				A7CC7528227196C4003C4F38 /* AccountSecuritySetTableViewCell.swift in Sources */,
 				A7F2D6E122B25EF30093000B /* CardContentPicVideoModel.swift in Sources */,
 				A70B2C292286D77200B2449F /* ProductDetailProductInfoTableViewCell.swift in Sources */,
@@ -4525,6 +4547,7 @@
 				A72A72B422321DE000B21995 /* Extension+UIImage.swift in Sources */,
 				A7BB68552268DE8600AB07A2 /* SelfRecommendationView.swift in Sources */,
 				BD12B69622B4F72900AEB10B /* KSMediaPickerPreviewView.swift in Sources */,
+				BD929CD622B906D10098C139 /* PublishTakePhotoController.swift in Sources */,
 				A7BF203122B47CC000396DB3 /* CardContentCommnetTableViewCell.swift in Sources */,
 				A7D07CDA22B7DFAE00186014 /* OtherPersonalCenterHeaderView.swift in Sources */,
 				A72A72AF22321DE000B21995 /* AppInfo.swift in Sources */,
@@ -4573,8 +4596,10 @@
 				A771F07C226D4E1C007999DB /* AddressPOITableViewCell.swift in Sources */,
 				A70B842E228F97EC00882BC5 /* ProcuctDetailSelectSkuTableViewCell.swift in Sources */,
 				A72A72AE22321DE000B21995 /* CountdownButton.swift in Sources */,
+				BD929CCE22B904A30098C139 /* PublishViewController.swift in Sources */,
 				A71738AD228AB7B2000AEA6A /* ProductCommentListModel.swift in Sources */,
 				A7C0FDF822B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift in Sources */,
+				BD929CCA22B8CFB10098C139 /* AliyunPathManager.m in Sources */,
 				A7B4E71F228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift in Sources */,
 				A77F2CB72232010F001BD3F6 /* MineViewController.swift in Sources */,
 				A7778CA92244904500C7C47A /* Extension+Gifu.GIFImageView.swift in Sources */,
@@ -4698,6 +4723,7 @@
 				A70B2C3E228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift in Sources */,
 				A79057022276C9770037F823 /* SetPasswordModel.swift in Sources */,
 				BD12B68022B4EF2600AEB10B /* KSMediaPickerViewImageCell.swift in Sources */,
+				BD929CD422B906C10098C139 /* PublishVideoRecorderController.swift in Sources */,
 				A7274C5A228EE636000E3A07 /* LBXScanView.swift in Sources */,
 				A7FF1560228C693D00A85748 /* OrderViewController.swift in Sources */,
 				A729B5B42267254B004AE098 /* PasswordLoginViewController.swift in Sources */,

+ 4 - 1
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -36,7 +36,10 @@ class BaseTabbarViewController: ESTabBarController {
         
         tabBarViewController.didHijackHandler = {
             tabbarController, viewController, index in
-            let pickVc = KSMediaPickerController(maxVideoItemCount: 1, maxPictureItemCount: 9)
+//            let pickVc = KSMediaPickerController(maxVideoItemCount: 1, maxPictureItemCount: 9)
+//            tabbarController.present(pickVc, animated: true, completion: nil)
+            
+            let pickVc = PublishViewController()
             tabbarController.present(pickVc, animated: true, completion: nil)
         }
         

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

@@ -64,4 +64,7 @@
 //#import "KSPageControl.h"
 
 
+#import "AliyunPathManager.h"
+
+
 #endif /* RainbowPlanet_Bridging_Header_h */

+ 62 - 0
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/AliyunPathManager.h

@@ -0,0 +1,62 @@
+//
+//  AliyunPathManager.h
+//  AliyunVideo
+//
+//  Created by Worthy on 2017/3/11.
+//  Copyright (C) 2010-2017 Alibaba Group Holding Limited. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface AliyunPathManager : NSObject
+
+/**
+ 文件根目录
+
+ @return 文件根目录
+ */
++ (NSString *)aliyunRootPath;
+
+/**
+ 视频合成文件根目录
+
+ @return 视频合成文件根目录
+ */
++ (NSString *)compositionRootDir;
+
+/**
+ 创建一个视频合成临时文件夹
+
+ @return 视频合成临时文件夹
+ */
+//+ (NSString *)createCompositionDir;
+
+
+
+/**
+ 文件根目录的相对路径
+
+ @return 文件根目录 相对路径
+ */
++ (NSString *)quRelativeRootPath;
+
+
++ (void)clearDir:(NSString *)dirPath;
+
+
++ (NSString *)createRecrodDir;
+
++ (NSString *)createMagicRecordDir;
+
++ (NSString *)createResourceDir;
+
++ (NSString *)resourceRelativeDir;
+
+/**
+ 生成随机字符串
+
+ @return 随机字符串
+ */
++ (NSString*)randomString;
+
+@end

+ 79 - 0
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/AliyunPathManager.m

@@ -0,0 +1,79 @@
+//
+//  AliyunPathManager.m
+//  AliyunVideo
+//
+//  Created by Worthy on 2017/3/11.
+//  Copyright (C) 2010-2017 Alibaba Group Holding Limited. All rights reserved.
+//
+
+#import "AliyunPathManager.h"
+
+@implementation AliyunPathManager
+
+#pragma mark - Public
+
++ (NSString *)aliyunRootPath {
+    return [[self rootPath] stringByAppendingPathComponent:@"com.duanqu.demo"];
+}
+
++ (NSString *)quCachePath {
+    return [[self cachePath] stringByAppendingPathComponent:@"com.duanqu.demo"];
+}
+
++ (NSString *)compositionRootDir {
+    return [[self aliyunRootPath] stringByAppendingPathComponent:@"composition"];
+}
+
++ (NSString *)quRelativeRootPath {
+    
+    return @"Documents/com.duanqu.demo";
+}
+
+//+ (NSString *)createCompositionDir {
+//    NSString *root = [self compositionRootDir];
+//    NSString *dir = [root stringByAppendingPathComponent:[self uuidString]];
+//    [[NSFileManager defaultManager] createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil];
+//    return dir;
+//}
+
++ (void)clearDir:(NSString *)dirPath {
+    [[NSFileManager defaultManager] removeItemAtPath:dirPath error:nil];
+    [[NSFileManager defaultManager] createDirectoryAtPath:dirPath withIntermediateDirectories:YES attributes:nil error:nil];
+}
+
++ (NSString*)randomString {
+    CFUUIDRef puuid = CFUUIDCreate(nil);
+    CFStringRef uuidString = CFUUIDCreateString(nil, puuid);
+    NSString * result = (NSString *)CFBridgingRelease(CFStringCreateCopy( NULL, uuidString));
+    CFRelease(puuid);
+    CFRelease(uuidString);
+    return result;
+}
+
++ (NSString *)createRecrodDir {
+    return [[self aliyunRootPath] stringByAppendingPathComponent:@"record"];
+}
+
++ (NSString *)createMagicRecordDir {
+    return [[self aliyunRootPath] stringByAppendingPathComponent:@"magicRecord"];
+}
+
++ (NSString *)createResourceDir {
+    return [[self aliyunRootPath] stringByAppendingPathComponent:@"QPRes"];
+}
+
++ (NSString *)resourceRelativeDir {
+    return [[self quRelativeRootPath] stringByAppendingPathComponent:@"QPRes"];
+}
+
+#pragma mark - Private
+
++ (NSString *)rootPath {
+    return NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
+}
+
++ (NSString *)cachePath {
+    return NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
+}
+
+@end

+ 103 - 0
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/testVideoRecordVc.swift

@@ -0,0 +1,103 @@
+//
+//  testVideoRecordVc.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import AliyunVideoSDKPro
+
+class testVideoRecordVc: BaseViewController {
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        
+        
+        
+        recorder.startPreview()
+        // 开始预览,cameraPosition 摄像头位置(前置、后置)
+//        recorder.startPreview(withPositon: AliyunIRecorderCameraPosition.back)
+    }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        recorder.stopPreview()
+        recorder.destroy()
+    }
+    
+    
+    private lazy var recorder: AliyunIRecorder = {
+        //清除之前生成的录制路径
+        let recordDir: String = AliyunPathManager.createRecrodDir()
+        AliyunPathManager.clearDir(recordDir)
+        //生成这次的存储路径
+        let taskPath: String = recordDir.appending(AliyunPathManager.randomString())
+        //视频存储路径
+        let videoSavePath: String = taskPath.appending(AliyunPathManager.randomString()).appending("mp4")
+        
+        
+        let recorder = AliyunIRecorder.init(delegate: self as? AliyunIRecorderDelegate, videoSize: CGSize(width: 720, height: 1280))
+        
+        // 预览视图,必须设置
+        recorder?.preview = self.view;
+        
+        // 摄像头角度
+        recorder?.cameraRotate = 270;
+        
+        /*
+         视频的输出路径
+         注意:若上一次录制的 outputPath 路径的视频存在沙盒里没有删除,并且与本次录制的视频路径且相同重名的话,录制将会失败
+         */
+        recorder?.outputPath = videoSavePath
+        
+        // 视频的输出类型
+        recorder?.outputType = AliyunIRecorderVideoOutputPixelFormatType.type420f
+        
+        /*
+         文件配置路径
+         注意:若上一次录制的 taskPath  路径的视频存在沙盒里没有删除,并且与本次录制的视频路径相且同重名的话,录制将会失败
+         */
+        recorder?.taskPath = taskPath;
+        
+        // 美颜状态
+        recorder?.beautifyStatus = true;
+        
+        // 设置美颜度 [0,100]
+        recorder?.beautifyValue = 0;
+        
+        // 后置摄像头采集分辨率 默认:AVCaptureSessionPreset640x480
+        recorder?.backCaptureSessionPreset = AVCaptureSession.Preset.hd1280x720.rawValue
+        
+        // 前置摄像头采集分辨率 默认:AVCaptureSessionPreset640x480
+        recorder?.frontCaptureSessionPreset = AVCaptureSession.Preset.hd1280x720.rawValue
+        
+        // 设置视频最大时长 默认8
+        recorder?.clipManager.maxDuration = 30;
+        
+        return recorder!
+    }()
+    
+//    func recordButtonTouchesBegin {
+//    // 点击录制button开始录制
+//    [self.recorder startRecording];
+//    }
+//    func recordButtonTouchesEnd {
+//    // 点击录制button停止录制
+//    [self.recorder stopRecording];
+//    }
+//    func recorderDidStopRecording {
+//    // 收到录制停止回调,调用完成录制
+//    [self.recorder finishRecording];
+//    }
+//    func recorderDidStopWithMaxDuration {
+//    // 收到录制达到最大时长回调,调用完成录制
+//    [self.recorder finishRecording];
+//    }
+//    func recorderDidFinishRecording {
+//    // 收到完成录制回调,视频已经保存到初始化设置的`视频输出沙盒路径`路径下
+//    }
+    
+}
+

+ 0 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift

@@ -280,8 +280,6 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
             collectionView.performBatchUpdates({
                 collectionView.reloadItems(at: indexPaths)
             }, completion: nil)
-            //FIXME: disable
-//            view.albumNavigationView.centerButton.isEnabled = !isLastItem
         }
         view.albumNavigationView.nextButton.isEnabled = lastCount > 0
         return lastCount
@@ -371,8 +369,6 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
             }
         }
         let albumNavigationView = view.albumNavigationView
-        //FIXME: disable
-//        albumNavigationView.centerButton.isEnabled = true
         albumNavigationView.nextButton.isEnabled = selectedAssetArray.count > 0
         return 0
     }

+ 79 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPickerController.swift

@@ -0,0 +1,79 @@
+//
+//  PublishMediaPickerController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import JXSegmentedView
+
+class PublishMediaPickerController: BaseViewController {
+    
+    var orderNumber: String? {
+        didSet {
+            numLbl.text = self.orderNumber
+        }
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupData()
+        
+    }
+    
+    override func setupViews() {
+        navigationBar.title = "mediaPicker"
+        
+        self.view.backgroundColor = kf7f8faColor
+        
+        let serialNumView = UIView()
+        serialNumView.backgroundColor = kffffffColor
+        self.view.addSubview(serialNumView)
+        serialNumView.snp.makeConstraints { (make) in
+            make.left.right.equalToSuperview()
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight+40+10)
+            make.height.equalTo(44)
+        }
+        
+        let titleLbl = UILabel()
+        titleLbl.text = "订单编号"
+        titleLbl.textColor = k999999Color
+        titleLbl.font = kRegularFont13
+        serialNumView.addSubview(titleLbl)
+        titleLbl.snp.makeConstraints { (make) in
+            make.left.equalTo(14)
+            make.centerY.equalToSuperview()
+            make.height.equalTo(20)
+        }
+        
+        serialNumView.addSubview(numLbl)
+        numLbl.snp.makeConstraints { (make) in
+            make.centerY.equalTo(titleLbl.snp_centerY)
+            make.left.equalTo(titleLbl.snp_right).offset(20)
+            make.height.equalTo(titleLbl)
+        }
+        
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    private lazy var numLbl: UILabel = {
+        let numLbl = UILabel()
+        numLbl.textColor = k333333Color
+        numLbl.font = kRegularFont13
+        return numLbl
+    }()
+    
+}
+
+extension PublishMediaPickerController : JXSegmentedListContainerViewListDelegate {
+    func listView() -> UIView {
+        return view
+    }
+}

+ 80 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakePhotoController.swift

@@ -0,0 +1,80 @@
+//
+//  PublishTakePhotoController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+import JXSegmentedView
+
+class PublishTakePhotoController: BaseViewController {
+    
+    var orderNumber: String? {
+        didSet {
+            numLbl.text = self.orderNumber
+        }
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupData()
+        
+    }
+    
+    override func setupViews() {
+        navigationBar.title = "mediaPicker"
+        
+        self.view.backgroundColor = kf7f8faColor
+        
+        let serialNumView = UIView()
+        serialNumView.backgroundColor = kffffffColor
+        self.view.addSubview(serialNumView)
+        serialNumView.snp.makeConstraints { (make) in
+            make.left.right.equalToSuperview()
+            make.top.equalToSuperview().offset(kSafeStatusBarHeight+40+10)
+            make.height.equalTo(44)
+        }
+        
+        let titleLbl = UILabel()
+        titleLbl.text = "订单编号"
+        titleLbl.textColor = k999999Color
+        titleLbl.font = kRegularFont13
+        serialNumView.addSubview(titleLbl)
+        titleLbl.snp.makeConstraints { (make) in
+            make.left.equalTo(14)
+            make.centerY.equalToSuperview()
+            make.height.equalTo(20)
+        }
+        
+        serialNumView.addSubview(numLbl)
+        numLbl.snp.makeConstraints { (make) in
+            make.centerY.equalTo(titleLbl.snp_centerY)
+            make.left.equalTo(titleLbl.snp_right).offset(20)
+            make.height.equalTo(titleLbl)
+        }
+        
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    private lazy var numLbl: UILabel = {
+        let numLbl = UILabel()
+        numLbl.textColor = k333333Color
+        numLbl.font = kRegularFont13
+        return numLbl
+    }()
+    
+}
+
+extension PublishTakePhotoController : JXSegmentedListContainerViewListDelegate {
+    func listView() -> UIView {
+        return view
+    }
+}
+

+ 109 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishVideoRecorderController.swift

@@ -0,0 +1,109 @@
+//
+//  PublishVideoRecorderController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import JXSegmentedView
+import AliyunVideoSDKPro
+
+class PublishVideoRecorderController: BaseViewController {
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        
+        
+        
+        recorder.startPreview()
+        // 开始预览,cameraPosition 摄像头位置(前置、后置)
+        //        recorder.startPreview(withPositon: AliyunIRecorderCameraPosition.back)
+    }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        recorder.stopPreview()
+        recorder.destroy()
+    }
+    
+    
+    private lazy var recorder: AliyunIRecorder = {
+        //清除之前生成的录制路径
+        let recordDir: String = AliyunPathManager.createRecrodDir()
+        AliyunPathManager.clearDir(recordDir)
+        //生成这次的存储路径
+        let taskPath: String = recordDir.appending(AliyunPathManager.randomString())
+        //视频存储路径
+        let videoSavePath: String = taskPath.appending(AliyunPathManager.randomString()).appending("mp4")
+        
+        
+        let recorder = AliyunIRecorder.init(delegate: self as? AliyunIRecorderDelegate, videoSize: CGSize(width: 720, height: 1280))
+        
+        // 预览视图,必须设置
+        recorder?.preview = self.view;
+        
+        // 摄像头角度
+        recorder?.cameraRotate = 270;
+        
+        /*
+         视频的输出路径
+         注意:若上一次录制的 outputPath 路径的视频存在沙盒里没有删除,并且与本次录制的视频路径且相同重名的话,录制将会失败
+         */
+        recorder?.outputPath = videoSavePath
+        
+        // 视频的输出类型
+        recorder?.outputType = AliyunIRecorderVideoOutputPixelFormatType.type420f
+        
+        /*
+         文件配置路径
+         注意:若上一次录制的 taskPath  路径的视频存在沙盒里没有删除,并且与本次录制的视频路径相且同重名的话,录制将会失败
+         */
+        recorder?.taskPath = taskPath;
+        
+        // 美颜状态
+        recorder?.beautifyStatus = true;
+        
+        // 设置美颜度 [0,100]
+        recorder?.beautifyValue = 0;
+        
+        // 后置摄像头采集分辨率 默认:AVCaptureSessionPreset640x480
+        recorder?.backCaptureSessionPreset = AVCaptureSession.Preset.hd1280x720.rawValue
+        
+        // 前置摄像头采集分辨率 默认:AVCaptureSessionPreset640x480
+        recorder?.frontCaptureSessionPreset = AVCaptureSession.Preset.hd1280x720.rawValue
+        
+        // 设置视频最大时长 默认8
+        recorder?.clipManager.maxDuration = 30;
+        
+        return recorder!
+    }()
+    
+    //    func recordButtonTouchesBegin {
+    //    // 点击录制button开始录制
+    //    [self.recorder startRecording];
+    //    }
+    //    func recordButtonTouchesEnd {
+    //    // 点击录制button停止录制
+    //    [self.recorder stopRecording];
+    //    }
+    //    func recorderDidStopRecording {
+    //    // 收到录制停止回调,调用完成录制
+    //    [self.recorder finishRecording];
+    //    }
+    //    func recorderDidStopWithMaxDuration {
+    //    // 收到录制达到最大时长回调,调用完成录制
+    //    [self.recorder finishRecording];
+    //    }
+    //    func recorderDidFinishRecording {
+    //    // 收到完成录制回调,视频已经保存到初始化设置的`视频输出沙盒路径`路径下
+    //    }
+    
+}
+
+extension PublishVideoRecorderController : JXSegmentedListContainerViewListDelegate {
+    func listView() -> UIView {
+        return view
+    }
+}

+ 153 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -0,0 +1,153 @@
+//
+//  PublishViewController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/6/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import JXSegmentedView
+
+class PublishViewController: BaseViewController {
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    override func setupViews() {        
+        view.addSubview(segmentedView)
+        view.addSubview(listContainerView)
+    }
+    
+    override func setupLayouts() {
+        segmentedView.snp.makeConstraints { (make) in
+            make.right.equalTo(-48)
+            make.height.equalTo(48)
+            make.left.equalTo(48)
+            make.bottom.equalTo(-kSafeTabBarHeight)
+        }
+        listContainerView.snp.makeConstraints { (make) in
+            make.top.left.right.equalToSuperview()
+            make.bottom.equalTo(segmentedView.snp_top)
+        }
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    //1.初始化JXSegmentedViewx
+    private lazy var segmentedView: JXSegmentedView = {
+        let segmentedView = JXSegmentedView()
+        segmentedView.delegate = self
+        segmentedView.dataSource = segmentedDataSource
+        segmentedView.indicators = [indicator]
+        segmentedView.contentScrollView = listContainerView.scrollView
+        segmentedView.selectItemAt(index: 0)
+        segmentedView.defaultSelectedIndex = 0
+        segmentedView.contentEdgeInsetLeft = 4
+        segmentedView.contentEdgeInsetRight = 4
+        return segmentedView
+    }()
+    
+    //2.初始化dataSource
+    private lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
+        let segmentedDataSource = JXSegmentedTitleDataSource()
+        segmentedDataSource.titles = ["相册","拍视频","拍照"]
+        segmentedDataSource.isTitleColorGradientEnabled = true
+        segmentedDataSource.isItemSpacingAverageEnabled = true
+        segmentedDataSource.isTitleZoomEnabled = true
+        segmentedDataSource.titleNormalColor = kbbbbbbColor
+        segmentedDataSource.titleSelectedColor = k333333Color
+        segmentedDataSource.titleNormalFont = kRegularFont14!
+        segmentedDataSource.titleSelectedFont = kBoldFont22
+        
+        //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
+        segmentedDataSource.reloadData(selectedIndex: 0)
+        
+        return segmentedDataSource
+    }()
+    
+    //3.初始化指示器indicator
+    private lazy var indicator: JXSegmentedIndicatorLineView = {
+        let indicator = JXSegmentedIndicatorLineView()
+        indicator.indicatorColor = k62CC74Color
+        indicator.indicatorHeight = 3
+        indicator.indicatorWidth = 20
+        return indicator
+    }()
+    
+    //4.初始化JXSegmentedListContainerView
+    private lazy var listContainerView: JXSegmentedListContainerView = {
+        let listContainerView = JXSegmentedListContainerView(dataSource: self)
+        listContainerView.didAppearPercent = 0.01
+        listContainerView.defaultSelectedIndex = 0
+        return listContainerView
+    }()
+    
+}
+
+extension PublishViewController : JXSegmentedViewDelegate {
+    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
+    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
+        switch index {
+        case 0:
+            self.segmentedView.backgroundColor = .white
+        case 1:
+            self.segmentedView.backgroundColor = .clear
+        case 2:
+            self.segmentedView.backgroundColor = .clear
+        default:
+            break
+        }
+    }
+    
+    // 点击选中的情况才会调用该方法
+    func segmentedView(_ segmentedView: JXSegmentedView, didClickSelectedItemAt index: Int) {
+        //传递didClickSelectedItemAt事件给listContainerView,必须调用!!!
+        listContainerView.didClickSelectedItem(at: index)
+    }
+    
+    // 滚动选中的情况才会调用该方法
+    func segmentedView(_ segmentedView: JXSegmentedView, didScrollSelectedItemAt index: Int) {
+        
+    }
+    
+    // 正在滚动中的回调
+    func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
+        //传递scrolling事件给listContainerView,必须调用!!!
+        listContainerView.segmentedViewScrolling(from: leftIndex, to: rightIndex, percent: percent, selectedIndex: segmentedView.selectedIndex)
+    }
+    
+    /// 是否允许点击选中目标index的item
+    func segmentedView(_ segmentedView: JXSegmentedView, canClickItemAt index: Int) -> Bool {
+        return true
+    }
+}
+
+extension PublishViewController :JXSegmentedListContainerViewDataSource {
+    
+    func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
+        if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
+            return titleDataSource.dataSource.count
+        }
+        return 0
+    }
+    func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
+        switch index {
+        case 0:
+            let mediaVc = PublishMediaPickerController()
+            return mediaVc
+        case 1:
+            let videoVc = PublishVideoRecorderController()
+            return videoVc        
+        default:
+            let photoVc = PublishTakePhotoController()
+            return photoVc
+        }
+    }
+}