修改UI提的问题,1.0.3发布
This commit is contained in:
parent
1dd0094b1b
commit
d859febdc8
@ -257,7 +257,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.2;
|
||||
MARKETING_VERSION = 1.0.3;
|
||||
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.2;
|
||||
MARKETING_VERSION = 1.0.3;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@ -30,6 +30,12 @@ class SPViewController: UIViewController, JYPageChildContollerProtocol {
|
||||
return imageView;
|
||||
}()
|
||||
|
||||
///无网空页面
|
||||
private(set) lazy var noNetworkEmptyView: SPNoNetworkEmptyView = {
|
||||
let view = SPNoNetworkEmptyView()
|
||||
return view
|
||||
}()
|
||||
|
||||
///头部渐变色
|
||||
private lazy var topGradientView: SPGradientView = {
|
||||
let view = SPGradientView()
|
||||
@ -121,6 +127,24 @@ class SPViewController: UIViewController, JYPageChildContollerProtocol {
|
||||
|
||||
func handleFooterRefresh(_ completer: (() -> Void)?) {}
|
||||
|
||||
///添加无网空页面
|
||||
func addNoNetworkEmptyView(clickButton: (() -> Void)?) {
|
||||
noNetworkEmptyView.clickButton = {
|
||||
clickButton?()
|
||||
}
|
||||
view.addSubview(noNetworkEmptyView)
|
||||
|
||||
noNetworkEmptyView.snp.makeConstraints { make in
|
||||
make.centerX.equalToSuperview()
|
||||
make.centerY.equalToSuperview().offset(-50)
|
||||
}
|
||||
}
|
||||
|
||||
///删除无网空页面
|
||||
func removeNoNetworkEmptyView() {
|
||||
noNetworkEmptyView.removeFromSuperview()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension UIViewController {
|
||||
|
@ -448,5 +448,37 @@ extension UIColor {
|
||||
static func colorD0C0AA(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xD0C0AA, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorF6D8A0(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xF6D8A0, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorDF9F46(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xDF9F46, alpha: alpha)
|
||||
}
|
||||
|
||||
static func color684B2A(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0x684B2A, alpha: alpha)
|
||||
}
|
||||
|
||||
static func color9E692C(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0x9E692C, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorBE9D70(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xBE9D70, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorF8F1E2(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xF8F1E2, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorEBD5A3(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xEBD5A3, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorAD7433(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xAD7433, alpha: alpha)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ class SPApnsAlertView: UIView {
|
||||
|
||||
private lazy var laterButton: UIButton = {
|
||||
let button = UIButton(type: .custom)
|
||||
button.setTitle("Later".localized, for: .normal)
|
||||
button.setTitle("movia_open_notification_later".localized, for: .normal)
|
||||
button.titleLabel?.font = .fontMedium(ofSize: 16)
|
||||
button.setTitleColor(.colorFF3232(), for: .normal)
|
||||
button.addTarget(self, action: #selector(handleLaterButton), for: .touchUpInside)
|
||||
|
@ -11,6 +11,9 @@ class SPCampaignWebViewController: SPWebViewController {
|
||||
|
||||
var id: String?
|
||||
|
||||
///重试次数
|
||||
private var receiveDataCount = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
autoTitle = false
|
||||
@ -38,6 +41,7 @@ class SPCampaignWebViewController: SPWebViewController {
|
||||
|
||||
override func webViewDidFinishLoad(_ webView: SPWebView) {
|
||||
super.webViewDidFinishLoad(webView)
|
||||
receiveDataCount = 0
|
||||
receiveDataFromNative()
|
||||
}
|
||||
|
||||
@ -46,6 +50,9 @@ class SPCampaignWebViewController: SPWebViewController {
|
||||
extension SPCampaignWebViewController {
|
||||
///设置登录信息
|
||||
func receiveDataFromNative() {
|
||||
receiveDataCount += 1
|
||||
if receiveDataCount > 10 { return }
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
var dic = [
|
||||
@ -62,8 +69,11 @@ extension SPCampaignWebViewController {
|
||||
|
||||
if let json = dic.toJsonString() {
|
||||
let js = "receiveDataFromNative(\(json))"
|
||||
self.webView.evaluateJavaScript(js) { _, error in
|
||||
|
||||
self.webView.evaluateJavaScript(js) { [weak self] _, error in
|
||||
guard let self = self else { return }
|
||||
if error != nil {
|
||||
self.receiveDataFromNative()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,8 @@ extension SPAllShortViewController {
|
||||
|
||||
tagView.snp.makeConstraints { make in
|
||||
make.left.right.equalToSuperview()
|
||||
make.top.equalToSuperview().offset(kSPStatusbarHeight + 40 + 12)
|
||||
// make.top.equalToSuperview().offset(kSPStatusbarHeight + 40 + 12)
|
||||
make.top.equalToSuperview().offset(kSPNavBarHeight + 12)
|
||||
make.height.lessThanOrEqualTo(tagMaxHeight)
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@ class SPExplorePageController: SPViewController {
|
||||
return pageView
|
||||
}()
|
||||
|
||||
|
||||
private lazy var menuBgView: UIView = {
|
||||
let view = UIView()
|
||||
view.addEffectView(style: .light)
|
||||
@ -77,11 +78,21 @@ class SPExplorePageController: SPViewController {
|
||||
return view
|
||||
}()
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||
setEmptyView()
|
||||
} else {
|
||||
_setupUI()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -90,6 +101,34 @@ class SPExplorePageController: SPViewController {
|
||||
self.navigationController?.setNavigationBarHidden(true, animated: true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
extension SPExplorePageController {
|
||||
|
||||
///设置无网空页面
|
||||
private func setEmptyView() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||
self.addNoNetworkEmptyView { [weak self] in
|
||||
self?.updateEmptyState()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func reachabilityDidChangeNotification() {
|
||||
updateEmptyState()
|
||||
}
|
||||
|
||||
private func updateEmptyState() {
|
||||
if self.pageView.view.superview != nil { return }
|
||||
|
||||
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||
self._setupUI()
|
||||
self.removeNoNetworkEmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SPExplorePageController {
|
||||
|
50
MoviaBox/Class/Home/Controller/SPAllViewController.swift
Normal file
50
MoviaBox/Class/Home/Controller/SPAllViewController.swift
Normal file
@ -0,0 +1,50 @@
|
||||
//
|
||||
// SPAllViewController.swift
|
||||
// MoviaBox
|
||||
//
|
||||
// Created by 佳尔 on 2025/5/15.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SPAllViewController: SPViewController {
|
||||
|
||||
|
||||
private lazy var allVC: SPAllShortViewController = {
|
||||
let vc = SPAllShortViewController()
|
||||
return vc
|
||||
}()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.edgesForExtendedLayout = .top
|
||||
self.title = "movia_library".localized
|
||||
|
||||
setBackgroundView(isShowGradient: false)
|
||||
|
||||
_setupUI()
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.setNavigationBarHidden(false, animated: true)
|
||||
|
||||
setNavigationBackgroundColor(color: .clear, isTranslucent: true)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
extension SPAllViewController {
|
||||
|
||||
private func _setupUI() {
|
||||
addChild(allVC)
|
||||
|
||||
view.addSubview(allVC.view)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -16,6 +16,8 @@ class SPHomeViewController: SPHomeChildController {
|
||||
|
||||
private lazy var requestGroup = DispatchGroup()
|
||||
|
||||
private var isSetupUI = false
|
||||
|
||||
//MARK: UI属性
|
||||
private lazy var logoImageView: UIImageView = {
|
||||
let imageView = UIImageView(image: UIImage(named: "logo_icon_01"))
|
||||
@ -30,6 +32,24 @@ class SPHomeViewController: SPHomeChildController {
|
||||
return button
|
||||
}()
|
||||
|
||||
private lazy var allButton: UIButton = {
|
||||
let button = UIButton(type: .custom)
|
||||
button.setImage(UIImage(named: "all_icon_01"), for: .normal)
|
||||
button.setContentHuggingPriority(.required, for: .horizontal)
|
||||
button.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
button.addTarget(self, action: #selector(handleAllButton), for: .touchUpInside)
|
||||
return button
|
||||
}()
|
||||
|
||||
private lazy var rewardButton: UIButton = {
|
||||
let button = UIButton(type: .custom)
|
||||
button.setImage(UIImage(named: "reward_icon_01"), for: .normal)
|
||||
button.setContentHuggingPriority(.required, for: .horizontal)
|
||||
button.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
button.addTarget(self, action: #selector(handleRewardButton), for: .touchUpInside)
|
||||
return button
|
||||
}()
|
||||
|
||||
private lazy var layout: UICollectionViewFlowLayout = {
|
||||
let width = floor((kSPScreenWidth - 32 - 13) / 2)
|
||||
let height = 221 / 165 * width + 44
|
||||
@ -64,10 +84,14 @@ class SPHomeViewController: SPHomeChildController {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||
|
||||
|
||||
updateAllData(completer: nil)
|
||||
// updateEmptyState()
|
||||
|
||||
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||
updateAllData(completer: nil)
|
||||
_setupUI()
|
||||
} else {
|
||||
setEmptyView()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -99,11 +123,17 @@ class SPHomeViewController: SPHomeChildController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
extension SPHomeViewController {
|
||||
|
||||
private func _setupUI() {
|
||||
if isSetupUI { return }
|
||||
isSetupUI = true
|
||||
|
||||
// view.addSubview(logoImageView)
|
||||
view.addSubview(searchButton)
|
||||
view.addSubview(allButton)
|
||||
view.addSubview(rewardButton)
|
||||
view.addSubview(self.collectionView)
|
||||
|
||||
// logoImageView.snp.makeConstraints { make in
|
||||
@ -114,10 +144,22 @@ extension SPHomeViewController {
|
||||
searchButton.snp.makeConstraints { make in
|
||||
// make.left.equalTo(logoImageView.snp.right).offset(6)
|
||||
make.left.equalToSuperview().offset(16)
|
||||
make.right.equalToSuperview().offset(-16)
|
||||
// make.right.equalToSuperview().offset(-16)
|
||||
make.right.equalTo(allButton.snp.left).offset(-4)
|
||||
make.top.equalToSuperview().offset(kSPStatusbarHeight + 10)
|
||||
}
|
||||
|
||||
allButton.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(searchButton)
|
||||
// make.right.equalToSuperview().offset(-16)
|
||||
make.right.equalTo(rewardButton.snp.left).offset(-1)
|
||||
}
|
||||
|
||||
rewardButton.snp.makeConstraints { make in
|
||||
make.centerY.equalTo(searchButton)
|
||||
make.right.equalToSuperview().offset(-16)
|
||||
}
|
||||
|
||||
self.collectionView.snp.makeConstraints { make in
|
||||
make.left.right.bottom.equalToSuperview()
|
||||
// make.top.equalToSuperview().offset(kSPStatusbarHeight + 66)
|
||||
@ -132,22 +174,39 @@ extension SPHomeViewController {
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
///设置无网空页面
|
||||
private func setEmptyView() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||
self.addNoNetworkEmptyView { [weak self] in
|
||||
self?.updateEmptyState()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func reachabilityDidChangeNotification() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable == true, self.viewModel.moduleModel == nil {
|
||||
updateAllData(completer: nil)
|
||||
}
|
||||
updateEmptyState()
|
||||
}
|
||||
|
||||
///更新空白页面状态
|
||||
private func updateEmptyState() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||
self._setupUI()
|
||||
if viewModel.isEmptyData {
|
||||
self.updateAllData(completer: nil)
|
||||
}
|
||||
self.removeNoNetworkEmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true, viewModel.isEmptyData {
|
||||
self.collectionView.showNoNetworkEmpty { [weak self] in
|
||||
self?.updateAllData(completer: nil)
|
||||
}
|
||||
} else {
|
||||
self.collectionView.hiddenEmpty()
|
||||
@objc private func handleAllButton() {
|
||||
let vc = SPAllViewController()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
@objc private func handleRewardButton() {
|
||||
let vc = SPRewardsViewController()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,8 @@ class SPSearchViewController: SPViewController {
|
||||
|
||||
searchInputView.textField.becomeFirstResponder()
|
||||
|
||||
setBackgroundView(isShowGradient: false, bgImage: nil)
|
||||
|
||||
_setupUI()
|
||||
}
|
||||
|
||||
|
@ -44,9 +44,11 @@ class SPHomeHeaderView: UICollectionReusableView {
|
||||
// stackView.addArrangedSubview(shortsForYouView)
|
||||
// shortsForYouView.dataArr = moduleModel?.bannerData
|
||||
|
||||
if (viewModel?.dataArr.count ?? 0) > 0 {
|
||||
stackView.addArrangedSubview(titleView)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private lazy var stackView: UIStackView = {
|
||||
@ -66,9 +68,9 @@ class SPHomeHeaderView: UICollectionReusableView {
|
||||
let view = ZKCycleScrollView(frame: .zero, shouldInfiniteLoop: true)
|
||||
view.itemSize = .init(width: 234, height: Self.bannerHeight())
|
||||
view.itemAlpha = true
|
||||
view.itemZoomScale = 0.9
|
||||
view.itemSpacing = 30
|
||||
view.itemZoomScale = 0.85
|
||||
view.rotationAngle = 12
|
||||
view.itemSpacing = 15
|
||||
view.delegate = self
|
||||
view.dataSource = self
|
||||
view.hidesPageControl = true
|
||||
|
@ -10,11 +10,11 @@ import UIKit
|
||||
class SPMineWalletView: UIView {
|
||||
|
||||
override var intrinsicContentSize: CGSize {
|
||||
if isShowMore {
|
||||
return .init(width: kSPScreenWidth, height: 119)
|
||||
} else {
|
||||
return .init(width: kSPScreenWidth, height: 82)
|
||||
}
|
||||
// if isShowMore {
|
||||
// } else {
|
||||
// return .init(width: kSPScreenWidth, height: 82)
|
||||
// }
|
||||
}
|
||||
|
||||
var userInfo: SPUserInfo? {
|
||||
@ -27,21 +27,19 @@ class SPMineWalletView: UIView {
|
||||
///是否展示更多按钮
|
||||
var isShowMore: Bool = true {
|
||||
didSet {
|
||||
moreButton.isHidden = !isShowMore
|
||||
lineView.isHidden = !isShowMore
|
||||
moreIndicatorImageView.isHidden = !isShowMore
|
||||
// lineView.isHidden = !isShowMore
|
||||
|
||||
invalidateIntrinsicContentSize()
|
||||
// invalidateIntrinsicContentSize()
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: UI属性
|
||||
private lazy var bgView: UIView = {
|
||||
private(set) lazy var bgView: UIView = {
|
||||
let view = UIView()
|
||||
view.backgroundColor = .colorFFFFFF(alpha: 0.06)
|
||||
view.layer.cornerRadius = 8
|
||||
view.layer.masksToBounds = true
|
||||
view.layer.borderWidth = 1
|
||||
view.layer.borderColor = UIColor.colorFFFFFF(alpha: 0.14).cgColor
|
||||
return view
|
||||
}()
|
||||
|
||||
@ -122,6 +120,7 @@ extension SPMineWalletView {
|
||||
}
|
||||
|
||||
@objc private func handleWalletButton() {
|
||||
if !isShowMore { return }
|
||||
let vc = SPWalletViewController()
|
||||
self.viewController?.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
@ -112,11 +112,20 @@ class SPMyListViewController: SPViewController {
|
||||
return view
|
||||
}()
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||
setEmptyView()
|
||||
} else {
|
||||
_setupUI()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
@ -149,6 +158,32 @@ class SPMyListViewController: SPViewController {
|
||||
}
|
||||
}
|
||||
|
||||
extension SPMyListViewController {
|
||||
|
||||
///设置无网空页面
|
||||
private func setEmptyView() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||
self.addNoNetworkEmptyView { [weak self] in
|
||||
self?.updateEmptyState()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func reachabilityDidChangeNotification() {
|
||||
updateEmptyState()
|
||||
}
|
||||
|
||||
private func updateEmptyState() {
|
||||
if self.pageView.view.superview != nil { return }
|
||||
|
||||
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||
self._setupUI()
|
||||
self.removeNoNetworkEmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SPMyListViewController {
|
||||
private func _setupUI() {
|
||||
addChild(pageView)
|
||||
|
@ -107,7 +107,7 @@ class SPPlayerDetailViewController: SPPlayerListViewController {
|
||||
//解锁视频需要的金币
|
||||
let videoCoin = videoInfo.coins ?? 0
|
||||
|
||||
if myCoin < videoCoin, self.viewModel.currentPlayer?.hasLockUpEpisode == true {//金币不够时打开充值页面
|
||||
if myCoin < videoCoin, self.viewModel.currentPlayer?.hasLockUpEpisode != true {//金币不够时打开充值页面
|
||||
self.onPlayBuy()
|
||||
}
|
||||
return
|
||||
|
@ -121,6 +121,11 @@ class SPPlayerListViewController: SPViewController {
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
self.viewModel.currentPlayer?.pause()
|
||||
///处理切换页面后,滑动代理scrollViewDidEndDecelerating不执行的问题
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.scrollDidEnd(self.collectionView)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -76,11 +76,21 @@ extension SPPlayerDetailRecommandCell {
|
||||
//MARK: -------------- SPPlayerDelegate --------------
|
||||
extension SPPlayerDetailRecommandCell: SPPlayerDelegate {
|
||||
func sp_player(_ player: SPPlayer, loadStateDidChange state: SPPlayer.LoadState) {
|
||||
|
||||
updateCoverShowState()
|
||||
}
|
||||
|
||||
func sp_player(_ player: SPPlayer, playStateDidChanged state: SPPlayer.PlayState) {
|
||||
if state == .playing, isCurrentPlayer {
|
||||
// if state == .playing, isCurrentPlayer {
|
||||
// self.coverImageView.isHidden = true
|
||||
// }
|
||||
updateCoverShowState()
|
||||
}
|
||||
|
||||
///更新封面显示状态
|
||||
private func updateCoverShowState() {
|
||||
let loadState = self.player.loadState
|
||||
let playState = self.player.playState
|
||||
if isCurrentPlayer && (loadState == .playable || loadState == .playthroughOK) && (playState == .playing) {
|
||||
self.coverImageView.isHidden = true
|
||||
}
|
||||
}
|
||||
|
@ -211,12 +211,16 @@ extension SPPlayerDetailRecommandView: ZKCycleScrollViewDelegate, ZKCycleScrollV
|
||||
func cycleScrollView(_ cycleScrollView: ZKCycleScrollView, didScrollFromIndex fromIndex: Int, toIndex: Int) {
|
||||
let model = self.dataArr[toIndex]
|
||||
videoNameLabel.text = model.name
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
|
||||
let cell = self.bannerView.cellForItem(at: toIndex) as? SPPlayerDetailRecommandCell
|
||||
self.currentCell = cell
|
||||
self.play()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SPPlayerDetailRecommandView {
|
||||
|
@ -20,9 +20,11 @@ class SPRewardsViewController: SPCampaignWebViewController {
|
||||
self.urlStr = SPRewardsWebUrl
|
||||
|
||||
super.viewDidLoad()
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(loginStateDidChangeNotification), name: SPLoginManager.loginStateDidChangeNotification, object: nil)
|
||||
|
||||
setEmptyView()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +42,26 @@ class SPRewardsViewController: SPCampaignWebViewController {
|
||||
|
||||
extension SPRewardsViewController {
|
||||
|
||||
|
||||
///设置无网空页面
|
||||
private func setEmptyView() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||
self.webView.isHidden = true
|
||||
self.addNoNetworkEmptyView { [weak self] in
|
||||
self?.reachabilityDidChangeNotification()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func loginStateDidChangeNotification() {
|
||||
self.reload()
|
||||
}
|
||||
|
||||
@objc private func reachabilityDidChangeNotification() {
|
||||
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||
self.webView.isHidden = false
|
||||
self.removeNoNetworkEmptyView()
|
||||
self.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class SPWalletViewController: SPViewController {
|
||||
}()
|
||||
|
||||
private lazy var headerView: SPWalletHeaderView = {
|
||||
let view = SPWalletHeaderView(frame: .init(x: 0, y: 0, width: kSPScreenWidth, height: 115))
|
||||
let view = SPWalletHeaderView(frame: .init(x: 0, y: 0, width: kSPScreenWidth, height: 152))
|
||||
view.userInfo = SPLoginManager.manager.userInfo
|
||||
return view
|
||||
}()
|
||||
|
@ -13,7 +13,8 @@ class SPMemberRechargeCell: SPCollectionViewCell {
|
||||
var model: SPPayTemplateItem? {
|
||||
didSet {
|
||||
desLabel.text = model?.sp_description
|
||||
typeLabel.text = model?.vip_type_key?.getText()
|
||||
// typeLabel.text = model?.vip_type_key?.getText()
|
||||
typeLabel.text = model?.brief
|
||||
currencyLabel.text = model?.currency
|
||||
moneyLabel.text = model?.price
|
||||
if let sendCoins = model?.send_coins, sendCoins > 0 {
|
||||
@ -120,6 +121,7 @@ class SPMemberRechargeCell: SPCollectionViewCell {
|
||||
|
||||
private lazy var typeIconImageView: UIImageView = {
|
||||
let imageView = UIImageView()
|
||||
imageView.isHidden = true
|
||||
return imageView
|
||||
}()
|
||||
|
||||
|
@ -13,14 +13,37 @@ class SPVipAlertCell: SPCollectionViewCell {
|
||||
didSet {
|
||||
moneyLabel.text = "\(model?.currency ?? "")\(model?.price ?? "")"
|
||||
|
||||
titleLabel.text = model?.vip_type_key?.getText().capitalizingFirstLetter()
|
||||
// titleLabel.text = model?.vip_type_key?.getText().capitalizingFirstLetter()
|
||||
titleLabel.text = model?.brief
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var bgView: UIView = {
|
||||
let view = UIView()
|
||||
view.backgroundColor = .colorFFFFFF()
|
||||
var sp_isSelected: Bool = false {
|
||||
didSet {
|
||||
if sp_isSelected {
|
||||
bgView.colors = [UIColor.colorF6D8A0().cgColor, UIColor.colorDF9F46().cgColor]
|
||||
contentView.backgroundColor = .color684B2A()
|
||||
titleLabel.textColor = .color9E692C()
|
||||
desLabel.textColor = .colorBE9D70()
|
||||
moneyBgView.colors = [UIColor.colorF8F1E2().cgColor, UIColor.colorEBD5A3().cgColor]
|
||||
moneyLabel.textColor = .colorAD7433()
|
||||
} else {
|
||||
bgView.colors = [UIColor.colorFFFFFF().cgColor, UIColor.colorFFFFFF().cgColor]
|
||||
contentView.backgroundColor = .colorCC9251()
|
||||
titleLabel.textColor = .colorCA8D3B()
|
||||
desLabel.textColor = .colorD0C0AA()
|
||||
moneyBgView.colors = [UIColor.colorA36C2D().cgColor, UIColor.color412D11().cgColor]
|
||||
moneyLabel.textColor = .colorFFFFFF()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var bgView: SPGradientView = {
|
||||
let view = SPGradientView()
|
||||
view.locations = [0, 1]
|
||||
view.startPoint = .init(x: 0, y: 0.5)
|
||||
view.endPoint = .init(x: 1, y: 0.5)
|
||||
view.layer.cornerRadius = 8
|
||||
view.layer.masksToBounds = true
|
||||
return view
|
||||
@ -29,21 +52,19 @@ class SPVipAlertCell: SPCollectionViewCell {
|
||||
private lazy var titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .fontBold(ofSize: 18)
|
||||
label.textColor = .colorCA8D3B()
|
||||
label.adjustsFontSizeToFitWidth = true
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var desLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .fontMedium(ofSize: 12)
|
||||
label.textColor = .colorD0C0AA()
|
||||
label.text = "movia_vip_membership".localized
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var moneyBgView: SPGradientView = {
|
||||
let view = SPGradientView()
|
||||
view.colors = [UIColor.colorA36C2D().cgColor, UIColor.color412D11().cgColor]
|
||||
view.locations = [0, 1]
|
||||
view.startPoint = .init(x: 0, y: 0.5)
|
||||
view.endPoint = .init(x: 1, y: 0.5)
|
||||
@ -56,6 +77,8 @@ class SPVipAlertCell: SPCollectionViewCell {
|
||||
let label = UILabel()
|
||||
label.font = .fontBold(ofSize: 14)
|
||||
label.textColor = .colorFFFFFF()
|
||||
label.setContentHuggingPriority(.required, for: .horizontal)
|
||||
label.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
return label
|
||||
}()
|
||||
|
||||
@ -65,7 +88,7 @@ class SPVipAlertCell: SPCollectionViewCell {
|
||||
|
||||
contentView.layer.cornerRadius = 8
|
||||
contentView.layer.masksToBounds = true
|
||||
contentView.backgroundColor = .colorCC9251()
|
||||
|
||||
|
||||
|
||||
_setupUI()
|
||||
@ -94,8 +117,9 @@ extension SPVipAlertCell {
|
||||
}
|
||||
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview().offset(25)
|
||||
make.left.equalToSuperview().offset(15)
|
||||
make.top.equalToSuperview().offset(11)
|
||||
make.right.lessThanOrEqualTo(moneyBgView.snp.left).offset(-5)
|
||||
}
|
||||
|
||||
desLabel.snp.makeConstraints { make in
|
||||
@ -105,7 +129,7 @@ extension SPVipAlertCell {
|
||||
|
||||
moneyBgView.snp.makeConstraints { make in
|
||||
make.centerY.equalToSuperview()
|
||||
make.right.equalToSuperview().offset(-25)
|
||||
make.right.equalToSuperview().offset(-15)
|
||||
make.height.equalTo(36)
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,9 @@ class SPVipAlertView: SPAlertView {
|
||||
}
|
||||
|
||||
static var isShowAlert: Bool {
|
||||
#if DEBUG
|
||||
return true
|
||||
#else
|
||||
guard let lastAlertDate = lastAlertDate else { return true }
|
||||
let nowDate = Date()
|
||||
|
||||
@ -29,12 +32,16 @@ class SPVipAlertView: SPAlertView {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
private lazy var dataArr: [SPPayTemplateItem] = []
|
||||
///会员购买成功
|
||||
var buyFinishHandle: (() -> Void)?
|
||||
|
||||
private var selectedIndex = 0
|
||||
|
||||
//MARK: UI属性
|
||||
private lazy var bgImageView: UIImageView = {
|
||||
let imageView = UIImageView(image: UIImage(named: "alert_bg_image_02"))
|
||||
@ -47,13 +54,15 @@ class SPVipAlertView: SPAlertView {
|
||||
return imageView
|
||||
}()
|
||||
|
||||
private lazy var vipTitleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .fontMedium(ofSize: 16)
|
||||
label.textColor = .colorFFC591()
|
||||
label.text = "movia_vip_alert_text_01".localized
|
||||
return label
|
||||
}()
|
||||
// private lazy var vipTitleLabel: UILabel = {
|
||||
// let label = UILabel()
|
||||
// label.font = .fontMedium(ofSize: 16)
|
||||
// label.textColor = .colorFFC591()
|
||||
// label.text = "movia_vip_alert_text_01".localized
|
||||
// label.numberOfLines = 2
|
||||
//// label.adjustsFontSizeToFitWidth = true
|
||||
// return label
|
||||
// }()
|
||||
|
||||
private lazy var vipTipLabel1: UILabel = {
|
||||
let label = UILabel()
|
||||
@ -83,7 +92,7 @@ class SPVipAlertView: SPAlertView {
|
||||
let collectionView = SPCollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
collectionView.isScrollEnabled = false
|
||||
collectionView.showsVerticalScrollIndicator = false
|
||||
SPVipAlertCell.registerCell(collectionView: collectionView)
|
||||
return collectionView
|
||||
}()
|
||||
@ -97,6 +106,7 @@ class SPVipAlertView: SPAlertView {
|
||||
|
||||
init(dataArr: [SPPayTemplateItem]) {
|
||||
super.init(frame: .zero)
|
||||
selectedIndex = dataArr.count - 1
|
||||
self.dataArr = dataArr
|
||||
|
||||
_setupUI()
|
||||
@ -127,7 +137,7 @@ extension SPVipAlertView {
|
||||
contentView.addSubview(bgImageView)
|
||||
contentView.addSubview(closeButton)
|
||||
bgImageView.addSubview(vipIconImageView)
|
||||
bgImageView.addSubview(vipTitleLabel)
|
||||
// bgImageView.addSubview(vipTitleLabel)
|
||||
bgImageView.addSubview(vipTipLabel1)
|
||||
bgImageView.addSubview(vipTipLabel2)
|
||||
bgImageView.addSubview(collectionView)
|
||||
@ -144,16 +154,18 @@ extension SPVipAlertView {
|
||||
|
||||
vipIconImageView.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview().offset(42)
|
||||
make.top.equalToSuperview().offset(57)
|
||||
// make.top.equalToSuperview().offset(57)
|
||||
make.top.equalToSuperview().offset(70)
|
||||
}
|
||||
|
||||
vipTitleLabel.snp.makeConstraints { make in
|
||||
make.left.equalTo(vipIconImageView)
|
||||
make.top.equalTo(vipIconImageView.snp.bottom).offset(11)
|
||||
}
|
||||
// vipTitleLabel.snp.makeConstraints { make in
|
||||
// make.left.equalTo(vipIconImageView)
|
||||
// make.top.equalTo(vipIconImageView.snp.bottom).offset(11)
|
||||
// make.right.lessThanOrEqualToSuperview().offset(-140)
|
||||
// }
|
||||
|
||||
vipTipLabel1.snp.makeConstraints { make in
|
||||
make.left.equalTo(vipTitleLabel)
|
||||
make.left.equalTo(vipIconImageView)
|
||||
make.top.equalToSuperview().offset(138)
|
||||
}
|
||||
|
||||
@ -178,6 +190,7 @@ extension SPVipAlertView: UICollectionViewDelegate, UICollectionViewDataSource {
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = SPVipAlertCell.dequeueReusableCell(collectionView: collectionView, indexPath: indexPath)
|
||||
cell.model = dataArr[indexPath.row]
|
||||
cell.sp_isSelected = indexPath.row == selectedIndex
|
||||
return cell
|
||||
}
|
||||
|
||||
@ -186,6 +199,8 @@ extension SPVipAlertView: UICollectionViewDelegate, UICollectionViewDataSource {
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
selectedIndex = indexPath.row
|
||||
collectionView.reloadData()
|
||||
let model = dataArr[indexPath.row]
|
||||
|
||||
SPIAPManager.manager.startRecharge(model: model, shortPlayId: nil, videoId: nil) { [weak self] finish in
|
||||
|
@ -19,6 +19,8 @@ class SPWalletHeaderView: UIView {
|
||||
private lazy var contentView: SPMineWalletView = {
|
||||
let view = SPMineWalletView()
|
||||
view.isShowMore = false
|
||||
view.bgView.layer.borderWidth = 1
|
||||
view.bgView.layer.borderColor = UIColor.colorFFFFFF(alpha: 0.14).cgColor
|
||||
return view
|
||||
}()
|
||||
|
||||
|
22
MoviaBox/Source/Assets.xcassets/icon/all_icon_01.imageset/Contents.json
vendored
Normal file
22
MoviaBox/Source/Assets.xcassets/icon/all_icon_01.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Frame@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Frame@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
MoviaBox/Source/Assets.xcassets/icon/all_icon_01.imageset/Frame@2x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/icon/all_icon_01.imageset/Frame@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 631 B |
BIN
MoviaBox/Source/Assets.xcassets/icon/all_icon_01.imageset/Frame@3x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/icon/all_icon_01.imageset/Frame@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 933 B |
22
MoviaBox/Source/Assets.xcassets/icon/reward_icon_01.imageset/Contents.json
vendored
Normal file
22
MoviaBox/Source/Assets.xcassets/icon/reward_icon_01.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "image 2@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "image 2@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
MoviaBox/Source/Assets.xcassets/icon/reward_icon_01.imageset/image 2@2x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/icon/reward_icon_01.imageset/image 2@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
MoviaBox/Source/Assets.xcassets/icon/reward_icon_01.imageset/image 2@3x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/icon/reward_icon_01.imageset/image 2@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
@ -113,6 +113,7 @@
|
||||
"q_complex" = "quarter";
|
||||
"Y_complex" = "years";
|
||||
"movia_vip_membership" = "VIP Membership";
|
||||
"movia_library" = "Library";
|
||||
|
||||
|
||||
"movia_vip_alert_text_01" = "Short Drama VIP Exclusive";
|
||||
|
@ -96,7 +96,7 @@ open class ZKCycleScrollViewFlowLayout: UICollectionViewFlowLayout {
|
||||
}
|
||||
|
||||
if itemAlpha {
|
||||
var alpha = 1 - abs(screenScale) + 0.2
|
||||
var alpha = 1 - abs(screenScale) + 0.1
|
||||
if alpha < 0 {
|
||||
alpha = 0
|
||||
} else if alpha > 1 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user