南鑫林 hace 5 años
padre
commit
068c999889

+ 3 - 3
RainbowPlanet/Podfile

@@ -20,9 +20,9 @@ target 'RainbowPlanet' do
   pod 'FMDB'
   # 图片加载
   pod 'Kingfisher'
-#  pod 'Nuke'
-#  pod 'Nuke-WebP-Plugin'
-#  pod 'Gifu'
+  # gif动画
+  pod 'Gifu'
+  # josn动画
   pod 'lottie-ios'
   # 自动布局
   pod 'SnapKit'

+ 5 - 1
RainbowPlanet/Podfile.lock

@@ -36,6 +36,7 @@ PODS:
   - FSPagerView (0.8.2)
   - FWPopupView (4.0.7):
     - SnapKit
+  - Gifu (3.2.0)
   - IQKeyboardManagerSwift (6.4.0)
   - JSONModel (1.7.0)
   - JXSegmentedView (0.0.19)
@@ -111,6 +112,7 @@ DEPENDENCIES:
   - FMDB
   - FSPagerView
   - FWPopupView
+  - Gifu
   - IQKeyboardManagerSwift
   - JSONModel (~> 1.7.0)
   - JXSegmentedView
@@ -164,6 +166,7 @@ SPEC REPOS:
     - FMDB
     - FSPagerView
     - FWPopupView
+    - Gifu
     - IQKeyboardManagerSwift
     - JSONModel
     - JXSegmentedView
@@ -215,6 +218,7 @@ SPEC CHECKSUMS:
   FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
   FSPagerView: 816a18842306973cc7cc6df8a5332272f7815c30
   FWPopupView: c1dbb33fbe4d223f619f28a7e5e5a00f08c10342
+  Gifu: 7bcb6427457d85e0b4dff5a84ec5947ac19a93ea
   IQKeyboardManagerSwift: ed9b04ee0e3067ffba543283462d619f944b05e5
   JSONModel: 840bc0fcffb24b8454d2c026bf26fea454b8e98d
   JXSegmentedView: 6e22381bd1e6f0767fc078bef1947b13b2d337a1
@@ -248,6 +252,6 @@ SPEC CHECKSUMS:
   YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
   ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
 
-PODFILE CHECKSUM: 623f202e502f85c661ea8455a208967e916c0ad1
+PODFILE CHECKSUM: 3e72005663525386830186d7b72455f4e5867eb5
 
 COCOAPODS: 1.7.4

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

@@ -63,6 +63,7 @@ class CardContentUserTableViewCell: UITableViewCell {
             make.top.equalTo(avatarButton).offset(2)
             make.height.equalTo(21)
             make.left.equalTo(avatarButton.snp_right).offset(16)
+            make.right.equalTo(setButton.snp_left).offset(-80)
         }
         timeLabel.snp_makeConstraints { (make) in
             make.bottom.equalTo(avatarButton).offset(4)
@@ -100,6 +101,9 @@ class CardContentUserTableViewCell: UITableViewCell {
         titleButton.setTitle("用户昵称", for: UIControl.State.normal)
         titleButton.setTitleColor(k333333Color, for: UIControl.State.normal)
         titleButton.titleLabel?.font = kMediumFont14
+        titleButton.titleLabel?.lineBreakMode = NSLineBreakMode.byTruncatingTail
+        titleButton.titleLabel?.textAlignment = .left
+        titleButton.contentHorizontalAlignment = .left
         titleButton.rx.tap.subscribe(onNext: {
             [weak self] (data) in
             self?.pushCommunityUser()

+ 7 - 5
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/Controller/CommunityRecommendController.swift

@@ -464,14 +464,16 @@ extension CommunityRecommendController {
                 //label高度
                 var labelHeight : CGFloat = 0
                 //总间距
-                let spacingHeght : CGFloat!
+                let spacingHeght : CGFloat = 35
+                
+                let str = communityPostDataModel.content?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "").prefix(13)
                 
                 if communityPostDataModel.title == "" || communityPostDataModel.title == nil  {
-                    labelHeight = 0
-                    spacingHeght = 25
+                    let content = "\(str ?? "")"
+                    labelHeight = (content.heightForComment(font: kMediumFont13!, width: (((kScreenWidth - 15)/2) - 20)))
                 }else {
-                    labelHeight = (communityPostDataModel.title?.heightForComment(font: kMediumFont13!, width: (((kScreenWidth - 15)/2) - 20)))!
-                    spacingHeght = 35
+                    let str = communityPostDataModel.title?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                    labelHeight = (str?.heightForComment(font: kMediumFont13!, width: (((kScreenWidth - 15)/2) - 20)))!
                 }
                 
                 //button高度

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/imageCell/RecommendDetailContentCell.swift

@@ -207,7 +207,7 @@ class RecommendDetailContentCell: UITableViewCell {
     
     var communityPostDetailModel : CommunityPostDetailModel? {
         didSet {
-            beanLabel.text = "\(communityPostDetailModel?.availableBean ?? 0)彩虹豆待收获"
+            beanLabel.text = "\(communityPostDetailModel?.willCollectBean ?? 0)彩虹豆待收获"
             contentLabel.text = communityPostDetailModel?.content
             if communityPostDetailModel?.location == nil || communityPostDetailModel?.location == "" {
                 timeLabel.text = "\(communityPostDetailModel?.createdAt ?? "")"

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

@@ -112,7 +112,6 @@ extension PersonViewUserAndOtherListView {
                 self?.postMyModels = (self?.postMyModels)! + (communityPostMyModel?.data!)!
                 self?.collectionView.reloadData()
                 if  self?.postMyModels.count ?? 0 >= communityPostMyModel?.pagination?.total ?? 0 {
-                    
                     self?.collectionView.endFooterNoMoreData()
                 }
             }else {

+ 25 - 8
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/View/SearchContentListCollectionCell.swift

@@ -80,17 +80,20 @@ class SearchContentListCollectionCell: UICollectionViewCell {
             make.left.equalToSuperview().offset(10)
             make.size.equalTo(18)
         }
-        nameButton.snp.remakeConstraints { (make) in
-            make.centerY.equalTo(avatarButton)
-            make.left.equalTo(avatarButton.snp_right).offset(5)
-            make.height.equalTo(18)
-        }
+
         likeBtn.snp.remakeConstraints { (make) in
             make.centerY.equalTo(avatarButton)
             make.right.equalTo(-13)
             make.height.equalTo(18)
         }
         likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
+        
+        nameButton.snp.remakeConstraints { (make) in
+            make.centerY.equalTo(avatarButton)
+            make.left.equalTo(avatarButton.snp_right).offset(5)
+            make.height.equalTo(18)
+            make.right.equalTo(likeBtn.snp_left).offset(-5)
+        }
         praiseAnimationView.snp.makeConstraints { (make) in
             make.edges.equalToSuperview()
         }
@@ -141,6 +144,7 @@ class SearchContentListCollectionCell: UICollectionViewCell {
         nameButton.setTitleColor(k262626Color, for: UIControl.State.normal)
         nameButton.titleLabel?.font = kRegularFont12
         nameButton.contentHorizontalAlignment = .left
+        nameButton.titleLabel?.lineBreakMode = .byTruncatingTail
         nameButton.rx.tap.subscribe(onNext: {
             [weak self] (data) in
             if let userClosure = self?.userClosure {
@@ -189,9 +193,9 @@ class SearchContentListCollectionCell: UICollectionViewCell {
             contentImageView.kf.setImage(with: kURLImage(name: communityPostDataModel?.img ?? ""), placeholder: kImage(name: "pic_preload"))
             titleLabel.text = communityPostDataModel?.title
             if communityPostDataModel?.title == "" || communityPostDataModel?.title == nil {
-                titleLabel.text = communityPostDataModel?.content
+                titleLabel.text = communityPostDataModel?.content?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
             }else {
-                titleLabel.text = communityPostDataModel?.title
+                titleLabel.text = communityPostDataModel?.title?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
             }
             avatarButton.kf.setImage(with: kURLImage(name: communityPostDataModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
             likeBtn.setTitle("\(communityPostDataModel?.praiseCount ?? 0)", for: UIControl.State.normal)
@@ -200,8 +204,21 @@ class SearchContentListCollectionCell: UICollectionViewCell {
             }else {
                 likeBtn.isSelected = true
             }
-            likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
+
+            
             nameButton.setTitle(communityPostDataModel?.username, for: UIControl.State.normal)
+            nameButton.snp.remakeConstraints { (make) in
+                make.centerY.equalTo(avatarButton)
+                make.left.equalTo(avatarButton.snp_right).offset(5)
+                make.height.equalTo(18)
+                make.right.lessThanOrEqualTo(likeBtn.snp_left).offset(-5)
+            }
+            likeBtn.snp.remakeConstraints { (make) in
+                make.centerY.equalTo(avatarButton)
+                make.right.equalTo(-13)
+                make.height.equalTo(18)
+            }
+            likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
             if PostType(rawValue: communityPostDataModel?.type ?? "video") == .video  {
                 pauseImageView.isHidden = false
             }else {

+ 5 - 2
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchContentList/ViewController/SearchContentListViewController.swift

@@ -129,11 +129,14 @@ extension SearchContentListViewController {
                 //总间距
                 let spacingHeght : CGFloat = 35
                 
+                let str = communityPostDataModel.content?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "").prefix(13)
+                
                 if communityPostDataModel.title == "" || communityPostDataModel.title == nil  {
-                    let content = "\(communityPostDataModel.content?.prefix(13) ?? "")"
+                    let content = "\(str ?? "")"
                     labelHeight = (content.heightForComment(font: kMediumFont13!, width: (((kScreenWidth - 15)/2) - 20)))
                 }else {
-                    labelHeight = (communityPostDataModel.title?.heightForComment(font: kMediumFont13!, width: (((kScreenWidth - 15)/2) - 20)))!
+                    let str = communityPostDataModel.title?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
+                    labelHeight = (str?.heightForComment(font: kMediumFont13!, width: (((kScreenWidth - 15)/2) - 20)))!
                 }
                 
                 //button高度

+ 4 - 2
RainbowPlanet/RainbowPlanet/Tools/KeyBoardCommentView/KeyBoardCommentView.swift

@@ -150,13 +150,14 @@ class KeyBoardCommentView: FWPopupView {
         let vProperty = FWPopupViewProperty()
         vProperty.animationDuration = view.duration
         vProperty.popupCustomAlignment = .bottomCenter
-        vProperty.popupViewEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: view.keyboardH, right: 0)
+        view.frame = CGRect(x: 0, y: kScaleHeight - view.keyboardH , width: kScreenWidth, height: 48)
+        vProperty.popupViewEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
         vProperty.popupAnimationType = .frame
         vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
         vProperty.touchWildToHide = "1"
         view.vProperty = vProperty
         view.show()
-        
+        view.superview?.bringSubviewToFront(view)
         return view
     }
 
@@ -185,6 +186,7 @@ extension KeyBoardCommentView : UITextViewDelegate {
             self.y = kScreenHeight -  self.height
         }
         sendButton.y = textView.height + 20 - 38
+        self.frame = CGRect(x: 0, y: self.y , width: kScreenWidth, height: self.height)
 
     }
 }