南鑫林 %!s(int64=5) %!d(string=hai) anos
pai
achega
b27350cb6f
Modificáronse 29 ficheiros con 400 adicións e 168 borrados
  1. 4 0
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 0 7
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  3. 4 11
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift
  4. 37 0
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  5. 11 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserDisLikeView.swift
  6. 10 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  7. 17 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift
  8. 9 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift
  9. 13 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  10. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift
  11. 16 4
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift
  12. 19 0
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/CommunityPostDetailTableViewHeaderView.swift
  13. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunitySubComment/ViewController/CommunitySubCommentController.swift
  14. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityAllCommentView.swift
  15. 2 2
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoSubCommentController/CommunityVideoSubCommentController.swift
  16. 9 1
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeTwoCollectionViewCell.swift
  17. 9 0
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift
  18. 26 14
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/View/MessageActivityTableCell.swift
  19. 1 1
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetNotification/Controller/MessagePlanetNotiController.swift
  20. 11 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/ViewController/UserPersonalCenterViewController.swift
  21. 17 0
      RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/ViewController/RedemptionAreaViewController.swift
  22. 1 1
      RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/MobileLogin/View/MobileLoginView.swift
  23. 1 4
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/View/SearchContentListCollectionCell.swift
  24. 16 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/MainView/ShoppingMallView.swift
  25. 1 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift
  26. 6 6
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift
  27. 15 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UICollectionView.swift
  28. 29 0
      RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+WKWebView.swift
  29. 111 110
      RainbowPlanet/RainbowPlanet/ViewModel/Virus/VirusViewModel.swift

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

@@ -201,6 +201,7 @@
 		A75B782822DEC708007B986A /* SepcialTwoTypeLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782722DEC708007B986A /* SepcialTwoTypeLayout.swift */; };
 		A75B782A22DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782922DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift */; };
 		A75B782C22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782B22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift */; };
+		A75B783022DF2CBF007B986A /* Extension+WKWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75B782F22DF2CBF007B986A /* Extension+WKWebView.swift */; };
 		A75C474E22938B3900139C0C /* OrderFreightTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A75C474D22938B3900139C0C /* OrderFreightTableViewCell.swift */; };
 		A7636AC52268139C00374F9E /* LocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC42268139C00374F9E /* LocationViewController.swift */; };
 		A7636AC822682BAF00374F9E /* LocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7636AC722682BAF00374F9E /* LocationView.swift */; };
@@ -901,6 +902,7 @@
 		A75B782722DEC708007B986A /* SepcialTwoTypeLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SepcialTwoTypeLayout.swift; sourceTree = "<group>"; };
 		A75B782922DEC8B3007B986A /* RedemptionAreaSpecialTwoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RedemptionAreaSpecialTwoTableViewCell.swift; sourceTree = "<group>"; };
 		A75B782B22DEC908007B986A /* SpecialTwoTypeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialTwoTypeCollectionViewCell.swift; sourceTree = "<group>"; };
+		A75B782F22DF2CBF007B986A /* Extension+WKWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+WKWebView.swift"; sourceTree = "<group>"; };
 		A75C474D22938B3900139C0C /* OrderFreightTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderFreightTableViewCell.swift; sourceTree = "<group>"; };
 		A7636AC42268139C00374F9E /* LocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationViewController.swift; sourceTree = "<group>"; };
 		A7636AC722682BAF00374F9E /* LocationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationView.swift; sourceTree = "<group>"; };
@@ -2415,6 +2417,7 @@
 				A72A729422321DE000B21995 /* Extension+UIAlertController.swift */,
 				A70EBBBF22561179000AD74F /* Extension+UITableView.swift */,
 				A738D201225AD6AD00EEE860 /* Extension+UICollectionView.swift */,
+				A75B782F22DF2CBF007B986A /* Extension+WKWebView.swift */,
 				A71AA5202272E527008FF1A5 /* Extension+UINavigationController.swift */,
 				A72A729922321DE000B21995 /* Extension+UIButton.swift */,
 				A72A729722321DE000B21995 /* Extension+UIColor.swift */,
@@ -6363,6 +6366,7 @@
 				BD13B6C322BA034D008BB323 /* PublishEditDescribeCell.swift in Sources */,
 				A7CC752C2271A1AE003C4F38 /* SetPasswordViewController.swift in Sources */,
 				BD10FBFE22C6F7D90096A34E /* AliyunPublishService.m in Sources */,
+				A75B783022DF2CBF007B986A /* Extension+WKWebView.swift in Sources */,
 				A7C0FDEE22B6516A00BC1E86 /* CommunityBannerTableViewCell.swift in Sources */,
 				A738D202225AD6AD00EEE860 /* Extension+UICollectionView.swift in Sources */,
 				BDAF83AA22B388F20004BCC3 /* RecommendDefaultBackCell.swift in Sources */,

+ 0 - 7
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -55,8 +55,6 @@ extension AppDelegate {
         
         /// 引导页
         setGuidePageView()
-        /// 版本更新
-        setconfigUpGrade()
         
     }
     
@@ -113,9 +111,4 @@ extension AppDelegate {
         
     }
     
-    //版本更新
-    func setconfigUpGrade() {
-        _ = UpdateVersionManager.shared
-    }
-    
 }

+ 4 - 11
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift

@@ -22,17 +22,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         //初始化百度地图
         BaiduMapManager.shared.initBaiduMap()
         BaiduMapManager.shared.startLocation()
-        DispatchQueue.global(qos: .default).async {
-
-            //初始化键盘
-            DispatchQueue.main.async {
-                //初始化友盟
-                UMManager.shared.initUM(launchOptions: launchOptions)
-
-                IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
-            }
-        }
-    
+        //初始化友盟
+        UMManager.shared.initUM(launchOptions: launchOptions)
+        
+        IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
         return true
     }
     

+ 37 - 0
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -12,6 +12,8 @@ class BaseTabbarViewController: UITabBarController {
     
     static let shared : BaseTabbarViewController = BaseTabbarViewController()
     
+    var lastClickTag : Int?
+    
     /// 社区
     let v1 = CommunityViewController()
     /// 商城
@@ -89,10 +91,45 @@ extension BaseTabbarViewController : UITabBarControllerDelegate {
     
     
     override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
+        
         if item.tag == 2 {
             let pickVc = PublishViewController()
             let nav = BaseNavigationViewController.init(rootViewController: pickVc)
             self.present(nav, animated: true, completion: nil)
+        }else {
+            if item.tag == self.lastClickTag && item.tag == 0  {
+                
+
+                
+                if communityModuleTopType == .communityModuleFollowTop {
+                    NotificationCenter.default.post(name: NSNotification.Name("CommunityModuleFollowTop"), object: nil)
+
+                }
+                if communityModuleTopType == .communityModuleRecommendTop {
+                    NotificationCenter.default.post(name: NSNotification.Name("CommunityModuleRecommendTop"), object: nil)
+
+                }
+                if communityModuleTopType == .communityModulePlanetTop {
+                    NotificationCenter.default.post(name: NSNotification.Name("CommunityModulePlanetTop"), object: nil)
+
+                }
+                
+            }
+            if item.tag == self.lastClickTag && item.tag == 1  {
+                NotificationCenter.default.post(name: NSNotification.Name("ShoppingMallModuleTop"), object: nil)
+//                NotificationCenter.default.post(name: NSNotification.Name("RedemptionAreaModuleTop"), object: nil)
+                
+            }
+            if item.tag == self.lastClickTag && item.tag == 3  {
+                NotificationCenter.default.post(name: NSNotification.Name("MessageModuleTop"), object: nil)
+
+            }
+            if item.tag == self.lastClickTag && item.tag == 4  {
+                NotificationCenter.default.post(name: NSNotification.Name("MineModuleTop"), object: nil)
+            }
         }
+        
+        self.lastClickTag = item.tag
+        
     }
 }

+ 11 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserDisLikeView.swift

@@ -29,6 +29,7 @@ class CardContentUserDisLikeView: FWPopupView {
         self.masksToBounds = true
         self.isUserInteractionEnabled = true
         self.backgroundColor = UIColor.white
+        addTapGesture(1, target: self, action: #selector(hideView))
         addSubview(disLikeButton)
     }
     
@@ -40,6 +41,16 @@ class CardContentUserDisLikeView: FWPopupView {
         disLikeButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 10)
     }
     
+   @objc  func hideView() {
+        if self.isDisLike == 0 {
+            if let disLikeButtonClosure = self.disLikeButtonClosure {
+                disLikeButtonClosure()
+            }
+        }else {
+            self.hide()
+        }
+    }
+    
     typealias DisLikeButtonClosure = () -> Void
     var disLikeButtonClosure : DisLikeButtonClosure?
     

+ 10 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift

@@ -129,6 +129,15 @@ class CommunityFollowViewController: UIViewController {
             }
             self?.tableView.reloadData()
         }
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("CommunityModuleFollowTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.tableView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.loadData(page:1)
+            }else {
+                self?.tableView.scrollToTop()
+            }
+        })
 
     }
     
@@ -232,7 +241,7 @@ extension CommunityFollowViewController {
             
             self?.communityFollowDataModel?.relateData?.postComment?.insert(communityFollowPostCommentModel, at: 0)
             
-            VirusViewModel.shared.comment(communityFollowDataModel:  self?.communityFollowDataModel, id: communityPostCommentIdModel?.id ?? 0)
+            VirusViewModel.shared.comment(communityFollowDataModel:  self?.communityFollowDataModel, id: communityPostCommentIdModel?.id ?? 0,content: text)
             let count = 1 + (self?.communityFollowDataModel?.relateData?.commentCount ?? 0)
             self?.communityFollowDataModel?.relateData?.commentCount = count
             self?.tableView.reloadData()

+ 17 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Main/CommunityViewController.swift

@@ -10,6 +10,14 @@ import UIKit
 import JXSegmentedView
 import SwiftyMediator
 
+enum CommunityModuleTopType : String {
+    case communityModuleFollowTop = "CommunityModuleFollowTop"
+    case communityModuleRecommendTop = "CommunityModuleRecommendTop"
+    case communityModulePlanetTop = "CommunityModulePlanetTop"
+}
+
+var communityModuleTopType :CommunityModuleTopType?
+
 class CommunityViewController: BaseViewController {
     
     deinit {
@@ -345,6 +353,15 @@ class CommunityViewController: BaseViewController {
 extension CommunityViewController : JXSegmentedViewDelegate {
     //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
     func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
+        if index == 0 {
+            communityModuleTopType = .communityModuleFollowTop
+        }
+        if index == 1 {
+            communityModuleTopType = .communityModuleRecommendTop
+        }
+        if index == 2 {
+            communityModuleTopType = .communityModulePlanetTop
+        }
         
     }
     

+ 9 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift

@@ -55,6 +55,15 @@ class CommunityPlanetViewController: BaseJSWebViewController {
             }
         }
         
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("CommunityModulePlanetTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.wkWebView.scrollView.contentOffset == CGPoint(x: 0, y: 0) {
+               WebViewJavascriptBridgeManager.shared.callHandlerH5(bridge: self?.bridge)
+            }else {
+                self?.wkWebView.scrollToTop()
+            }
+        })
+        
         
     }
 }

+ 13 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift

@@ -105,6 +105,15 @@ class CommunityRecommnendViewController: UIViewController {
             self?.tableView.reloadData()
         }
         
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("CommunityModuleRecommendTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.tableView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.communityPostSuggestApi(page:1)
+            }else {
+                self?.tableView.scrollToTop()
+            }
+        })
+        
         
     }
     
@@ -139,6 +148,8 @@ class CommunityRecommnendViewController: UIViewController {
         }
     }
     
+    
+    
 }
 
 extension CommunityRecommnendViewController {
@@ -187,7 +198,8 @@ extension CommunityRecommnendViewController {
             
             self?.communityRecommendDataModel?.comment?.insert(communityRecommendCommentModel, at: 0)
             
-            VirusViewModel.shared.comment(communityRecommendDataModel:  self?.communityRecommendDataModel, id: communityPostCommentIdModel?.id ?? 0)
+            VirusViewModel.shared.comment(communityRecommendDataModel:  self?.communityRecommendDataModel, id: communityPostCommentIdModel?.id ?? 0,content: text)
+            
             let count = self?.communityRecommendDataModel?.commentCount ?? 0 + 1
             self?.communityRecommendDataModel?.commentCount = count
             self?.tableView.reloadData()

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -351,7 +351,7 @@ extension CommunityFeaturedTopicsViewController {
             
             self?.communityRecommendDataModel?.comment?.insert(communityRecommendCommentModel, at: 0)
             
-            VirusViewModel.shared.comment(communityRecommendDataModel:  self?.communityRecommendDataModel, id: communityPostCommentIdModel?.id ?? 0)
+            VirusViewModel.shared.comment(communityRecommendDataModel:  self?.communityRecommendDataModel, id: communityPostCommentIdModel?.id ?? 0,content: text)
             let count = self?.communityRecommendDataModel?.commentCount ?? 0 + 1
             self?.communityRecommendDataModel?.commentCount = count
             self?.tableView.reloadData()

+ 16 - 4
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -362,9 +362,21 @@ extension CommunityRecommendController {
             }
             
             self?.tableView.reloadData()
-            VirusViewModel.shared.read(communityPostDetailModel: (self?.communityPostDetailModel)!)
-
+            self?.readVirueRecordAddApi()
+        }
+    }
+    
+    
+    /// 阅读virue
+    func readVirueRecordAddApi() {
+        var postDesc : String?
+        if self.communityPostDetailModel?.title == nil ||  self.communityPostDetailModel?.title == "" {
+            postDesc = String(describing:self.communityPostDetailModel?.content?.prefix(20))
+        }else {
+            postDesc = self.communityPostDetailModel?.title
         }
+        
+        VirusViewModel.shared.readVirueRecordAddApi(postId: self.communityPostDetailModel?.id, postAuthorUid: "\(self.communityPostDetailModel?.uid ?? 0)", postDesc: postDesc, postType: self.communityPostDetailModel?.type, postCover: self.communityPostDetailModel?.img, actionId: "\(self.communityPostDetailModel?.id ?? 0)")
     }
     
     /// 评论列表
@@ -469,7 +481,7 @@ extension CommunityRecommendController {
                 communityPostCommentModel.username = UserModel.shared().getModel()?.username
                 communityPostCommentModel.uid = UserModel.shared().getModel()?.uid
                 self?.communityPostCommentModels.insert(communityPostCommentModel, at: 0)
-                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0)
+                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text)
                 self?.count += 1
                 self?.communityPostDetailModel?.commentCount = self?.count
                 self?.commentView.communityPostDetailModel = self?.communityPostDetailModel
@@ -490,7 +502,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, communityPostCommentModel: self?.communityPostCommentModel)
+                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
                 self?.tableView.reloadData()
             }
             complete()

+ 19 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/CommunityPostDetailTableViewHeaderView.swift

@@ -13,12 +13,18 @@ class CommunityPostDetailTableViewHeaderView: BaseView {
     
     override func setupViews() {
          addSubview(pagerView)
+         addSubview(numberLabel)
     }
     
     override func setupLayouts() {
         pagerView.snp.makeConstraints { (make) in
             make.edges.equalToSuperview()
         }
+        numberLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(14)
+            make.right.equalTo(-14)
+            make.height.equalTo(20)
+        }
     }
     
     private lazy var pagerView: FSPagerView = {
@@ -33,7 +39,12 @@ class CommunityPostDetailTableViewHeaderView: BaseView {
     
     lazy var numberLabel: UILabel = {
         let numberLabel = UILabel()
+        numberLabel.backgroundColor = UIColor.black.withAlphaComponent(0.3)
+        numberLabel.textColor = kffffffColor
+        numberLabel.font = kRegularFont12
         numberLabel.cornerRadius = 10
+        numberLabel.masksToBounds = true
+        numberLabel.isHidden = true
         return numberLabel
     }()
     
@@ -46,6 +57,13 @@ class CommunityPostDetailTableViewHeaderView: BaseView {
                     imgs.append(communityPostDetailModel?.img ?? "")
                 }
             }
+            if imgs.count <= 1 {
+                numberLabel.isHidden = true
+            }else {
+                numberLabel.isHidden = false
+                self.numberLabel.text = "  1/\(imgs.count)  "
+
+            }
         }
     }
     
@@ -83,6 +101,7 @@ extension CommunityPostDetailTableViewHeaderView:FSPagerViewDataSource,FSPagerVi
     }
     func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
         let currentIndex = pagerView.currentIndex
+        self.numberLabel.text =  "  \(targetIndex+1)/" + "\(imgs.count)  "
         let cell = pagerView.cellForItem(at: currentIndex) as! CommunityPostDetailFSPagerViewCell
         UIView.animate(withDuration: 0.5) {
             self.size = cell.size

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunitySubComment/ViewController/CommunitySubCommentController.swift

@@ -153,10 +153,10 @@ 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, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
+                VirusViewModel.shared.comment(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, communityPostCommentModel: (self?.communityPostCommentModel)!)
+                VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!)
 
             }
             complete()

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

@@ -299,7 +299,7 @@ extension CommunityAllCommentView {
                 let count = 1 + (self?.communityPostCommentsModel?.pagination?.total ?? 0)
                 self?.communityPostCommentsModel?.pagination?.total = count
                 self?.titleLabel.text = "全部评论 \(count)"
-                VirusViewModel.shared.comment(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0)
+                VirusViewModel.shared.comment(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text)
                 
                 self?.tableView.reloadData()
                 
@@ -319,7 +319,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, communityPostCommentModel: self?.communityPostCommentModel)
+                VirusViewModel.shared.comment(communityVideoItemModel: (self?.videoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
                 
                 self?.tableView.reloadData()
             }

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

@@ -153,10 +153,10 @@ extension CommunityVideoSubCommentController {
 
             
             if self?.communityPostReplyModel != nil {
-                VirusViewModel.shared.comment(communityVideoItemModel: (self?.communityVideoItemModel)!, id: communityPostCommentIdModel?.id ?? 0, communityPostCommentModel: (self?.communityPostCommentModel)!, communityPostReplyModel: (self?.communityPostReplyModel)!)
+                VirusViewModel.shared.comment(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, communityPostCommentModel: (self?.communityPostCommentModel)!)
+                VirusViewModel.shared.comment(communityVideoItemModel: (self?.communityVideoItemModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: (self?.communityPostCommentModel)!)
                 
             }
             complete()

+ 9 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/View/MessageHomeTwoCollectionViewCell.swift

@@ -64,6 +64,7 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
             make.width.equalTo(67)
             make.height.equalTo(23)
         }
+
         lineLabel.snp.makeConstraints { (make) in
             make.bottom.equalToSuperview()
             make.height.equalTo(1)
@@ -135,7 +136,9 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
                     make.width.equalTo(67)
                     make.height.equalTo(23)
                 }
+                timeLabel.isHidden = true
             }else {
+                timeLabel.isHidden = false
                 titleLabel.snp.remakeConstraints { (make) in
                     make.top.equalTo(12)
                     make.left.equalTo(iconImageView.snp_right).offset(8)
@@ -143,6 +146,11 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
                     make.height.equalTo(23)
                 }
                 
+                timeLabel.snp.makeConstraints { (make) in
+                    make.centerY.equalTo(titleLabel)
+                    make.right.equalTo(-17.5)
+                }
+                
                 subLabel.snp.remakeConstraints { (make) in
                     make.top.equalTo(titleLabel.snp.bottom).offset(4)
                     make.left.equalTo(titleLabel.snp_left)
@@ -152,7 +160,7 @@ class MessageHomeTwoCollectionViewCell: UICollectionViewCell {
                 
                 dotLabel.snp.remakeConstraints { (make) in
                     make.centerY.equalTo(subLabel)
-                    make.centerX.equalTo(timeLabel)
+                    make.right.equalTo(-17.5)
                     make.size.equalTo(10)
                 }
             }

+ 9 - 0
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageMain/ViewController/MessageMainViewController.swift

@@ -43,6 +43,15 @@ class MessageMainViewController: BaseViewController {
             [weak self] (page) in
             self?.userMemberMessageIndexApi()
         }
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("MessageModuleTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.collectionView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.userMemberMessageIndexApi()
+            }else {
+                self?.collectionView.scrollToTop()
+            }
+        })
     }
     
     lazy var collectionView: UICollectionView = {

+ 26 - 14
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetActivity/View/MessageActivityTableCell.swift

@@ -52,7 +52,6 @@ class MessageActivityTableCell: UITableViewCell {
         activityView.addSubview(layerView)
         activityView.addSubview(titleLabel)
         activityView.addSubview(subLabel)
-        activityView.addSubview(itemButton)
     }
     
     private func setupLayouts() {
@@ -77,9 +76,6 @@ class MessageActivityTableCell: UITableViewCell {
             make.right.equalTo(titleLabel.snp_right)
             make.height.equalTo(17)
         }
-        itemButton.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
     }
     
     private lazy var timeLabel: UILabel = {
@@ -105,6 +101,7 @@ class MessageActivityTableCell: UITableViewCell {
         let actImageView = UIImageView()
         actImageView.image = kImage(name: "pic_preload")
         actImageView.isUserInteractionEnabled = true
+        actImageView.contentMode = .scaleAspectFill
         return actImageView
     }()
     
@@ -141,22 +138,37 @@ class MessageActivityTableCell: UITableViewCell {
         return subLabel
     }()
     
-    private lazy var itemButton: UIButton = {
-        let itemButton = UIButton(type: UIButton.ButtonType.custom)
-        itemButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let activityClosure = self?.activityClosure {
-                activityClosure()
-            }            
-        }).disposed(by: disposeBag)
-        return itemButton
-    }()
-    
     var messageDataModel : MessageDataModel? {
         didSet {
             timeLabel.text = " \(messageDataModel?.createdAt ?? "") "
             subLabel.text = "活动时间:\(messageDataModel?.param?.activityTime ?? "")"
             titleLabel.text = messageDataModel?.param?.title
             actImageView.kf.setImage(with: kURLImage(name: messageDataModel?.param?.cover ?? ""), placeholder: kImage(name: "pic_preload"))
+            if messageDataModel?.param?.activityTime == nil || messageDataModel?.param?.activityTime == "" {
+                titleLabel.snp.remakeConstraints { (make) in
+                    make.bottom.equalTo(-14)
+                    make.left.equalTo(14)
+                    make.right.equalTo(-14)
+                    make.height.equalTo(17)
+                }
+                subLabel.isHidden = true
+            }else {
+                subLabel.isHidden = false
+                titleLabel.snp.remakeConstraints { (make) in
+                    make.top.equalTo(103)
+                    make.left.equalTo(14)
+                    make.right.equalTo(-14)
+                    make.height.equalTo(21)
+                }
+                subLabel.snp.remakeConstraints { (make) in
+                    make.top.equalTo(titleLabel.snp_bottom).offset(6)
+                    make.left.equalTo(titleLabel.snp_left)
+                    make.right.equalTo(titleLabel.snp_right)
+                    make.height.equalTo(17)
+                }
+            }
+            
+            
         }
     }
     

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessagePlanetNotification/Controller/MessagePlanetNotiController.swift

@@ -21,7 +21,7 @@ class MessagePlanetNotiController: BaseViewController {
     }
     
     override func setupViews() {
-        navigationBar.title = "星球活动"
+        navigationBar.title = "星球通知"
         view.backgroundColor = kf7f8faColor
         view.addSubview(tableView)
         DIYEmptyView.emptyTableView(tableView: tableView)

+ 11 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/ViewController/UserPersonalCenterViewController.swift

@@ -116,6 +116,17 @@ class UserPersonalCenterViewController: BaseViewController {
             [weak self] (notification) in
             self?.setBadge()
         })
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("MineModuleTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.pagingView.mainTableView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.userMemberDetailApi()
+            }else {
+                self?.pagingView.mainTableView.scrollToTop()
+            }
+        })
+        
+        
   
     }
     

+ 17 - 0
RainbowPlanet/RainbowPlanet/Modules/RedemptionAreaModule/ViewController/RedemptionAreaViewController.swift

@@ -10,6 +10,13 @@ import UIKit
 import SwiftyMediator
 
 class RedemptionAreaViewController: BaseViewController {
+    
+    deinit {
+        if observe != nil {
+            NotificationCenter.default.removeObserver(observe!)
+        }
+    }
+    weak var observe : NSObjectProtocol?
 
     var cmsRedemptionAreaModel : CMSRedemptionAreaModel?
     
@@ -46,6 +53,16 @@ class RedemptionAreaViewController: BaseViewController {
         navigationBar.onClickRightButton = {
             Mediator.push(H5RouterModuleType.pushCategory)
         }
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("RedemptionAreaModuleTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.tableView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.cmsTemplateExchangeApi()
+            }else {
+                self?.tableView.scrollToTop()
+            }
+        })
+        
     }
     
 }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/RegisterLoginModule/MobileLogin/View/MobileLoginView.swift

@@ -164,7 +164,7 @@ class MobileLoginView: BaseView {
         phoneNumberTextField.clearButtonMode = .whileEditing
         phoneNumberTextField.sizeToFit()
         phoneNumberTextField.keyboardType = .numberPad
-        phoneNumberTextField.tintColor = kFFA42FColor
+        phoneNumberTextField.tintColor = kThemeColor
 
         phoneNumberTextField.rx.text.orEmpty.changed.subscribe(onNext: { [weak self] (text) in
             self?.phoneNumberTextField.text = String(text.prefix(11))

+ 1 - 4
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/View/SearchContentListCollectionCell.swift

@@ -11,9 +11,6 @@ import RxSwift
 
 class SearchContentListCollectionCell: UICollectionViewCell {
     
-    
-
-    
     let disposeBag = DisposeBag()
     
     typealias LikeSelectBlock = (_ isLiked: Int) -> Void
@@ -154,7 +151,7 @@ class SearchContentListCollectionCell: UICollectionViewCell {
         likeBtn.setImage(kImage(name: "btn_praise_pre_36px"), for: UIControl.State.selected)
         likeBtn.titleLabel?.font = kRegularFont12
         likeBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            VirusViewModel.shared.virueRecordAddApi(communityPostDataModel: (self?.communityPostDataModel!)!, cell: self!)
+            VirusViewModel.shared.likeVirueRecordAddApi(communityPostDataModel: (self?.communityPostDataModel!)!, cell: self!)
         }).disposed(by: disposeBag)
         return likeBtn
     }()

+ 16 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/MainView/ShoppingMallView.swift

@@ -12,6 +12,12 @@ import RxSwift
 
 class ShoppingMallView: UIView {
     
+    deinit {
+        if observe != nil {
+            NotificationCenter.default.removeObserver(observe!)
+        }
+    }
+    weak var observe : NSObjectProtocol?
     let disposeBag = DisposeBag()
     
     override init(frame: CGRect) {
@@ -21,6 +27,16 @@ class ShoppingMallView: UIView {
             self.addressPopView(address: addrMdl?.address ?? "")
         }
         self.cmsTemplateSetTemplateNameApi()
+        
+        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("ShoppingMallModuleTop"), object: nil, queue: OperationQueue.main, using: {
+            [weak self] (notification) in
+            if self?.pagingView.mainTableView.contentOffset == CGPoint(x: 0, y: 0) {
+                self?.cmsTemplateSetTemplateNameApi()
+            }else {
+                self?.pagingView.mainTableView.scrollToTop()
+            }
+        })
+        
     }
 
     required init?(coder aDecoder: NSCoder) {

+ 1 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift

@@ -321,6 +321,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
         var parameters = Dictionary<String,Any>()
         parameters.updateValue(postId, forKey: "post_id")
         parameters.updateValue(page, forKey: "page")
+        parameters.updateValue(10, forKey: "per_page")
         SwiftProgressHUD.shared().showWait()
         SwiftMoyaNetWorkManager.shared.requestObject(CommunityPostCommentsModel.self,target: MultiTarget(SwiftMoyaServiceCommunityApi.communityPostComments(parameters: parameters))) {  (communityPostCommentsModel) in
             SwiftProgressHUD.shared().hide()

+ 6 - 6
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -9,8 +9,8 @@
 import Foundation
 
 let kPersonalService = false
-let kDevelopSever = true
-let kBetaSever = false
+let kDevelopSever = false
+let kBetaSever = true
 let kProductSever = false
 
 // MARK: - 数据服务器
@@ -29,8 +29,8 @@ public func kApiDataPrefix() -> String {
 }
 
 let kVirusPersonalService = false
-let kVirusDevelopSever = true
-let kVirusBetaSever = false
+let kVirusDevelopSever = false
+let kVirusBetaSever = true
 let kVirusProductSever = false
 
 // MARK: - Virus
@@ -49,8 +49,8 @@ public func kApiVirusPrefix() -> String {
 }
 
 let kH5PersonalService = false
-let kH5DevelopSever = true
-let kH5BetaSever = false
+let kH5DevelopSever = false
+let kH5BetaSever = true
 let kH5ProductSever = false
 
 // MARK: - H5

+ 15 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UICollectionView.swift

@@ -67,6 +67,21 @@ public extension UICollectionView {
             completion()
         })
     }
+    
+    /// SwifterSwift: Scroll to bottom of TableView.
+    ///
+    /// - Parameter animated: set true to animate scroll (default is true).
+    func scrollToBottom(animated: Bool = true) {
+        let bottomOffset = CGPoint(x: 0, y: contentSize.height - bounds.size.height)
+        setContentOffset(bottomOffset, animated: animated)
+    }
+    
+    /// SwifterSwift: Scroll to top of TableView.
+    ///
+    /// - Parameter animated: set true to animate scroll (default is true).
+    func scrollToTop(animated: Bool = true) {
+        setContentOffset(CGPoint.zero, animated: animated)
+    }
 
     /// SwifterSwift: Dequeue reusable UICollectionViewCell using class name.
     ///

+ 29 - 0
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+WKWebView.swift

@@ -0,0 +1,29 @@
+//
+//  Extension+WKWebView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/7/17.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import WebKit
+
+extension WKWebView {
+    /// SwifterSwift: Scroll to bottom of TableView.
+    ///
+    /// - Parameter animated: set true to animate scroll (default is true).
+    func scrollToBottom(animated: Bool = true) {
+        
+        let bottomOffset = CGPoint(x: 0, y: scrollView.contentSize.height - scrollView.bounds.size.height)
+          scrollView.setContentOffset(bottomOffset, animated: animated)
+    }
+    
+    /// SwifterSwift: Scroll to top of TableView.
+    ///
+    /// - Parameter animated: set true to animate scroll (default is true).
+    func scrollToTop(animated: Bool = true) {
+        scrollView.setContentOffset(CGPoint.zero, animated: animated)
+    }
+}
+

+ 111 - 110
RainbowPlanet/RainbowPlanet/ViewModel/Virus/VirusViewModel.swift

@@ -477,10 +477,10 @@ extension VirusViewModel {
 }
 // MARK: - 评论
 extension VirusViewModel {
-    func comment(communityPostDetailModel:CommunityPostDetailModel,id:Int,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
+    func comment(communityPostDetailModel:CommunityPostDetailModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.publish ?? "")
-        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.publish.rawValue
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
 
         virueRecordAddParameterModel.postId = communityPostDetailModel.id
         virueRecordAddParameterModel.postAuthorUid = "\(communityPostDetailModel.uid!)"
@@ -493,24 +493,24 @@ extension VirusViewModel {
         virueRecordAddParameterModel.postCover = communityPostDetailModel.img
         
         virueRecordAddParameterModel.actionId = "\(id)"
-
-        virueRecordAddParameterModel.commentId = communityPostCommentModel?.id
-        virueRecordAddParameterModel.commentContent = communityPostCommentModel?.content
         
         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(communityVideoItemModel:CommunityVideoItemModel,id:Int,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
+    func comment(communityVideoItemModel:CommunityVideoItemModel,id:Int,content:String,communityPostCommentModel:CommunityPostCommentModel? = nil,communityPostReplyModel:CommunityPostReplyModel? = nil) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.publish ?? "")
-        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.publish.rawValue
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
         
         virueRecordAddParameterModel.postId = communityVideoItemModel.id
         virueRecordAddParameterModel.postAuthorUid = "\(communityVideoItemModel.uid!)"
@@ -524,23 +524,23 @@ extension VirusViewModel {
         
         virueRecordAddParameterModel.actionId = "\(id)"
         
-        virueRecordAddParameterModel.commentId = communityPostCommentModel?.id
-        virueRecordAddParameterModel.commentContent = communityPostCommentModel?.content
-        
         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) {
+    func comment(communityRecommendDataModel:CommunityRecommendDataModel? = nil,id:Int,content:String) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.publish ?? "")
-        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.publish.rawValue
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
         
         virueRecordAddParameterModel.postId = communityRecommendDataModel?.id
         virueRecordAddParameterModel.postAuthorUid = "\(communityRecommendDataModel?.uid ?? 0)"
@@ -550,19 +550,20 @@ extension VirusViewModel {
             virueRecordAddParameterModel.postDesc = communityRecommendDataModel?.title
         }
         virueRecordAddParameterModel.postType = communityRecommendDataModel?.type
-        virueRecordAddParameterModel.postCover = communityRecommendDataModel?.img
-        virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
-        
+        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) {
+    func comment(communityFollowDataModel:CommunityFollowDataModel? = nil,id:Int,content:String) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.publish ?? "")
-        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.publish.rawValue
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.comment ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.comment.rawValue
         
         virueRecordAddParameterModel.postId = communityFollowDataModel?.relateData?.id
         virueRecordAddParameterModel.postAuthorUid = "\(communityFollowDataModel?.relateData?.uid ?? 0)"
@@ -575,6 +576,9 @@ extension VirusViewModel {
         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
@@ -583,31 +587,6 @@ extension VirusViewModel {
     
 }
 
-// MARK: - 阅读
-extension VirusViewModel {
-    func read(communityPostDetailModel:CommunityPostDetailModel) {
-        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.read ?? "")
-        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.read.rawValue
-       
-        virueRecordAddParameterModel.postId = communityPostDetailModel.id
-        virueRecordAddParameterModel.postAuthorUid = "\(communityPostDetailModel.uid!)"
-        if communityPostDetailModel.title == nil ||  communityPostDetailModel.title == "" {
-            virueRecordAddParameterModel.postDesc = String(describing: communityPostDetailModel.content!.prefix(20))
-        }else {
-            virueRecordAddParameterModel.postDesc = communityPostDetailModel.title
-        }
-        virueRecordAddParameterModel.postType = communityPostDetailModel.type
-        virueRecordAddParameterModel.postCover = communityPostDetailModel.img
-        virueRecordAddParameterModel.actionId = "\(communityPostDetailModel.id!)"
-        virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
-        virueRecordAddParameterModel.behaviorValue = 1
-
-        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-        })
-    }
-}
-
 
 // MARK: - 帖子详情
 extension VirusViewModel {
@@ -705,16 +684,88 @@ extension VirusViewModel {
     }
 }
 
+// MARK: - 搜索点赞
+extension VirusViewModel {
+    func likeVirueRecordAddApi(communityPostDataModel:CommunityPostDataModel,cell:SearchContentListCollectionCell) {
+        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.like ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.like.rawValue
+        if communityPostDataModel.isLike == 0 {
+            virueRecordAddParameterModel.behaviorValue = 1
+        }else {
+            virueRecordAddParameterModel.behaviorValue = 0
+        }
+        virueRecordAddParameterModel.postId = communityPostDataModel.id
+        virueRecordAddParameterModel.postAuthorUid = "\(communityPostDataModel.uid!)"
+        virueRecordAddParameterModel.postDesc = communityPostDataModel.title
+        virueRecordAddParameterModel.postCover = communityPostDataModel.img
+        virueRecordAddParameterModel.actionId = "\(communityPostDataModel.id!)"
+        virueRecordAddParameterModel.postType = communityPostDataModel.type
+        
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {
+            (data) -> (Void) in
+            let followStatusModel = FollowStatusModel()
+            followStatusModel.uid = communityPostDataModel.uid
+            if communityPostDataModel.isLike == 0 {
+                communityPostDataModel.isLike = 1
+                followStatusModel.isFollowStatus = 1
+
+                cell.likeBtn.isSelected = true
+                let praiseCount = (communityPostDataModel.praiseCount ?? 0) + 1
+                cell.likeBtn.setTitle("\(praiseCount)", for: UIControl.State.normal)
+                communityPostDataModel.praiseCount = praiseCount
+                
+            }else {
+                communityPostDataModel.isLike = 0
+                followStatusModel.isFollowStatus = 0
+                cell.likeBtn.isSelected = false
+                let praiseCount = (communityPostDataModel.praiseCount ?? 0) - 1
+                
+                cell.likeBtn.setTitle("\(praiseCount)", for: UIControl.State.normal)
+                communityPostDataModel.praiseCount = praiseCount
+                
+            }
+            cell.likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
+            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
+
+        })
+    }
+}
+
+// MARK: - 阅读
+extension VirusViewModel {
+    
+    func readVirueRecordAddApi(postId:Int?,
+                               postAuthorUid:String?,
+                               postDesc:String?,
+                               postType:String?,
+                               postCover:String?,
+                               actionId:String) {
+        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.read ?? "")
+        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.read.rawValue
+        virueRecordAddParameterModel.behaviorValue = 1
+
+        virueRecordAddParameterModel.postId = postId
+        virueRecordAddParameterModel.actionId = actionId
+        virueRecordAddParameterModel.postAuthorUid = postAuthorUid
+        virueRecordAddParameterModel.postDesc = postDesc
+        virueRecordAddParameterModel.postType = postType
+        virueRecordAddParameterModel.postCover = postCover
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
+        })
+        
+    }
+}
+
+// MARK: - 转发
 extension VirusViewModel {
-    // 转发
     func forwarVirueRecordAddApi(postId:Int?,postAuthorUid:String?,title:String?,content:String?,postType:String?,postCover:String?) {
         
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
         virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.forward ?? "")
         virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.forward.rawValue
         virueRecordAddParameterModel.behaviorValue = 1
-        virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
-
         
         virueRecordAddParameterModel.postId = postId
         virueRecordAddParameterModel.actionId = "\(postId ?? 0)"
@@ -732,24 +783,8 @@ extension VirusViewModel {
     }
 }
 
+// MARK: - 发布
 extension VirusViewModel {
-    // 注册
-    func registeredVirueRecordAddApi(completion:@escaping ()->()) {
-        
-        let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.register ?? "")
-        virueRecordAddParameterModel.behaviorFlag =
-            BehaviorFlagType.register.rawValue
-        virueRecordAddParameterModel.sourceId = "\(UserModel.shared().getModel()?.inviteUid ?? 0)"
-        virueRecordAddParameterModel.actionId = "\(UserModel.shared().getModel()?.uid ?? 0)"
-        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
-            completion()
-        })
-    }
-}
-
-extension VirusViewModel {
-    // 发布
     func publishVirueRecordAddApi(postId:Int?,postType:String?,title:String?,content:String?,postCover:String?) {
         
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
@@ -774,52 +809,18 @@ extension VirusViewModel {
     }
 }
 
+// MARK: - 注册
 extension VirusViewModel {
-    func virueRecordAddApi(communityPostDataModel:CommunityPostDataModel,cell:SearchContentListCollectionCell) {
+    func registeredVirueRecordAddApi(completion:@escaping ()->()) {
         let virueRecordAddParameterModel = VirueRecordAddParameterModel()
-        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.like ?? "")
-        virueRecordAddParameterModel.behaviorFlag = BehaviorFlagType.like.rawValue
-        if communityPostDataModel.isLike == 0 {
-            virueRecordAddParameterModel.behaviorValue = 1
-        }else {
-            virueRecordAddParameterModel.behaviorValue = 0
-        }
-        virueRecordAddParameterModel.postId = communityPostDataModel.id
-        virueRecordAddParameterModel.postAuthorUid = "\(communityPostDataModel.uid!)"
-        virueRecordAddParameterModel.postDesc = communityPostDataModel.title
-        virueRecordAddParameterModel.postCover = communityPostDataModel.img
-        virueRecordAddParameterModel.actionId = "\(communityPostDataModel.id!)"
-        virueRecordAddParameterModel.targetId = "\((UserModel.shared().getModel()?.uid)!)"
-        virueRecordAddParameterModel.postType = communityPostDataModel.type
-        
-        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {
-            (data) -> (Void) in
-            let followStatusModel = FollowStatusModel()
-            followStatusModel.uid = communityPostDataModel.uid
-            if communityPostDataModel.isLike == 0 {
-                communityPostDataModel.isLike = 1
-                followStatusModel.isFollowStatus = 1
-
-                cell.likeBtn.isSelected = true
-                let praiseCount = (communityPostDataModel.praiseCount ?? 0) + 1
-                cell.likeBtn.setTitle("\(praiseCount)", for: UIControl.State.normal)
-                communityPostDataModel.praiseCount = praiseCount
-                
-            }else {
-                communityPostDataModel.isLike = 0
-                followStatusModel.isFollowStatus = 0
-                cell.likeBtn.isSelected = false
-                let praiseCount = (communityPostDataModel.praiseCount ?? 0) - 1
-                
-                cell.likeBtn.setTitle("\(praiseCount)", for: UIControl.State.normal)
-                communityPostDataModel.praiseCount = praiseCount
-                
-            }
-            cell.likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "isLikeApi"), object: followStatusModel)
-
+        virueRecordAddParameterModel.behaviorId = (ConfigModel.shared.object()?.virus?.register ?? "")
+        virueRecordAddParameterModel.behaviorFlag =
+            BehaviorFlagType.register.rawValue
+        virueRecordAddParameterModel.sourceId = "\(UserModel.shared().getModel()?.inviteUid ?? 0)"
+        virueRecordAddParameterModel.actionId = BehaviorFlagType.register.rawValue
+        SwiftMoyaNetWorkServiceVirus.shared().virueRecordAddApi(virueRecordAddParameterModel: virueRecordAddParameterModel, completion: {(data) -> (Void) in
+            completion()
         })
-
-        
     }
 }
+