Просмотр исходного кода

Merge branch 'develop' into feature/jeremy

南鑫林 лет назад: 5
Родитель
Сommit
6e4bed7d44
13 измененных файлов с 111 добавлено и 23 удалено
  1. 4 0
      RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityVideoListModel.swift
  2. 3 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift
  3. 44 4
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift
  4. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m
  5. 2 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m
  6. 0 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m
  7. 27 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift
  8. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerNavigationView.swift
  9. 3 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakePhoto/PublishConfirmPhotoController.swift
  10. 1 1
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakePhoto/PublishTakePhotoController.swift
  11. 22 0
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_dot.imageset/Contents.json
  12. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_dot.imageset/music_btn_dot@2x.png
  13. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_dot.imageset/music_btn_dot@3x.png

+ 4 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityVideoListModel.swift

@@ -37,6 +37,8 @@ class CommunityVideoItemModel : NSObject, Mappable{
     var collectCount : Int?
     var commentCount : Int?
     var content : String?
+    var descUrl : String?
+    var h5url : String?
     var id : Int?
     var img : String?
     var isCollect : Int?
@@ -64,6 +66,8 @@ class CommunityVideoItemModel : NSObject, Mappable{
         collectCount <- map["collect_count"]
         commentCount <- map["comment_count"]
         content <- map["content"]
+        descUrl <- map["desc_url"]
+        h5url <- map["h5url"]
         id <- map["id"]
         img <- map["img"]
         isCollect <- map["is_collect"]

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -81,7 +81,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     typealias BackClosure = () -> Void
     var backClosure : BackClosure?
     
-    typealias ShareClosure = () -> Void
+    typealias ShareClosure = (_ videoItemMdl: CommunityVideoItemModel) -> Void
     var shareClosure : ShareClosure?
     
     typealias ButtonClickClosure = (_ clickType: videoBtnClickType, _ uid: Int, _ postId: Int) -> Void
@@ -402,7 +402,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         shareBtnRight.rx.tap.subscribe(onNext: {
             [weak self] (data) in
             if let shareClosure = self?.shareClosure {
-                shareClosure()
+                shareClosure(self!.videoItemMdl!)
             }
         }).disposed(by: disposeBag)
         return shareBtnRight
@@ -414,7 +414,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         shareBtnLeft.rx.tap.subscribe(onNext: {
             [weak self] (data) in
             if let shareClosure = self?.shareClosure {
-                shareClosure()
+                shareClosure(self!.videoItemMdl!)
             }
         }).disposed(by: disposeBag)
         return shareBtnLeft

+ 44 - 4
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -147,8 +147,8 @@ extension CommunityVideoListController: UICollectionViewDelegateFlowLayout,UICol
             self?.navigationController?.popViewController(animated: true)
         }
         cell.shareClosure = {
-            [weak self] in
-            print("------点击了[分享]")
+            [weak self] (videoItemMdl) in
+            self?.share(videoItemMdl)
         }
         cell.followClosure = { (videoItemMdl, followButton) in
             CommunityFollowUserViewModel.shared.follow(communityVideoItemModel: videoItemMdl, button: followButton)
@@ -241,8 +241,48 @@ extension CommunityVideoListController {
         }) {
             [weak self] (payType) in
         }
-        
-       
+    }
+    
+    /// 分享
+    func share(_ videoItemModel: CommunityVideoItemModel) {
+        var title = videoItemModel.title?.prefix(12)
+        if title == nil || title == "" {
+            title = videoItemModel.content?.prefix(12) ?? ""
+        }
+        let shareCommunityView =  ShareCommunityView.shareCommunityView(
+            title: "向好友传递美好生活,送TA 500彩虹豆",
+            detailTitle: "越多好友看到,收获彩虹豆越多",
+            h5Str: (videoItemModel.h5url ?? "" + "\(UserModel.shared().getModel()?.inviteCode ?? "")"),
+            thumbnailImg: videoItemModel.img ?? "",
+            sharedTitle: String(title ?? ""),
+            sharedDetailTitle: kCommunityPostDetailTitleShare,
+            shareCommunityViewType: ShareCommunityViewType.postDetail,
+            completion: {
+                VirusViewModel.shared.forwarVirueRecordAddApi(postId: videoItemModel.id, postAuthorUid: "\(videoItemModel.uid ?? 0)", title: videoItemModel.title, content: videoItemModel.content, postType: videoItemModel.type, postCover: videoItemModel.img)
+        })
+        shareCommunityView.saveCompletion = {
+            [weak self] in
+            let vc = CommunityShareContentViewController()
+            vc.imgUrl = videoItemModel.img
+            let communityPostDetailTopicModel = videoItemModel.topic?[0]
+            vc.topicStr = communityPostDetailTopicModel?.name ?? ""
+            if videoItemModel.title == "" || videoItemModel.title == nil {
+                vc.titleStr =
+                    String(videoItemModel.content?.prefix(20) ?? "")
+            }else {
+                vc.titleStr =                      String(videoItemModel.title?.prefix(20) ?? "")
+
+            }
+            vc.avatarStr = videoItemModel.avatar
+            vc.nameStr = videoItemModel.username
+            vc.H5UrlStr = (videoItemModel.h5url ?? "" + "\(UserModel.shared().getModel()?.inviteCode ?? "")")
+            vc.bean = videoItemModel.willCollectBean
+            vc.postId = videoItemModel.id
+            vc.uid = videoItemModel.uid
+            vc.type = videoItemModel.type
+            vc.contentStr = videoItemModel.content
+            self?.navigationController?.pushViewController(vc, animated: true)
+        }
     }
     
 }

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

@@ -122,7 +122,7 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
 }
 - (void)setupSubViews {
     
-    self.view.backgroundColor = [AliyunIConfig config].backgroundColor;
+    self.view.backgroundColor = RGBToColor(35, 42, 66);
     self.automaticallyAdjustsScrollViewInsets = NO;
     UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(previewTapGesture)];
     self.previewScrollView = [[UIScrollView alloc] init];

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

@@ -283,8 +283,8 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
     self.playSlider.minimumTrackTintColor = [UIColor whiteColor];
     self.playSlider.maximumTrackTintColor = rgba(0, 0, 0, 0.3);
     //
-    [self.playSlider setThumbImage:[UIImage imageNamed:@"edit_topic_delete"] forState:UIControlStateNormal];
-    [self.playSlider setThumbImage:[UIImage imageNamed:@"edit_topic_delete"] forState:UIControlStateHighlighted];
+    [self.playSlider setThumbImage:[UIImage imageNamed:@"music_btn_dot"] forState:UIControlStateNormal];
+    [self.playSlider setThumbImage:[UIImage imageNamed:@"music_btn_dot"] forState:UIControlStateHighlighted];
     [self.view addSubview:_playSlider];
 }
 

+ 0 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m

@@ -563,7 +563,6 @@
     _magicCameraView.musicButton.enabled = ![_clipManager partCount];
     NSLog(@"%zd",[_clipManager partCount]);
     [[UIApplication sharedApplication] setIdleTimerDisabled:YES];//录制模块禁止自动熄屏
-    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
     [self startRetainCameraRotate];
     //禁用侧滑手势
     self.navigationController.interactivePopGestureRecognizer.enabled = NO;
@@ -580,7 +579,6 @@
         [self stopPreview];
     }
     [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
-    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
     //启用侧滑手势
     self.navigationController.interactivePopGestureRecognizer.enabled = YES;
     [self.motionManager stopDeviceMotionUpdates];

+ 27 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/Controller/KSMediaPickerController.swift

@@ -46,6 +46,8 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
     @objc public let mediaType: KSMediaPickerController.mediaType
     @objc open weak var delegate: KSMediaPickerControllerDelegate?
     
+    var curSelectCount: UInt = 0
+    
     /// 限制单一媒体类型混合显示构造函数,此函数为指定初始化器
     ///
     /// - Parameters:
@@ -198,13 +200,36 @@ open class KSMediaPickerController: UIViewController, UICollectionViewDelegate,
             _updateHighlightItem(at: indexPath!)
         }
         
+        var selCount: UInt = 0
+        var maxCount: UInt = 0
+        let assetMediaType = itemModel.asset.mediaType
+        if assetMediaType == .video {
+            maxCount = 1
+        } else if assetMediaType == .image {
+            maxCount = 9
+        }
+        
         if itemModel.index > 0 {
-            return _remove(itemModel: itemModel)
+            selCount = _remove(itemModel: itemModel)
+            curSelectCount -= 1
         } else {
-            return _add(itemModel: itemModel)
+            selCount = _add(itemModel: itemModel)
+            curSelectCount = selCount
         }
+        
+        updateFinishBtnStatus(curSelectCount, maxCount)
+        
+        return selCount
     }
     
+    // 更新
+    func updateFinishBtnStatus(_ selCount: UInt, _ maxCount: UInt) {
+        let showMaxCount = selCount == 0 ? 0 : maxCount
+        
+        let view = self.view as! KSMediaPickerView
+        let nav = view.albumNavigationView
+        nav.nextButton.setTitle("完成(\(selCount)/\(showMaxCount))", for: .normal)
+    }
     
     private func _update(asset: PHAsset) {
         _updateHighlightedItemStatus()

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMediaPicker/View/KSMediaPickerNavigationView.swift

@@ -18,9 +18,9 @@ extension KSMediaPickerView {
         public let nextButton = {() -> UIButton in
             let nextButton = UIButton(type: .custom)
             nextButton.titleLabel?.font = .systemFont(ofSize: 14.0)
-            nextButton.setTitle("完成", for: .normal)
-            nextButton.setTitleColor(.ks_wordMain, for: .normal)
-            nextButton.setTitleColor(.ks_wordMain_2, for: .disabled)
+            nextButton.setTitle("完成(0/0)", for: .normal)
+            nextButton.setTitleColor(k333333Color, for: .normal)
+            nextButton.setTitleColor(k999999Color, for: .disabled)
             return nextButton
         }()
         
@@ -46,7 +46,7 @@ extension KSMediaPickerView {
             let viewY = UIView.statusBarSize.height
             let viewH = windowSize.height-viewY
             var viewW = viewH+30.0
-            closeButton.frame = CGRect(x: viewX, y: viewY, width: viewW, height: viewH)
+            closeButton.frame = CGRect(x: 5, y: viewY, width: 40, height: 44)
             
             viewW = nextButton.sizeThatFits(windowSize).width+30.0
             viewX = windowWidth-viewW

+ 3 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakePhoto/PublishConfirmPhotoController.swift

@@ -34,18 +34,17 @@ class PublishConfirmPhotoController: BaseViewController {
     
     override func setupLayouts() {        
         photoImageView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.bottom.equalTo(-kSafeTabBarHeight)
+            make.edges.equalToSuperview()
         }
         retakeBtn.snp.makeConstraints { (make) in
             make.left.equalTo(photoImageView.snp_left)
-            make.bottom.equalTo(photoImageView.snp_bottom)
+            make.bottom.equalTo(-kSafeTabBarHeight)
             make.width.equalTo(125)
             make.height.equalTo(48)
         }
         usePhotoBtn.snp.makeConstraints { (make) in
             make.right.equalTo(photoImageView.snp_right)
-            make.bottom.equalTo(photoImageView.snp_bottom)
+            make.bottom.equalTo(-kSafeTabBarHeight)
             make.width.equalTo(125)
             make.height.equalTo(48)
         }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishTakePhoto/PublishTakePhotoController.swift

@@ -47,7 +47,7 @@ class PublishTakePhotoController: BaseViewController {
     
     override func setupLayouts() {
         backButton.snp.makeConstraints { (make) in
-            make.top.equalTo(23)
+            make.top.equalTo(kSafeStatusBarHeight+3)
             make.left.equalTo(5)
             make.width.equalTo(40)
             make.height.equalTo(40)

+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_dot.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "music_btn_dot@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "music_btn_dot@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_dot.imageset/music_btn_dot@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/music_btn_dot.imageset/music_btn_dot@3x.png