对收藏数据库的构建
This commit is contained in:
parent
0a5253a349
commit
97297c7c55
@ -29,12 +29,17 @@
|
||||
CB102F562BFAFA7200E967D8 /* MP_DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB102F542BFAFA7200E967D8 /* MP_DownloadManager.swift */; };
|
||||
CB102F582BFAFFCC00E967D8 /* MPPositive_RecommendListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB102F572BFAFFCC00E967D8 /* MPPositive_RecommendListViewModel.swift */; };
|
||||
CB102F5A2BFB002C00E967D8 /* MPPositive_RecommendLoadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB102F592BFB002C00E967D8 /* MPPositive_RecommendLoadViewModel.swift */; };
|
||||
CB102F5C2BFB244500E967D8 /* MPPositive_RecommendMemberCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB102F5B2BFB244500E967D8 /* MPPositive_RecommendMemberCollectionViewCell.swift */; };
|
||||
CB102F5E2BFB2F7C00E967D8 /* MPPositive_RecommendShowTypeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB102F5D2BFB2F7C00E967D8 /* MPPositive_RecommendShowTypeView.swift */; };
|
||||
CB1C16522BC80BF100B96AB3 /* MPSideA_MediaCenterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB1C16512BC80BF100B96AB3 /* MPSideA_MediaCenterManager.swift */; };
|
||||
CB5661292BE09D0500CFD014 /* MPPositive_JsonPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5661282BE09D0500CFD014 /* MPPositive_JsonPlayer.swift */; };
|
||||
CB56612D2BE0DF8C00CFD014 /* MP_WebWork.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB56612C2BE0DF8C00CFD014 /* MP_WebWork.swift */; };
|
||||
CBB5D31D2BDF4E9600CC333D /* MPPositive_MusicItemShowTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB5D31C2BDF4E9600CC333D /* MPPositive_MusicItemShowTableViewCell.swift */; };
|
||||
CBB5D31F2BDF711600CC333D /* MPPositive_SongItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB5D31E2BDF711600CC333D /* MPPositive_SongItemModel.swift */; };
|
||||
CBB5D3222BDF80C800CC333D /* MPPositive_PlayerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB5D3212BDF80C800CC333D /* MPPositive_PlayerViewController.swift */; };
|
||||
CBB5F1F92BFC35D000CBF73A /* MPPositive_CollectionSongModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB5F1F82BFC35D000CBF73A /* MPPositive_CollectionSongModel.swift */; };
|
||||
CBB5F1FB2BFC3DB600CBF73A /* MPPositive_CollectionListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB5F1FA2BFC3DB600CBF73A /* MPPositive_CollectionListModel.swift */; };
|
||||
CBB5F1FD2BFC40E400CBF73A /* MPPositive_CollectionArtistModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB5F1FC2BFC40E400CBF73A /* MPPositive_CollectionArtistModel.swift */; };
|
||||
CBB75B0B2BEF0BC400B3FF9A /* MPPositive_DownloadItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB75B0A2BEF0BC400B3FF9A /* MPPositive_DownloadItemModel.swift */; };
|
||||
CBB9F9DD2BEDCFEE008338DE /* MPPositive_JsonLyrics.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB9F9DC2BEDCFEE008338DE /* MPPositive_JsonLyrics.swift */; };
|
||||
CBB9F9DF2BEDDCC5008338DE /* MP_PlayerManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB9F9DE2BEDDCC5008338DE /* MP_PlayerManager.swift */; };
|
||||
@ -174,7 +179,6 @@
|
||||
CBEE8E362BEB2604007DA798 /* MPPositive_PlayerLyricView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBEE8E352BEB2604007DA798 /* MPPositive_PlayerLyricView.swift */; };
|
||||
CBEE8E382BEB92CC007DA798 /* MPPositive_SongViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBEE8E372BEB92CC007DA798 /* MPPositive_SongViewModel.swift */; };
|
||||
CBF456DD2BF1E72F00ABF761 /* MPPositive_SearchResultListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBF456DC2BF1E72F00ABF761 /* MPPositive_SearchResultListViewModel.swift */; };
|
||||
CBF456DF2BF1E8A500ABF761 /* MPPositive_SearchResultItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBF456DE2BF1E8A500ABF761 /* MPPositive_SearchResultItemModel.swift */; };
|
||||
CBF456E12BF1EB4300ABF761 /* MPPositive_SearchResultItemViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBF456E02BF1EB4300ABF761 /* MPPositive_SearchResultItemViewModel.swift */; };
|
||||
CBF456E32BF2086600ABF761 /* MPPositive_SearchResultsLoadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBF456E22BF2086600ABF761 /* MPPositive_SearchResultsLoadViewModel.swift */; };
|
||||
CBF456E72BF20BBD00ABF761 /* MPPositive_SearchResultShowTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBF456E62BF20BBD00ABF761 /* MPPositive_SearchResultShowTableViewCell.swift */; };
|
||||
@ -214,12 +218,17 @@
|
||||
CB102F542BFAFA7200E967D8 /* MP_DownloadManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MP_DownloadManager.swift; sourceTree = "<group>"; };
|
||||
CB102F572BFAFFCC00E967D8 /* MPPositive_RecommendListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_RecommendListViewModel.swift; sourceTree = "<group>"; };
|
||||
CB102F592BFB002C00E967D8 /* MPPositive_RecommendLoadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_RecommendLoadViewModel.swift; sourceTree = "<group>"; };
|
||||
CB102F5B2BFB244500E967D8 /* MPPositive_RecommendMemberCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_RecommendMemberCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
CB102F5D2BFB2F7C00E967D8 /* MPPositive_RecommendShowTypeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_RecommendShowTypeView.swift; sourceTree = "<group>"; };
|
||||
CB1C16512BC80BF100B96AB3 /* MPSideA_MediaCenterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSideA_MediaCenterManager.swift; sourceTree = "<group>"; };
|
||||
CB5661282BE09D0500CFD014 /* MPPositive_JsonPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_JsonPlayer.swift; sourceTree = "<group>"; };
|
||||
CB56612C2BE0DF8C00CFD014 /* MP_WebWork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MP_WebWork.swift; sourceTree = "<group>"; };
|
||||
CBB5D31C2BDF4E9600CC333D /* MPPositive_MusicItemShowTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_MusicItemShowTableViewCell.swift; sourceTree = "<group>"; };
|
||||
CBB5D31E2BDF711600CC333D /* MPPositive_SongItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SongItemModel.swift; sourceTree = "<group>"; };
|
||||
CBB5D3212BDF80C800CC333D /* MPPositive_PlayerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_PlayerViewController.swift; sourceTree = "<group>"; };
|
||||
CBB5F1F82BFC35D000CBF73A /* MPPositive_CollectionSongModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CollectionSongModel.swift; sourceTree = "<group>"; };
|
||||
CBB5F1FA2BFC3DB600CBF73A /* MPPositive_CollectionListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CollectionListModel.swift; sourceTree = "<group>"; };
|
||||
CBB5F1FC2BFC40E400CBF73A /* MPPositive_CollectionArtistModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_CollectionArtistModel.swift; sourceTree = "<group>"; };
|
||||
CBB75B0A2BEF0BC400B3FF9A /* MPPositive_DownloadItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_DownloadItemModel.swift; sourceTree = "<group>"; };
|
||||
CBB9F9DC2BEDCFEE008338DE /* MPPositive_JsonLyrics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_JsonLyrics.swift; sourceTree = "<group>"; };
|
||||
CBB9F9DE2BEDDCC5008338DE /* MP_PlayerManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MP_PlayerManager.swift; sourceTree = "<group>"; };
|
||||
@ -359,7 +368,6 @@
|
||||
CBEE8E352BEB2604007DA798 /* MPPositive_PlayerLyricView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_PlayerLyricView.swift; sourceTree = "<group>"; };
|
||||
CBEE8E372BEB92CC007DA798 /* MPPositive_SongViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SongViewModel.swift; sourceTree = "<group>"; };
|
||||
CBF456DC2BF1E72F00ABF761 /* MPPositive_SearchResultListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SearchResultListViewModel.swift; sourceTree = "<group>"; };
|
||||
CBF456DE2BF1E8A500ABF761 /* MPPositive_SearchResultItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SearchResultItemModel.swift; sourceTree = "<group>"; };
|
||||
CBF456E02BF1EB4300ABF761 /* MPPositive_SearchResultItemViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SearchResultItemViewModel.swift; sourceTree = "<group>"; };
|
||||
CBF456E22BF2086600ABF761 /* MPPositive_SearchResultsLoadViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SearchResultsLoadViewModel.swift; sourceTree = "<group>"; };
|
||||
CBF456E62BF20BBD00ABF761 /* MPPositive_SearchResultShowTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPPositive_SearchResultShowTableViewCell.swift; sourceTree = "<group>"; };
|
||||
@ -720,8 +728,10 @@
|
||||
CBD6F2152BF48DDD00343A4A /* MPPositive_ArtistHeaderModel.swift */,
|
||||
CBB5D31E2BDF711600CC333D /* MPPositive_SongItemModel.swift */,
|
||||
CBB75B0A2BEF0BC400B3FF9A /* MPPositive_DownloadItemModel.swift */,
|
||||
CBB5F1F82BFC35D000CBF73A /* MPPositive_CollectionSongModel.swift */,
|
||||
CBB5F1FA2BFC3DB600CBF73A /* MPPositive_CollectionListModel.swift */,
|
||||
CBB5F1FC2BFC40E400CBF73A /* MPPositive_CollectionArtistModel.swift */,
|
||||
CBFECE382BF0CFF900E07DC4 /* MPPositive_SearchSuggestionItemModel.swift */,
|
||||
CBF456DE2BF1E8A500ABF761 /* MPPositive_SearchResultItemModel.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
@ -991,6 +1001,8 @@
|
||||
CBEE8E332BEB16BB007DA798 /* MPPositive_PlayerSilder.swift */,
|
||||
CBEE8E352BEB2604007DA798 /* MPPositive_PlayerLyricView.swift */,
|
||||
CBCC23522BEE596E004D7A57 /* MPPositive_PlayerListShowTableViewCell.swift */,
|
||||
CB102F5B2BFB244500E967D8 /* MPPositive_RecommendMemberCollectionViewCell.swift */,
|
||||
CB102F5D2BFB2F7C00E967D8 /* MPPositive_RecommendShowTypeView.swift */,
|
||||
);
|
||||
path = Player;
|
||||
sourceTree = "<group>";
|
||||
@ -1165,7 +1177,6 @@
|
||||
CBCB35212BD7ACE900802900 /* MPPositive_JsonBrowse.swift in Sources */,
|
||||
CBCB4FF62BD11402009760B3 /* MPSideA_DeleteViewController.swift in Sources */,
|
||||
CBFECE392BF0CFFA00E07DC4 /* MPPositive_SearchSuggestionItemModel.swift in Sources */,
|
||||
CBF456DF2BF1E8A500ABF761 /* MPPositive_SearchResultItemModel.swift in Sources */,
|
||||
CBF456E72BF20BBD00ABF761 /* MPPositive_SearchResultShowTableViewCell.swift in Sources */,
|
||||
CBDD516F2BECBA6E000F12C5 /* MPPositive_PlayerLoadViewModel.swift in Sources */,
|
||||
CBD6F2122BF4499800343A4A /* MPPositive_ArtistShowViewController.swift in Sources */,
|
||||
@ -1217,6 +1228,7 @@
|
||||
CBCB4FFA2BD11402009760B3 /* MPSideA_PrivacyViewController.swift in Sources */,
|
||||
CBD6F21C2BF4AEE600343A4A /* MPPositive_ArtistShowHeaderView.swift in Sources */,
|
||||
CBCB500E2BD11402009760B3 /* MPSideA_CenterTableViewCell.swift in Sources */,
|
||||
CB102F5E2BFB2F7C00E967D8 /* MPPositive_RecommendShowTypeView.swift in Sources */,
|
||||
009662312BB14A5A00FCA65F /* ViewController.swift in Sources */,
|
||||
CBEB01852BF5DB3400D45006 /* MPPositive_ArtistDescriptionTableViewCell.swift in Sources */,
|
||||
CBE2C4C72BC783F700F283A7 /* MP_HUD.swift in Sources */,
|
||||
@ -1254,6 +1266,7 @@
|
||||
CBEB017D2BF5D35700D45006 /* MPPositive_ArtistShowSongTableViewCell.swift in Sources */,
|
||||
CBCC23512BEE58C1004D7A57 /* MPPositive_PlayerListShowViewController.swift in Sources */,
|
||||
CBDD516D2BEC6AFE000F12C5 /* MPPositive_JsonNext.swift in Sources */,
|
||||
CBB5F1F92BFC35D000CBF73A /* MPPositive_CollectionSongModel.swift in Sources */,
|
||||
CBD6F2202BF4CE8E00343A4A /* MPPositive_JsonArtistMore.swift in Sources */,
|
||||
CBD6F21A2BF4A38C00343A4A /* MPPositive_ArtistContentListViewModel.swift in Sources */,
|
||||
CB0918912BD255EA006D2B39 /* MPPositive_NavigationController.swift in Sources */,
|
||||
@ -1266,6 +1279,7 @@
|
||||
CBCAFB5F2BB3C55500BC6520 /* DateTime.swift in Sources */,
|
||||
CBD958D22BB6600500666B0D /* MP_PlayerSlider.swift in Sources */,
|
||||
CBCC23532BEE596E004D7A57 /* MPPositive_PlayerListShowTableViewCell.swift in Sources */,
|
||||
CBB5F1FD2BFC40E400CBF73A /* MPPositive_CollectionArtistModel.swift in Sources */,
|
||||
CBC687492BC2882B0023ECA6 /* MPTableManager.swift in Sources */,
|
||||
CBD6F2142BF44D8A00343A4A /* MPPositive_JsonArtist.swift in Sources */,
|
||||
CBD313532BD60CD80015D227 /* MPPositive_HomeShowTableViewCell.swift in Sources */,
|
||||
@ -1278,6 +1292,8 @@
|
||||
CBE477B12BB16CCC0031C14B /* Macro.swift in Sources */,
|
||||
CBCB4FFE2BD11402009760B3 /* MPSideA_ServiceViewController.swift in Sources */,
|
||||
CBE2C4CB2BC7BE5D00F283A7 /* MP_NetWorkManager.swift in Sources */,
|
||||
CB102F5C2BFB244500E967D8 /* MPPositive_RecommendMemberCollectionViewCell.swift in Sources */,
|
||||
CBB5F1FB2BFC3DB600CBF73A /* MPPositive_CollectionListModel.swift in Sources */,
|
||||
CBF456EB2BF222EC00ABF761 /* MPPositive_SearchSuggestionsView.swift in Sources */,
|
||||
CBBFA91E2BBA9B5C00057FD5 /* Notification.swift in Sources */,
|
||||
CBCB321A2BD7578500802900 /* MP_LocationManager.swift in Sources */,
|
||||
|
||||
@ -1,5 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22757" systemVersion="23E224" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
||||
<entity name="MPPositive_CollectionArtistModel" representedClassName="MPPositive_CollectionArtistModel" syncable="YES" codeGenerationType="class">
|
||||
<attribute name="artistId" optional="YES" attributeType="String"/>
|
||||
<attribute name="coverImage" optional="YES" attributeType="URI"/>
|
||||
<attribute name="subtitle" optional="YES" attributeType="String"/>
|
||||
<attribute name="title" optional="YES" attributeType="String"/>
|
||||
</entity>
|
||||
<entity name="MPPositive_CollectionListModel" representedClassName="MPPositive_CollectionListModel" syncable="YES">
|
||||
<attribute name="browseId" optional="YES" attributeType="String"/>
|
||||
<attribute name="coverImage" optional="YES" attributeType="URI"/>
|
||||
<attribute name="params" optional="YES" attributeType="String"/>
|
||||
<attribute name="subtitle" optional="YES" attributeType="String"/>
|
||||
<attribute name="title" optional="YES" attributeType="String"/>
|
||||
</entity>
|
||||
<entity name="MPPositive_CollectionSongModel" representedClassName="MPPositive_CollectionSongModel" syncable="YES">
|
||||
<attribute name="coverImage" optional="YES" attributeType="URI"/>
|
||||
<attribute name="subtitle" optional="YES" attributeType="String"/>
|
||||
<attribute name="title" optional="YES" attributeType="String"/>
|
||||
<attribute name="videoId" optional="YES" attributeType="String"/>
|
||||
</entity>
|
||||
<entity name="MPPositive_DownloadItemModel" representedClassName="MPPositive_DownloadItemModel" syncable="YES">
|
||||
<attribute name="coverImage" optional="YES" attributeType="URI"/>
|
||||
<attribute name="lengthText" optional="YES" attributeType="String"/>
|
||||
|
||||
@ -47,6 +47,7 @@ let placeholderImage:UIImage = UIImage(named: "Home First'placeholder")!
|
||||
let privacyUrl:URL = .init(string: "https://musicoo.app/privacy")!
|
||||
///用户协议网址
|
||||
let serviceUrl:URL = .init(string: "https://musicoo.app/terms")!
|
||||
|
||||
//MARK: - 全局变量与方法
|
||||
///总事件闭包
|
||||
typealias ActionBlock = () -> Void?
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
//
|
||||
// MPPositive_CollectionArtistModel.swift
|
||||
// MusicPlayer
|
||||
//
|
||||
// Created by Mr.Zhou on 2024/5/21.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import CoreData
|
||||
///收藏艺术家Model
|
||||
@objc(MPPositive_CollectionArtistModel)
|
||||
class MPPositive_CollectionArtistModel: NSManagedObject, MP_CoreDataManageableDelegate, MP_CoreDataOperationDelegate {
|
||||
typealias ManagedObject = MPPositive_CollectionArtistModel
|
||||
///封面
|
||||
@NSManaged var coverImage:URL!
|
||||
///一级标题
|
||||
@NSManaged var title:String!
|
||||
///二级标题
|
||||
@NSManaged var subtitle:String!
|
||||
///艺术家Id
|
||||
@NSManaged var artistId:String?
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
//
|
||||
// MPPositive_CollectionListModel.swift
|
||||
// MusicPlayer
|
||||
//
|
||||
// Created by Mr.Zhou on 2024/5/21.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import CoreData
|
||||
///收藏列表/专辑Model
|
||||
@objc(MPPositive_CollectionListModel)
|
||||
class MPPositive_CollectionListModel: NSManagedObject, MP_CoreDataManageableDelegate, MP_CoreDataOperationDelegate {
|
||||
typealias ManagedObject = MPPositive_CollectionListModel
|
||||
///封面
|
||||
@NSManaged var coverImage:URL!
|
||||
///标题(单曲标题)
|
||||
@NSManaged var title:String?
|
||||
///二级标题
|
||||
@NSManaged var subtitle:String?
|
||||
///列表专辑预览ID
|
||||
@NSManaged var browseId:String?
|
||||
///列表专辑预览参数
|
||||
@NSManaged var params:String?
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
//
|
||||
// MPPositive_CollectionSongModel.swift
|
||||
// MusicPlayer
|
||||
//
|
||||
// Created by Mr.Zhou on 2024/5/21.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import CoreData
|
||||
///收藏音乐Model
|
||||
@objc(MPPositive_CollectionSongModel)
|
||||
class MPPositive_CollectionSongModel: NSManagedObject, MP_CoreDataManageableDelegate, MP_CoreDataOperationDelegate {
|
||||
typealias ManagedObject = MPPositive_CollectionSongModel
|
||||
///封面
|
||||
@NSManaged var coverImage:URL!
|
||||
///标题(单曲标题)
|
||||
@NSManaged var title:String?
|
||||
///二级标题
|
||||
@NSManaged var subtitle:String?
|
||||
///播放的VideoID
|
||||
@NSManaged var videoId:String?
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
//
|
||||
// MPPositive_SearchResultItemModel.swift
|
||||
// MusicPlayer
|
||||
//
|
||||
// Created by Mr.Zhou on 2024/5/13.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
///预览结果个体模型
|
||||
//class MPPositive_SearchResultItemModel: NSObject {
|
||||
// ///预览图片
|
||||
// var reviewUrls:[String]?
|
||||
// ///一级标题
|
||||
// var title:String?
|
||||
// ///二级标题
|
||||
// var subtitle:String?
|
||||
// ///单曲视频/VideoID
|
||||
// var videoId:String?
|
||||
// ///预览ID(可以是歌单/专辑/艺术家)
|
||||
// var browseId:String?
|
||||
// ///类型
|
||||
// var itemType:BrowseItemType?
|
||||
//}
|
||||
@ -77,7 +77,7 @@ class MPPositive_SongViewModel: NSObject {
|
||||
//检索是否收藏
|
||||
|
||||
//检索是否下载
|
||||
|
||||
isDlownd = MPPositive_DownloadItemModel.fetch(.init(format: "videoId==%i", "dsadasda")).count != 0
|
||||
//执行预加载
|
||||
if isPloading == false {
|
||||
preloadAsset(resourceAsset)
|
||||
|
||||
@ -9,11 +9,37 @@ import UIKit
|
||||
///相关内容
|
||||
class MPPositive_RecommendLoadViewModel: NSObject {
|
||||
///相关内容组
|
||||
var sectionLists:[MPPositive_RecommendListViewModel]!
|
||||
|
||||
var sectionLists:[MPPositive_RecommendListViewModel]!{
|
||||
didSet{
|
||||
DispatchQueue.main.async {
|
||||
[weak self] in
|
||||
guard let self = self else {return}
|
||||
//得到了搜索结果
|
||||
if resultReloadBlock != nil {
|
||||
resultReloadBlock!()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//艺术家们
|
||||
var members:MPPositive_RecommendListViewModel!
|
||||
var resultReloadBlock:(() -> Void)?
|
||||
/// 初始化方法
|
||||
/// - Parameter browseId: 相关内容Id
|
||||
init(_ browseId:String) {
|
||||
super.init()
|
||||
//进行网络请求
|
||||
getRecommendResults(browseId)
|
||||
}
|
||||
//根据browseId进行网络请求
|
||||
private func getRecommendResults(_ text:String) {
|
||||
MP_NetWorkManager.shared.requestRecommend(text) { [weak self] results in
|
||||
self?.members = (results.filter { item in
|
||||
return item.items.first?.browseItem.pageType == "MUSIC_PAGE_TYPE_ARTIST"
|
||||
}).first
|
||||
self?.sectionLists = results.filter { item in
|
||||
return item.items.first?.browseItem.pageType != "MUSIC_PAGE_TYPE_ARTIST"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,9 +80,13 @@ extension MPPositive_TabBarController {
|
||||
DispatchQueue.main.async {
|
||||
[weak self] in
|
||||
//检索播放器中是否存在load模型
|
||||
if MP_PlayerManager.shared.loadPlayer != nil {
|
||||
if MP_PlayerManager.shared.loadPlayer != nil{
|
||||
let playerVC = MPPositive_PlayerViewController()
|
||||
playerVC.modalPresentationStyle = .fullScreen
|
||||
playerVC.recommendBlock = {
|
||||
let recommendVC = MPPositive_RecommendViewController(MP_PlayerManager.shared.loadPlayer.currentVideo.relatedId ?? "")
|
||||
self?.viewControllers![self?.selectedIndex ?? 0].children[0].navigationController?.pushViewController(recommendVC, animated: true)
|
||||
}
|
||||
self?.present(playerVC, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ class MPPositive_ArtistShowViewController: MPPositive_BaseViewController {
|
||||
headView.artist = artist
|
||||
//更新分页数据源
|
||||
dataSource.titles = artist.lists.compactMap({$0.title})
|
||||
nameLabel.text = artist.header.title
|
||||
nameLabel.text = artist.header?.title
|
||||
dataSource.reloadData(selectedIndex: 0)
|
||||
segmentView.reloadData()
|
||||
}
|
||||
|
||||
@ -107,6 +107,7 @@ extension MPPositive_HomeViewController: UITableViewDataSource, UITableViewDeleg
|
||||
let lodaViewModel = MPPositive_PlayerLoadViewModel(listSongs, currentVideoId: item.browseItem.videoId ?? "")
|
||||
lodaViewModel.improveData(item.browseItem.videoId ?? "")
|
||||
MP_PlayerManager.shared.loadPlayer = lodaViewModel
|
||||
//判断是否
|
||||
NotificationCenter.notificationKey.post(notificationName: .pup_player_vc)
|
||||
}
|
||||
case .list:
|
||||
|
||||
@ -109,6 +109,7 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont
|
||||
private lazy var coverView:MPPositive_PlayerCoverView = .init(frame: .init(x: 0, y: 0, width: screen_Width, height: 480*width))
|
||||
//歌词View
|
||||
private lazy var lyricsView:MPPositive_PlayerLyricView = .init(frame: .init(x: 0, y: 0, width: screen_Width, height: 480*width))
|
||||
var recommendBlock:(() -> Void)?
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
//隐藏导航栏label
|
||||
@ -307,6 +308,8 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont
|
||||
lyricsView.titleLabel.text = MP_PlayerManager.shared.loadPlayer.currentVideo?.title
|
||||
lyricsView.subtitleLabel.text = MP_PlayerManager.shared.loadPlayer.currentVideo?.subtitle
|
||||
lyricsView.lyricsLabel.text = MP_PlayerManager.shared.loadPlayer.currentVideo.lyrics ?? "No Lyrics"
|
||||
coverView.loadBtn.isSelected = MP_PlayerManager.shared.loadPlayer.currentVideo?.isDlownd ?? false
|
||||
coverView.collectionSongBtn.isSelected = MP_PlayerManager.shared.loadPlayer.currentVideo.isCollection ?? false
|
||||
}
|
||||
//MARK: - 通知
|
||||
//播放器音乐刷新
|
||||
@ -415,7 +418,13 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont
|
||||
}
|
||||
//弹出关联内容
|
||||
@objc private func relatedContentClick(_ sender:UIButton) {
|
||||
|
||||
//先dismiss
|
||||
dismiss(animated: true) {[weak self] in
|
||||
guard let self = self else {return}
|
||||
if recommendBlock != nil {
|
||||
recommendBlock!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//播放/暂停/继续
|
||||
|
||||
@ -8,10 +8,205 @@
|
||||
import UIKit
|
||||
///相关内容推荐
|
||||
class MPPositive_RecommendViewController: MPPositive_BaseViewController {
|
||||
|
||||
//load模块
|
||||
private var loadRecommend:MPPositive_RecommendLoadViewModel!{
|
||||
didSet{
|
||||
if loadRecommend != nil {
|
||||
membersView.isHidden = false
|
||||
segmentView.isHidden = false
|
||||
listContainerView.isHidden = false
|
||||
loadRecommend.resultReloadBlock = {
|
||||
[weak self] in
|
||||
//刷新分页控制器
|
||||
guard let self = self else {return}
|
||||
sectionLabel.text = loadRecommend.members.title
|
||||
collectionView.reloadData()
|
||||
dataSource.titles = loadRecommend?.sectionLists.compactMap({$0.title}) ?? []
|
||||
dataSource.reloadData(selectedIndex: 0)
|
||||
segmentView.reloadData()
|
||||
}
|
||||
}else {
|
||||
membersView.isHidden = true
|
||||
segmentView.isHidden = true
|
||||
listContainerView.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
//MARK: - 音乐人模块
|
||||
///音乐人View
|
||||
private lazy var membersView:UIView = createMusicMembersView()
|
||||
//模块标题
|
||||
private lazy var sectionLabel:UILabel = createLabel(font: .systemFont(ofSize: 18*width, weight: .regular), textColor: .white, textAlignment: .left)
|
||||
//音乐人CollectionView
|
||||
private lazy var collectionView:UICollectionView = {
|
||||
let layout = UICollectionViewFlowLayout()
|
||||
layout.itemSize = .init(width: 50*width, height: 90*width)
|
||||
layout.sectionInset = .init(top: 0, left: 0, bottom: 0, right: 0)
|
||||
layout.minimumInteritemSpacing = 16*width
|
||||
layout.scrollDirection = .horizontal
|
||||
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
||||
collectionView.backgroundColor = .clear
|
||||
collectionView.showsVerticalScrollIndicator = false
|
||||
collectionView.showsHorizontalScrollIndicator = false
|
||||
collectionView.dataSource = self
|
||||
collectionView.delegate = self
|
||||
collectionView.register(MPPositive_RecommendMemberCollectionViewCell.self, forCellWithReuseIdentifier: MPPositive_RecommendMemberCollectionViewCellID)
|
||||
return collectionView
|
||||
}()
|
||||
private let MPPositive_RecommendMemberCollectionViewCellID = "MPPositive_RecommendMemberCollectionViewCell"
|
||||
//MARK: - 分页栏设置
|
||||
//分页栏View
|
||||
private lazy var segmentView:JXSegmentedView = {
|
||||
var jxSegmentView = JXSegmentedView()
|
||||
jxSegmentView.backgroundColor = .init(hex: "1A1A1A")
|
||||
return jxSegmentView
|
||||
}()
|
||||
//数据源
|
||||
private lazy var dataSource:JXSegmentedTitleDataSource = {
|
||||
var dataSource = JXSegmentedTitleDataSource()
|
||||
//标题未选中状态
|
||||
dataSource.titleNormalColor = .init(hex: "#666666")
|
||||
dataSource.titleNormalFont = .systemFont(ofSize: 16*width, weight: .regular)
|
||||
//标题选中状态
|
||||
dataSource.titleSelectedColor = .init(hex: "#80F988")
|
||||
dataSource.titleSelectedFont = .systemFont(ofSize: 16*width, weight: .bold)
|
||||
//是否颜色过度
|
||||
dataSource.isTitleColorGradientEnabled = true
|
||||
dataSource.isSelectedAnimable = true
|
||||
dataSource.isItemTransitionEnabled = true
|
||||
return dataSource
|
||||
}()
|
||||
//指示器
|
||||
private lazy var indicator:JXSegmentedIndicatorLineView = {
|
||||
let indicator = JXSegmentedIndicatorLineView()
|
||||
indicator.indicatorWidth = 16*width
|
||||
indicator.indicatorHeight = 3*width
|
||||
indicator.indicatorCornerRadius = 1.5*width
|
||||
indicator.indicatorColor = .init(hex: "#80F988")
|
||||
indicator.indicatorPosition = .bottom
|
||||
return indicator
|
||||
}()
|
||||
//分页内容承载框
|
||||
fileprivate lazy var listContainerView:JXSegmentedListContainerView = {
|
||||
let listContainerView = JXSegmentedListContainerView(dataSource: self)
|
||||
listContainerView.backgroundColor = .clear
|
||||
return listContainerView
|
||||
}()
|
||||
/// 初始化
|
||||
/// - Parameter browseId: 相关内容id
|
||||
init(_ browseId:String) {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
DispatchQueue.main.async {
|
||||
[weak self] in
|
||||
self?.loadRecommend = .init(browseId)
|
||||
}
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
setTitle("Recommend")
|
||||
setPopBtn()
|
||||
configure()
|
||||
}
|
||||
private func configure() {
|
||||
view.addSubview(membersView)
|
||||
membersView.snp.makeConstraints { make in
|
||||
make.width.equalTo(338*width)
|
||||
make.height.equalTo(141*width)
|
||||
make.top.equalTo(navView.snp.bottom).offset(33*width)
|
||||
make.centerX.equalToSuperview()
|
||||
}
|
||||
segmentView.indicators = [indicator]
|
||||
segmentView.dataSource = dataSource
|
||||
//配置View
|
||||
view.addSubview(segmentView)
|
||||
segmentView.snp.makeConstraints { make in
|
||||
make.left.right.equalToSuperview()
|
||||
make.top.equalTo(membersView.snp.bottom).offset(10*width)
|
||||
make.height.equalTo(60*width)
|
||||
}
|
||||
view.addSubview(listContainerView)
|
||||
listContainerView.snp.makeConstraints { (make) in
|
||||
make.left.right.bottom.equalToSuperview().priority(999)
|
||||
make.top.equalTo(segmentView.snp.bottom).priority(999)
|
||||
}
|
||||
segmentView.contentScrollView = listContainerView.scrollView
|
||||
segmentView.listContainer = listContainerView
|
||||
}
|
||||
|
||||
//生成音乐人部分
|
||||
private func createMusicMembersView() -> UIView {
|
||||
let membersView:UIView = .init()
|
||||
membersView.backgroundColor = .init(hex: "#1A1A1A")
|
||||
membersView.layer.masksToBounds = true
|
||||
membersView.layer.cornerRadius = 14*width
|
||||
//添加内容
|
||||
membersView.addSubview(sectionLabel)
|
||||
sectionLabel.snp.makeConstraints { make in
|
||||
make.top.equalToSuperview().offset(14*width)
|
||||
make.left.equalToSuperview().offset(12*width)
|
||||
make.right.equalToSuperview().offset(-12*width)
|
||||
}
|
||||
membersView.addSubview(collectionView)
|
||||
collectionView.snp.makeConstraints { make in
|
||||
make.top.equalToSuperview().offset(50*width)
|
||||
make.left.equalToSuperview().offset(14*width)
|
||||
make.right.equalToSuperview().offset(-10*width)
|
||||
make.bottom.equalToSuperview()
|
||||
}
|
||||
return membersView
|
||||
}
|
||||
}
|
||||
//MARK: - collectionView
|
||||
extension MPPositive_RecommendViewController:UICollectionViewDataSource, UICollectionViewDelegate {
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return loadRecommend?.members?.items.count ?? 0
|
||||
}
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MPPositive_RecommendMemberCollectionViewCellID, for: indexPath) as! MPPositive_RecommendMemberCollectionViewCell
|
||||
cell.itemView = loadRecommend?.members?.items[indexPath.row]
|
||||
return cell
|
||||
}
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
//用户查看艺术家
|
||||
let artistVC = MPPositive_ArtistShowViewController(loadRecommend?.members?.items[indexPath.row].browseItem.artistId ?? "")
|
||||
navigationController?.pushViewController(artistVC, animated: true)
|
||||
}
|
||||
}
|
||||
//MARK: - JXSegmentedTitleDataSource
|
||||
extension MPPositive_RecommendViewController: JXSegmentedListContainerViewDataSource, JXSegmentedViewDelegate {
|
||||
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
|
||||
return dataSource.titles.count
|
||||
}
|
||||
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
|
||||
let showView:MPPositive_RecommendShowTypeView = .init(listContainerView.frame, list: loadRecommend.sectionLists[index])
|
||||
showView.chooseItemBlock = {
|
||||
[weak self] (item) in
|
||||
guard let self = self else {return}
|
||||
switch item.browseItem.itemType {
|
||||
case .list:
|
||||
//列表专辑
|
||||
let listVC = MPPositive_ListShowViewController(item.browseItem.browseId ?? "", params: "")
|
||||
navigationController?.pushViewController(listVC, animated: true)
|
||||
case .single:
|
||||
//单曲/视频跳转
|
||||
//触发next请求,优先获取列表全部单曲基础数据(不完善)
|
||||
MP_NetWorkManager.shared.requestNextList(item.browseItem.playListId ?? "", videoId: item.browseItem.videoId ?? ""){ [weak self] listSongs in
|
||||
guard let self = self else {return}
|
||||
//回掉的数据并不完善,生成一个playerloadViewModel
|
||||
let lodaViewModel = MPPositive_PlayerLoadViewModel(listSongs, currentVideoId: item.browseItem.videoId ?? "")
|
||||
lodaViewModel.improveData(item.browseItem.videoId ?? "")
|
||||
MP_PlayerManager.shared.loadPlayer = lodaViewModel
|
||||
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
return showView
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,9 +37,9 @@ class MPPositive_ArtistShowHeaderView: UIView {
|
||||
}()
|
||||
var artist:MPPositive_ArtistViewModel!{
|
||||
didSet{
|
||||
reviewImageView.kf.setImage(with: URL(string: artist.header.thumbnails?.last ?? ""), placeholder: placeholderImage)
|
||||
nameLabel.text = artist.header.title
|
||||
followersLabel.text = (artist.header.subscriptions ?? "")+" "+(artist.header.subscriptionedText ?? "")
|
||||
reviewImageView.kf.setImage(with: URL(string: artist.header?.thumbnails?.last ?? ""), placeholder: placeholderImage)
|
||||
nameLabel.text = artist.header?.title
|
||||
followersLabel.text = (artist.header?.subscriptions ?? "")+" "+(artist.header?.subscriptionedText ?? "")
|
||||
}
|
||||
}
|
||||
override init(frame: CGRect) {
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
//
|
||||
// MPPositive_RecommendMemberCollectionViewCell.swift
|
||||
// MusicPlayer
|
||||
//
|
||||
// Created by Mr.Zhou on 2024/5/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class MPPositive_RecommendMemberCollectionViewCell: UICollectionViewCell {
|
||||
///艺术家头像
|
||||
private lazy var avatarImageView:UIImageView = {
|
||||
let imageView:UIImageView = .init()
|
||||
imageView.contentMode = .scaleAspectFill
|
||||
imageView.layer.masksToBounds = true
|
||||
imageView.layer.cornerRadius = 25*width
|
||||
return imageView
|
||||
}()
|
||||
private lazy var titleLabel:UILabel = createLabel(font: .systemFont(ofSize: 14*width, weight: .regular), textColor: .white, textAlignment: .left)
|
||||
var itemView:MPPositive_BrowseItemViewModel! {
|
||||
didSet{
|
||||
itemView.setUrltoImage(avatarImageView)
|
||||
titleLabel.text = itemView.title
|
||||
}
|
||||
}
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
backgroundColor = .clear
|
||||
configure()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
}
|
||||
private func configure() {
|
||||
addSubview(avatarImageView)
|
||||
avatarImageView.snp.makeConstraints { make in
|
||||
make.left.top.right.equalToSuperview()
|
||||
make.height.equalTo(50*width)
|
||||
}
|
||||
addSubview(titleLabel)
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.top.equalTo(avatarImageView.snp.bottom).offset(8*width)
|
||||
make.left.right.equalToSuperview()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
//
|
||||
// MPPositive_RecommendShowTypeView.swift
|
||||
// MusicPlayer
|
||||
//
|
||||
// Created by Mr.Zhou on 2024/5/20.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MJRefresh
|
||||
class MPPositive_RecommendShowTypeView: UIView, JXSegmentedListContainerViewListDelegate {
|
||||
//tableView
|
||||
private lazy var tableView:UITableView = {
|
||||
let tableView = UITableView()
|
||||
if #available(iOS 15.0, *) {
|
||||
tableView.sectionHeaderTopPadding = 0
|
||||
}
|
||||
tableView.backgroundColor = .clear
|
||||
tableView.separatorStyle = .none
|
||||
tableView.estimatedRowHeight = 200
|
||||
tableView.rowHeight = UITableView.automaticDimension
|
||||
tableView.dataSource = self
|
||||
tableView.delegate = self
|
||||
tableView.register(MPPositive_ArtistShowSongTableViewCell.self, forCellReuseIdentifier: MPPositive_ArtistShowSongTableViewCellID)
|
||||
tableView.register(MPPositive_ArtistShowListableViewCell.self, forCellReuseIdentifier: MPPositive_ArtistShowListableViewCellID)
|
||||
return tableView
|
||||
}()
|
||||
private let MPPositive_ArtistShowSongTableViewCellID = "MPPositive_ArtistShowSongTableViewCell"
|
||||
private let MPPositive_ArtistShowListableViewCellID = "MPPositive_ArtistShowListableViewCell"
|
||||
private var sectionList:MPPositive_RecommendListViewModel!{
|
||||
didSet{
|
||||
//当前数据完整
|
||||
tableView.reloadData()
|
||||
}
|
||||
}
|
||||
//选中内容
|
||||
var chooseItemBlock:((MPPositive_BrowseItemViewModel) -> Void)?
|
||||
|
||||
init(_ frame:CGRect, list:MPPositive_RecommendListViewModel) {
|
||||
super.init(frame: frame)
|
||||
backgroundColor = .clear
|
||||
//赋值
|
||||
DispatchQueue.main.async {
|
||||
[weak self] in
|
||||
self?.sectionList = list
|
||||
}
|
||||
addSubview(tableView)
|
||||
tableView.snp.makeConstraints { make in
|
||||
make.left.top.right.bottom.equalToSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
}
|
||||
|
||||
//MARK: - 分页代理
|
||||
func listView() -> UIView {
|
||||
return self
|
||||
}
|
||||
|
||||
}
|
||||
//MARK: - tableView
|
||||
extension MPPositive_RecommendShowTypeView:UITableViewDataSource, UITableViewDelegate {
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
if let first = sectionList?.items.first {
|
||||
switch first.browseItem.itemType {
|
||||
case .single:
|
||||
return sectionList.items.count
|
||||
case .list:
|
||||
return 1
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
if let first = sectionList?.items.first {
|
||||
switch first.browseItem.itemType {
|
||||
case .single:
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_ArtistShowSongTableViewCellID) as! MPPositive_ArtistShowSongTableViewCell
|
||||
cell.itemView = sectionList.items[indexPath.row]
|
||||
return cell
|
||||
case .list:
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_ArtistShowListableViewCellID, for: indexPath) as! MPPositive_ArtistShowListableViewCell
|
||||
cell.itemViews = sectionList.items
|
||||
cell.chooseItemBlock = {
|
||||
[weak self] item in
|
||||
guard let self = self else {return}
|
||||
if chooseItemBlock != nil {
|
||||
chooseItemBlock!(item)
|
||||
}
|
||||
}
|
||||
cell.showType = .List
|
||||
return cell
|
||||
default:
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_ArtistShowSongTableViewCellID) as! MPPositive_ArtistShowSongTableViewCell
|
||||
|
||||
return cell
|
||||
}
|
||||
}else {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: MPPositive_ArtistShowSongTableViewCellID) as! MPPositive_ArtistShowSongTableViewCell
|
||||
|
||||
return cell
|
||||
}
|
||||
}
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
if let first = sectionList?.items.first {
|
||||
switch first.browseItem.itemType {
|
||||
case .single:
|
||||
//当前是单曲分页,点击cell可以直接触发事件块
|
||||
if chooseItemBlock != nil {
|
||||
chooseItemBlock!(sectionList.items[indexPath.row])
|
||||
}
|
||||
case .list:
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user