个人中心会员样式
This commit is contained in:
parent
bc4f3139ec
commit
2f8018a430
@ -204,5 +204,13 @@ extension UIColor {
|
|||||||
static func colorB0B0B3(alpha: CGFloat = 1) -> UIColor {
|
static func colorB0B0B3(alpha: CGFloat = 1) -> UIColor {
|
||||||
return color(hex: 0xB0B0B3, alpha: alpha)
|
return color(hex: 0xB0B0B3, alpha: alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static func colorBBB9B3(alpha: CGFloat = 1) -> UIColor {
|
||||||
|
return color(hex: 0xBBB9B3, alpha: alpha)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func colorFFD791(alpha: CGFloat = 1) -> UIColor {
|
||||||
|
return color(hex: 0xFFD791, alpha: alpha)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,11 +12,21 @@ class SPMineHeaderView: UIView {
|
|||||||
var contentHeight: CGFloat {
|
var contentHeight: CGFloat {
|
||||||
var height: CGFloat = kSPStatusbarHeight + 108
|
var height: CGFloat = kSPStatusbarHeight + 108
|
||||||
|
|
||||||
|
var stackHeight = 0.0
|
||||||
|
stackHeight += memberView.intrinsicContentSize.height
|
||||||
|
|
||||||
if playHistoryArr?.count ?? 0 > 0 {
|
if playHistoryArr?.count ?? 0 > 0 {
|
||||||
height += playHistoryView.contentHeight
|
stackHeight += self.stackView.spacing
|
||||||
|
stackHeight += playHistoryView.contentHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if stackHeight > 0 {
|
||||||
|
height += stackHeight
|
||||||
height += 10
|
height += 10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return height
|
return height
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,11 +45,8 @@ class SPMineHeaderView: UIView {
|
|||||||
|
|
||||||
var playHistoryArr: [SPShortModel]? {
|
var playHistoryArr: [SPShortModel]? {
|
||||||
didSet {
|
didSet {
|
||||||
stackView.removeAllArrangedSubview()
|
updateStackViewLayout()
|
||||||
|
|
||||||
if let arr = playHistoryArr, arr.count > 0 {
|
|
||||||
stackView.addArrangedSubview(playHistoryView)
|
|
||||||
}
|
|
||||||
|
|
||||||
playHistoryView.dataArr = playHistoryArr
|
playHistoryView.dataArr = playHistoryArr
|
||||||
}
|
}
|
||||||
@ -84,9 +91,17 @@ class SPMineHeaderView: UIView {
|
|||||||
private lazy var stackView: UIStackView = {
|
private lazy var stackView: UIStackView = {
|
||||||
let view = UIStackView()
|
let view = UIStackView()
|
||||||
view.axis = .vertical
|
view.axis = .vertical
|
||||||
|
view.spacing = 12
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
///会员视图
|
||||||
|
private lazy var memberView: SPMineMemberView = {
|
||||||
|
let view = SPMineMemberView()
|
||||||
|
return view
|
||||||
|
}()
|
||||||
|
|
||||||
|
///播放记录
|
||||||
private lazy var playHistoryView: SPMinePlayHistoryView = {
|
private lazy var playHistoryView: SPMinePlayHistoryView = {
|
||||||
let view = SPMinePlayHistoryView()
|
let view = SPMinePlayHistoryView()
|
||||||
return view
|
return view
|
||||||
@ -109,6 +124,7 @@ class SPMineHeaderView: UIView {
|
|||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
updateStackViewLayout()
|
||||||
_setupUI()
|
_setupUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,6 +132,19 @@ class SPMineHeaderView: UIView {
|
|||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func updateStackViewLayout() {
|
||||||
|
stackView.removeAllArrangedSubview()
|
||||||
|
|
||||||
|
stackView.addArrangedSubview(memberView)
|
||||||
|
|
||||||
|
if let arr = playHistoryArr, arr.count > 0 {
|
||||||
|
stackView.addArrangedSubview(playHistoryView)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extension SPMineHeaderView {
|
||||||
@objc private func handleCopyButton() {
|
@objc private func handleCopyButton() {
|
||||||
SPAPPTool.copy(text: userInfo?.customer_id)
|
SPAPPTool.copy(text: userInfo?.customer_id)
|
||||||
|
|
||||||
@ -171,7 +200,7 @@ extension SPMineHeaderView {
|
|||||||
loginButton.snp.makeConstraints { make in
|
loginButton.snp.makeConstraints { make in
|
||||||
make.right.equalToSuperview().offset(-16)
|
make.right.equalToSuperview().offset(-16)
|
||||||
make.height.equalTo(30)
|
make.height.equalTo(30)
|
||||||
make.width.equalTo(76)
|
make.width.equalTo(loginWidth)
|
||||||
make.centerY.equalTo(avatarImageView)
|
make.centerY.equalTo(avatarImageView)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
78
Thimra/Class/Mine/View/SPMineMemberNoView.swift
Normal file
78
Thimra/Class/Mine/View/SPMineMemberNoView.swift
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
//
|
||||||
|
// SPMineMemberNoView.swift
|
||||||
|
// Thimra
|
||||||
|
//
|
||||||
|
// Created by 佳尔 on 2025/4/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
class SPMineMemberNoView: UIView {
|
||||||
|
|
||||||
|
|
||||||
|
//MARK: UI属性
|
||||||
|
private lazy var iconImageView: UIImageView = {
|
||||||
|
let imageView = UIImageView(image: UIImage(named: "vip_icon_01"))
|
||||||
|
return imageView
|
||||||
|
}()
|
||||||
|
|
||||||
|
private lazy var titleLabel: UILabel = {
|
||||||
|
let label = UILabel()
|
||||||
|
label.text = "You are not a member yet".localized
|
||||||
|
label.textColor = .colorBBB9B3()
|
||||||
|
label.font = .fontMedium(ofSize: 16)
|
||||||
|
label.adjustsFontSizeToFitWidth = true
|
||||||
|
return label
|
||||||
|
}()
|
||||||
|
|
||||||
|
|
||||||
|
private lazy var activateButton: UIButton = {
|
||||||
|
let button = JXButton(type: .custom)
|
||||||
|
button.leftAnyRightmargin = 13
|
||||||
|
button.setTitle("Activate".localized, for: .normal)
|
||||||
|
button.setTitleColor(.colorFFD791(), for: .normal)
|
||||||
|
button.jx_font = .fontMedium(ofSize: 14)
|
||||||
|
button.layer.cornerRadius = 14
|
||||||
|
button.layer.masksToBounds = true
|
||||||
|
button.layer.borderWidth = 1
|
||||||
|
button.layer.borderColor = UIColor.colorFFD791().cgColor
|
||||||
|
return button
|
||||||
|
}()
|
||||||
|
|
||||||
|
override init(frame: CGRect) {
|
||||||
|
super.init(frame: frame)
|
||||||
|
_setupUI()
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extension SPMineMemberNoView {
|
||||||
|
|
||||||
|
private func _setupUI() {
|
||||||
|
addSubview(iconImageView)
|
||||||
|
addSubview(titleLabel)
|
||||||
|
addSubview(activateButton)
|
||||||
|
|
||||||
|
iconImageView.snp.makeConstraints { make in
|
||||||
|
make.left.equalToSuperview().offset(12)
|
||||||
|
make.top.equalToSuperview().offset(15)
|
||||||
|
}
|
||||||
|
|
||||||
|
titleLabel.snp.makeConstraints { make in
|
||||||
|
make.left.equalTo(iconImageView.snp.right).offset(4)
|
||||||
|
make.centerY.equalTo(iconImageView)
|
||||||
|
make.right.lessThanOrEqualToSuperview().offset(-12)
|
||||||
|
}
|
||||||
|
|
||||||
|
activateButton.snp.makeConstraints { make in
|
||||||
|
make.right.equalToSuperview().offset(-18)
|
||||||
|
make.bottom.equalToSuperview().offset(-14)
|
||||||
|
make.height.equalTo(28)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
73
Thimra/Class/Mine/View/SPMineMemberView.swift
Normal file
73
Thimra/Class/Mine/View/SPMineMemberView.swift
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
//
|
||||||
|
// SPMineMemberView.swift
|
||||||
|
// Thimra
|
||||||
|
//
|
||||||
|
// Created by 佳尔 on 2025/4/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
class SPMineMemberView: UIView {
|
||||||
|
|
||||||
|
|
||||||
|
override var intrinsicContentSize: CGSize {
|
||||||
|
let width = kSPScreenWidth - 32
|
||||||
|
return CGSize(width: width, height: width * bgRatio)
|
||||||
|
}
|
||||||
|
|
||||||
|
///背景图宽高比
|
||||||
|
var bgRatio: CGFloat {
|
||||||
|
let imageSize = bgImageView.image?.size ?? .zero
|
||||||
|
if imageSize == .zero {
|
||||||
|
return 1
|
||||||
|
} else {
|
||||||
|
return imageSize.height / imageSize.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//MARK: UI属性
|
||||||
|
private lazy var bgImageView: UIImageView = {
|
||||||
|
let imageView = UIImageView()
|
||||||
|
imageView.image = UIImage(named: "member_bg_image_01")
|
||||||
|
return imageView
|
||||||
|
}()
|
||||||
|
|
||||||
|
private lazy var noView: SPMineMemberNoView = {
|
||||||
|
let view = SPMineMemberNoView()
|
||||||
|
return view
|
||||||
|
}()
|
||||||
|
|
||||||
|
override init(frame: CGRect) {
|
||||||
|
super.init(frame: frame)
|
||||||
|
|
||||||
|
_setupUI()
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extension SPMineMemberView {
|
||||||
|
|
||||||
|
private func _setupUI() {
|
||||||
|
addSubview(bgImageView)
|
||||||
|
addSubview(noView)
|
||||||
|
|
||||||
|
let width = kSPScreenWidth - 32
|
||||||
|
bgImageView.snp.makeConstraints { make in
|
||||||
|
make.top.equalToSuperview()
|
||||||
|
make.left.equalToSuperview().offset(16)
|
||||||
|
make.centerX.equalToSuperview()
|
||||||
|
make.height.equalTo(width * bgRatio)
|
||||||
|
}
|
||||||
|
|
||||||
|
noView.snp.makeConstraints { make in
|
||||||
|
make.edges.equalTo(bgImageView)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,7 +10,7 @@ import UIKit
|
|||||||
class SPMinePlayHistoryView: UIView {
|
class SPMinePlayHistoryView: UIView {
|
||||||
|
|
||||||
var contentHeight: CGFloat {
|
var contentHeight: CGFloat {
|
||||||
return collectionViewLayout.itemSize.height + 20 + 12
|
return 8 + collectionViewLayout.itemSize.height + 20 + 12
|
||||||
}
|
}
|
||||||
|
|
||||||
override var intrinsicContentSize: CGSize {
|
override var intrinsicContentSize: CGSize {
|
||||||
@ -91,7 +91,7 @@ extension SPMinePlayHistoryView {
|
|||||||
|
|
||||||
titleIconImageView.snp.makeConstraints { make in
|
titleIconImageView.snp.makeConstraints { make in
|
||||||
make.left.equalToSuperview().offset(16)
|
make.left.equalToSuperview().offset(16)
|
||||||
make.top.equalToSuperview()
|
make.top.equalToSuperview().offset(8)
|
||||||
}
|
}
|
||||||
|
|
||||||
titleLabel.snp.makeConstraints { make in
|
titleLabel.snp.makeConstraints { make in
|
||||||
|
22
Thimra/Source/Assets.xcassets/icon/vip_icon_01.imageset/Contents.json
vendored
Normal file
22
Thimra/Source/Assets.xcassets/icon/vip_icon_01.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "Group 57@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "Group 57@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
Thimra/Source/Assets.xcassets/icon/vip_icon_01.imageset/Group 57@2x.png
vendored
Normal file
BIN
Thimra/Source/Assets.xcassets/icon/vip_icon_01.imageset/Group 57@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
BIN
Thimra/Source/Assets.xcassets/icon/vip_icon_01.imageset/Group 57@3x.png
vendored
Normal file
BIN
Thimra/Source/Assets.xcassets/icon/vip_icon_01.imageset/Group 57@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
22
Thimra/Source/Assets.xcassets/image/member_bg_image_01.imageset/Contents.json
vendored
Normal file
22
Thimra/Source/Assets.xcassets/image/member_bg_image_01.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "Group 63@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "Group 63@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@2x.png
vendored
Normal file
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@3x.png
vendored
Normal file
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_01.imageset/Group 63@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 239 KiB |
22
Thimra/Source/Assets.xcassets/image/member_bg_image_02.imageset/Contents.json
vendored
Normal file
22
Thimra/Source/Assets.xcassets/image/member_bg_image_02.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "Frame 208@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "Frame 208@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame 208@2x.png
vendored
Normal file
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame 208@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 174 KiB |
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame 208@3x.png
vendored
Normal file
BIN
Thimra/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame 208@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 351 KiB |
@ -51,7 +51,8 @@
|
|||||||
"List of Third-Party Sharing of Personal Information" = "List of Third-Party Sharing of Personal Information";
|
"List of Third-Party Sharing of Personal Information" = "List of Third-Party Sharing of Personal Information";
|
||||||
"Explicit List of Personal Information Collection" = "Explicit List of Personal Information Collection";
|
"Explicit List of Personal Information Collection" = "Explicit List of Personal Information Collection";
|
||||||
"Log in" = "Log in";
|
"Log in" = "Log in";
|
||||||
|
"You are not a member yet" = "You are not a member yet";
|
||||||
|
"Activate" = "Activate";
|
||||||
|
|
||||||
|
|
||||||
"kLoginAgreementText" = "By continuing, you agree to the User Agreement and Privacy Policy";
|
"kLoginAgreementText" = "By continuing, you agree to the User Agreement and Privacy Policy";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user