修改UI提的问题,1.0.3发布
This commit is contained in:
parent
1dd0094b1b
commit
d859febdc8
@ -257,7 +257,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.2;
|
MARKETING_VERSION = 1.0.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -303,7 +303,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.2;
|
MARKETING_VERSION = 1.0.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
PRODUCT_BUNDLE_IDENTIFIER = com.thimratv.app;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
@ -30,6 +30,12 @@ class SPViewController: UIViewController, JYPageChildContollerProtocol {
|
|||||||
return imageView;
|
return imageView;
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
///无网空页面
|
||||||
|
private(set) lazy var noNetworkEmptyView: SPNoNetworkEmptyView = {
|
||||||
|
let view = SPNoNetworkEmptyView()
|
||||||
|
return view
|
||||||
|
}()
|
||||||
|
|
||||||
///头部渐变色
|
///头部渐变色
|
||||||
private lazy var topGradientView: SPGradientView = {
|
private lazy var topGradientView: SPGradientView = {
|
||||||
let view = SPGradientView()
|
let view = SPGradientView()
|
||||||
@ -120,6 +126,24 @@ class SPViewController: UIViewController, JYPageChildContollerProtocol {
|
|||||||
func handleHeaderRefresh(_ completer: (() -> Void)?) {}
|
func handleHeaderRefresh(_ completer: (() -> Void)?) {}
|
||||||
|
|
||||||
func handleFooterRefresh(_ completer: (() -> Void)?) {}
|
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()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,5 +448,37 @@ extension UIColor {
|
|||||||
static func colorD0C0AA(alpha: CGFloat = 1) -> UIColor {
|
static func colorD0C0AA(alpha: CGFloat = 1) -> UIColor {
|
||||||
return color(hex: 0xD0C0AA, alpha: alpha)
|
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 = {
|
private lazy var laterButton: UIButton = {
|
||||||
let button = UIButton(type: .custom)
|
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.titleLabel?.font = .fontMedium(ofSize: 16)
|
||||||
button.setTitleColor(.colorFF3232(), for: .normal)
|
button.setTitleColor(.colorFF3232(), for: .normal)
|
||||||
button.addTarget(self, action: #selector(handleLaterButton), for: .touchUpInside)
|
button.addTarget(self, action: #selector(handleLaterButton), for: .touchUpInside)
|
||||||
|
@ -10,6 +10,9 @@ import UIKit
|
|||||||
class SPCampaignWebViewController: SPWebViewController {
|
class SPCampaignWebViewController: SPWebViewController {
|
||||||
|
|
||||||
var id: String?
|
var id: String?
|
||||||
|
|
||||||
|
///重试次数
|
||||||
|
private var receiveDataCount = 0
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
@ -38,6 +41,7 @@ class SPCampaignWebViewController: SPWebViewController {
|
|||||||
|
|
||||||
override func webViewDidFinishLoad(_ webView: SPWebView) {
|
override func webViewDidFinishLoad(_ webView: SPWebView) {
|
||||||
super.webViewDidFinishLoad(webView)
|
super.webViewDidFinishLoad(webView)
|
||||||
|
receiveDataCount = 0
|
||||||
receiveDataFromNative()
|
receiveDataFromNative()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +50,9 @@ class SPCampaignWebViewController: SPWebViewController {
|
|||||||
extension SPCampaignWebViewController {
|
extension SPCampaignWebViewController {
|
||||||
///设置登录信息
|
///设置登录信息
|
||||||
func receiveDataFromNative() {
|
func receiveDataFromNative() {
|
||||||
|
receiveDataCount += 1
|
||||||
|
if receiveDataCount > 10 { return }
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
var dic = [
|
var dic = [
|
||||||
@ -62,8 +69,11 @@ extension SPCampaignWebViewController {
|
|||||||
|
|
||||||
if let json = dic.toJsonString() {
|
if let json = dic.toJsonString() {
|
||||||
let js = "receiveDataFromNative(\(json))"
|
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
|
tagView.snp.makeConstraints { make in
|
||||||
make.left.right.equalToSuperview()
|
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)
|
make.height.lessThanOrEqualTo(tagMaxHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ class SPExplorePageController: SPViewController {
|
|||||||
return pageView
|
return pageView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
||||||
private lazy var menuBgView: UIView = {
|
private lazy var menuBgView: UIView = {
|
||||||
let view = UIView()
|
let view = UIView()
|
||||||
view.addEffectView(style: .light)
|
view.addEffectView(style: .light)
|
||||||
@ -77,11 +78,21 @@ class SPExplorePageController: SPViewController {
|
|||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
NotificationCenter.default.removeObserver(self)
|
||||||
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
|
||||||
_setupUI()
|
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||||
|
|
||||||
|
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||||
|
setEmptyView()
|
||||||
|
} else {
|
||||||
|
_setupUI()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +100,35 @@ class SPExplorePageController: SPViewController {
|
|||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
self.navigationController?.setNavigationBarHidden(true, animated: true)
|
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 {
|
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 lazy var requestGroup = DispatchGroup()
|
||||||
|
|
||||||
|
private var isSetupUI = false
|
||||||
|
|
||||||
//MARK: UI属性
|
//MARK: UI属性
|
||||||
private lazy var logoImageView: UIImageView = {
|
private lazy var logoImageView: UIImageView = {
|
||||||
let imageView = UIImageView(image: UIImage(named: "logo_icon_01"))
|
let imageView = UIImageView(image: UIImage(named: "logo_icon_01"))
|
||||||
@ -30,6 +32,24 @@ class SPHomeViewController: SPHomeChildController {
|
|||||||
return button
|
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 = {
|
private lazy var layout: UICollectionViewFlowLayout = {
|
||||||
let width = floor((kSPScreenWidth - 32 - 13) / 2)
|
let width = floor((kSPScreenWidth - 32 - 13) / 2)
|
||||||
let height = 221 / 165 * width + 44
|
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)
|
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||||
|
|
||||||
|
|
||||||
updateAllData(completer: nil)
|
|
||||||
// updateEmptyState()
|
|
||||||
|
|
||||||
_setupUI()
|
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||||
|
updateAllData(completer: nil)
|
||||||
|
_setupUI()
|
||||||
|
} else {
|
||||||
|
setEmptyView()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,11 +123,17 @@ class SPHomeViewController: SPHomeChildController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extension SPHomeViewController {
|
extension SPHomeViewController {
|
||||||
|
|
||||||
private func _setupUI() {
|
private func _setupUI() {
|
||||||
|
if isSetupUI { return }
|
||||||
|
isSetupUI = true
|
||||||
|
|
||||||
// view.addSubview(logoImageView)
|
// view.addSubview(logoImageView)
|
||||||
view.addSubview(searchButton)
|
view.addSubview(searchButton)
|
||||||
|
view.addSubview(allButton)
|
||||||
|
view.addSubview(rewardButton)
|
||||||
view.addSubview(self.collectionView)
|
view.addSubview(self.collectionView)
|
||||||
|
|
||||||
// logoImageView.snp.makeConstraints { make in
|
// logoImageView.snp.makeConstraints { make in
|
||||||
@ -114,10 +144,22 @@ extension SPHomeViewController {
|
|||||||
searchButton.snp.makeConstraints { make in
|
searchButton.snp.makeConstraints { make in
|
||||||
// make.left.equalTo(logoImageView.snp.right).offset(6)
|
// make.left.equalTo(logoImageView.snp.right).offset(6)
|
||||||
make.left.equalToSuperview().offset(16)
|
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)
|
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
|
self.collectionView.snp.makeConstraints { make in
|
||||||
make.left.right.bottom.equalToSuperview()
|
make.left.right.bottom.equalToSuperview()
|
||||||
// make.top.equalToSuperview().offset(kSPStatusbarHeight + 66)
|
// make.top.equalToSuperview().offset(kSPStatusbarHeight + 66)
|
||||||
@ -132,21 +174,38 @@ extension SPHomeViewController {
|
|||||||
self.navigationController?.pushViewController(vc, animated: true)
|
self.navigationController?.pushViewController(vc, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func reachabilityDidChangeNotification() {
|
///设置无网空页面
|
||||||
if SPNetworkReachabilityManager.manager.isReachable == true, self.viewModel.moduleModel == nil {
|
private func setEmptyView() {
|
||||||
updateAllData(completer: nil)
|
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||||
|
self.addNoNetworkEmptyView { [weak self] in
|
||||||
|
self?.updateEmptyState()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc private func reachabilityDidChangeNotification() {
|
||||||
|
updateEmptyState()
|
||||||
|
}
|
||||||
|
|
||||||
///更新空白页面状态
|
///更新空白页面状态
|
||||||
private func updateEmptyState() {
|
private func updateEmptyState() {
|
||||||
|
if SPNetworkReachabilityManager.manager.isReachable == true {
|
||||||
if SPNetworkReachabilityManager.manager.isReachable != true, viewModel.isEmptyData {
|
self._setupUI()
|
||||||
self.collectionView.showNoNetworkEmpty { [weak self] in
|
if viewModel.isEmptyData {
|
||||||
self?.updateAllData(completer: nil)
|
self.updateAllData(completer: nil)
|
||||||
}
|
}
|
||||||
} else {
|
self.removeNoNetworkEmptyView()
|
||||||
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()
|
searchInputView.textField.becomeFirstResponder()
|
||||||
|
|
||||||
|
setBackgroundView(isShowGradient: false, bgImage: nil)
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,9 @@ class SPHomeHeaderView: UICollectionReusableView {
|
|||||||
// stackView.addArrangedSubview(shortsForYouView)
|
// stackView.addArrangedSubview(shortsForYouView)
|
||||||
// shortsForYouView.dataArr = moduleModel?.bannerData
|
// shortsForYouView.dataArr = moduleModel?.bannerData
|
||||||
|
|
||||||
stackView.addArrangedSubview(titleView)
|
if (viewModel?.dataArr.count ?? 0) > 0 {
|
||||||
|
stackView.addArrangedSubview(titleView)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,9 +68,9 @@ class SPHomeHeaderView: UICollectionReusableView {
|
|||||||
let view = ZKCycleScrollView(frame: .zero, shouldInfiniteLoop: true)
|
let view = ZKCycleScrollView(frame: .zero, shouldInfiniteLoop: true)
|
||||||
view.itemSize = .init(width: 234, height: Self.bannerHeight())
|
view.itemSize = .init(width: 234, height: Self.bannerHeight())
|
||||||
view.itemAlpha = true
|
view.itemAlpha = true
|
||||||
view.itemZoomScale = 0.9
|
view.itemZoomScale = 0.85
|
||||||
view.itemSpacing = 30
|
|
||||||
view.rotationAngle = 12
|
view.rotationAngle = 12
|
||||||
|
view.itemSpacing = 15
|
||||||
view.delegate = self
|
view.delegate = self
|
||||||
view.dataSource = self
|
view.dataSource = self
|
||||||
view.hidesPageControl = true
|
view.hidesPageControl = true
|
||||||
|
@ -10,11 +10,11 @@ import UIKit
|
|||||||
class SPMineWalletView: UIView {
|
class SPMineWalletView: UIView {
|
||||||
|
|
||||||
override var intrinsicContentSize: CGSize {
|
override var intrinsicContentSize: CGSize {
|
||||||
if isShowMore {
|
return .init(width: kSPScreenWidth, height: 119)
|
||||||
return .init(width: kSPScreenWidth, height: 119)
|
// if isShowMore {
|
||||||
} else {
|
// } else {
|
||||||
return .init(width: kSPScreenWidth, height: 82)
|
// return .init(width: kSPScreenWidth, height: 82)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
var userInfo: SPUserInfo? {
|
var userInfo: SPUserInfo? {
|
||||||
@ -27,21 +27,19 @@ class SPMineWalletView: UIView {
|
|||||||
///是否展示更多按钮
|
///是否展示更多按钮
|
||||||
var isShowMore: Bool = true {
|
var isShowMore: Bool = true {
|
||||||
didSet {
|
didSet {
|
||||||
moreButton.isHidden = !isShowMore
|
moreIndicatorImageView.isHidden = !isShowMore
|
||||||
lineView.isHidden = !isShowMore
|
// lineView.isHidden = !isShowMore
|
||||||
|
|
||||||
invalidateIntrinsicContentSize()
|
// invalidateIntrinsicContentSize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: UI属性
|
//MARK: UI属性
|
||||||
private lazy var bgView: UIView = {
|
private(set) lazy var bgView: UIView = {
|
||||||
let view = UIView()
|
let view = UIView()
|
||||||
view.backgroundColor = .colorFFFFFF(alpha: 0.06)
|
view.backgroundColor = .colorFFFFFF(alpha: 0.06)
|
||||||
view.layer.cornerRadius = 8
|
view.layer.cornerRadius = 8
|
||||||
view.layer.masksToBounds = true
|
view.layer.masksToBounds = true
|
||||||
view.layer.borderWidth = 1
|
|
||||||
view.layer.borderColor = UIColor.colorFFFFFF(alpha: 0.14).cgColor
|
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@ -122,6 +120,7 @@ extension SPMineWalletView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc private func handleWalletButton() {
|
@objc private func handleWalletButton() {
|
||||||
|
if !isShowMore { return }
|
||||||
let vc = SPWalletViewController()
|
let vc = SPWalletViewController()
|
||||||
self.viewController?.navigationController?.pushViewController(vc, animated: true)
|
self.viewController?.navigationController?.pushViewController(vc, animated: true)
|
||||||
}
|
}
|
||||||
|
@ -112,10 +112,19 @@ class SPMyListViewController: SPViewController {
|
|||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
NotificationCenter.default.removeObserver(self)
|
||||||
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityDidChangeNotification), name: SPNetworkReachabilityManager.reachabilityDidChangeNotification, object: nil)
|
||||||
|
|
||||||
_setupUI()
|
if SPNetworkReachabilityManager.manager.isReachable != true {
|
||||||
|
setEmptyView()
|
||||||
|
} else {
|
||||||
|
_setupUI()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -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 {
|
extension SPMyListViewController {
|
||||||
private func _setupUI() {
|
private func _setupUI() {
|
||||||
addChild(pageView)
|
addChild(pageView)
|
||||||
|
@ -107,7 +107,7 @@ class SPPlayerDetailViewController: SPPlayerListViewController {
|
|||||||
//解锁视频需要的金币
|
//解锁视频需要的金币
|
||||||
let videoCoin = videoInfo.coins ?? 0
|
let videoCoin = videoInfo.coins ?? 0
|
||||||
|
|
||||||
if myCoin < videoCoin, self.viewModel.currentPlayer?.hasLockUpEpisode == true {//金币不够时打开充值页面
|
if myCoin < videoCoin, self.viewModel.currentPlayer?.hasLockUpEpisode != true {//金币不够时打开充值页面
|
||||||
self.onPlayBuy()
|
self.onPlayBuy()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -121,6 +121,11 @@ class SPPlayerListViewController: SPViewController {
|
|||||||
override func viewDidDisappear(_ animated: Bool) {
|
override func viewDidDisappear(_ animated: Bool) {
|
||||||
super.viewDidDisappear(animated)
|
super.viewDidDisappear(animated)
|
||||||
self.viewModel.currentPlayer?.pause()
|
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 --------------
|
//MARK: -------------- SPPlayerDelegate --------------
|
||||||
extension SPPlayerDetailRecommandCell: SPPlayerDelegate {
|
extension SPPlayerDetailRecommandCell: SPPlayerDelegate {
|
||||||
func sp_player(_ player: SPPlayer, loadStateDidChange state: SPPlayer.LoadState) {
|
func sp_player(_ player: SPPlayer, loadStateDidChange state: SPPlayer.LoadState) {
|
||||||
|
updateCoverShowState()
|
||||||
}
|
}
|
||||||
|
|
||||||
func sp_player(_ player: SPPlayer, playStateDidChanged state: SPPlayer.PlayState) {
|
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
|
self.coverImageView.isHidden = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,10 +211,14 @@ extension SPPlayerDetailRecommandView: ZKCycleScrollViewDelegate, ZKCycleScrollV
|
|||||||
func cycleScrollView(_ cycleScrollView: ZKCycleScrollView, didScrollFromIndex fromIndex: Int, toIndex: Int) {
|
func cycleScrollView(_ cycleScrollView: ZKCycleScrollView, didScrollFromIndex fromIndex: Int, toIndex: Int) {
|
||||||
let model = self.dataArr[toIndex]
|
let model = self.dataArr[toIndex]
|
||||||
videoNameLabel.text = model.name
|
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()
|
||||||
|
}
|
||||||
|
|
||||||
let cell = self.bannerView.cellForItem(at: toIndex) as? SPPlayerDetailRecommandCell
|
|
||||||
self.currentCell = cell
|
|
||||||
self.play()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,11 @@ class SPRewardsViewController: SPCampaignWebViewController {
|
|||||||
self.urlStr = SPRewardsWebUrl
|
self.urlStr = SPRewardsWebUrl
|
||||||
|
|
||||||
super.viewDidLoad()
|
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)
|
NotificationCenter.default.addObserver(self, selector: #selector(loginStateDidChangeNotification), name: SPLoginManager.loginStateDidChangeNotification, object: nil)
|
||||||
|
|
||||||
|
setEmptyView()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -40,7 +42,26 @@ class SPRewardsViewController: SPCampaignWebViewController {
|
|||||||
|
|
||||||
extension SPRewardsViewController {
|
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() {
|
@objc private func loginStateDidChangeNotification() {
|
||||||
self.reload()
|
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 = {
|
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
|
view.userInfo = SPLoginManager.manager.userInfo
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
@ -13,7 +13,8 @@ class SPMemberRechargeCell: SPCollectionViewCell {
|
|||||||
var model: SPPayTemplateItem? {
|
var model: SPPayTemplateItem? {
|
||||||
didSet {
|
didSet {
|
||||||
desLabel.text = model?.sp_description
|
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
|
currencyLabel.text = model?.currency
|
||||||
moneyLabel.text = model?.price
|
moneyLabel.text = model?.price
|
||||||
if let sendCoins = model?.send_coins, sendCoins > 0 {
|
if let sendCoins = model?.send_coins, sendCoins > 0 {
|
||||||
@ -120,6 +121,7 @@ class SPMemberRechargeCell: SPCollectionViewCell {
|
|||||||
|
|
||||||
private lazy var typeIconImageView: UIImageView = {
|
private lazy var typeIconImageView: UIImageView = {
|
||||||
let imageView = UIImageView()
|
let imageView = UIImageView()
|
||||||
|
imageView.isHidden = true
|
||||||
return imageView
|
return imageView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -13,14 +13,37 @@ class SPVipAlertCell: SPCollectionViewCell {
|
|||||||
didSet {
|
didSet {
|
||||||
moneyLabel.text = "\(model?.currency ?? "")\(model?.price ?? "")"
|
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 = {
|
var sp_isSelected: Bool = false {
|
||||||
let view = UIView()
|
didSet {
|
||||||
view.backgroundColor = .colorFFFFFF()
|
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.cornerRadius = 8
|
||||||
view.layer.masksToBounds = true
|
view.layer.masksToBounds = true
|
||||||
return view
|
return view
|
||||||
@ -29,21 +52,19 @@ class SPVipAlertCell: SPCollectionViewCell {
|
|||||||
private lazy var titleLabel: UILabel = {
|
private lazy var titleLabel: UILabel = {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontBold(ofSize: 18)
|
label.font = .fontBold(ofSize: 18)
|
||||||
label.textColor = .colorCA8D3B()
|
label.adjustsFontSizeToFitWidth = true
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
private lazy var desLabel: UILabel = {
|
private lazy var desLabel: UILabel = {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontMedium(ofSize: 12)
|
label.font = .fontMedium(ofSize: 12)
|
||||||
label.textColor = .colorD0C0AA()
|
|
||||||
label.text = "movia_vip_membership".localized
|
label.text = "movia_vip_membership".localized
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
private lazy var moneyBgView: SPGradientView = {
|
private lazy var moneyBgView: SPGradientView = {
|
||||||
let view = SPGradientView()
|
let view = SPGradientView()
|
||||||
view.colors = [UIColor.colorA36C2D().cgColor, UIColor.color412D11().cgColor]
|
|
||||||
view.locations = [0, 1]
|
view.locations = [0, 1]
|
||||||
view.startPoint = .init(x: 0, y: 0.5)
|
view.startPoint = .init(x: 0, y: 0.5)
|
||||||
view.endPoint = .init(x: 1, y: 0.5)
|
view.endPoint = .init(x: 1, y: 0.5)
|
||||||
@ -56,6 +77,8 @@ class SPVipAlertCell: SPCollectionViewCell {
|
|||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontBold(ofSize: 14)
|
label.font = .fontBold(ofSize: 14)
|
||||||
label.textColor = .colorFFFFFF()
|
label.textColor = .colorFFFFFF()
|
||||||
|
label.setContentHuggingPriority(.required, for: .horizontal)
|
||||||
|
label.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@ -65,7 +88,7 @@ class SPVipAlertCell: SPCollectionViewCell {
|
|||||||
|
|
||||||
contentView.layer.cornerRadius = 8
|
contentView.layer.cornerRadius = 8
|
||||||
contentView.layer.masksToBounds = true
|
contentView.layer.masksToBounds = true
|
||||||
contentView.backgroundColor = .colorCC9251()
|
|
||||||
|
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
@ -94,8 +117,9 @@ extension SPVipAlertCell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
titleLabel.snp.makeConstraints { make in
|
titleLabel.snp.makeConstraints { make in
|
||||||
make.left.equalToSuperview().offset(25)
|
make.left.equalToSuperview().offset(15)
|
||||||
make.top.equalToSuperview().offset(11)
|
make.top.equalToSuperview().offset(11)
|
||||||
|
make.right.lessThanOrEqualTo(moneyBgView.snp.left).offset(-5)
|
||||||
}
|
}
|
||||||
|
|
||||||
desLabel.snp.makeConstraints { make in
|
desLabel.snp.makeConstraints { make in
|
||||||
@ -105,7 +129,7 @@ extension SPVipAlertCell {
|
|||||||
|
|
||||||
moneyBgView.snp.makeConstraints { make in
|
moneyBgView.snp.makeConstraints { make in
|
||||||
make.centerY.equalToSuperview()
|
make.centerY.equalToSuperview()
|
||||||
make.right.equalToSuperview().offset(-25)
|
make.right.equalToSuperview().offset(-15)
|
||||||
make.height.equalTo(36)
|
make.height.equalTo(36)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ class SPVipAlertView: SPAlertView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static var isShowAlert: Bool {
|
static var isShowAlert: Bool {
|
||||||
|
#if DEBUG
|
||||||
|
return true
|
||||||
|
#else
|
||||||
guard let lastAlertDate = lastAlertDate else { return true }
|
guard let lastAlertDate = lastAlertDate else { return true }
|
||||||
let nowDate = Date()
|
let nowDate = Date()
|
||||||
|
|
||||||
@ -29,12 +32,16 @@ class SPVipAlertView: SPAlertView {
|
|||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private lazy var dataArr: [SPPayTemplateItem] = []
|
private lazy var dataArr: [SPPayTemplateItem] = []
|
||||||
///会员购买成功
|
///会员购买成功
|
||||||
var buyFinishHandle: (() -> Void)?
|
var buyFinishHandle: (() -> Void)?
|
||||||
|
|
||||||
|
private var selectedIndex = 0
|
||||||
|
|
||||||
//MARK: UI属性
|
//MARK: UI属性
|
||||||
private lazy var bgImageView: UIImageView = {
|
private lazy var bgImageView: UIImageView = {
|
||||||
let imageView = UIImageView(image: UIImage(named: "alert_bg_image_02"))
|
let imageView = UIImageView(image: UIImage(named: "alert_bg_image_02"))
|
||||||
@ -47,13 +54,15 @@ class SPVipAlertView: SPAlertView {
|
|||||||
return imageView
|
return imageView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
private lazy var vipTitleLabel: UILabel = {
|
// private lazy var vipTitleLabel: UILabel = {
|
||||||
let label = UILabel()
|
// let label = UILabel()
|
||||||
label.font = .fontMedium(ofSize: 16)
|
// label.font = .fontMedium(ofSize: 16)
|
||||||
label.textColor = .colorFFC591()
|
// label.textColor = .colorFFC591()
|
||||||
label.text = "movia_vip_alert_text_01".localized
|
// label.text = "movia_vip_alert_text_01".localized
|
||||||
return label
|
// label.numberOfLines = 2
|
||||||
}()
|
//// label.adjustsFontSizeToFitWidth = true
|
||||||
|
// return label
|
||||||
|
// }()
|
||||||
|
|
||||||
private lazy var vipTipLabel1: UILabel = {
|
private lazy var vipTipLabel1: UILabel = {
|
||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
@ -83,7 +92,7 @@ class SPVipAlertView: SPAlertView {
|
|||||||
let collectionView = SPCollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)
|
let collectionView = SPCollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)
|
||||||
collectionView.delegate = self
|
collectionView.delegate = self
|
||||||
collectionView.dataSource = self
|
collectionView.dataSource = self
|
||||||
collectionView.isScrollEnabled = false
|
collectionView.showsVerticalScrollIndicator = false
|
||||||
SPVipAlertCell.registerCell(collectionView: collectionView)
|
SPVipAlertCell.registerCell(collectionView: collectionView)
|
||||||
return collectionView
|
return collectionView
|
||||||
}()
|
}()
|
||||||
@ -97,6 +106,7 @@ class SPVipAlertView: SPAlertView {
|
|||||||
|
|
||||||
init(dataArr: [SPPayTemplateItem]) {
|
init(dataArr: [SPPayTemplateItem]) {
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
|
selectedIndex = dataArr.count - 1
|
||||||
self.dataArr = dataArr
|
self.dataArr = dataArr
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
@ -127,7 +137,7 @@ extension SPVipAlertView {
|
|||||||
contentView.addSubview(bgImageView)
|
contentView.addSubview(bgImageView)
|
||||||
contentView.addSubview(closeButton)
|
contentView.addSubview(closeButton)
|
||||||
bgImageView.addSubview(vipIconImageView)
|
bgImageView.addSubview(vipIconImageView)
|
||||||
bgImageView.addSubview(vipTitleLabel)
|
// bgImageView.addSubview(vipTitleLabel)
|
||||||
bgImageView.addSubview(vipTipLabel1)
|
bgImageView.addSubview(vipTipLabel1)
|
||||||
bgImageView.addSubview(vipTipLabel2)
|
bgImageView.addSubview(vipTipLabel2)
|
||||||
bgImageView.addSubview(collectionView)
|
bgImageView.addSubview(collectionView)
|
||||||
@ -144,16 +154,18 @@ extension SPVipAlertView {
|
|||||||
|
|
||||||
vipIconImageView.snp.makeConstraints { make in
|
vipIconImageView.snp.makeConstraints { make in
|
||||||
make.left.equalToSuperview().offset(42)
|
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
|
// vipTitleLabel.snp.makeConstraints { make in
|
||||||
make.left.equalTo(vipIconImageView)
|
// make.left.equalTo(vipIconImageView)
|
||||||
make.top.equalTo(vipIconImageView.snp.bottom).offset(11)
|
// make.top.equalTo(vipIconImageView.snp.bottom).offset(11)
|
||||||
}
|
// make.right.lessThanOrEqualToSuperview().offset(-140)
|
||||||
|
// }
|
||||||
|
|
||||||
vipTipLabel1.snp.makeConstraints { make in
|
vipTipLabel1.snp.makeConstraints { make in
|
||||||
make.left.equalTo(vipTitleLabel)
|
make.left.equalTo(vipIconImageView)
|
||||||
make.top.equalToSuperview().offset(138)
|
make.top.equalToSuperview().offset(138)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,6 +190,7 @@ extension SPVipAlertView: UICollectionViewDelegate, UICollectionViewDataSource {
|
|||||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||||
let cell = SPVipAlertCell.dequeueReusableCell(collectionView: collectionView, indexPath: indexPath)
|
let cell = SPVipAlertCell.dequeueReusableCell(collectionView: collectionView, indexPath: indexPath)
|
||||||
cell.model = dataArr[indexPath.row]
|
cell.model = dataArr[indexPath.row]
|
||||||
|
cell.sp_isSelected = indexPath.row == selectedIndex
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,6 +199,8 @@ extension SPVipAlertView: UICollectionViewDelegate, UICollectionViewDataSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||||
|
selectedIndex = indexPath.row
|
||||||
|
collectionView.reloadData()
|
||||||
let model = dataArr[indexPath.row]
|
let model = dataArr[indexPath.row]
|
||||||
|
|
||||||
SPIAPManager.manager.startRecharge(model: model, shortPlayId: nil, videoId: nil) { [weak self] finish in
|
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 = {
|
private lazy var contentView: SPMineWalletView = {
|
||||||
let view = SPMineWalletView()
|
let view = SPMineWalletView()
|
||||||
view.isShowMore = false
|
view.isShowMore = false
|
||||||
|
view.bgView.layer.borderWidth = 1
|
||||||
|
view.bgView.layer.borderColor = UIColor.colorFFFFFF(alpha: 0.14).cgColor
|
||||||
return view
|
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";
|
"q_complex" = "quarter";
|
||||||
"Y_complex" = "years";
|
"Y_complex" = "years";
|
||||||
"movia_vip_membership" = "VIP Membership";
|
"movia_vip_membership" = "VIP Membership";
|
||||||
|
"movia_library" = "Library";
|
||||||
|
|
||||||
|
|
||||||
"movia_vip_alert_text_01" = "Short Drama VIP Exclusive";
|
"movia_vip_alert_text_01" = "Short Drama VIP Exclusive";
|
||||||
|
@ -96,7 +96,7 @@ open class ZKCycleScrollViewFlowLayout: UICollectionViewFlowLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if itemAlpha {
|
if itemAlpha {
|
||||||
var alpha = 1 - abs(screenScale) + 0.2
|
var alpha = 1 - abs(screenScale) + 0.1
|
||||||
if alpha < 0 {
|
if alpha < 0 {
|
||||||
alpha = 0
|
alpha = 0
|
||||||
} else if alpha > 1 {
|
} else if alpha > 1 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user