南鑫林 5 年 前
コミット
eb1dc5a2b4
共有18 個のファイルを変更した300 個の追加122 個の削除を含む
  1. 7 11
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 0 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserTableViewCell.swift
  3. 2 3
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift
  4. 8 7
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityShareContent/CommunityShareContentViewController.swift
  5. 7 5
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunitySubComment/ViewController/CommunitySubCommentController.swift
  6. 2 4
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityAllCommentView.swift
  7. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/CommunityVideoSubCommentController.swift
  8. 1 5
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/OtherPersonalCenter/ViewController/OtherPersonalCenterViewController.swift
  9. 6 5
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/ViewController/UserPersonalCenterViewController.swift
  10. 5 3
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/Controller/AliyunCoverPickViewController.m
  11. 3 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m
  12. 21 17
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m
  13. 23 12
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m
  14. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift
  15. 2 2
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishRecommendMusicController.swift
  16. 0 5
      RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift
  17. 57 0
      RainbowPlanet/RainbowPlanet/Tools/QRCode/QRCode.swift
  18. 150 34
      RainbowPlanet/RainbowPlanet/ViewModel/Virus/VirusViewModel.swift

+ 7 - 11
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -326,6 +326,7 @@
 		A7AA9F6322C62B270086498B /* CommunityRecommnendViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AA9F6222C62B270086498B /* CommunityRecommnendViewController.swift */; };
 		A7AA9F6522C63DCD0086498B /* CommunityFollowFeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AA9F6422C63DCD0086498B /* CommunityFollowFeedModel.swift */; };
 		A7AA9F6722C640F10086498B /* CommunityRecommendFeedModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AA9F6622C640F10086498B /* CommunityRecommendFeedModel.swift */; };
+		A7AD2795231365470099B3E0 /* QRCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7AD2794231365470099B3E0 /* QRCode.swift */; };
 		A7B4E71F228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E71E228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift */; };
 		A7B4E721228151F40012914A /* ProductFloorTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E720228151F40012914A /* ProductFloorTitleView.swift */; };
 		A7B4E723228154750012914A /* ProductFloorBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B4E722228154750012914A /* ProductFloorBannerView.swift */; };
@@ -1058,6 +1059,7 @@
 		A7AA9F6222C62B270086498B /* CommunityRecommnendViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityRecommnendViewController.swift; sourceTree = "<group>"; };
 		A7AA9F6422C63DCD0086498B /* CommunityFollowFeedModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunityFollowFeedModel.swift; sourceTree = "<group>"; };
 		A7AA9F6622C640F10086498B /* CommunityRecommendFeedModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunityRecommendFeedModel.swift; sourceTree = "<group>"; };
+		A7AD2794231365470099B3E0 /* QRCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCode.swift; sourceTree = "<group>"; };
 		A7B4E71E228131720012914A /* ProductSlidingLeftRightCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductSlidingLeftRightCollectionViewCell.swift; sourceTree = "<group>"; };
 		A7B4E720228151F40012914A /* ProductFloorTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorTitleView.swift; sourceTree = "<group>"; };
 		A7B4E722228154750012914A /* ProductFloorBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFloorBannerView.swift; sourceTree = "<group>"; };
@@ -3380,6 +3382,7 @@
 		A77F2CBC2232022A001BD3F6 /* Tools */ = {
 			isa = PBXGroup;
 			children = (
+				A7AD2793231365250099B3E0 /* QRCode */,
 				A7EE6E1323055A6000628D39 /* MemoryManager */,
 				A7EF3E112303EB6C001E4D26 /* GuidePageView */,
 				A76068F122E4B0ED008DF18F /* UImage+Gif */,
@@ -3744,19 +3747,12 @@
 			path = Router;
 			sourceTree = "<group>";
 		};
-		A7AD2745230F8D7C0099B3E0 /* PhotoPicker */ = {
+		A7AD2793231365250099B3E0 /* QRCode */ = {
 			isa = PBXGroup;
 			children = (
-				A7AD274B230F8D7C0099B3E0 /* TLPhotoPicker */,
+				A7AD2794231365470099B3E0 /* QRCode.swift */,
 			);
-			path = PhotoPicker;
-			sourceTree = "<group>";
-		};
-		A7AD274B230F8D7C0099B3E0 /* TLPhotoPicker */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = TLPhotoPicker;
+			path = QRCode;
 			sourceTree = "<group>";
 		};
 		A7B4E71B22812D390012914A /* ShoppingMallSlidingLeftRight */ = {
@@ -5009,7 +5005,6 @@
 		BD12B67122B4E96100AEB10B /* PublishModule */ = {
 			isa = PBXGroup;
 			children = (
-				A7AD2745230F8D7C0099B3E0 /* PhotoPicker */,
 				BD929CCD22B904A30098C139 /* PublishViewController.swift */,
 				BDE376C922C1B5350055E2EA /* AliyunVideo */,
 				BD12B67222B4E99800AEB10B /* PublishMediaPicker */,
@@ -6631,6 +6626,7 @@
 				A729B5A82266F2E0004AE098 /* AlertSheetView.swift in Sources */,
 				A7D07CC322B745C800186014 /* PersonViewUserAndOtherHeaderView.swift in Sources */,
 				A7CC75382271ADD6003C4F38 /* AddressManagerSelfMentionExpressHeaderView.swift in Sources */,
+				A7AD2795231365470099B3E0 /* QRCode.swift in Sources */,
 				A714348C22DDA3E400132DA9 /* CMSRedemptionAreaModel.swift in Sources */,
 				A738D66F225D9BD900EEE860 /* UMLoginModel.swift in Sources */,
 				A7FF156C228C6E5E00A85748 /* OrderTotalAmountTableViewCell.swift in Sources */,

+ 0 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserTableViewCell.swift

@@ -129,7 +129,6 @@ class CardContentUserTableViewCell: UITableViewCell {
         followButton.layer.borderColor = kThemeColor.cgColor
         followButton.alpha = 0
         followButton.rx.tap.subscribe(onNext: {[weak self] (data) in
-            self?.followButton.isEnabled = false
             if let followClosure = self?.followClosure {
                 followClosure()
             }

+ 2 - 3
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -509,10 +509,9 @@ extension CommunityRecommendController {
         let communityCustomCommnetModel = CommunityCustomCommnetModel()
         communityCustomCommnetModel.postId = communityPostDetailModel?.id ?? 0
         communityCustomCommnetModel.content = text
+
         if communityPostCommentModel != nil {
             communityCustomCommnetModel.parentId = communityPostCommentModel?.id
-            communityCustomCommnetModel.replyUid = communityPostCommentModel?.uid
-            communityCustomCommnetModel.replyUsername = communityPostCommentModel?.username
         }
 
         SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(communityCustomCommnetModel: communityCustomCommnetModel) {
@@ -546,7 +545,7 @@ extension CommunityRecommendController {
                     self?.communityPostCommentModel?.reply = Array<CommunityPostReplyModel>()
                 }
                 self?.communityPostCommentModel?.reply?.insert(communityPostReplyModel, at: 0)
-                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
+                VirusViewModel.shared.commentReply(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
             }
             self?.count += 1
             self?.communityPostDetailModel?.commentCount = self?.count

+ 8 - 7
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityShareContent/CommunityShareContentViewController.swift

@@ -129,13 +129,14 @@ class CommunityShareContentViewController: BaseViewController {
 
         nameLable.text = nameStr ?? ""
         
-        if let tryImage = EFQRCode.generate(
-            content: H5UrlStr ?? "",
-            size: EFIntSize(width: Int(90*kScaleWidth), height: Int(90*kScaleWidth))
-        ) {
-            QRCodeImageView.image = UIImage(cgImage: tryImage)
-        } else {
-        }
+//        if let tryImage = EFQRCode.generate(
+//            content: H5UrlStr ?? "",
+//            size: EFIntSize(width: Int(90*kScaleWidth), height: Int(90*kScaleWidth))
+//        ) {
+//            QRCodeImageView.image = UIImage(cgImage: tryImage)
+//        } else {
+//        }
+        QRCodeImageView.image = QRCode.createQRForString(qrString: H5UrlStr, qrImageName: "")
         scanLabel.text = "扫码查看内容 领取\(bean ?? 0)U米"
         
         avatarImageView.kf.setImage(with: kURLThumbnailsImage(name: avatarStr ?? "",size: CGSize(width: 20*kScaleWidth, height: 20*kScaleWidth)), placeholder: kImage(name: "default_pic"),completionHandler:{ [weak self] (image, error, cacheType, url) in

+ 7 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunitySubComment/ViewController/CommunitySubCommentController.swift

@@ -130,8 +130,11 @@ extension CommunitySubCommentController {
         communityCustomCommnetModel.postId = communityPostDetailModel?.id ?? 0
         communityCustomCommnetModel.content = text
         communityCustomCommnetModel.parentId = communityPostCommentModel?.id
-        communityCustomCommnetModel.replyUid = communityPostReplyModel?.uid
-        communityCustomCommnetModel.replyUsername = communityPostReplyModel?.username
+        if self.communityPostReplyModel != nil {
+            communityCustomCommnetModel.replyUid = communityPostReplyModel?.uid
+            communityCustomCommnetModel.replyUsername = communityPostReplyModel?.username
+        }
+       
         SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(communityCustomCommnetModel: communityCustomCommnetModel) {
             [weak self] (communityPostCommentIdModel) -> (Void) in
 
@@ -151,14 +154,13 @@ extension CommunitySubCommentController {
             self?.tableView.reloadData()
             self?.navigationBar.title = "\(self?.communityPostReplyModels.count ?? 0)条评论"
             if self?.communityPostReplyModel != nil {
-                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
+                VirusViewModel.shared.commentReplyAIT(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text,communityPostCommentModel: (self?.communityPostCommentModel)!,communityPostReplyModel: self?.communityPostReplyModel)
                 
             }else {
-                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!)
+                VirusViewModel.shared.commentReply(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!)
 
             }
             complete()
-            
         }
     }
 }

+ 2 - 4
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityAllCommentView.swift

@@ -310,8 +310,6 @@ extension CommunityAllCommentView {
         communityCustomCommnetModel.content = text
         if communityPostCommentModel != nil {
             communityCustomCommnetModel.parentId = communityPostCommentModel?.id
-            communityCustomCommnetModel.replyUid = communityPostCommentModel?.uid
-            communityCustomCommnetModel.replyUsername = communityPostCommentModel?.username
         }
         
         SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(communityCustomCommnetModel: communityCustomCommnetModel) {
@@ -339,7 +337,7 @@ extension CommunityAllCommentView {
                 let count = 1 + (self?.communityPostCommentsModel?.commentCount ?? 0)
                 self?.communityPostCommentsModel?.commentCount = count
                 self?.titleLabel.text = "全部评论 \(count)"
-                VirusViewModel.shared.comment(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text)
+                VirusViewModel.shared.commentVideo(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text)
                 
                 self?.tableView.reloadData()
                 
@@ -359,7 +357,7 @@ extension CommunityAllCommentView {
                 self?.communityPostCommentModel?.reply?.insert(communityPostReplyModel, at: 0)
                 self?.communityPostCommentModel?.replyCount = 1 +  (self?.communityPostCommentModel?.replyCount ?? 0)
                 
-                VirusViewModel.shared.comment(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
+                VirusViewModel.shared.commentVideoReply(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
                 
                 self?.tableView.reloadData()
             }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/CommunityVideoSubCommentController.swift

@@ -150,10 +150,10 @@ extension CommunityVideoSubCommentController {
 
             
             if self?.communityPostReplyModel != nil {
-                VirusViewModel.shared.comment(communityVideoItemModel: (self?.communityVideoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
+                VirusViewModel.shared.commentVideoReplyAIT(communityVideoItemModel: (self?.communityVideoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
                 
             }else {
-                VirusViewModel.shared.comment(communityVideoItemModel: (self?.communityVideoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!)
+                VirusViewModel.shared.commentVideoReply(communityVideoItemModel: (self?.communityVideoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!)
                 
             }
             complete()

+ 1 - 5
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/OtherPersonalCenter/ViewController/OtherPersonalCenterViewController.swift

@@ -80,11 +80,7 @@ class OtherPersonalCenterViewController: BaseViewController {
     
     override func setupData() {
         reloadData()
-        pagingView.mainTableView.addHeader(withBeginRefresh: true, animation: false, refreshBlock: { [weak self] (page) in
-            self?.userMemberDetailApi()
-        })
-        
-
+        userMemberDetailApi()
     }
     
     

+ 6 - 5
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/ViewController/UserPersonalCenterViewController.swift

@@ -107,15 +107,16 @@ class UserPersonalCenterViewController: BaseViewController {
         }
         
         //设置
-        setButton.rx.tap.subscribe(onNext: {
+        setButton.rx.tap.subscribe(onNext:{
             [weak self] (data) in
             let vc = SetViewController()
             self?.navigationController?.pushViewController(vc, animated: true)
         }).disposed(by: disposeBag)
         
-        pagingView.mainTableView.addHeader(withBeginRefresh: true, animation: false, refreshBlock: { [weak self] (page) in
-            self?.userMemberDetailApi()
-        })
+//        pagingView.mainTableView.addHeader(withBeginRefresh: true, animation: false, refreshBlock: { [weak self] (page) in
+//        })
+        self.userMemberDetailApi()
+
         // 更新用户信息
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("UserMemberDetail"), object: nil, queue: OperationQueue.main) {
             [weak self] (notification) in
@@ -394,7 +395,7 @@ extension UserPersonalCenterViewController: JXPagingViewDelegate {
     }
     
     func mainTableViewDidScroll(_ scrollView: UIScrollView) {
-    userHeaderView.personViewUserAndOtherHeaderView.scrollViewDidScroll(contentOffsetY: scrollView.contentOffset.y)
+        userHeaderView.personViewUserAndOtherHeaderView.scrollViewDidScroll(contentOffsetY: scrollView.contentOffset.y)
         
         let offsetY = scrollView.contentOffset.y
         if (offsetY > kSafeStatusBarHeight) {

+ 5 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCoverPick/Controller/AliyunCoverPickViewController.m

@@ -26,10 +26,11 @@
     [super viewDidLoad];
     [self setupSubviews];
     
-    
+    __weak __typeof(self)weakSelf = self;
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
              ^{
-        [self.pickView loadThumbnailData];
+        __strong __typeof(weakSelf)strongSelf = weakSelf;
+        [strongSelf.pickView loadThumbnailData];
     });
 }
 
@@ -119,7 +120,8 @@
 - (void)pickViewDidUpdateImage:(UIImage *)image {
     __weak typeof(self) weakSelf = self;
   dispatch_async(dispatch_get_main_queue(), ^{
-    weakSelf.coverView.image = image;
+      __strong __typeof(weakSelf)strongSelf = weakSelf;
+    strongSelf.coverView.image = image;
   });
 }
 - (BOOL)shouldAutorotate {

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

@@ -416,8 +416,9 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     [[AlivcShortVideoRoute shared] registerMediaConfig:_cutInfo];
     [[AlivcShortVideoRoute shared] registerIsFromCropVc:YES];
     UIViewController *editVC = [[AlivcShortVideoRoute shared] alivcViewControllerWithType:AlivcViewControlEdit];
+    __weak __typeof(self)weakSelf = self;
     dispatch_async(dispatch_get_main_queue(), ^{
-        [self.navigationController pushViewController:editVC animated:YES];
+        [weakSelf.navigationController pushViewController:editVC animated:YES];
     });
 }
 
@@ -560,7 +561,7 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
                                                             queue:dispatch_get_main_queue()
                                                        usingBlock:^(CMTime time) {
                                                            
-                                                           __strong typeof(self) strong = weakSelf;
+                                                           __strong typeof(weakSelf) strong = weakSelf;
                                                            CGFloat crt = CMTimeGetSeconds(time);
                                                            
                                                            if (strong.cutInfo.sourceDuration) {

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

@@ -760,6 +760,8 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     //请求
     NSURLRequest *request = [NSURLRequest requestWithURL:URL];
     
+    __weak __typeof(self)weakSelf = self;
+    
     //下载Task操作
     _downloadTask = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
         
@@ -793,17 +795,17 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
             CGFloat musicDuration = [asset avAssetVideoTrackDuration];
             
             //如果录制的时候有音乐 编辑的时候重新音乐 则播放新的音乐
-            if (self.hasRecordMusic) {
-                [self.editor setAudioMixWeight:100];
+            if (weakSelf.hasRecordMusic) {
+                [weakSelf.editor setAudioMixWeight:100];
             }
-            [self.editor removeMusics];
+            [weakSelf.editor removeMusics];
             AliyunEffectMusic *effectMusic =[[AliyunEffectMusic alloc] initWithFile:musicFilePath];
             effectMusic.startTime = 0;
             effectMusic.duration = musicDuration;
-            [self.editor applyMusic:effectMusic];
-            self.curEffectVid = [effectMusic effectVid];
+            [weakSelf.editor applyMusic:effectMusic];
+            weakSelf.curEffectVid = [effectMusic effectVid];
             
-            [self resume];
+            [weakSelf resume];
         }
     }];
     
@@ -1047,11 +1049,13 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 - (void)p_showEffectView:(UIView *)view duration:(CGFloat)duration {
     view.hidden = NO;
     [self.view bringSubviewToFront:view];
+    
+    __weak __typeof(view)weakView = view;
     [UIView animateWithDuration:duration
                      animations:^{
-                         CGRect f = view.frame;
+                         CGRect f = weakView.frame;
                          f.origin.y = ScreenHeight - CGRectGetHeight(f);
-                         view.frame = f;
+                         weakView.frame = f;
                      } completion:^(BOOL finished) {
                          if (finished) {
                              NSLog(@"多点测试:底部按钮可以点击");
@@ -1068,16 +1072,18 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
 - (void)p_dismissEffectView:(UIView *)view
                    duration:(CGFloat)duration
            CompletionHandle:(void (^__nullable)(BOOL finished))completion {
+    __weak __typeof(view)weakView = view;
+
     [UIView animateWithDuration:duration
                      animations:^{
                          CGRect f = view.frame;
                          f.origin.y = ScreenHeight;
-                         view.frame = f;
+                         weakView.frame = f;
                      } completion:^(BOOL finished) {
                          if (completion) {
                              completion(finished);
                          }
-                         view.hidden = YES;
+                         weakView.hidden = YES;
                      }];
 }
 
@@ -1207,15 +1213,13 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     self.progressView.progress = 0;
     
     ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
-    [library
-     writeVideoAtPathToSavedPhotosAlbum:[NSURL
-                                         fileURLWithPath:_config.outputPath]
-     completionBlock:^(NSURL *assetURL, NSError *error) {
+    __weak __typeof(self)weakSelf = self;
+    [library writeVideoAtPathToSavedPhotosAlbum:[NSURL fileURLWithPath:_config.outputPath] completionBlock:^(NSURL *assetURL, NSError *error) {
          /* process assetURL */
          if (!error) {
              NSLog(@"视频已保存到相册");
              dispatch_async(dispatch_get_main_queue(), ^{
-                 [self jumpToCoverImage];
+                 [weakSelf jumpToCoverImage];
              });
              
          } else {
@@ -1307,9 +1311,9 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
     }else {
         frame.origin.y = ScreenHeight - self.musicView.bounds.size.height;
     }
-    
+    __weak __typeof(self)weakSelf = self;
     [UIView animateWithDuration:0.2 animations:^{
-        self.musicView.frame = frame;
+        weakSelf.musicView.frame = frame;
     }];
 }
 

+ 23 - 12
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m

@@ -491,6 +491,7 @@
 #pragma mark - Download Music Method
 - (void)downloadFileFromServerWithUrlStr:(NSString *)urlStr{
     
+    __weak __typeof(self)weakSelf = self;
     NSURL *URL = [NSURL URLWithString:urlStr];
     
     NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
@@ -523,6 +524,7 @@
         return [NSURL fileURLWithPath:path];
         
     } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
+        __strong __typeof(weakSelf)strongSelf = weakSelf;  //3
         // filePath就是你下载文件的位置,你可以解压,也可以直接拿来使用
         NSString *musicFilePath = [filePath path];// 将NSURL转成NSString
         // 应用音乐效果
@@ -532,7 +534,7 @@
         AliyunEffectMusic *effectMusic = [[AliyunEffectMusic alloc] initWithFile:musicFilePath];
         effectMusic.startTime = 0;
         effectMusic.duration = musicDuration;
-        [self.recorder applyMusic:effectMusic];
+        [strongSelf.recorder applyMusic:effectMusic];
     }];
     
     // 开始执行下载
@@ -583,8 +585,11 @@
     //禁用侧滑手势
     self.navigationController.interactivePopGestureRecognizer.enabled = NO;
     self.magicCameraView.userInteractionEnabled = YES;
+    __weak __typeof(self)weakSelf = self;
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        [self startRetainCameraRotate];
+        __strong __typeof(weakSelf)strongSelf = weakSelf;  //3
+        
+        [strongSelf startRetainCameraRotate];
      });
 }
 
@@ -761,9 +766,12 @@
         frame.origin.y = ScreenHeight - self.musicView.bounds.size.height;
     }
     
+    __weak __typeof(self)weakSelf = self;
+
     self.magicCameraView.rateView.hidden = false;
     [UIView animateWithDuration:0.2 animations:^{
-        self.musicView.frame = frame;
+        __strong __typeof(weakSelf)strongSelf = weakSelf;
+        strongSelf.musicView.frame = frame;
     }];
 }
 
@@ -782,10 +790,11 @@
     }else {
         frame.origin.y = ScreenHeight - self.filterView.bounds.size.height;
     }
-    
+    __weak __typeof(self)weakSelf = self;
     self.magicCameraView.rateView.hidden = false;
     [UIView animateWithDuration:0.2 animations:^{
-        self.filterView.frame = frame;
+        __strong __typeof(weakSelf)strongSelf = weakSelf;  //3
+        strongSelf.filterView.frame = frame;
     }];
 }
 
@@ -827,22 +836,23 @@
         __weak typeof(self) weakSelf = self;
 
         [self.motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion * _Nullable motion, NSError * _Nullable error) {
+            __strong __typeof(weakSelf)strongSelf = weakSelf;  //3
             // Gravity 获取手机的重力值在各个方向上的分量,根据这个就可以获得手机的空间位置,倾斜角度等
             double gravityX = motion.gravity.x;
             double gravityY = motion.gravity.y;
             double xyTheta = atan2(gravityX,gravityY)/M_PI*180.0;//手机旋转角度。
             if (xyTheta >= -45 && xyTheta <= 45) {
                 //down
-                weakSelf.cameraRotate =180;
+                strongSelf.cameraRotate =180;
             } else if (xyTheta > 45 && xyTheta < 135) {
                 //left
-                weakSelf.cameraRotate = 90;
+                strongSelf.cameraRotate = 90;
             } else if ((xyTheta >= 135 && xyTheta < 180) || (xyTheta >= -180 && xyTheta < -135)) {
                 //up
-                weakSelf.cameraRotate = 0;
+                strongSelf.cameraRotate = 0;
             } else if (xyTheta >= -135 && xyTheta < -45) {
                 //right
-                weakSelf.cameraRotate = 270;
+                strongSelf.cameraRotate = 270;
             }
         }];
     }
@@ -851,11 +861,12 @@
 
 - (void)recorderVideoDuration:(CGFloat)duration {
     
+    __weak __typeof(self)weakSelf = self;
     dispatch_async(dispatch_get_main_queue(), ^{
-        
+        __strong __typeof(weakSelf)strongSelf = weakSelf;  //3
 //        CGFloat percent = duration / _clipManager.maxDuration;
-        [self.magicCameraView recordingPercent:duration];
-        self.recordingDuration = duration;
+        [strongSelf.magicCameraView recordingPercent:duration];
+        strongSelf.recordingDuration = duration;
     });
 }
 

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicVolumnView.swift

@@ -239,13 +239,13 @@ class PublishMusicVolumnView: FWPopupView {
         view.vProperty = vProperty
         view.show()
         
-        view.applyButton.rx.tap.subscribe(onNext: {(data) in
+        view.applyButton.rx.tap.subscribe(onNext: {[weak view] (data) in
             var paraDic = Dictionary<String, Any>()
-            paraDic.updateValue(view.originVolumn!, forKey: "origin")
-            paraDic.updateValue(view.backVolumn!, forKey: "back")
+            paraDic.updateValue(view?.originVolumn!, forKey: "origin")
+            paraDic.updateValue(view?.backVolumn!, forKey: "back")
             NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ChangeAudioVolumnNoti"), object: paraDic)
             
-            view.hide()
+            view?.hide()
         }).disposed(by: view.disposeBag)
         
         view.musicButton.rx.tap.subscribe(onNext: {[weak view] (data) in

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

@@ -184,10 +184,10 @@ extension PublishRecommendMusicController {
         let userName = UserModel.shared().getModel()?.username ?? ""
         let uid = UserModel.shared().getModel()?.uid ?? 0
         
-        SwiftMoyaNetWorkServiceCommunity.shared().communityUploadMusicApi(name: name, username: userName, url: url, uid: uid) { (data) -> (Void) in
+        SwiftMoyaNetWorkServiceCommunity.shared().communityUploadMusicApi(name: name, username: userName, url: url, uid: uid) {[weak self] (data) -> (Void) in
             // 上传成功,返回
             SwiftProgressHUD.shared().showText("提交成功")
-            self.navigationController?.popViewController(animated: true)
+            self?.navigationController?.popViewController(animated: true)
         }
         
     }

+ 0 - 5
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/RedemptionArea/ViewController/RedemptionAreaViewController.swift

@@ -68,11 +68,6 @@ class RedemptionAreaViewController: BaseViewController {
             }
         })
         
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("userMemberGetTotalBean"), object: nil, queue: OperationQueue.main, using: {
-            [weak self] (notification) in
-            self?.cmsTemplateExchangeApi()
-        })
-        
     }
     
 }

+ 57 - 0
RainbowPlanet/RainbowPlanet/Tools/QRCode/QRCode.swift

@@ -0,0 +1,57 @@
+//
+//  QRCode.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/8/26.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class QRCode: NSObject {
+    
+    //创建二维码图片
+    class func createQRForString(qrString: String?, qrImageName: String?) -> UIImage?{
+        if let sureQRString = qrString {
+            let stringData = sureQRString.data(using: .utf8,
+                                               allowLossyConversion: false)
+            // 创建一个二维码的滤镜
+            let qrFilter = CIFilter(name: "CIQRCodeGenerator")!
+            qrFilter.setValue(stringData, forKey: "inputMessage")
+            qrFilter.setValue("H", forKey: "inputCorrectionLevel")
+            let qrCIImage = qrFilter.outputImage
+            
+            // 创建一个颜色滤镜,黑白色
+            let colorFilter = CIFilter(name: "CIFalseColor")!
+            colorFilter.setDefaults()
+            colorFilter.setValue(qrCIImage, forKey: "inputImage")
+            colorFilter.setValue(CIColor(red: 0, green: 0, blue: 0), forKey: "inputColor0")
+            colorFilter.setValue(CIColor(red: 1, green: 1, blue: 1), forKey: "inputColor1")
+            
+            // 返回二维码image
+            let codeImage = UIImage(ciImage: colorFilter.outputImage!
+                .transformed(by: CGAffineTransform(scaleX: 5, y: 5)))
+            
+            // 通常,二维码都是定制的,中间都会放想要表达意思的图片
+            if let iconImage = UIImage(named: qrImageName!) {
+                let rect = CGRect(x:0, y:0, width:codeImage.size.width,
+                                  height:codeImage.size.height)
+                UIGraphicsBeginImageContext(rect.size)
+                
+                codeImage.draw(in: rect)
+                let avatarSize = CGSize(width:rect.size.width * 0.25,
+                                        height:rect.size.height * 0.25)
+                let x = (rect.width - avatarSize.width) * 0.5
+                let y = (rect.height - avatarSize.height) * 0.5
+                iconImage.draw(in: CGRect(x:x, y:y, width:avatarSize.width,
+                                          height:avatarSize.height))
+                let resultImage = UIGraphicsGetImageFromCurrentImageContext()
+                
+                UIGraphicsEndImageContext()
+                return resultImage
+            }
+            return codeImage
+        }
+        return nil
+    }
+}

+ 150 - 34
RainbowPlanet/RainbowPlanet/ViewModel/Virus/VirusViewModel.swift

@@ -504,7 +504,85 @@ extension VirusViewModel {
 }
 // MARK: - 评论
 extension VirusViewModel {
-    func comment(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
+    
+    func comment(communityRecommendDataModel:CommunityRecommendDataModel? = nil,id:Int,content:String) {
+        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
+        
+        virueRecordAddParameterModel.postId = communityRecommendDataModel?.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityRecommendDataModel?.uid ?? 0)"
+        if communityRecommendDataModel?.title == nil ||  communityRecommendDataModel?.title == "" {
+            virueRecordAddParameterModel.postDesc = "\(communityRecommendDataModel?.content!.prefix(20) ?? "")"
+            
+        }else {
+            virueRecordAddParameterModel.postDesc = communityRecommendDataModel?.title
+        }
+        virueRecordAddParameterModel.postType = communityRecommendDataModel?.type
+        virueRecordAddParameterModel.postCover = communityRecommendDataModel?.img
+        virueRecordAddParameterModel.actionId = "\(id)"
+        
+        virueRecordAddParameterModel.commentContent = content
+        virueRecordAddParameterModel.commentId = id
+        
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
+        })
+    }
+    
+    func comment(communityFollowDataModel:CommunityFollowDataModel? = nil,id:Int,content:String) {
+        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
+        
+        virueRecordAddParameterModel.postId = communityFollowDataModel?.relateData?.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityFollowDataModel?.relateData?.uid ?? 0)"
+        if communityFollowDataModel?.relateData?.title == nil ||  communityFollowDataModel?.relateData?.title == "" {
+            
+            virueRecordAddParameterModel.postDesc = "\(communityFollowDataModel?.relateData?.content!.prefix(20) ?? "")"
+            
+        }else {
+            virueRecordAddParameterModel.postDesc = communityFollowDataModel?.relateData?.title
+        }
+        virueRecordAddParameterModel.postType = communityFollowDataModel?.relateData?.type
+        virueRecordAddParameterModel.postCover = communityFollowDataModel?.relateData?.img
+        virueRecordAddParameterModel.actionId = "\(id)"
+        virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
+        
+        virueRecordAddParameterModel.commentContent = content
+        virueRecordAddParameterModel.commentId = id
+        
+        
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
+        })
+    }
+    
+    
+    func comment(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String) {
+        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
+        
+        virueRecordAddParameterModel.postId = communityPostDetailModel.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityPostDetailModel.uid!)"
+        if communityPostDetailModel.title == nil ||  communityPostDetailModel.title == "" {
+            virueRecordAddParameterModel.postDesc = "\(communityPostDetailModel.content!.prefix(20))"
+            
+        }else {
+            virueRecordAddParameterModel.postDesc = communityPostDetailModel.title
+        }
+        virueRecordAddParameterModel.postType = communityPostDetailModel.type
+        virueRecordAddParameterModel.postCover = communityPostDetailModel.img
+        
+        virueRecordAddParameterModel.actionId = "\(id)"
+        virueRecordAddParameterModel.commentContent = content
+        virueRecordAddParameterModel.commentId = id
+        
+        
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
+        })
+    }
+    
+    func commentReply(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
         virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
         virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
@@ -522,20 +600,52 @@ extension VirusViewModel {
         
         virueRecordAddParameterModel.actionId = "\(id)"
         
-        virueRecordAddParameterModel.parentCommentId = communityPostReplyModel?.id
-        virueRecordAddParameterModel.parentCommentContent = communityPostReplyModel?.content
-        virueRecordAddParameterModel.parentCommentUid = communityPostReplyModel?.uid
-        virueRecordAddParameterModel.parentCommentTime = communityPostReplyModel?.createdAt
+        virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
+        virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
+        virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
+        virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
+        virueRecordAddParameterModel.commentContent = content
+        virueRecordAddParameterModel.commentId = id
+        
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
+        })
+    }
+    
+    func commentReplyAIT(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
+        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
+        
+        virueRecordAddParameterModel.postId = communityPostDetailModel.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityPostDetailModel.uid!)"
+        if communityPostDetailModel.title == nil ||  communityPostDetailModel.title == "" {
+            virueRecordAddParameterModel.postDesc = "\(communityPostDetailModel.content!.prefix(20))"
+            
+        }else {
+            virueRecordAddParameterModel.postDesc = communityPostDetailModel.title
+        }
+        virueRecordAddParameterModel.postType = communityPostDetailModel.type
+        virueRecordAddParameterModel.postCover = communityPostDetailModel.img
+        
+        virueRecordAddParameterModel.actionId = "\(id)"
+        
+        virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
+        virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
+        virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
+        virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
+        
+        virueRecordAddParameterModel.replyUid = communityPostReplyModel?.uid
+        virueRecordAddParameterModel.replyUserName = communityPostReplyModel?.username
         
         virueRecordAddParameterModel.commentContent = content
         virueRecordAddParameterModel.commentId = id
-
+        
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
         })
     }
     
-    func comment(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
+    func commentVideo(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
         virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
         virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
@@ -553,36 +663,36 @@ extension VirusViewModel {
         
         virueRecordAddParameterModel.actionId = "\(id)"
         
-        virueRecordAddParameterModel.parentCommentId = communityPostReplyModel?.id
-        virueRecordAddParameterModel.parentCommentContent = communityPostReplyModel?.content
-        virueRecordAddParameterModel.parentCommentUid = communityPostReplyModel?.uid
-        virueRecordAddParameterModel.parentCommentTime = communityPostReplyModel?.createdAt
-        
         virueRecordAddParameterModel.commentContent = content
         virueRecordAddParameterModel.commentId = id
         
-        
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
         })
-    }    
+    }
     
-    func comment(communityRecommendDataModel:CommunityRecommendDataModel? = nil,id:Int,content:String) {
+    func commentVideoReply(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
         virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
         virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
         
-        virueRecordAddParameterModel.postId = communityRecommendDataModel?.id
-        virueRecordAddParameterModel.postAuthorUid = "\(communityRecommendDataModel?.uid ?? 0)"
-        if communityRecommendDataModel?.title == nil ||  communityRecommendDataModel?.title == "" {
-            virueRecordAddParameterModel.postDesc = "\(communityRecommendDataModel?.content!.prefix(20) ?? "")"
-
+        virueRecordAddParameterModel.postId = communityVideoItemModel.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityVideoItemModel.uid!)"
+        if communityVideoItemModel.title == nil ||  communityVideoItemModel.title == "" {
+            virueRecordAddParameterModel.postDesc = "\(communityVideoItemModel.content!.prefix(20))"
+            
         }else {
-            virueRecordAddParameterModel.postDesc = communityRecommendDataModel?.title
+            virueRecordAddParameterModel.postDesc = communityVideoItemModel.title
         }
-        virueRecordAddParameterModel.postType = communityRecommendDataModel?.type
-        virueRecordAddParameterModel.postCover = communityRecommendDataModel?.img        
+        virueRecordAddParameterModel.postType = communityVideoItemModel.type
+        virueRecordAddParameterModel.postCover = communityVideoItemModel.img
+        
         virueRecordAddParameterModel.actionId = "\(id)"
         
+        virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
+        virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
+        virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
+        virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
+        
         virueRecordAddParameterModel.commentContent = content
         virueRecordAddParameterModel.commentId = id
         
@@ -590,28 +700,34 @@ extension VirusViewModel {
         })
     }
     
-    func comment(communityFollowDataModel:CommunityFollowDataModel? = nil,id:Int,content:String) {
+    func commentVideoReplyAIT(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
         virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
         virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
         
-        virueRecordAddParameterModel.postId = communityFollowDataModel?.relateData?.id
-        virueRecordAddParameterModel.postAuthorUid = "\(communityFollowDataModel?.relateData?.uid ?? 0)"
-        if communityFollowDataModel?.relateData?.title == nil ||  communityFollowDataModel?.relateData?.title == "" {
+        virueRecordAddParameterModel.postId = communityVideoItemModel.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityVideoItemModel.uid!)"
+        if communityVideoItemModel.title == nil ||  communityVideoItemModel.title == "" {
+            virueRecordAddParameterModel.postDesc = "\(communityVideoItemModel.content!.prefix(20))"
             
-            virueRecordAddParameterModel.postDesc = "\(communityFollowDataModel?.relateData?.content!.prefix(20) ?? "")"
-
         }else {
-            virueRecordAddParameterModel.postDesc = communityFollowDataModel?.relateData?.title
+            virueRecordAddParameterModel.postDesc = communityVideoItemModel.title
         }
-        virueRecordAddParameterModel.postType = communityFollowDataModel?.relateData?.type
-        virueRecordAddParameterModel.postCover = communityFollowDataModel?.relateData?.img
+        virueRecordAddParameterModel.postType = communityVideoItemModel.type
+        virueRecordAddParameterModel.postCover = communityVideoItemModel.img
+        
         virueRecordAddParameterModel.actionId = "\(id)"
-        virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
+        
+        virueRecordAddParameterModel.parentCommentId = communityPostCommentModel?.id
+        virueRecordAddParameterModel.parentCommentContent = communityPostCommentModel?.content
+        virueRecordAddParameterModel.parentCommentUid = communityPostCommentModel?.uid
+        virueRecordAddParameterModel.parentCommentTime = communityPostCommentModel?.createdAt
+        
+        virueRecordAddParameterModel.replyUid = communityPostReplyModel?.uid
+        virueRecordAddParameterModel.replyUserName = communityPostReplyModel?.username
         
         virueRecordAddParameterModel.commentContent = content
         virueRecordAddParameterModel.commentId = id
-
         
         SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
         })