diff --git a/MoviaBox/Base/Extension/UIColor+SPAdd.swift b/MoviaBox/Base/Extension/UIColor+SPAdd.swift index 89a4c37..fd552e5 100644 --- a/MoviaBox/Base/Extension/UIColor+SPAdd.swift +++ b/MoviaBox/Base/Extension/UIColor+SPAdd.swift @@ -232,5 +232,25 @@ extension UIColor { static func colorF76359(alpha: CGFloat = 1) -> UIColor { return color(hex: 0xF76359, alpha: alpha) } + + static func colorFFD5B2(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0xFFD5B2, alpha: alpha) + } + + static func color321704(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0x321704, alpha: alpha) + } + + static func colorF2A3A3(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0xF2A3A3, alpha: alpha) + } + + static func colorFEE095(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0xFEE095, alpha: alpha) + } + + static func color0D0807(alpha: CGFloat = 1) -> UIColor { + return color(hex: 0x0D0807, alpha: alpha) + } } diff --git a/MoviaBox/Class/Mine/View/SPMineHeaderView.swift b/MoviaBox/Class/Mine/View/SPMineHeaderView.swift index fae22f0..7680903 100644 --- a/MoviaBox/Class/Mine/View/SPMineHeaderView.swift +++ b/MoviaBox/Class/Mine/View/SPMineHeaderView.swift @@ -14,6 +14,7 @@ class SPMineHeaderView: UIView { var stackHeight = 0.0 stackHeight += memberView.intrinsicContentSize.height + stackHeight += walletView.intrinsicContentSize.height if playHistoryArr?.count ?? 0 > 0 { stackHeight += self.stackView.spacing @@ -101,6 +102,12 @@ class SPMineHeaderView: UIView { return view }() + ///钱包 + private lazy var walletView: SPMineWalletView = { + let view = SPMineWalletView() + return view + }() + ///播放记录 private lazy var playHistoryView: SPMinePlayHistoryView = { let view = SPMinePlayHistoryView() @@ -137,6 +144,8 @@ class SPMineHeaderView: UIView { stackView.addArrangedSubview(memberView) + stackView.addArrangedSubview(walletView) + if let arr = playHistoryArr, arr.count > 0 { stackView.addArrangedSubview(playHistoryView) } diff --git a/MoviaBox/Class/Mine/View/SPMineMemberYesView.swift b/MoviaBox/Class/Mine/View/SPMineMemberYesView.swift index b08a41b..d3b03a8 100644 --- a/MoviaBox/Class/Mine/View/SPMineMemberYesView.swift +++ b/MoviaBox/Class/Mine/View/SPMineMemberYesView.swift @@ -10,6 +10,7 @@ import UIKit class SPMineMemberYesView: UIView { + //MARK: UI属性 private lazy var iconImageView: UIImageView = { let imageView = UIImageView(image: UIImage(named: "vip_icon_02")) return imageView @@ -23,6 +24,29 @@ class SPMineMemberYesView: UIView { return label }() + private lazy var expirationTimeLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFD5B2() + label.text = "VlP expiration time : 2023-11-23" + return label + }() + + private lazy var openButton: UIButton = { + let button = JXButton(type: .custom) + button.setTitle("Stream Unlimited".localized, for: .normal) + button.setTitleColor(.color321704(), for: .normal) + button.jx_font = .fontRegular(ofSize: 12) + button.leftAnyRightmargin = 12 + button.colors = [UIColor.colorF2A3A3().cgColor, UIColor.colorFEE095().cgColor] + button.locations = [0, 1] + button.startPoint = .init(x: 0, y: 0.5) + button.endPoint = .init(x: 1, y: 0.5) + button.layer.cornerRadius = 11 + button.layer.masksToBounds = true + return button + }() + override init(frame: CGRect) { super.init(frame: frame) @@ -46,10 +70,12 @@ extension SPMineMemberYesView { private func _setupUI() { addSubview(iconImageView) addSubview(titleLabel) + addSubview(expirationTimeLabel) + addSubview(openButton) iconImageView.snp.makeConstraints { make in make.left.equalToSuperview().offset(3) - make.top.equalToSuperview().offset(6) + make.top.equalToSuperview().offset(12) } titleLabel.snp.makeConstraints { make in @@ -57,6 +83,17 @@ extension SPMineMemberYesView { make.centerY.equalTo(iconImageView) } + expirationTimeLabel.snp.makeConstraints { make in + make.left.equalToSuperview().offset(14) + make.bottom.equalTo(openButton.snp.top).offset(kSPMainW(-10)) + } + + openButton.snp.makeConstraints { make in + make.left.equalToSuperview().offset(12) + make.bottom.equalToSuperview().offset(-16) + make.height.equalTo(22) + } + } diff --git a/MoviaBox/Class/Mine/View/SPMineWalletView.swift b/MoviaBox/Class/Mine/View/SPMineWalletView.swift new file mode 100644 index 0000000..1d35f07 --- /dev/null +++ b/MoviaBox/Class/Mine/View/SPMineWalletView.swift @@ -0,0 +1,151 @@ +// +// SPMineWalletView.swift +// MoviaBox +// +// Created by 佳尔 on 2025/4/27. +// + +import UIKit + +class SPMineWalletView: UIView { + + override var intrinsicContentSize: CGSize { + return .init(width: kSPScreenWidth, height: 119) + } + + //MARK: UI属性 + private lazy var bgView: UIView = { + let view = UIView() + view.backgroundColor = .colorFFFFFF(alpha: 0.06) + view.layer.cornerRadius = 8 + view.layer.masksToBounds = true + return view + }() + + private lazy var moreButton: UIButton = { + let button = UIButton(type: .custom) + return button + }() + + private lazy var moreTitleLabel: UILabel = { + let label = UILabel() + label.font = .fontRegular(ofSize: 12) + label.textColor = .colorFFFFFF() + label.text = "My wallet".localized + return label + }() + + private lazy var moreIndicatorImageView: UIImageView = { + let imageView = UIImageView(image: UIImage(named: "arrow_right_icon_02")) + return imageView + }() + + private lazy var lineView: UIView = { + let view = UIView() + view.backgroundColor = .color0D0807() + return view + }() + + private lazy var storeButton: UIButton = { + let button = UIButton(type: .custom) + button.setBackgroundImage(UIImage(named: "store_button_01"), for: .normal) + button.setTitle("Store".localized, for: .normal) + button.setTitleColor(.colorFFFFFF(), for: .normal) + button.titleLabel?.font = .fontMedium(ofSize: 18) + return button + }() + + private lazy var coinButton: UIButton = { + let button = JXButton(type: .custom) + button.isUserInteractionEnabled = false + button.setImage(UIImage(named: "coin_icon_01"), for: .normal) + button.setTitleColor(.colorFFFFFF(), for: .normal) + button.jx_font = .fontMedium(ofSize: 18) + button.space = 2 + return button + }() + ///赠送的金币 + private lazy var complimentaryCoinButton: UIButton = { + let button = JXButton(type: .custom) + button.isUserInteractionEnabled = false + button.setImage(UIImage(named: "coin_icon_02"), for: .normal) + button.setTitleColor(.colorFFFFFF(), for: .normal) + button.jx_font = .fontMedium(ofSize: 18) + button.space = 2 + return button + }() + + + override init(frame: CGRect) { + super.init(frame: frame) + coinButton.setTitle("0", for: .normal) + complimentaryCoinButton.setTitle("0", for: .normal) + + + _setupUI() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +extension SPMineWalletView { + + private func _setupUI() { + addSubview(bgView) + bgView.addSubview(moreButton) + moreButton.addSubview(moreTitleLabel) + moreButton.addSubview(moreIndicatorImageView) + bgView.addSubview(lineView) + bgView.addSubview(storeButton) + bgView.addSubview(coinButton) + bgView.addSubview(complimentaryCoinButton) + + bgView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(16) + make.centerX.equalToSuperview() + make.top.bottom.equalToSuperview() + } + + moreButton.snp.makeConstraints { make in + make.left.equalToSuperview() + make.top.right.equalToSuperview() + make.height.equalTo(36) + } + + moreTitleLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.left.equalToSuperview().offset(12) + } + + moreIndicatorImageView.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.right.equalToSuperview().offset(-12) + } + + lineView.snp.makeConstraints { make in + make.left.equalToSuperview().offset(12) + make.centerX.equalToSuperview() + make.top.equalTo(moreButton.snp.bottom) + make.height.equalTo(1) + } + + storeButton.snp.makeConstraints { make in + make.right.equalToSuperview().offset(-12) + make.bottom.equalToSuperview().offset(-21) + } + + coinButton.snp.makeConstraints { make in + make.left.equalToSuperview().offset(8) + make.centerY.equalTo(storeButton) + } + + complimentaryCoinButton.snp.makeConstraints { make in + make.left.equalTo(coinButton.snp.right).offset(10) + make.centerY.equalTo(storeButton) + } + } + + +} diff --git a/MoviaBox/Class/Player/Model/SPVideoInfoModel.swift b/MoviaBox/Class/Player/Model/SPVideoInfoModel.swift index 184536b..5f56992 100644 --- a/MoviaBox/Class/Player/Model/SPVideoInfoModel.swift +++ b/MoviaBox/Class/Player/Model/SPVideoInfoModel.swift @@ -15,7 +15,10 @@ class SPVideoInfoModel: SPModel, SmartCodable { var episode: String? var id: String? var image_url: String? + ///1:会员,2: 非会员 var is_vip: Int? + ///是否锁定,购买后解锁 + var is_lock: Bool? var promise_view_ad: Int? // var revolution: [] var short_id: String? diff --git a/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Contents.json b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Contents.json new file mode 100644 index 0000000..f910615 --- /dev/null +++ b/MoviaBox/Source/Assets.xcassets/icon/coin_icon_01.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame 1912056653@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame 1912056653@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} 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/store_button_01.imageset/Contents.json b/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Contents.json new file mode 100644 index 0000000..2202cc8 --- /dev/null +++ b/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Frame 203@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Frame 203@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Frame 203@2x.png b/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Frame 203@2x.png new file mode 100644 index 0000000..0bddb30 Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Frame 203@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Frame 203@3x.png b/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Frame 203@3x.png new file mode 100644 index 0000000..4eaf52d Binary files /dev/null and b/MoviaBox/Source/Assets.xcassets/icon/store_button_01.imageset/Frame 203@3x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@2x.png b/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@2x.png index 96f6a15..8e94e3b 100644 Binary files a/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@2x.png and b/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@2x.png differ diff --git a/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@3x.png b/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@3x.png index 41ab047..adad307 100644 Binary files a/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@3x.png and b/MoviaBox/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@3x.png differ diff --git a/MoviaBox/Source/en.lproj/Localizable.strings b/MoviaBox/Source/en.lproj/Localizable.strings index a134b39..5bd93c9 100644 --- a/MoviaBox/Source/en.lproj/Localizable.strings +++ b/MoviaBox/Source/en.lproj/Localizable.strings @@ -55,6 +55,9 @@ "Activate" = "Activate"; "Members can enjoy" = "Members can enjoy"; "Unlimited access to all series" = "Unlimited access to all series"; +"Stream Unlimited" = "Stream Unlimited"; +"My wallet" = "My wallet"; +"Store" = "Store"; "kLoginAgreementText" = "By continuing, you agree to the User Agreement and Privacy Policy";