diff --git a/relax.offline.mp3.music.xcodeproj/project.pbxproj b/relax.offline.mp3.music.xcodeproj/project.pbxproj index c8283ca..33655fa 100644 --- a/relax.offline.mp3.music.xcodeproj/project.pbxproj +++ b/relax.offline.mp3.music.xcodeproj/project.pbxproj @@ -496,13 +496,13 @@ CBAFCA042C0A10500054500E /* Extension(扩展) */ = { isa = PBXGroup; children = ( + CBAFCA022C0A10500054500E /* String.swift */, CBAFC9FC2C0A10500054500E /* AVPlayerItem.swift */, CBAFC9FD2C0A10500054500E /* DateTime.swift */, CBAFC9FE2C0A10500054500E /* HexColor.swift */, CBAFC9FF2C0A10500054500E /* ImagePicker.swift */, CBAFCA002C0A10500054500E /* LayoutConstraint.swift */, CBAFCA012C0A10500054500E /* Notification.swift */, - CBAFCA022C0A10500054500E /* String.swift */, CBAFCA032C0A10500054500E /* TableView.swift */, ); path = "Extension(扩展)"; @@ -702,10 +702,10 @@ isa = PBXGroup; children = ( CBAFCA602C0A10500054500E /* MPPositive_BaseViewController.swift */, - CBAFCA612C0A10500054500E /* MPPositive_MoreSongOperationsViewController.swift */, CBAFCA622C0A10500054500E /* MPPositive_NavigationController.swift */, - CBAFCA632C0A10500054500E /* MPPositive_PresentationController.swift */, CBAFCA642C0A10500054500E /* MPPositive_TabBarController.swift */, + CBAFCA632C0A10500054500E /* MPPositive_PresentationController.swift */, + CBAFCA612C0A10500054500E /* MPPositive_MoreSongOperationsViewController.swift */, ); path = "Base(基类,导航栏,标签栏)"; sourceTree = ""; @@ -724,10 +724,10 @@ CBAFCA6F2C0A10500054500E /* Home(首页,各项列表页,艺术家页) */ = { isa = PBXGroup; children = ( - CBAFCA6B2C0A10500054500E /* MPPositive_ArtistShowViewController.swift */, CBAFCA6C2C0A10500054500E /* MPPositive_HomeViewController.swift */, - CBAFCA6D2C0A10500054500E /* MPPositive_ListShowViewController.swift */, CBAFCA6E2C0A10500054500E /* MPPositive_MoreContentViewController.swift */, + CBAFCA6D2C0A10500054500E /* MPPositive_ListShowViewController.swift */, + CBAFCA6B2C0A10500054500E /* MPPositive_ArtistShowViewController.swift */, ); path = "Home(首页,各项列表页,艺术家页)"; sourceTree = ""; @@ -735,8 +735,8 @@ CBAFCA732C0A10500054500E /* Player(播放器) */ = { isa = PBXGroup; children = ( - CBAFCA702C0A10500054500E /* MPPositive_PlayerListShowViewController.swift */, CBAFCA712C0A10500054500E /* MPPositive_PlayerViewController.swift */, + CBAFCA702C0A10500054500E /* MPPositive_PlayerListShowViewController.swift */, CBAFCA722C0A10500054500E /* MPPositive_RecommendViewController.swift */, ); path = "Player(播放器)"; @@ -745,8 +745,8 @@ CBAFCA762C0A10500054500E /* Search(搜索页) */ = { isa = PBXGroup; children = ( - CBAFCA742C0A10500054500E /* MPPositive_SearchResultShowViewController.swift */, CBAFCA752C0A10500054500E /* MPPositive_SearchViewController.swift */, + CBAFCA742C0A10500054500E /* MPPositive_SearchResultShowViewController.swift */, ); path = "Search(搜索页)"; sourceTree = ""; @@ -755,10 +755,10 @@ isa = PBXGroup; children = ( CBAFCA652C0A10500054500E /* Base(基类,导航栏,标签栏) */, - CBAFCA6A2C0A10500054500E /* Center(个人曲库页) */, CBAFCA6F2C0A10500054500E /* Home(首页,各项列表页,艺术家页) */, CBAFCA732C0A10500054500E /* Player(播放器) */, CBAFCA762C0A10500054500E /* Search(搜索页) */, + CBAFCA6A2C0A10500054500E /* Center(个人曲库页) */, ); path = ViewControllers; sourceTree = ""; @@ -766,10 +766,10 @@ CBAFCA7D2C0A10500054500E /* Base */ = { isa = PBXGroup; children = ( - CBAFCA782C0A10500054500E /* MPPositive_BottomShowView.swift */, CBAFCA792C0A10500054500E /* MPPositive_CustomTabBar.swift */, CBAFCA7A2C0A10500054500E /* MPPositive_CustomTabBarItem.swift */, CBAFCA7B2C0A10500054500E /* MPPositive_CustomTabBarView.swift */, + CBAFCA782C0A10500054500E /* MPPositive_BottomShowView.swift */, CBAFCA7C2C0A10500054500E /* MPPositive_MoreOperationDownLoadTableViewCell.swift */, ); path = Base; @@ -787,21 +787,21 @@ CBAFCA902C0A10500054500E /* Home */ = { isa = PBXGroup; children = ( + CBAFCA8D2C0A10500054500E /* MPPositive_HomeShowTableViewCell.swift */, + CBAFCA892C0A10500054500E /* MPPositive_HomeListFirstCollectionViewCell.swift */, + CBAFCA8C2C0A10500054500E /* MPPositive_HomeListThirdCollectionViewCell.swift */, + CBAFCA8B2C0A10500054500E /* MPPositive_HomeListSecondCollectionViewCell.swift */, + CBAFCA8A2C0A10500054500E /* MPPositive_HomeListFourthCollectionViewCell.swift */, + CBAFCA882C0A10500054500E /* MPPositive_HomeListFifthCollectionViewCell.swift */, + CBAFCA8F2C0A10500054500E /* MPPositive_MusicItemShowTableViewCell.swift */, + CBAFCA8E2C0A10500054500E /* MPPositive_MoreListContentCollectionViewCell.swift */, + CBAFCA832C0A10500054500E /* MPPositive_ArtistShowHeaderView.swift */, + CBAFCA872C0A10500054500E /* MPPositive_ArtistShowTypeView.swift */, CBAFCA812C0A10500054500E /* MPPositive_ArtistDescriptionTableViewCell.swift */, CBAFCA822C0A10500054500E /* MPPositive_ArtistShowCollectionViewCell.swift */, - CBAFCA832C0A10500054500E /* MPPositive_ArtistShowHeaderView.swift */, CBAFCA842C0A10500054500E /* MPPositive_ArtistShowListableViewCell.swift */, CBAFCA852C0A10500054500E /* MPPositive_ArtistShowListCollectionViewCell.swift */, CBAFCA862C0A10500054500E /* MPPositive_ArtistShowSongTableViewCell.swift */, - CBAFCA872C0A10500054500E /* MPPositive_ArtistShowTypeView.swift */, - CBAFCA882C0A10500054500E /* MPPositive_HomeListFifthCollectionViewCell.swift */, - CBAFCA892C0A10500054500E /* MPPositive_HomeListFirstCollectionViewCell.swift */, - CBAFCA8A2C0A10500054500E /* MPPositive_HomeListFourthCollectionViewCell.swift */, - CBAFCA8B2C0A10500054500E /* MPPositive_HomeListSecondCollectionViewCell.swift */, - CBAFCA8C2C0A10500054500E /* MPPositive_HomeListThirdCollectionViewCell.swift */, - CBAFCA8D2C0A10500054500E /* MPPositive_HomeShowTableViewCell.swift */, - CBAFCA8E2C0A10500054500E /* MPPositive_MoreListContentCollectionViewCell.swift */, - CBAFCA8F2C0A10500054500E /* MPPositive_MusicItemShowTableViewCell.swift */, ); path = Home; sourceTree = ""; @@ -810,9 +810,9 @@ isa = PBXGroup; children = ( CBAFCA912C0A10500054500E /* MPPositive_PlayerCoverView.swift */, - CBAFCA922C0A10500054500E /* MPPositive_PlayerListShowTableViewCell.swift */, CBAFCA932C0A10500054500E /* MPPositive_PlayerLyricView.swift */, CBAFCA942C0A10500054500E /* MPPositive_PlayerSilder.swift */, + CBAFCA922C0A10500054500E /* MPPositive_PlayerListShowTableViewCell.swift */, CBAFCA952C0A10500054500E /* MPPositive_RecommendMemberCollectionViewCell.swift */, CBAFCA962C0A10500054500E /* MPPositive_RecommendShowTypeView.swift */, ); @@ -837,10 +837,10 @@ isa = PBXGroup; children = ( CBAFCA7D2C0A10500054500E /* Base */, - CBAFCA802C0A10500054500E /* Center */, CBAFCA902C0A10500054500E /* Home */, CBAFCA972C0A10500054500E /* Player */, CBAFCA9F2C0A10500054500E /* Search */, + CBAFCA802C0A10500054500E /* Center */, ); path = Views; sourceTree = ""; @@ -848,9 +848,9 @@ CBAFCAA12C0A10500054500E /* MPPositive */ = { isa = PBXGroup; children = ( - CBAFCA5F2C0A10500054500E /* Models */, CBAFCA772C0A10500054500E /* ViewControllers */, CBAFCAA02C0A10500054500E /* Views */, + CBAFCA5F2C0A10500054500E /* Models */, ); path = MPPositive; sourceTree = ""; @@ -912,22 +912,22 @@ CBAFCAC12C0A10500054500E /* Center(个人资源) */ = { isa = PBXGroup; children = ( - CBAFCAB12C0A10500054500E /* MPSideA_AboutViewController.swift */, - CBAFCAB22C0A10500054500E /* MPSideA_AboutViewController.xib */, CBAFCAB32C0A10500054500E /* MPSideA_CenterViewController.swift */, CBAFCAB42C0A10500054500E /* MPSideA_CenterViewController.xib */, - CBAFCAB52C0A10500054500E /* MPSideA_DeleteViewController.swift */, - CBAFCAB62C0A10500054500E /* MPSideA_DeleteViewController.xib */, CBAFCAB72C0A10500054500E /* MPSideA_MoreViewController.swift */, CBAFCAB82C0A10500054500E /* MPSideA_MoreViewController.xib */, - CBAFCAB92C0A10500054500E /* MPSideA_PrivacyViewController.swift */, - CBAFCABA2C0A10500054500E /* MPSideA_PrivacyViewController.xib */, CBAFCABB2C0A10500054500E /* MPSideA_RenameViewController.swift */, CBAFCABC2C0A10500054500E /* MPSideA_RenameViewController.xib */, - CBAFCABD2C0A10500054500E /* MPSideA_ServiceViewController.swift */, - CBAFCABE2C0A10500054500E /* MPSideA_ServiceViewController.xib */, + CBAFCAB52C0A10500054500E /* MPSideA_DeleteViewController.swift */, + CBAFCAB62C0A10500054500E /* MPSideA_DeleteViewController.xib */, CBAFCABF2C0A10500054500E /* MPSideA_SettingViewController.swift */, CBAFCAC02C0A10500054500E /* MPSideA_SettingViewController.xib */, + CBAFCAB12C0A10500054500E /* MPSideA_AboutViewController.swift */, + CBAFCAB22C0A10500054500E /* MPSideA_AboutViewController.xib */, + CBAFCAB92C0A10500054500E /* MPSideA_PrivacyViewController.swift */, + CBAFCABA2C0A10500054500E /* MPSideA_PrivacyViewController.xib */, + CBAFCABD2C0A10500054500E /* MPSideA_ServiceViewController.swift */, + CBAFCABE2C0A10500054500E /* MPSideA_ServiceViewController.xib */, ); path = "Center(个人资源)"; sourceTree = ""; @@ -948,10 +948,10 @@ CBAFCAC92C0A10500054500E /* ViewControllers */ = { isa = PBXGroup; children = ( - CBAFCAAB2C0A10500054500E /* Add(新增资源) */, CBAFCAB02C0A10500054500E /* Base(基类-导航栏-标签栏-计时器-播放器) */, - CBAFCAC12C0A10500054500E /* Center(个人资源) */, CBAFCAC82C0A10500054500E /* Home(音乐资源列表) */, + CBAFCAAB2C0A10500054500E /* Add(新增资源) */, + CBAFCAC12C0A10500054500E /* Center(个人资源) */, ); path = ViewControllers; sourceTree = ""; @@ -1018,9 +1018,9 @@ CBAFCAE32C0A10500054500E /* MPSideA */ = { isa = PBXGroup; children = ( - CBAFCAA82C0A10500054500E /* Models */, CBAFCAC92C0A10500054500E /* ViewControllers */, CBAFCAE22C0A10500054500E /* Views */, + CBAFCAA82C0A10500054500E /* Models */, ); path = MPSideA; sourceTree = ""; diff --git a/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..27c3c46 --- /dev/null +++ b/relax.offline.mp3.music.xcworkspace/xcuserdata/zhou.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift b/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift index 9dce3b6..7f1316f 100644 --- a/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift +++ b/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift @@ -81,6 +81,18 @@ class MP_LunchViewController: UIViewController { } //启动计时器 timer.isPaused = false +// self.completionBlock = { +// DispatchQueue.main.async { +// [weak self] in +// guard let self = self else {return} +// //停止计时器 +// timer.isPaused = true +// //加载完毕,判断并跳转 +// accessAppdelegate.switch_positive() +// //获取首页 +// MPPositive_BrowseLoadViewModel.shared.reloadBrowseLists() +// } +// } } deinit { //销毁计时器 diff --git a/relax.offline.mp3.music/MP/Common/Macro(宏定义与全局量)/Macro.swift b/relax.offline.mp3.music/MP/Common/Macro(宏定义与全局量)/Macro.swift index 4095611..154af25 100644 --- a/relax.offline.mp3.music/MP/Common/Macro(宏定义与全局量)/Macro.swift +++ b/relax.offline.mp3.music/MP/Common/Macro(宏定义与全局量)/Macro.swift @@ -18,8 +18,10 @@ extension JXPagingListContainerView: JXSegmentedViewListContainer {} let screen_Width = UIScreen.main.bounds.width ///屏幕高 let screen_Height = UIScreen.main.bounds.height -///像素比值 +///像素宽比值 let width = screen_Width / 375 +///像素高比值 +let height = screen_Height / 667 ///状态栏高度 #if __IPHONE_13_0 let statusBarHeight:CGFloat = UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.size.height @@ -39,7 +41,15 @@ let Phone_Model = UIDevice.current.model ///系统版本号 let System_Version = UIDevice.current.systemVersion ///获取当前系统语言 -let Language_first_local = NSLocale.preferredLanguages.first! +var Language_first_local:String { + let first = Locale.preferredLanguages.first! + let languageCode = Locale(identifier: first).languageCode + if let code = languageCode { + return code + } else { + return "en" + } +} ///当前应用版本号 var app_Version:String{ if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String { diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift index 6b86854..ebb7996 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MPPositive_Debouncer.swift @@ -15,7 +15,7 @@ class MPPositive_Debouncer: NSObject { private var delay: TimeInterval private override init() { - delay = 0.5 + delay = 0.2 super.init() } deinit { diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift index 6e847cb..8ad8f14 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_NetWorkManager.swift @@ -82,7 +82,7 @@ class MP_NetWorkManager: NSObject { //固定时间点(同一天的上一周) private lazy var currTimeDate:String = (Date().timeZone() - 7.days).toString(.custom("YYYYMMdd")) ///地址 - private var locaton:String? + private var locaton:String? = "HK" //预览下一阶段参数(网络请求获取) private var continuationAndItct:(String?,String?){ willSet{ @@ -110,7 +110,7 @@ class MP_NetWorkManager: NSObject { //语言 "hl":Language_first_local, //地址 - "gl":locaton ?? "" + "gl":locaton ?? "HK" ] ] ] @@ -291,6 +291,9 @@ extension MP_NetWorkManager { parsingBrowseContinuationContents(continuationContents) }else { print("Failed to parse browses content") + // 请求失败,处理错误 + handleError(url, error: nil) + browseQueque = nil } case .failure(let error): // 请求失败,处理错误 @@ -1050,9 +1053,9 @@ extension MP_NetWorkManager { } } ///错误处理方法 - private func handleError(_ url: URL, error:AFError) { + private func handleError(_ url: URL, error:AFError?) { // 根据错误类型处理 - if let statusCode = error.responseCode { + if let statusCode = error?.responseCode { switch statusCode { case 400...499: print("\(url)请求错误,错误码: \(statusCode)。") @@ -1061,7 +1064,7 @@ extension MP_NetWorkManager { default: print("\(url)其他 HTTP 错误,错误码: \(statusCode)。") } - } else if let underlyingError = error.underlyingError as? URLError { + } else if let underlyingError = error?.underlyingError as? URLError { switch underlyingError.code { case .notConnectedToInternet: print("\(url)网络连接不可用,请检查你的网络设置。") @@ -1071,7 +1074,7 @@ extension MP_NetWorkManager { print("\(url)NSURL 错误,错误码: \(underlyingError.code.rawValue)。") } } else { - print("\(url)未知错误: \(error.localizedDescription)") + print("\(url)未知错误: \(error?.localizedDescription ?? "")") } DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { //统一发一个报错通知 diff --git a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_PlayerManager.swift b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_PlayerManager.swift index 55a6adf..77936bc 100644 --- a/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_PlayerManager.swift +++ b/relax.offline.mp3.music/MP/Common/Tool(工具封装)/MP_PlayerManager.swift @@ -77,6 +77,7 @@ class MP_PlayerManager:NSObject{ //用户清空了load模块,隐藏播放器 NotificationCenter.notificationKey.post(notificationName: .player_delete_list) playState = .Null + player.pause() } } } @@ -145,6 +146,8 @@ class MP_PlayerManager:NSObject{ cacheLoadTimes() //转化为当前播放进度秒值 let currentDuration = CMTimeGetSeconds(time) + //更新控制中心的进度条 + updateProgress(currentDuration) //获取当前播放音乐资源的最大时间值 let maxDuration = getMusicDuration() if maxDuration.isNaN == false { @@ -164,6 +167,8 @@ class MP_PlayerManager:NSObject{ center?.pauseCommand.removeTarget(self) center?.nextTrackCommand.removeTarget(self) center?.previousTrackCommand.removeTarget(self) + timer?.cancel() + timer = nil } /// 开始播放音乐 /// - Parameters: @@ -646,5 +651,15 @@ class MP_PlayerManager:NSObject{ } } } + //实时更新当前控制中心的进度条信息 + private func updateProgress(_ time:TimeInterval) { + if var nowPlayingInfo = MPNowPlayingInfoCenter.default().nowPlayingInfo { + nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = time + DispatchQueue.main.async { + //更新远程中心 + MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo + } + } + } } diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift index 84ed5f0..b3f6224 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Base(基类,导航栏,标签栏)/MPPositive_TabBarController.swift @@ -19,6 +19,8 @@ class MPPositive_TabBarController: UITabBarController, UIViewControllerTransitio } } } + //是否Push + private var isPush:Bool = false override func viewDidLoad() { super.viewDidLoad() self.setValue(customTabBar, forKey: "tabBar") @@ -75,7 +77,6 @@ class MPPositive_TabBarController: UITabBarController, UIViewControllerTransitio func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { return MPPositive_PresentationController(presentedViewController: presented, presenting: presenting) } - //弹出音乐播放器 } //MARK: - 通知处理 @@ -90,15 +91,22 @@ extension MPPositive_TabBarController { DispatchQueue.main.async { [weak self] in //检索播放器中是否存在load模型 - if MP_PlayerManager.shared.loadPlayer != nil{ - let playerVC = MPPositive_PlayerViewController() - playerVC.modalPresentationStyle = .fullScreen - playerVC.recommendBlock = { - let recommendVC = MPPositive_RecommendViewController(MP_PlayerManager.shared.loadPlayer.currentVideo.song.relatedID) - self?.viewControllers![self?.selectedIndex ?? 0].children[0].navigationController?.pushViewController(recommendVC, animated: true) - } - self?.present(playerVC, animated: true) +// if MP_PlayerManager.shared.loadPlayer != nil{ +// let playerVC = MPPositive_PlayerViewController() +// playerVC.modalPresentationStyle = .fullScreen +// playerVC.recommendBlock = { +// let recommendVC = MPPositive_RecommendViewController(MP_PlayerManager.shared.loadPlayer.currentVideo.song.relatedID) +// self?.viewControllers![self?.selectedIndex ?? 0].children[0].navigationController?.pushViewController(recommendVC, animated: true) +// } +// self?.present(playerVC, animated: true) +// } + let playerVC = MPPositive_PlayerViewController() + playerVC.modalPresentationStyle = .fullScreen + playerVC.recommendBlock = { + let recommendVC = MPPositive_RecommendViewController(MP_PlayerManager.shared.loadPlayer.currentVideo.song.relatedID) + self?.viewControllers![self?.selectedIndex ?? 0].children[0].navigationController?.pushViewController(recommendVC, animated: true) } + self?.present(playerVC, animated: true) } } //切换底部音乐模块状态 @@ -112,7 +120,7 @@ extension MPPositive_TabBarController { guard let self = self else { return } if state { //向上展示 - bottomView.transform = .init(translationX: 0, y: -145*width) + bottomView.transform = .init(translationX: 0, y: isPush ? -82*width:-145*width) }else { //向下隐藏 bottomView.transform = .identity @@ -121,6 +129,7 @@ extension MPPositive_TabBarController { } //页面push事件 @objc private func pushAction(_ sender:Notification) { + isPush = true //检索页面状态 if isbottomShow == true { //将bottomView,向下移动83 @@ -132,6 +141,7 @@ extension MPPositive_TabBarController { } } @objc private func popAction(_ sender:Notification) { + isPush = false //检索页面状态 if isbottomShow == true { //将bottomView,向上移动83 diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_LoveSongsViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_LoveSongsViewController.swift index e507bc1..7270b2b 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_LoveSongsViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_LoveSongsViewController.swift @@ -112,6 +112,10 @@ extension MPPositive_LoveSongsViewController: UITableViewDataSource, UITableView MPPositive_Debouncer.shared.call { [weak self] in guard let self = self else {return} + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //将当前收藏音乐放入列表中 var array:[MPPositive_SongItemModel] = [] for (index,song) in MPPositive_LoadCoreModel.shared.songViewModels.enumerated() { @@ -129,7 +133,7 @@ extension MPPositive_LoveSongsViewController: UITableViewDataSource, UITableView let lodaViewModel = MPPositive_PlayerLoadViewModel(array, currentVideoId: MPPositive_LoadCoreModel.shared.songViewModels[indexPath.row].collectionSong.videoId ?? "") lodaViewModel.improveData(MPPositive_LoadCoreModel.shared.songViewModels[indexPath.row].collectionSong.videoId ?? "") MP_PlayerManager.shared.loadPlayer = lodaViewModel - NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_OfflineSongsViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_OfflineSongsViewController.swift index 616977d..32b8fab 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_OfflineSongsViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Center(个人曲库页)/MPPositive_OfflineSongsViewController.swift @@ -99,6 +99,10 @@ extension MPPositive_OfflineSongsViewController: UITableViewDataSource, UITableV MPPositive_Debouncer.shared.call { [weak self] in guard let self = self else {return} + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //将当前下载音乐放入列表中 var array:[MPPositive_SongItemModel] = [] for (index, song) in MPPositive_LoadCoreModel.shared.loadViewModels.enumerated() { @@ -119,7 +123,7 @@ extension MPPositive_OfflineSongsViewController: UITableViewDataSource, UITableV let lodaViewModel = MPPositive_PlayerLoadViewModel(array, currentVideoId: MPPositive_LoadCoreModel.shared.loadViewModels[indexPath.row].loadItem.videoId ?? "") lodaViewModel.improveData(MPPositive_LoadCoreModel.shared.loadViewModels[indexPath.row].loadItem.videoId ?? "") MP_PlayerManager.shared.loadPlayer = lodaViewModel - NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? { diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ArtistShowViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ArtistShowViewController.swift index e7b5c45..8028730 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ArtistShowViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ArtistShowViewController.swift @@ -216,6 +216,10 @@ extension MPPositive_ArtistShowViewController: JXPagingViewDelegate{ [weak self] in guard let self = self else {return} //单曲/视频跳转 + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //触发next请求,优先获取列表全部单曲基础数据(不完善) MP_NetWorkManager.shared.requestNextList(item.browseItem.playListId ?? "", videoId: item.browseItem.videoId ?? ""){ [weak self] listSongs in guard let self = self else {return} @@ -223,7 +227,7 @@ extension MPPositive_ArtistShowViewController: JXPagingViewDelegate{ 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) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } case .none: diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift index 7d445ee..3e47f84 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_HomeViewController.swift @@ -40,8 +40,8 @@ class MPPositive_HomeViewController: MPPositive_BaseViewController{ super.viewDidLoad() setTitle("Musiclax") confirgue() - //获取首页 - MPPositive_BrowseLoadViewModel.shared.reloadBrowseLists() +// //获取首页 +// MPPositive_BrowseLoadViewModel.shared.reloadBrowseLists() NotificationCenter.notificationKey.add(observer: self, selector: #selector(reloadAction(_ :)), notificationName: .positive_browses_reload) MP_HUD.loading() errorBlock = { @@ -158,6 +158,10 @@ extension MPPositive_HomeViewController: UITableViewDataSource, UITableViewDeleg MPPositive_Debouncer.shared.call { [weak self] in guard let self = self else {return} + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //触发next请求,优先获取列表全部单曲基础数据(不完善) MP_NetWorkManager.shared.requestNextList(item.browseItem.playListId ?? "", videoId: item.browseItem.videoId ?? ""){ [weak self] listSongs in guard let self = self else {return} @@ -165,7 +169,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) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } case .list: diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ListShowViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ListShowViewController.swift index a3855c6..48bdad4 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ListShowViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_ListShowViewController.swift @@ -253,6 +253,10 @@ class MPPositive_ListShowViewController: MPPositive_BaseViewController, UIViewCo MPPositive_Debouncer.shared.call { [weak self] in guard let self = self, let item = listOrAlbum.items.randomElement() else {return} + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //触发next请求,优先获取列表全部单曲基础数据(不完善) MP_NetWorkManager.shared.requestNextList(item.browseItem.playListId ?? "", videoId: item.browseItem.videoId ?? ""){ [weak self] listSongs in guard let self = self else {return} @@ -260,8 +264,8 @@ class MPPositive_ListShowViewController: MPPositive_BaseViewController, UIViewCo 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) + //弹出播放器 +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } } @@ -339,6 +343,8 @@ extension MPPositive_ListShowViewController: UITableViewDataSource, UITableViewD MPPositive_Debouncer.shared.call { [weak self] in guard let self = self else {return} + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) //触发next请求,优先获取列表全部单曲基础数据(不完善) MP_NetWorkManager.shared.requestNextList(listOrAlbum.items[indexPath.row].browseItem.playListId ?? "", videoId: listOrAlbum.items[indexPath.row].browseItem.videoId ?? ""){ [weak self] listSongs in guard let self = self else {return} @@ -347,7 +353,7 @@ extension MPPositive_ListShowViewController: UITableViewDataSource, UITableViewD lodaViewModel.improveData(listOrAlbum.items[indexPath.row].browseItem.videoId ?? "") MP_PlayerManager.shared.loadPlayer = lodaViewModel //发布弹出音乐播放器的通知 - NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } } diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_MoreContentViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_MoreContentViewController.swift index fb78a7a..8256aa5 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_MoreContentViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Home(首页,各项列表页,艺术家页)/MPPositive_MoreContentViewController.swift @@ -12,19 +12,23 @@ class MPPositive_MoreContentViewController: MPPositive_BaseViewController { enum MoreShowType: Int { case Single = 0 case List = 1 - + case Video = 2 //布局Layout var layout:UICollectionViewFlowLayout{ let layout = UICollectionViewFlowLayout() layout.sectionInset = .init(top: 0, left: 18*width, bottom: 50*width, right: 16*width) switch self { case .Single: - layout.itemSize = .init(width: 339*width, height: 237*width) + layout.itemSize = .init(width: 168*width, height: 134*width) + layout.minimumInteritemSpacing = 5*width layout.minimumLineSpacing = 32*width case .List: layout.itemSize = .init(width: 162*width, height: 210*width) layout.minimumLineSpacing = 32*width layout.minimumInteritemSpacing = 15*width + case .Video: + layout.itemSize = .init(width: 339*width, height: 237*width) + layout.minimumLineSpacing = 32*width } return layout } @@ -43,12 +47,14 @@ class MPPositive_MoreContentViewController: MPPositive_BaseViewController { collectionView.backgroundColor = .clear collectionView.dataSource = self collectionView.delegate = self + collectionView.register(MPPositive_HomeListFirstCollectionViewCell.self, forCellWithReuseIdentifier: MPPositive_HomeListFirstCollectionViewCellID) collectionView.register(MPPositive_MoreListContentCollectionViewCell.self, forCellWithReuseIdentifier: MPPositive_MoreListContentCollectionViewCellID) collectionView.register(MPPositive_HomeListFifthCollectionViewCell.self, forCellWithReuseIdentifier: MPPositive_HomeListFifthCollectionViewCellID) collectionView.contentInset = .init(top: 0, left: 0, bottom: 70*width, right: 0) return collectionView }() //列表cell + private let MPPositive_HomeListFirstCollectionViewCellID = "MPPositive_HomeListFirstCollectionViewCell" private let MPPositive_MoreListContentCollectionViewCellID = "MPPositive_MoreListContentCollectionViewCell" //单曲cell private let MPPositive_HomeListFifthCollectionViewCellID = "MPPositive_HomeListFifthCollectionViewCell" @@ -86,23 +92,31 @@ extension MPPositive_MoreContentViewController: UICollectionViewDataSource, UICo func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { switch showType { case .Single: - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MPPositive_HomeListFifthCollectionViewCellID, for: indexPath) as! MPPositive_HomeListFifthCollectionViewCell + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MPPositive_HomeListFirstCollectionViewCellID, for: indexPath) as! MPPositive_HomeListFirstCollectionViewCell cell.itemViewModel = browseModuleList.items[indexPath.row] return cell case .List: let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MPPositive_MoreListContentCollectionViewCellID, for: indexPath) as! MPPositive_MoreListContentCollectionViewCell cell.itemViewModel = browseModuleList.items[indexPath.row] return cell + case .Video: + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MPPositive_HomeListFifthCollectionViewCellID, for: indexPath) as! MPPositive_HomeListFifthCollectionViewCell + cell.itemViewModel = browseModuleList.items[indexPath.row] + return cell } } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { MP_AnalyticsManager.shared.home_b_module_clickAction(browseModuleList.title) switch showType { - case .Single: + case .Single, .Video: //单曲/视频跳转 MPPositive_Debouncer.shared.call { [weak self] in guard let self = self else {return} + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //触发next请求,优先获取列表全部单曲基础数据(不完善) MP_NetWorkManager.shared.requestNextList(browseModuleList.items[indexPath.row].browseItem.playListId ?? "", videoId: browseModuleList.items[indexPath.row].browseItem.videoId ?? ""){ [weak self] listSongs in guard let self = self else {return} @@ -110,7 +124,7 @@ extension MPPositive_MoreContentViewController: UICollectionViewDataSource, UICo let lodaViewModel = MPPositive_PlayerLoadViewModel(listSongs, currentVideoId: browseModuleList.items[indexPath.row].browseItem.videoId ?? "") lodaViewModel.improveData(browseModuleList.items[indexPath.row].browseItem.videoId ?? "") MP_PlayerManager.shared.loadPlayer = lodaViewModel - NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } default: diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Player(播放器)/MPPositive_PlayerViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Player(播放器)/MPPositive_PlayerViewController.swift index 65ef8bc..b97c18d 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Player(播放器)/MPPositive_PlayerViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Player(播放器)/MPPositive_PlayerViewController.swift @@ -7,6 +7,7 @@ import UIKit import Kingfisher + ///b面播放器内容 class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewControllerTransitioningDelegate { //播放器展示状态 @@ -54,6 +55,7 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont //背景封面图 private lazy var backImageView:UIImageView = { let imageView:UIImageView = .init() + imageView.image = placeholderImage imageView.contentMode = .scaleAspectFill return imageView }() @@ -166,7 +168,7 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) //判断播放器是否装填数据 - if MP_PlayerManager.shared.loadPlayer.currentVideo != nil { + if MP_PlayerManager.shared.loadPlayer?.currentVideo != nil { uploadUI() } } @@ -200,21 +202,6 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont backBlurView.snp.makeConstraints { make in make.left.right.top.bottom.equalToSuperview() } - //配置封面和歌词 - view.addSubview(lyricsView) - lyricsView.snp.makeConstraints { make in - make.top.equalTo(navView.snp.bottom) - make.left.right.equalToSuperview() - make.height.equalTo(480*width) - } - lyricsView.isHidden = true - view.addSubview(coverView) - coverView.snp.makeConstraints { make in - make.top.equalTo(navView.snp.bottom) - make.left.right.equalToSuperview() - make.height.equalTo(480*width) - } - coverView.isHidden = false let bottomImageView:UIImageView = .init(image: .init(named: "Player_Bottom'mask")) bottomImageView.contentMode = .scaleAspectFill bottomImageView.isUserInteractionEnabled = false @@ -230,6 +217,21 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont make.left.right.bottom.equalToSuperview() make.height.equalTo(200*width) } + //配置封面和歌词 + view.addSubview(lyricsView) + lyricsView.snp.makeConstraints { make in + make.top.equalTo(navView.snp.bottom) + make.left.right.equalToSuperview() + make.height.equalTo(480*width) + } + lyricsView.isHidden = true + view.addSubview(coverView) + coverView.snp.makeConstraints { make in + make.top.equalTo(navView.snp.bottom) + make.left.right.equalToSuperview() + make.height.equalTo(480*width) + } + coverView.isHidden = false } //生成一个单选按钮组View private func createSwitchActionView() -> UIView { @@ -274,18 +276,19 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont bottomView.addSubview(playBtn) playBtn.snp.makeConstraints { make in make.width.height.equalTo(66*width) - make.center.equalToSuperview() + make.centerX.equalToSuperview() + make.centerY.equalToSuperview().multipliedBy(1.1) } bottomView.addSubview(listBtn) listBtn.snp.makeConstraints { make in make.right.equalToSuperview().offset(-20*width) - make.centerY.equalToSuperview() + make.centerY.equalTo(playBtn) make.width.height.equalTo(24*width) } bottomView.addSubview(typeBtn) typeBtn.snp.makeConstraints { make in make.left.equalToSuperview().offset(20*width) - make.centerY.equalToSuperview() + make.centerY.equalTo(playBtn) make.width.height.equalTo(24*width) } bottomView.addSubview(nextBtn) @@ -309,13 +312,13 @@ class MPPositive_PlayerViewController: MPPositive_BaseViewController, UIViewCont guard let self = self else {return} print("\(MP_PlayerManager.shared.loadPlayer.currentVideo.title ?? "")刷新了页面") //填充数据 - backImageView.kf.setImage(with: MP_PlayerManager.shared.loadPlayer.currentVideo?.coverUrl) - coverView.coverImageView.kf.setImage(with: MP_PlayerManager.shared.loadPlayer.currentVideo?.coverUrl) + backImageView.kf.setImage(with: MP_PlayerManager.shared.loadPlayer.currentVideo?.coverUrl, placeholder: placeholderImage) + coverView.coverImageView.kf.setImage(with: MP_PlayerManager.shared.loadPlayer.currentVideo?.coverUrl, placeholder: placeholderImage) coverView.titleLabel.text = MP_PlayerManager.shared.loadPlayer.currentVideo?.title coverView.subtitleLabel.text = MP_PlayerManager.shared.loadPlayer.currentVideo?.subtitle 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?.isEmpty == true ? "No Lyrics":MP_PlayerManager.shared.loadPlayer.currentVideo?.lyrics + lyricsView.lyricsLabel.text = (MP_PlayerManager.shared.loadPlayer.currentVideo?.lyrics ?? "").isEmpty == true ? "No Lyrics":MP_PlayerManager.shared.loadPlayer.currentVideo?.lyrics coverView.downloadButton.state = (MPPositive_DownloadItemModel.fetch(.init(format: "videoId == %@", MP_PlayerManager.shared.loadPlayer.currentVideo?.song.videoId ?? "")).count != 0) ? .downloaded:.startDownload coverView.downloadButton.isUserInteractionEnabled = !(MP_PlayerManager.shared.loadPlayer.currentVideo?.isDlownd ?? false) coverView.collectionSongBtn.isSelected = MP_PlayerManager.shared.loadPlayer.currentVideo?.isCollection ?? false diff --git a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Search(搜索页)/MPPositive_SearchResultShowViewController.swift b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Search(搜索页)/MPPositive_SearchResultShowViewController.swift index 90223ec..13c9a99 100644 --- a/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Search(搜索页)/MPPositive_SearchResultShowViewController.swift +++ b/relax.offline.mp3.music/MP/MPPositive/ViewControllers/Search(搜索页)/MPPositive_SearchResultShowViewController.swift @@ -114,6 +114,10 @@ class MPPositive_SearchResultShowViewController: MPPositive_BaseViewController, [weak self] in guard let self = self else {return} //单曲/视频跳转 + //弹出播放器 + NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) + //优先清除数据 + MP_PlayerManager.shared.loadPlayer = nil //触发next请求,优先获取列表全部单曲基础数据(不完善) MP_NetWorkManager.shared.requestNextList(item.item.playListId ?? "", videoId: item.item.videoId ?? ""){ [weak self] listSongs in guard let self = self else {return} @@ -121,7 +125,7 @@ class MPPositive_SearchResultShowViewController: MPPositive_BaseViewController, let lodaViewModel = MPPositive_PlayerLoadViewModel(listSongs, currentVideoId: item.item.videoId ?? "") lodaViewModel.improveData(item.item.videoId ?? "") MP_PlayerManager.shared.loadPlayer = lodaViewModel - NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) +// NotificationCenter.notificationKey.post(notificationName: .pup_player_vc) } } case .none: diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift index 0ea80e8..f8b640a 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Base/MPPositive_MoreOperationDownLoadTableViewCell.swift @@ -18,13 +18,12 @@ class MPPositive_MoreOperationDownLoadTableViewCell: UITableViewCell { //下载结束状态 btn.downloadedButton.setBackgroundImage(UIImage(named: "Song_Loaded'logo"), for: .normal) btn.downloadedButton.isUserInteractionEnabled = false + btn.downloadedButton.setAttributedTitle(nil, for: .normal) //停止下载状态 btn.stopDownloadButton.stopButton.setImage(UIImage(named: "download"), for: .normal) btn.stopDownloadButton.isUserInteractionEnabled = false btn.stopDownloadButton.tintColor = UIColor(hex: "#80F988") - btn.stopDownloadButton.stopButtonWidth = 1 - btn.stopDownloadButton.stopButton.backgroundColor = .clear - btn.stopDownloadButton.stopButton.tintColor = .clear + btn.stopDownloadButton.stopButtonWidth = 2 btn.stopDownloadButton.filledLineWidth = 3*width btn.stopDownloadButton.filledLineStyleOuter = true diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift index f6abcde..1eed528 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerCoverView.swift @@ -6,21 +6,19 @@ import UIKit import DownloadButton //B面播放器封面View(封面,标题,副标题,收藏,下载,进度条View) class MPPositive_PlayerCoverView: UIView, PKDownloadButtonDelegate { - //下载进度条View -// private var loadView = CircularProgressView() - ///封面 lazy var coverImageView:UIImageView = { let imageView = UIImageView() + imageView.image = placeholderImage imageView.contentMode = .scaleAspectFill imageView.layer.masksToBounds = true imageView.layer.cornerRadius = 16*width return imageView }() ///标题 - lazy var titleLabel:UILabel = createLabel(font: .systemFont(ofSize: 22*width, weight: .regular), textColor: .init(hex: "#FFFFFF", alpha: 0.85), textAlignment: .left) + lazy var titleLabel:UILabel = createLabel("Loading", font: .systemFont(ofSize: 22*width, weight: .regular), textColor: .init(hex: "#FFFFFF", alpha: 0.85), textAlignment: .left) ///副标题 - lazy var subtitleLabel:UILabel = createLabel(font: .systemFont(ofSize: 12*width, weight: .regular), textColor: .init(hex: "#EEEEEE", alpha: 0.6), textAlignment: .left) + lazy var subtitleLabel:UILabel = createLabel("Loading", font: .systemFont(ofSize: 12*width, weight: .regular), textColor: .init(hex: "#EEEEEE", alpha: 0.6), textAlignment: .left) ///收藏按钮 lazy var collectionSongBtn:UIButton = { let btn = UIButton() @@ -30,14 +28,6 @@ class MPPositive_PlayerCoverView: UIView, PKDownloadButtonDelegate { return btn }() ///下载按钮 -// lazy var loadBtn:UIButton = { -// let btn:UIButton = .init() -// btn.setBackgroundImage(UIImage(named: "Song_Unload'logo"), for: .normal) -// btn.setBackgroundImage(UIImage(named: "Song_Loaded'logo"), for: .selected) -// btn.addTarget(self, action: #selector(loadActionClick(_ :)), for: .touchUpInside) -// return btn -// }() - ///下载按钮 lazy var downloadButton:PKDownloadButton = { let btn:PKDownloadButton = .init() //开始下载状态 @@ -46,13 +36,12 @@ class MPPositive_PlayerCoverView: UIView, PKDownloadButtonDelegate { //下载结束状态 btn.downloadedButton.setBackgroundImage(UIImage(named: "Song_Loaded'logo"), for: .normal) btn.downloadedButton.isUserInteractionEnabled = false + btn.downloadedButton.setAttributedTitle(nil, for: .normal) //停止下载状态 btn.stopDownloadButton.stopButton.setImage(UIImage(named: "download"), for: .normal) btn.stopDownloadButton.isUserInteractionEnabled = false btn.stopDownloadButton.tintColor = UIColor(hex: "#80F988") - btn.stopDownloadButton.stopButtonWidth = 1 - btn.stopDownloadButton.stopButton.backgroundColor = .clear - btn.stopDownloadButton.stopButton.tintColor = .clear + btn.stopDownloadButton.stopButtonWidth = 2 btn.stopDownloadButton.filledLineWidth = 3*width btn.stopDownloadButton.filledLineStyleOuter = true diff --git a/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerLyricView.swift b/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerLyricView.swift index 2359c0e..36d27ea 100644 --- a/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerLyricView.swift +++ b/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerLyricView.swift @@ -24,7 +24,7 @@ class MPPositive_PlayerLyricView: UIView { make.width.equalToSuperview().multipliedBy(0.89) make.centerX.equalToSuperview() make.top.equalToSuperview().offset(15*width) - make.bottom.equalToSuperview().offset(30*width) + make.bottom.equalToSuperview().offset(-30*width) } return scrollView }() diff --git a/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.swift b/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.swift index 7b93cdf..42a0003 100644 --- a/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.swift +++ b/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.swift @@ -15,9 +15,10 @@ class MPSideA_AboutViewController: MPSideA_BaseViewController { versionView.isUserInteractionEnabled = true } } + @IBOutlet weak var versionLabel: UILabel! override func viewDidLoad() { super.viewDidLoad() - + versionLabel.text = "Version \(app_Version)" } @objc private func versionClick(){ let eventAlert = UIAlertController(title: "Version Update", message: "is the latest Version", preferredStyle: .alert) diff --git a/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.xib b/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.xib index e80a6d2..d09b65d 100644 --- a/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.xib +++ b/relax.offline.mp3.music/MP/MPSideA/ViewControllers/Center(个人资源)/MPSideA_AboutViewController.xib @@ -8,8 +8,9 @@ - + +