Parcourir la source

1,插入数据判断 2,回到头部判断

jsonwang il y a 3 ans
Parent
commit
a2cb4e7794
1 fichiers modifiés avec 6 ajouts et 4 suppressions
  1. 6 4
      BFFramework/Classes/Stuckpoint/View/PQSelecteMusicView.swift

+ 6 - 4
BFFramework/Classes/Stuckpoint/View/PQSelecteMusicView.swift

@@ -146,7 +146,7 @@ class PQSelecteMusicView: UIView {
         searchMusiceDatas.insert(model, at: 0)
         
         //有搜索的数据
-        if(musicDatas.first?.cacheTagID == 425){
+        if(currentSelectTag?.tagId == 425){
             musicDatas.insert(contentsOf: searchMusiceDatas, at: 0)
         }
         
@@ -211,9 +211,11 @@ class PQSelecteMusicView: UIView {
                 }
                 
                 self?.selectMusicCollection.reloadData()
-                
-                //歌曲列表返回到头部
-                self?.selectMusicCollection.setContentOffset(.zero, animated: false)
+                if( self?.pageNum == 2){
+                    //歌曲列表返回到头部
+                    self?.selectMusicCollection.setContentOffset(.zero, animated: false)
+                }
+           
             }
 
         }