南鑫林 hace 5 años
padre
commit
e8dc0caf30

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

@@ -17,10 +17,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         //初始化窗口
         initWindow()
         //版本更新
-        _ = UpdateVersionManager.shared
+//        _ = UpdateVersionManager.shared
 
         //初始化百度地图
         BaiduMapManager.shared.initBaiduMap()
+        //百度定位
         BaiduMapManager.shared.startLocation()
         //初始化友盟
         UMManager.shared.initUM(launchOptions: launchOptions)

+ 1 - 0
RainbowPlanet/RainbowPlanet/Model/UserModel/FollowStatusModel.swift

@@ -10,6 +10,7 @@ class FollowStatusModel : NSObject, Mappable{
 
 	var isFollowStatus : Int?
     var uid : Int?
+    var postId : Int?
 
 	class func newInstance(map: Map) -> Mappable?{
 		return FollowStatusModel()

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

@@ -98,7 +98,7 @@ class CommunityFollowViewController: UIViewController {
             let followStatusModel = notification.object as? FollowStatusModel
             if !(self?.communityFollowDataModels.isEmpty ?? true) {
                 for communityFollowDataModel in (self?.communityFollowDataModels)! {
-                    if communityFollowDataModel.relateData?.uid == followStatusModel?.uid {
+                    if communityFollowDataModel.relateData?.id == followStatusModel?.postId {
                         communityFollowDataModel.relateData?.isDislike = followStatusModel?.isFollowStatus
                     }
                 }

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

@@ -73,7 +73,7 @@ class CommunityRecommnendViewController: UIViewController {
             let followStatusModel = notification.object as? FollowStatusModel
             if !(self?.communityRecommendDataModels.isEmpty ?? true) {
                 for communityRecommendDataModel in (self?.communityRecommendDataModels)! {
-                    if communityRecommendDataModel.uid == followStatusModel?.uid {
+                    if communityRecommendDataModel.id == followStatusModel?.postId {
                         communityRecommendDataModel.isDislike = followStatusModel?.isFollowStatus
                     }
                 }
@@ -200,7 +200,7 @@ extension CommunityRecommnendViewController {
             
             VirusViewModel.shared.comment(communityRecommendDataModel:  self?.communityRecommendDataModel, id: communityPostCommentIdModel?.id ?? 0,content: text)
             
-            let count = self?.communityRecommendDataModel?.commentCount ?? 0 + 1
+            let count = (1 + (self?.communityRecommendDataModel?.commentCount ?? 0))
             self?.communityRecommendDataModel?.commentCount = count
             self?.tableView.reloadData()
             complete()

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

@@ -204,7 +204,7 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
             let followStatusModel = notification.object as? FollowStatusModel
             if !(self?.communityRecommendDataModels.isEmpty ?? true) {
                 for communityRecommendDataModel in (self?.communityRecommendDataModels)! {
-                    if communityRecommendDataModel.uid == followStatusModel?.uid {
+                    if communityRecommendDataModel.id == followStatusModel?.postId {
                         communityRecommendDataModel.isDislike = followStatusModel?.isFollowStatus
                     }
                 }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -215,7 +215,7 @@ class CommunityRecommendController: BaseViewController {
         }
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("unlikeApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let followStatusModel = notification.object as? FollowStatusModel
-            if self?.communityPostDetailModel?.uid == followStatusModel?.uid {
+            if self?.communityPostDetailModel?.id == followStatusModel?.postId {
                 self?.communityPostDetailModel?.isDislike = followStatusModel?.isFollowStatus
                 self?.communityPostDetailTableViewHeaderView.communityPostDetailModel = self?.communityPostDetailModel
                 self?.tableView.reloadData()

+ 2 - 0
RainbowPlanet/RainbowPlanet/ViewModel/Virus/VirusViewModel.swift

@@ -41,6 +41,7 @@ extension VirusViewModel {
             if communityRecommendDataModel.isDislike == 0 {
                 let followStatusModel = FollowStatusModel()
                 followStatusModel.uid = communityRecommendDataModel.uid!
+                followStatusModel.postId = communityRecommendDataModel.id
                 followStatusModel.isFollowStatus = 1
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "unlikeApi"), object: followStatusModel)
                 completion(1)
@@ -218,6 +219,7 @@ extension VirusViewModel {
             if communityFollowDataModel.relateData?.isDislike == 0 {
                 let followStatusModel = FollowStatusModel()
                 followStatusModel.uid = communityFollowDataModel.relateData?.uid!
+                followStatusModel.postId = communityFollowDataModel.relateData?.id
                 followStatusModel.isFollowStatus = 1
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "unlikeApi"), object: followStatusModel)
                 completion(1)