Browse Source

bug修复

南鑫林 5 years ago
parent
commit
2d04a059a0
16 changed files with 213 additions and 137 deletions
  1. 5 7
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  2. 1 1
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate.swift
  3. 1 0
      RainbowPlanet/RainbowPlanet/Base/BaseNavigationController/BaseNavigationViewController.swift
  4. 2 2
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  5. 17 27
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/CommentList/CardContentCommentListTableViewCell.swift
  6. 17 14
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/TitleContent/CardContentTitleTableViewCell.swift
  7. 46 20
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  8. 51 27
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Recommend/CommunityRecommnendViewController.swift
  9. 46 19
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift
  10. 8 10
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift
  11. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift
  12. 7 5
      RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/View/MessageListTableCell.swift
  13. 9 2
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListCollectionViewCell.swift
  14. 1 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift
  15. 1 0
      RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/ViewController/SetViewController.swift
  16. 0 2
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceUser/SwiftMoyaNetWorkServiceUser.swift

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

@@ -17,13 +17,10 @@ extension AppDelegate {
         window?.makeKeyAndVisible()
         window?.makeKeyAndVisible()
         window?.rootViewController = UIViewController()
         window?.rootViewController = UIViewController()
         setBaiduToCityFactory()
         setBaiduToCityFactory()
-        DispatchQueue.global(qos: .default).async {
-            [weak self] in
-            /// 设置全局的tabbar
-            self?.setTabbarAppearence()
-            /// 设置全局的navigation
-            self?.setNavBarAppearence()
-        }
+        /// 设置全局的tabbar
+        setTabbarAppearence()
+        /// 设置全局的navigation
+        setNavBarAppearence()
         /// 设置默认为快递
         /// 设置默认为快递
         let deliveryMethodTypeModel = DeliveryMethodTypeModel.shared()
         let deliveryMethodTypeModel = DeliveryMethodTypeModel.shared()
         deliveryMethodTypeModel.deliveryMethodType = "2"
         deliveryMethodTypeModel.deliveryMethodType = "2"
@@ -101,6 +98,7 @@ extension AppDelegate {
         UITabBar.appearance().backgroundColor = UIColor.white
         UITabBar.appearance().backgroundColor = UIColor.white
         UITabBar.appearance().shadowImage = UIImage(named: "tab_top_line")
         UITabBar.appearance().shadowImage = UIImage(named: "tab_top_line")
     }
     }
+
     
     
     ///设置百度city转
     ///设置百度city转
     func setBaiduToCityFactory() {
     func setBaiduToCityFactory() {

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

@@ -24,7 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         BaiduMapManager.shared.startLocation()
         BaiduMapManager.shared.startLocation()
         //初始化友盟
         //初始化友盟
         UMManager.shared.initUM(launchOptions: launchOptions)
         UMManager.shared.initUM(launchOptions: launchOptions)
-        
+        //键盘处理
         IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
         IQKeyboardManagerSwiftManager.shared().initIQKeyboardManagerSwift()
         return true
         return true
     }
     }

+ 1 - 0
RainbowPlanet/RainbowPlanet/Base/BaseNavigationController/BaseNavigationViewController.swift

@@ -12,6 +12,7 @@ class BaseNavigationViewController: UINavigationController {
 
 
     override func viewDidLoad() {
     override func viewDidLoad() {
         super.viewDidLoad()
         super.viewDidLoad()
+        self.navigationBar.isHidden = true
 
 
         // Do any additional setup after loading the view.
         // Do any additional setup after loading the view.
     }
     }

+ 2 - 2
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -216,8 +216,8 @@ class BaseTabbarViewController: ESTabBarController {
         if index == 1 && lastIndex == 1  {
         if index == 1 && lastIndex == 1  {
             self.lottieAnimateContentView2.animationView.stop()
             self.lottieAnimateContentView2.animationView.stop()
             self.lottieAnimateContentView2.animationView.play()
             self.lottieAnimateContentView2.animationView.play()
-            NotificationCenter.default.post(name: NSNotification.Name("ShoppingMallModuleTop"), object: nil)
-            //                NotificationCenter.default.post(name: NSNotification.Name("RedemptionAreaModuleTop"), object: nil)
+//            NotificationCenter.default.post(name: NSNotification.Name("ShoppingMallModuleTop"), object: nil)
+            NotificationCenter.default.post(name: NSNotification.Name("RedemptionAreaModuleTop"), object: nil)
             
             
         }
         }
         if index == 3 && lastIndex == 3  {
         if index == 3 && lastIndex == 3  {

+ 17 - 27
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/CommentList/CardContentCommentListTableViewCell.swift

@@ -72,19 +72,6 @@ class CardContentCommentListTableViewCell: UITableViewCell {
         return footerView
         return footerView
     }()
     }()
     
     
-    func reloadData() {
-        //collectionView重新加载数据
-        self.tableView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.tableView.contentSize
-        tableView.snp.remakeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height - 54)
-            make.bottom.lessThanOrEqualToSuperview()
-        }
-        
-    }
-    
     var communityType: CommunityType?
     var communityType: CommunityType?
     
     
     var communityRecommendDataModel: CommunityRecommendDataModel? {
     var communityRecommendDataModel: CommunityRecommendDataModel? {
@@ -93,7 +80,7 @@ class CardContentCommentListTableViewCell: UITableViewCell {
                 footerView.communityRecommendDataModel = communityRecommendDataModel
                 footerView.communityRecommendDataModel = communityRecommendDataModel
                 tableView.tableFooterView = footerView
                 tableView.tableFooterView = footerView
             }
             }
-            reloadData()
+            tableView.reloadData()
         }
         }
     }
     }
     
     
@@ -103,7 +90,7 @@ class CardContentCommentListTableViewCell: UITableViewCell {
                 footerView.communityFollowDataModel = communityFollowDataModel
                 footerView.communityFollowDataModel = communityFollowDataModel
                 tableView.tableFooterView = footerView
                 tableView.tableFooterView = footerView
             }
             }
-            reloadData()
+            tableView.reloadData()
         }
         }
     }
     }
 }
 }
@@ -141,20 +128,23 @@ extension CardContentCommentListTableViewCell : UITableViewDelegate,UITableViewD
     }
     }
     
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
-        cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
-    }
-    
-    func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
-        let height = cellHeightsDictionary[indexPath]
-        if let height = height  {
-            return height as! CGFloat
+        if communityType == .follow {
+            let communityFollowPostCommentModel = communityFollowDataModel?.relateData?.postComment?[indexPath.row]
+            let nameStr = "\(communityFollowPostCommentModel?.username ?? ""):"
+            let contentStr = "\(communityFollowPostCommentModel?.content ?? "")"
+            let str =  nameStr + contentStr
+            let strHeight = str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+            return strHeight + 4
+        }else {
+            let communityRecommendCommentModel = communityRecommendDataModel?.comment?[indexPath.row]
+            let nameStr = "\(communityRecommendCommentModel?.username ?? ""):"
+            let contentStr = "\(communityRecommendCommentModel?.content ?? "")"
+            let str =  nameStr + contentStr
+            let strHeight = str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+            return strHeight + 4
         }
         }
-        return UITableView.automaticDimension
     }
     }
+
     
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
         return 0
         return 0

+ 17 - 14
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/TitleContent/CardContentTitleTableViewCell.swift

@@ -76,6 +76,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
         subtitleLabel.textColor = k313334Color
         subtitleLabel.textColor = k313334Color
         subtitleLabel.font = kRegularFont14
         subtitleLabel.font = kRegularFont14
         subtitleLabel.numberOfLines = 0
         subtitleLabel.numberOfLines = 0
+        subtitleLabel.sizeToFit()
         return subtitleLabel
         return subtitleLabel
     }()
     }()
     
     
@@ -99,13 +100,15 @@ class CardContentTitleTableViewCell: UITableViewCell {
     
     
     var cardContentTitleTableViewCellType: CardContentTitleTableViewCellType? {
     var cardContentTitleTableViewCellType: CardContentTitleTableViewCellType? {
         didSet {
         didSet {
+            var str = communityRecommendDataModel?.content ?? ""
+            str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            var titleStr = communityRecommendDataModel?.title ?? ""
+            titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
             switch cardContentTitleTableViewCellType {
             switch cardContentTitleTableViewCellType {
             case .noTitleMoreThan?:
             case .noTitleMoreThan?:
                 titleLabel.isHidden = true
                 titleLabel.isHidden = true
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
-                    var str = communityRecommendDataModel?.content ?? ""
-                    
                     if str.count >= 45 {
                     if str.count >= 45 {
                         str = String(str.prefix(45) + "...更多")
                         str = String(str.prefix(45) + "...更多")
                         let str1 = str.suffix(2)
                         let str1 = str.suffix(2)
@@ -128,7 +131,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
             case .noTitleNoMoreThan?:
             case .noTitleNoMoreThan?:
                 titleLabel.isHidden = true
                 titleLabel.isHidden = true
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
-                    subtitleLabel.text = communityRecommendDataModel?.content
+                    subtitleLabel.text = str
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
                 }else {
                 }else {
                     subtitleLabel.isHidden = true
                     subtitleLabel.isHidden = true
@@ -142,10 +145,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
                 break
                 break
             case .titleMoreThan?:
             case .titleMoreThan?:
                 titleLabel.isHidden = false
                 titleLabel.isHidden = false
-                titleLabel.text = communityRecommendDataModel?.title
+                titleLabel.text = titleStr
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
-                    var str = communityRecommendDataModel?.content ?? ""
                     if str.count >= 45 {
                     if str.count >= 45 {
                         str = String(str.prefix(45) + "...更多")
                         str = String(str.prefix(45) + "...更多")
                         let str1 = str.suffix(2)
                         let str1 = str.suffix(2)
@@ -180,9 +182,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
                 break
                 break
             case .titleNoMoreThan?:
             case .titleNoMoreThan?:
                 titleLabel.isHidden = false
                 titleLabel.isHidden = false
-                titleLabel.text = communityRecommendDataModel?.title
+                titleLabel.text = titleStr
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
                 if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
-                    subtitleLabel.text = communityRecommendDataModel?.content
+                    subtitleLabel.text = str
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
                     titleLabel.snp_remakeConstraints { (make) in
                     titleLabel.snp_remakeConstraints { (make) in
                         make.top.equalToSuperview()
                         make.top.equalToSuperview()
@@ -231,13 +233,15 @@ class CardContentTitleTableViewCell: UITableViewCell {
     
     
     var cardContentTitleTableViewCellType1: CardContentTitleTableViewCellType? {
     var cardContentTitleTableViewCellType1: CardContentTitleTableViewCellType? {
         didSet {
         didSet {
+            var str = communityFollowDataModel?.relateData?.content ?? ""
+            str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            var titleStr = communityFollowDataModel?.relateData?.title ?? ""
+            titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
             switch cardContentTitleTableViewCellType1 {
             switch cardContentTitleTableViewCellType1 {
             case .noTitleMoreThan?:
             case .noTitleMoreThan?:
                 titleLabel.isHidden = true
                 titleLabel.isHidden = true
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
-                    var str = communityFollowDataModel?.relateData?.content ?? ""
-                    
                     if str.count >= 45 {
                     if str.count >= 45 {
                         str = String(str.prefix(45) + "...更多")
                         str = String(str.prefix(45) + "...更多")
                         let str1 = str.suffix(2)
                         let str1 = str.suffix(2)
@@ -260,7 +264,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
             case .noTitleNoMoreThan?:
             case .noTitleNoMoreThan?:
                 titleLabel.isHidden = true
                 titleLabel.isHidden = true
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
-                    subtitleLabel.text = communityFollowDataModel?.relateData?.content
+                    subtitleLabel.text = str
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
                 }else {
                 }else {
                     subtitleLabel.isHidden = true
                     subtitleLabel.isHidden = true
@@ -274,10 +278,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
                 break
                 break
             case .titleMoreThan?:
             case .titleMoreThan?:
                 titleLabel.isHidden = false
                 titleLabel.isHidden = false
-                titleLabel.text = communityFollowDataModel?.relateData?.title
+                titleLabel.text = titleStr
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
-                    var str = communityFollowDataModel?.relateData?.content ?? ""
                     if str.count >= 45 {
                     if str.count >= 45 {
                         str = String(str.prefix(45) + "...更多")
                         str = String(str.prefix(45) + "...更多")
                         let str1 = str.suffix(2)
                         let str1 = str.suffix(2)
@@ -312,9 +315,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
                 break
                 break
             case .titleNoMoreThan?:
             case .titleNoMoreThan?:
                 titleLabel.isHidden = false
                 titleLabel.isHidden = false
-                titleLabel.text = communityFollowDataModel?.relateData?.title
+                titleLabel.text = titleStr
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
                 if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
-                    subtitleLabel.text = communityFollowDataModel?.relateData?.content
+                    subtitleLabel.text = str
                     subtitleLabel.isHidden = false
                     subtitleLabel.isHidden = false
                     titleLabel.snp_remakeConstraints { (make) in
                     titleLabel.snp_remakeConstraints { (make) in
                         make.top.equalToSuperview()
                         make.top.equalToSuperview()

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

@@ -18,7 +18,6 @@ class CommunityFollowViewController: UIViewController {
     }
     }
     weak var observe : NSObjectProtocol?
     weak var observe : NSObjectProtocol?
     
     
-    var cellHeightsDictionary = Dictionary<IndexPath, Any>()
     var communityFollowDataModels = Array<CommunityFollowDataModel>()
     var communityFollowDataModels = Array<CommunityFollowDataModel>()
     var communityFollowDataModel : CommunityFollowDataModel?
     var communityFollowDataModel : CommunityFollowDataModel?
     var keyBoardCommentView : KeyBoardCommentView?
     var keyBoardCommentView : KeyBoardCommentView?
@@ -50,6 +49,9 @@ class CommunityFollowViewController: UIViewController {
         tableView.backgroundColor = kf7f8faColor
         tableView.backgroundColor = kf7f8faColor
         tableView.dataSource = self
         tableView.dataSource = self
         tableView.delegate = self
         tableView.delegate = self
+        tableView.estimatedRowHeight = 0
+        tableView.estimatedSectionFooterHeight = 0
+        tableView.estimatedSectionHeaderHeight = 0
         return tableView
         return tableView
     }()
     }()
     
     
@@ -415,9 +417,6 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
             let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             cell.communityFollowDataModel = communityFollowDataModel
             cell.communityFollowDataModel = communityFollowDataModel
             cell.communityType = .follow
             cell.communityType = .follow
-            cell.frame = tableView.bounds
-            cell.layoutIfNeeded()
-            cell.reloadData()
             return cell
             return cell
         //评论
         //评论
         case 5:
         case 5:
@@ -563,14 +562,53 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
             }
             }
         //内容标题
         //内容标题
         case 2:
         case 2:
-            return UITableView.automaticDimension
+            var str = communityFollowDataModel.relateData?.content ?? ""
+            str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            if (communityFollowDataModel.relateData?.title == "" || communityFollowDataModel.relateData?.title == nil) {
+                if communityFollowDataModel.relateData?.content?.count ?? 0 >= 45 {
+                    str = str.prefix(45) + "...更多"
+                    let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                    return contentHeight
+                }else {
+                    let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                    return contentHeight
+                }
+            }else {
+                if PostType(rawValue: communityFollowDataModel.relateData?.type ?? "html") == .html {
+                    return 22
+                }else {
+                    if communityFollowDataModel.relateData?.content?.count ?? 0 >= 45 {
+                        str = str.prefix(45) + "...更多"
+                        let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        return (22 + 10 + contentHeight)
+                    }else {
+                        let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        return 22 + 10 + contentHeight
+                    }
+                }
+            }
         //点赞,收藏,分享
         //点赞,收藏,分享
         case 3:
         case 3:
             return 54
             return 54
         //评论列表
         //评论列表
         case 4:
         case 4:
             if !(communityFollowDataModel.relateData?.postComment?.isEmpty ?? true) {
             if !(communityFollowDataModel.relateData?.postComment?.isEmpty ?? true) {
-                return UITableView.automaticDimension
+                
+                var height : CGFloat?
+                for communityFollowPostCommentModel in (communityFollowDataModel.relateData?.postComment!.prefix(2))! {
+                    
+                    let nameStr = "\(communityFollowPostCommentModel.username ?? ""):"
+                    let contentStr = "\(communityFollowPostCommentModel.content ?? "")"
+                    let str =  nameStr + contentStr
+                    let strHeight = str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                    height = (height ?? 0) + strHeight + 4
+                }
+                
+                if (communityFollowDataModel.relateData?.commentCount ?? 0) <= 2 {
+                    return (height ?? 0) + 18
+                }else {
+                    return 30 + 18 + (height ?? 0)
+                }
             }
             }
             return 0
             return 0
         //评论
         //评论
@@ -618,9 +656,9 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
             if !cmsMemberModels.isEmpty {
             if !cmsMemberModels.isEmpty {
                 return 62
                 return 62
             }
             }
-            return 0
+            return 0.000001
         default:
         default:
-            return 0
+            return 0.000001
         }
         }
     }
     }
     
     
@@ -649,18 +687,6 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
             return nil
             return nil
         }
         }
     }
     }
-    
-    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
-        cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
-    }
-    
-    func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
-        let height = cellHeightsDictionary[indexPath]
-        if let height = height  {
-            return height as! CGFloat
-        }
-        return UITableView.automaticDimension
-    }
 
 
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
         return nil
         return nil

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

@@ -18,7 +18,6 @@ class CommunityRecommnendViewController: UIViewController {
     }
     }
     weak var observe : NSObjectProtocol?
     weak var observe : NSObjectProtocol?
     
     
-    var cellHeightsDictionary = Dictionary<IndexPath, Any>()
     var communityRecommendDataModels = Array<CommunityRecommendDataModel>()
     var communityRecommendDataModels = Array<CommunityRecommendDataModel>()
     /// 评论需要的模型
     /// 评论需要的模型
     var communityRecommendDataModel : CommunityRecommendDataModel?
     var communityRecommendDataModel : CommunityRecommendDataModel?
@@ -137,6 +136,9 @@ class CommunityRecommnendViewController: UIViewController {
         tableView.backgroundColor = kf7f8faColor
         tableView.backgroundColor = kf7f8faColor
         tableView.dataSource = self
         tableView.dataSource = self
         tableView.delegate = self
         tableView.delegate = self
+        tableView.estimatedRowHeight = 0
+        tableView.estimatedSectionFooterHeight = 0
+        tableView.estimatedSectionHeaderHeight = 0
         return tableView
         return tableView
     }()
     }()
     
     
@@ -338,9 +340,6 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
             case 4:
             case 4:
                 let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
                 let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
                 cell.communityRecommendDataModel = communityRecommendDataModel
                 cell.communityRecommendDataModel = communityRecommendDataModel
-                cell.frame = tableView.bounds
-                cell.layoutIfNeeded()
-                cell.reloadData()
                 return cell
                 return cell
             //评论
             //评论
             case 5:
             case 5:
@@ -478,14 +477,53 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
                 }
                 }
             //内容标题
             //内容标题
             case 2:
             case 2:
-                return UITableView.automaticDimension
+                var str = communityRecommendDataModel.content ?? ""
+                str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                if (communityRecommendDataModel.title == "" || communityRecommendDataModel.title == nil) {
+                    if str.count >= 45 {
+                        str = str.prefix(45) + "...更多"
+                        let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        return contentHeight
+                    }else {
+                        let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        return contentHeight
+                    }
+                }else {
+                    if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                        return 22
+                    }else {
+                        if communityRecommendDataModel.content?.count ?? 0 >= 45 {
+                            str = str.prefix(45) + "...更多"
+                            let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                            return (22 + 10 + contentHeight)
+                        }else {
+                            let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                            return 22 + 10 + contentHeight
+                        }
+                    }
+                }
             //点赞,收藏,分享
             //点赞,收藏,分享
             case 3:
             case 3:
                 return 54
                 return 54
             //评论列表
             //评论列表
             case 4:
             case 4:
                 if !(communityRecommendDataModel.comment?.isEmpty ?? true) {
                 if !(communityRecommendDataModel.comment?.isEmpty ?? true) {
-                    return UITableView.automaticDimension
+                    
+                    var height : CGFloat?
+                    for communityRecommendCommentModel in communityRecommendDataModel.comment!.prefix(2) {
+                        
+                        let nameStr = "\(communityRecommendCommentModel.username ?? ""):"
+                        let contentStr = "\(communityRecommendCommentModel.content ?? "")"
+                        let str =  nameStr + contentStr
+                        let strHeight = str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        height = (height ?? 0) + strHeight + 4
+                    }
+                    
+                    if (communityRecommendDataModel.commentCount ?? 0) <= 2 {
+                        return (height ?? 0) + 18
+                    }else {
+                        return 30 + 18 + (height ?? 0)
+                    }
                 }
                 }
                 return 0
                 return 0
             //评论
             //评论
@@ -508,32 +546,32 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
         case .banner?:
         case .banner?:
             
             
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
-                return 0
+                return 0.000001
             }
             }
-            return 0
+            return 0.000001
         //推荐用户
         //推荐用户
         case .user?:
         case .user?:
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
                 return 62
                 return 62
             }
             }
-            return 0
+            return 0.000001
         //推荐视频
         //推荐视频
         case .video?:
         case .video?:
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
                 return 62
                 return 62
             }
             }
-            return 0
+            return 0.000001
         //推荐话题
         //推荐话题
         case .topic?:
         case .topic?:
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
             if !(communityRecommendDataModel.data?.isEmpty ?? true) {
                 return 62
                 return 62
             }
             }
-            return 0
+            return 0.000001
         //贴子
         //贴子
         case .post?:
         case .post?:
-            return 0
+            return 0.000001
         default:
         default:
-            return 0
+            return 0.000001
         }
         }
 
 
     }
     }
@@ -586,20 +624,6 @@ extension CommunityRecommnendViewController : UITableViewDelegate,UITableViewDat
             return nil
             return nil
         }
         }
     }
     }
-    
-    
-    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
-        cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
-    }
-    
-    func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
-        let height = cellHeightsDictionary[indexPath]
-        if let height = height  {
-            return height as! CGFloat
-        }
-        return UITableView.automaticDimension
-    }
-    
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
     func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
         return nil
         return nil
     }
     }

+ 46 - 19
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -17,7 +17,6 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
     }
     }
     weak var observe : NSObjectProtocol?
     weak var observe : NSObjectProtocol?
     
     
-    var cellHeightsDictionary = Dictionary<IndexPath, Any>()
     var id : Int = 0
     var id : Int = 0
     var communityRecommendDataModels = Array<CommunityRecommendDataModel>()
     var communityRecommendDataModels = Array<CommunityRecommendDataModel>()
     var communityTopicDetailModel : CommunityTopicDetailModel?
     var communityTopicDetailModel : CommunityTopicDetailModel?
@@ -98,6 +97,9 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
         tableView.backgroundColor = UIColor.clear
         tableView.backgroundColor = UIColor.clear
         tableView.dataSource = self
         tableView.dataSource = self
         tableView.delegate = self
         tableView.delegate = self
+        tableView.estimatedRowHeight = 0
+        tableView.estimatedSectionFooterHeight = 0
+        tableView.estimatedSectionHeaderHeight = 0
         if #available(iOS 11.0, *) {
         if #available(iOS 11.0, *) {
             tableView.contentInsetAdjustmentBehavior = .never
             tableView.contentInsetAdjustmentBehavior = .never
         }
         }
@@ -444,9 +446,6 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
         case 4:
         case 4:
             let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
             cell.communityRecommendDataModel = communityRecommendDataModel
             cell.communityRecommendDataModel = communityRecommendDataModel
-            cell.frame = tableView.bounds
-            cell.layoutIfNeeded()
-            cell.reloadData()
             return cell
             return cell
         //评论
         //评论
         case 5:
         case 5:
@@ -531,14 +530,54 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
             }
             }
         //内容标题
         //内容标题
         case 2:
         case 2:
-            return UITableView.automaticDimension
+            var str = communityRecommendDataModel.content ?? ""
+            str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+            if (communityRecommendDataModel.title == "" || communityRecommendDataModel.title == nil) {
+                if str.count >= 45 {
+                    str = str.prefix(45) + "...更多"
+                    let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                    return contentHeight
+                }else {
+                    let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                    return contentHeight
+                }
+            }else {
+                if PostType(rawValue: communityRecommendDataModel.type ?? "html") == .html {
+                    return 22
+                }else {
+                    if communityRecommendDataModel.content?.count ?? 0 >= 45 {
+                        str = str.prefix(45) + "...更多"
+                        let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        return (22 + 10 + contentHeight)
+                    }else {
+                        let contentHeight = "\(str)".heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                        return 22 + 10 + contentHeight
+                    }
+                }
+            }
+
         //点赞,收藏,分享
         //点赞,收藏,分享
         case 3:
         case 3:
             return 54
             return 54
         //评论列表
         //评论列表
         case 4:
         case 4:
             if !(communityRecommendDataModel.comment?.isEmpty ?? true) {
             if !(communityRecommendDataModel.comment?.isEmpty ?? true) {
-                return UITableView.automaticDimension
+                
+                var height : CGFloat?
+                for communityRecommendCommentModel in communityRecommendDataModel.comment!.prefix(2) {
+                    
+                    let nameStr = "\(communityRecommendCommentModel.username ?? ""):"
+                    let contentStr = "\(communityRecommendCommentModel.content ?? "")"
+                    let str =  nameStr + contentStr
+                    let strHeight = str.heightForComment(font: kRegularFont14!, width: kScreenWidth-28)
+                    height = (height ?? 0) + strHeight + 4
+                }
+                
+                if (communityRecommendDataModel.commentCount ?? 0) <= 2 {
+                    return (height ?? 0) + 18
+                }else {
+                    return 30 + 18 + (height ?? 0)
+                }
             }
             }
             return 0
             return 0
         //评论
         //评论
@@ -550,7 +589,7 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
     }
     }
     
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 0
+        return 0.000001
         
         
     }
     }
     
     
@@ -568,16 +607,4 @@ extension CommunityFeaturedTopicsViewController : UITableViewDelegate,UITableVie
         view.backgroundColor = kf7f8faColor
         view.backgroundColor = kf7f8faColor
         return view
         return view
     }
     }
-    
-    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
-        cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
-    }
-    
-    func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
-        let height = cellHeightsDictionary[indexPath]
-        if let height = height  {
-            return height as! CGFloat
-        }
-        return UITableView.automaticDimension
-    }
 }
 }

+ 8 - 10
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -308,10 +308,10 @@ class CommunityRecommendController: BaseViewController {
             let communityPostDetailTopicModel = self?.communityPostDetailModel?.topic?[0]
             let communityPostDetailTopicModel = self?.communityPostDetailModel?.topic?[0]
             vc.topicStr = communityPostDetailTopicModel?.name ?? ""
             vc.topicStr = communityPostDetailTopicModel?.name ?? ""
             if self?.communityPostDetailModel?.title == "" || self?.communityPostDetailModel?.title == nil {
             if self?.communityPostDetailModel?.title == "" || self?.communityPostDetailModel?.title == nil {
-                vc.titleStr =
-                    String(self?.communityPostDetailModel?.content?.prefix(20) ?? "")
+                vc.titleStr = "\(self?.communityPostDetailModel?.content?.prefix(20) ?? "")"
+                
             }else {
             }else {
-                vc.titleStr =                      String(self?.communityPostDetailModel?.title?.prefix(20) ?? "")
+                vc.titleStr = "\(self?.communityPostDetailModel?.title?.prefix(20) ?? "")"
 
 
             }
             }
             vc.avatarStr = self?.communityPostDetailModel?.avatar
             vc.avatarStr = self?.communityPostDetailModel?.avatar
@@ -415,7 +415,7 @@ extension CommunityRecommendController {
         SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentsApi(postId: id, page: page) {
         SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentsApi(postId: id, page: page) {
             [weak self] (communityPostCommentsModel) -> (Void) in
             [weak self] (communityPostCommentsModel) -> (Void) in
             self?.communityPostCommentsModel = communityPostCommentsModel as? CommunityPostCommentsModel
             self?.communityPostCommentsModel = communityPostCommentsModel as? CommunityPostCommentsModel
-            self?.count = self?.communityPostCommentsModel?.pagination?.total ?? 0
+            self?.count = self?.communityPostDetailModel?.commentCount ?? 0
             if self?.communityPostCommentsModel?.pagination?.currentPage == 1{
             if self?.communityPostCommentsModel?.pagination?.currentPage == 1{
                 self?.communityPostCommentModels.removeAll()
                 self?.communityPostCommentModels.removeAll()
             }
             }
@@ -497,7 +497,6 @@ extension CommunityRecommendController {
             [weak self] (communityPostCommentIdModel) -> (Void) in
             [weak self] (communityPostCommentIdModel) -> (Void) in
             
             
             let communityPostCommentIdModel = communityPostCommentIdModel as? CommunityPostCommentIdModel
             let communityPostCommentIdModel = communityPostCommentIdModel as? CommunityPostCommentIdModel
-            
 
 
             if self?.communityPostCommentModel == nil { //评
             if self?.communityPostCommentModel == nil { //评
                 let communityPostCommentModel = CommunityPostCommentModel()
                 let communityPostCommentModel = CommunityPostCommentModel()
@@ -509,11 +508,7 @@ extension CommunityRecommendController {
                 communityPostCommentModel.uid = UserModel.shared().getModel()?.uid
                 communityPostCommentModel.uid = UserModel.shared().getModel()?.uid
                 self?.communityPostCommentModels.insert(communityPostCommentModel, at: 0)
                 self?.communityPostCommentModels.insert(communityPostCommentModel, at: 0)
                 VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text)
                 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
 
 
-                self?.tableView.reloadData()
 
 
             }else { //回评论
             }else { //回评论
                 let communityPostReplyModel = CommunityPostReplyModel()
                 let communityPostReplyModel = CommunityPostReplyModel()
@@ -530,8 +525,11 @@ extension CommunityRecommendController {
                 }
                 }
                 self?.communityPostCommentModel?.reply?.insert(communityPostReplyModel, at: 0)
                 self?.communityPostCommentModel?.reply?.insert(communityPostReplyModel, at: 0)
                 VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
                 VirusViewModel.shared.comment(communityPostDetailModel: (self?.communityPostDetailModel)!, id: communityPostCommentIdModel?.id ?? 0,content: text, communityPostCommentModel: self?.communityPostCommentModel)
-                self?.tableView.reloadData()
             }
             }
+            self?.count += 1
+            self?.communityPostDetailModel?.commentCount = self?.count
+            self?.commentView.communityPostDetailModel = self?.communityPostDetailModel
+            self?.tableView.reloadData()
             complete()
             complete()
         }
         }
     }
     }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -352,7 +352,7 @@ extension CommunityVideoListController {
         
         
         var postDesc : String?
         var postDesc : String?
         if videoItemMdl.title == nil ||  videoItemMdl.title == "" {
         if videoItemMdl.title == nil ||  videoItemMdl.title == "" {
-            postDesc = String(describing:videoItemMdl.content?.prefix(20))
+            postDesc = "\(videoItemMdl.content?.prefix(20) ?? "")"
         }else {
         }else {
             postDesc = videoItemMdl.title
             postDesc = videoItemMdl.title
         }
         }

+ 7 - 5
RainbowPlanet/RainbowPlanet/Modules/MessageModule/MessageList/View/MessageListTableCell.swift

@@ -120,6 +120,7 @@ class MessageListTableCell: UITableViewCell {
         contentImageView.image = kImage(name: "pic_preload")
         contentImageView.image = kImage(name: "pic_preload")
         contentImageView.cornerRadius = 4
         contentImageView.cornerRadius = 4
         contentImageView.masksToBounds = true
         contentImageView.masksToBounds = true
+        contentImageView.contentMode = .scaleAspectFill
         return contentImageView
         return contentImageView
     }()
     }()
     
     
@@ -208,12 +209,13 @@ class MessageListTableCell: UITableViewCell {
         if oneStr != "" {
         if oneStr != "" {
             self.titleLabel.addClickText(oneStr, attributeds: [NSAttributedString.Key.foregroundColor:k333333Color], transmitBody: nil) {
             self.titleLabel.addClickText(oneStr, attributeds: [NSAttributedString.Key.foregroundColor:k333333Color], transmitBody: nil) {
                 [weak self] (data) in
                 [weak self] (data) in
-                if self?.messageDataModel?.param?.uid != UserModel.shared().getModel()?.uid {
-                    let vc = OtherPersonalCenterViewController()
-                    vc.uid = self?.messageDataModel?.param?.uid ?? 0
-                    self?.findViewController()?.navigationController?.pushViewController(vc, animated: true)
+                if MessageShowType.follow == MessageShowType(rawValue: self?.messageDataModel?.messageShowType ?? 12) {
+                    if self?.messageDataModel?.param?.uid != UserModel.shared().getModel()?.uid {
+                        let vc = OtherPersonalCenterViewController()
+                        vc.uid = self?.messageDataModel?.param?.uid ?? 0
+                        self?.findViewController()?.navigationController?.pushViewController(vc, animated: true)
+                    }
                 }
                 }
-
             }
             }
         }
         }
         if Three != "" {
         if Three != "" {

+ 9 - 2
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListCollectionViewCell.swift

@@ -116,8 +116,14 @@ class PersonViewUserAndOtherListCollectionViewCell: UICollectionViewCell {
                 videoImageView.isHidden = true
                 videoImageView.isHidden = true
             }
             }
             if uid == UserModel.shared().getModel()?.uid {
             if uid == UserModel.shared().getModel()?.uid {
-                rainbowBeanImageView.isHidden = false
-                rainbowBeanNumberLabel.isHidden = false
+                if type != 0 {
+                    rainbowBeanImageView.isHidden = true
+                    rainbowBeanNumberLabel.isHidden = true
+                }else {
+                    rainbowBeanImageView.isHidden = false
+                    rainbowBeanNumberLabel.isHidden = false
+                }
+
             }else {
             }else {
                 rainbowBeanImageView.isHidden = true
                 rainbowBeanImageView.isHidden = true
                 rainbowBeanNumberLabel.isHidden = true
                 rainbowBeanNumberLabel.isHidden = true
@@ -126,4 +132,5 @@ class PersonViewUserAndOtherListCollectionViewCell: UICollectionViewCell {
         }
         }
     }
     }
     var uid: Int?
     var uid: Int?
+    var type : Int?
 }
 }

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/PersonalCenterView/PersonViewUserAndOtherListView.swift

@@ -132,6 +132,7 @@ extension PersonViewUserAndOtherListView: UICollectionViewDelegateFlowLayout,UIC
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = PersonViewUserAndOtherListCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
         let cell = PersonViewUserAndOtherListCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
         cell.uid = self.uid
         cell.uid = self.uid
+        cell.type = self.personalCenterVCType
         cell.postMyModel = postMyModels[indexPath.row]
         cell.postMyModel = postMyModels[indexPath.row]
         return cell
         return cell
         
         

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/ViewController/SetViewController.swift

@@ -73,6 +73,7 @@ class SetViewController: BaseViewController {
                 break
                 break
             case 2:
             case 2:
                 SwiftMoyaNetWorkServiceUser.shared().userLogoutApi()
                 SwiftMoyaNetWorkServiceUser.shared().userLogoutApi()
+                self?.navigationController?.popToRootViewController(animated: false)
                 break
                 break
             default:
             default:
                 showSwiftProgressHUDInfo()
                 showSwiftProgressHUDInfo()

+ 0 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceUser/SwiftMoyaNetWorkServiceUser.swift

@@ -117,11 +117,9 @@ public class SwiftMoyaNetWorkServiceUser: NSObject {
     ///   - completion: 回调
     ///   - completion: 回调
     func userLogoutApi() {
     func userLogoutApi() {
         let parameters = Dictionary<String,Any>()
         let parameters = Dictionary<String,Any>()
-        SwiftProgressHUD.shared().showWait()
         SwiftMoyaNetWorkManager.shared.requestAny(target: MultiTarget(SwiftMoyaServiceUserApi.userLogout(parameters: parameters))) { (data) in
         SwiftMoyaNetWorkManager.shared.requestAny(target: MultiTarget(SwiftMoyaServiceUserApi.userLogout(parameters: parameters))) { (data) in
             // 设置友盟别名
             // 设置友盟别名
             kAppDelegate.setLoginController()
             kAppDelegate.setLoginController()
-            SwiftProgressHUD.shared().hide()
         }
         }
     }
     }