个人中心样式开发

This commit is contained in:
zeng 2025-04-27 18:26:01 +08:00
parent f75e05808a
commit 4345d8e3dd
17 changed files with 290 additions and 1 deletions

View File

@ -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)
}
}

View File

@ -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)
}

View File

@ -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)
}
}

View File

@ -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)
}
}
}

View File

@ -15,7 +15,10 @@ class SPVideoInfoModel: SPModel, SmartCodable {
var episode: String?
var id: String?
var image_url: String?
///12:
var is_vip: Int?
///
var is_lock: Bool?
var promise_view_ad: Int?
// var revolution: []
var short_id: String?

View File

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 242 KiB

View File

@ -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";