Browse Source

fix:音乐播放icon状态错误问题

huzhiqiang 3 years ago
parent
commit
bdf8dfe5f4

+ 7 - 3
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointMusicContentController.swift

@@ -248,11 +248,15 @@ extension PQStuckPointMusicContentController: UICollectionViewDelegate, UICollec
                     (itemList[indexPath.item] as? PQVoiceModel)?.isSelected = true
                     (itemList[indexPath.item] as? PQVoiceModel)?.isPlaying = true
                 }
-                var indexpaths = [indexPath]
+//                var indexpaths = [indexPath]
                 if lastIndexPath != nil {
-                    indexpaths.append(lastIndexPath!)
+//                    indexpaths.append(lastIndexPath!)
+                    let cell = collectionView.cellForItem(at: lastIndexPath!) as? PQStuckPointMusicContentCell
+                    cell?.bgmData = itemList[lastIndexPath!.item]
                 }
-                collectionView.reloadItems(at: indexpaths)
+                let cell = collectionView.cellForItem(at: indexPath) as? PQStuckPointMusicContentCell
+                cell?.bgmData = itemList[indexPath.item]
+//                collectionView.reloadItems(at: indexpaths)
                 lastIndexPath = indexPath
 //                collectionView.reloadData()
             } else if contentType != .catagery {