diff --git a/MoviaBox.xcodeproj/project.pbxproj b/MoviaBox.xcodeproj/project.pbxproj index 1d28052..cb8c562 100644 --- a/MoviaBox.xcodeproj/project.pbxproj +++ b/MoviaBox.xcodeproj/project.pbxproj @@ -257,7 +257,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.7; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -303,7 +303,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.7; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/MoviaBox/Class/Home/Controller/SPHomePageController.swift b/MoviaBox/Class/Home/Controller/SPHomePageController.swift new file mode 100644 index 0000000..465f814 --- /dev/null +++ b/MoviaBox/Class/Home/Controller/SPHomePageController.swift @@ -0,0 +1,158 @@ +// +// SPHomePageController.swift +// MoviaBox +// +// Created by 曾觉新 on 2025/4/8. +// + +import UIKit + +class SPHomePageController: SPViewController { + + private var topModel: SPHomeTopModel? + + ///是否在请求中 + private var isRequesting = false + + private lazy var categoryArr: [SPHomeCategoryModel] = [] +// { +// let arr = [ +// SPHomeCategoryModel(category_name: "Hot Picks".localized, category_id: nil, viewController: SPHomeViewController()), +// SPHomeCategoryModel(category_name: "Top 10".localized, category_id: nil, viewController: nil), +// SPHomeCategoryModel(category_name: "Fresh Drops".localized, category_id: nil, viewController: nil), +// SPHomeCategoryModel(category_name: "Free".localized, category_id: nil, viewController: nil), +// ] +// return arr +// }() + + private lazy var searchButton: SPHomeSearchButton = { + let button = SPHomeSearchButton() + button.addTarget(self, action: #selector(handleSearchButton), for: .touchUpInside) + return button + }() + + private lazy var pageView: JYPageController = { + let customIndicatorImage = UIImage(named: "page_indicator_icon_01") + let customIndicator = UIImageView(image: customIndicatorImage) + + let pageView = JYPageController() + pageView.delegate = self + pageView.dataSource = self + pageView.config.normalTitleColor = .colorD2D2D2() + pageView.config.selectedTitleColor = .colorBF6BFF() + pageView.config.normalTitleFont = 14 + pageView.config.selectedTitleFont = 16 + pageView.config.normalTitleFontWeight = .regular + pageView.config.selectedTitleFontWeight = .medium + pageView.config.alignment = .scatter + pageView.config.customIndicator = customIndicator + pageView.config.indicatorStyle = .customView + pageView.config.indicatorWidth = customIndicatorImage?.size.width ?? 0 + pageView.config.indicatorHeight = customIndicatorImage?.size.height ?? 0 + pageView.config.leftPadding = 15 + pageView.config.rightPadding = 15 + pageView.config.itemsMargin = 24 + return pageView + }() + + + + override func viewDidLoad() { + super.viewDidLoad() + NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil) + + sp_setupUI() + + requestData() + } + + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationController?.setNavigationBarHidden(true, animated: true) + } + +} + +extension SPHomePageController { + + private func sp_setupUI() { + addChild(pageView) + view.addSubview(pageView.view) + view.addSubview(searchButton) + + pageView.view.snp.makeConstraints { make in +// make.edges.equalToSuperview() + make.top.equalToSuperview().offset(kSPStatusbarHeight + 66) + make.left.right.bottom.equalToSuperview() + } + + searchButton.snp.makeConstraints { make in + make.left.equalToSuperview().offset(15) + make.centerX.equalToSuperview() + make.top.equalToSuperview().offset(kSPStatusbarHeight + 10) + } + } +} + +extension SPHomePageController { + + @objc private func handleSearchButton() { + let vc = SPSearchViewController() + self.navigationController?.pushViewController(vc, animated: true) + } + + @objc private func reachabilityDidChangeNotification() { + requestData() + } + +} + +//MARK: -------------- JYPageControllerDelegate & JYPageControllerDataSource -------------- +extension SPHomePageController: JYPageControllerDelegate, JYPageControllerDataSource { + func pageController(_ pageController: JYPageController, frameForSegmentedView segmentedView: JYSegmentedView) -> CGRect { + return .init(x: 0, y: 0, width: kSPScreenWidth, height: 40) + } + + func pageController(_ pageController: JYPageController, frameForContainerView container: UIScrollView) -> CGRect { + return .init(x: 0, y: 40, width: kSPScreenWidth, height: kSPScreenHeight - kSPTabBarHeight - kSPStatusbarHeight - 66 - 40) + } + + func pageController(_ pageController: JYPageController, titleAt index: Int) -> String { + return self.categoryArr[index].category_name ?? "" + } + + func childController(atIndex index: Int) -> any JYPageChildContollerProtocol { + let vc = SPHomeViewController() +// vc.topMargins = 15 + return vc + } + + + func numberOfChildControllers() -> Int { + return self.categoryArr.count + } +} + + +extension SPHomePageController { + + private func requestData() { + if self.topModel != nil || isRequesting { return } + + isRequesting = true + SPHomeAPI.requestHomeTopData { [weak self] model in + guard let self = self else { return } + if let model = model { + self.topModel = model + if let category = self.topModel?.category { + self.categoryArr += category + } + self.pageView.reload() + } + self.isRequesting = false + } + + } + +} diff --git a/MoviaBox/Class/Player/Controller/SPPlayerListViewController.swift b/MoviaBox/Class/Player/Controller/SPPlayerListViewController.swift index 072e720..f9c2643 100644 --- a/MoviaBox/Class/Player/Controller/SPPlayerListViewController.swift +++ b/MoviaBox/Class/Player/Controller/SPPlayerListViewController.swift @@ -236,13 +236,6 @@ class SPPlayerListViewController: SPViewController { ///当前播放进度变更 子类可重写 func currentPlayTimeDidChange(time: Int) { - let currentTime = self.viewModel.currentPlayer?.currentPosition ?? 0 -// let duration = self.viewModel.currentPlayer?.duration ?? 0 -// -// var time = currentTime -// if currentTime >= duration { -// time = 0 -// } if time > 1 { self.viewModel.currentPlayer?.videoInfo?.play_seconds = time * 1000 } diff --git a/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/Contents.json b/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/Contents.json index 7d75700..d99a60c 100644 --- a/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/Contents.json +++ b/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "启动页(MoviaBox 1.png", + "filename" : "启动页@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "启动页(MoviaBox.png", + "filename" : "启动页@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/启动页@2x.png b/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/启动页@2x.png new file mode 100644 index 0000000..e45c019 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/启动页@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/启动页@3x.png b/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/启动页@3x.png new file mode 100644 index 0000000..ffb9649 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/LaunchScreen/launch_screen_bg_image.imageset/启动页@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Frame 1912056653@2x.png b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Frame 1912056653@2x.png new file mode 100644 index 0000000..2fdfb94 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Frame 1912056653@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Frame 1912056653@3x.png b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Frame 1912056653@3x.png new file mode 100644 index 0000000..adb663a Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Frame 1912056653@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Contents.json b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Contents.json new file mode 100644 index 0000000..2f77ae3 --- /dev/null +++ b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame 1912056652@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame 1912056652@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Frame 1912056652@2x.png b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Frame 1912056652@2x.png new file mode 100644 index 0000000..b49bf5e Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Frame 1912056652@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Frame 1912056652@3x.png b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Frame 1912056652@3x.png new file mode 100644 index 0000000..046d0bb Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_02.imageset/Frame 1912056652@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/vip_icon_03.imageset/Subtract@2x.png 10-48-12-532.png b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_03.imageset/Subtract@2x.png 10-48-12-532.png new file mode 100644 index 0000000..72fe0f1 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_03.imageset/Subtract@2x.png 10-48-12-532.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/vip_icon_03.imageset/Subtract@3x.png 10-48-12-535.png b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_03.imageset/Subtract@3x.png 10-48-12-535.png new file mode 100644 index 0000000..8597bf4 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_03.imageset/Subtract@3x.png 10-48-12-535.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/vip_icon_04.imageset/Subtract@2x.png b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_04.imageset/Subtract@2x.png new file mode 100644 index 0000000..8b2a4a5 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_04.imageset/Subtract@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/vip_icon_04.imageset/Subtract@3x.png b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_04.imageset/Subtract@3x.png new file mode 100644 index 0000000..a49bbbc Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/vip_icon_04.imageset/Subtract@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/Color.colorset/Contents.json b/MoviaBox/Source/Assets.xcassets/image/Color.colorset/Contents.json new file mode 100644 index 0000000..22c4bb0 --- /dev/null +++ b/MoviaBox/Source/Assets.xcassets/image/Color.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_01.imageset/Frame 1912056629@2x.png b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_01.imageset/Frame 1912056629@2x.png new file mode 100644 index 0000000..d551807 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_01.imageset/Frame 1912056629@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_01.imageset/Frame 1912056629@3x.png b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_01.imageset/Frame 1912056629@3x.png new file mode 100644 index 0000000..737a836 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_01.imageset/Frame 1912056629@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_02.imageset/Frame 1912056630@2x.png b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_02.imageset/Frame 1912056630@2x.png new file mode 100644 index 0000000..7f925d6 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_02.imageset/Frame 1912056630@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_02.imageset/Frame 1912056630@3x.png b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_02.imageset/Frame 1912056630@3x.png new file mode 100644 index 0000000..ede9210 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/recharge_bg_image_02.imageset/Frame 1912056630@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_01.imageset/分组 3@2x.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_01.imageset/分组 3@2x.png new file mode 100644 index 0000000..ecf7b89 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_01.imageset/分组 3@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_01.imageset/分组 3@3x.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_01.imageset/分组 3@3x.png new file mode 100644 index 0000000..7643920 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_01.imageset/分组 3@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_02.imageset/分组 2@2x.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_02.imageset/分组 2@2x.png new file mode 100644 index 0000000..d08d8ff Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_02.imageset/分组 2@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_02.imageset/分组 2@3x.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_02.imageset/分组 2@3x.png new file mode 100644 index 0000000..93ce2f0 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_02.imageset/分组 2@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_03.imageset/分组 2@2x.png 10-27-20-833.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_03.imageset/分组 2@2x.png 10-27-20-833.png new file mode 100644 index 0000000..601a0a6 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_03.imageset/分组 2@2x.png 10-27-20-833.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_03.imageset/分组 2@3x.png 10-27-20-836.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_03.imageset/分组 2@3x.png 10-27-20-836.png new file mode 100644 index 0000000..4f4f326 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_03.imageset/分组 2@3x.png 10-27-20-836.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_04.imageset/分组 2@2x.png 10-27-10-896.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_04.imageset/分组 2@2x.png 10-27-10-896.png new file mode 100644 index 0000000..571b468 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_04.imageset/分组 2@2x.png 10-27-10-896.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/vip_image_04.imageset/分组 2@3x.png 10-27-10-911.png b/MoviaBox/Source/Assets.xcassets/image/vip_image_04.imageset/分组 2@3x.png 10-27-10-911.png new file mode 100644 index 0000000..18ff216 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/image/vip_image_04.imageset/分组 2@3x.png 10-27-10-911.png differ