1
This commit is contained in:
parent
38edfeb022
commit
d7a2582c86
@ -224,5 +224,13 @@ extension UIColor {
|
||||
static func colorFFD28F(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xFFD28F, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorFFFFC8(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xFFFFC8, alpha: alpha)
|
||||
}
|
||||
|
||||
static func colorF76359(alpha: CGFloat = 1) -> UIColor {
|
||||
return color(hex: 0xF76359, alpha: alpha)
|
||||
}
|
||||
}
|
||||
|
||||
|
53
MoviaBox/Base/View/SPGradientLabel.swift
Normal file
53
MoviaBox/Base/View/SPGradientLabel.swift
Normal file
@ -0,0 +1,53 @@
|
||||
//
|
||||
// SPGradientLabel.swift
|
||||
// MoviaBox
|
||||
//
|
||||
// Created by 佳尔 on 2025/4/27.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SPGradientLabel: UILabel {
|
||||
|
||||
|
||||
|
||||
private(set) var gradientLayer: CAGradientLayer = {
|
||||
// 创建渐变层
|
||||
let gradient = CAGradientLayer()
|
||||
gradient.colors = [
|
||||
UIColor.red.cgColor,
|
||||
UIColor.blue.cgColor
|
||||
]
|
||||
gradient.startPoint = CGPoint(x: 0.5, y: 0)
|
||||
gradient.endPoint = CGPoint(x: 0.5, y: 1)
|
||||
gradient.locations = [0, 1]
|
||||
return gradient
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
layer.addSublayer(gradientLayer)
|
||||
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
gradientLayer.frame = bounds
|
||||
|
||||
// 创建一个文字图层
|
||||
let textLayer = CATextLayer()
|
||||
textLayer.string = attributedText ?? NSAttributedString(string: text ?? "")
|
||||
textLayer.frame = bounds
|
||||
textLayer.alignmentMode = .center
|
||||
textLayer.contentsScale = UIScreen.main.scale
|
||||
|
||||
gradientLayer.mask = textLayer
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -28,15 +28,24 @@ class SPMineMemberView: UIView {
|
||||
//MARK: UI属性
|
||||
private lazy var bgImageView: UIImageView = {
|
||||
let imageView = UIImageView()
|
||||
imageView.image = UIImage(named: "member_bg_image_01")
|
||||
// imageView.image = UIImage(named: "member_bg_image_01")
|
||||
imageView.image = UIImage(named: "member_bg_image_02")
|
||||
imageView.contentMode = .scaleToFill
|
||||
return imageView
|
||||
}()
|
||||
|
||||
private lazy var noView: SPMineMemberNoView = {
|
||||
let view = SPMineMemberNoView()
|
||||
view.isHidden = true
|
||||
return view
|
||||
}()
|
||||
|
||||
private lazy var yesView: SPMineMemberYesView = {
|
||||
let view = SPMineMemberYesView()
|
||||
return view
|
||||
}()
|
||||
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
@ -55,6 +64,7 @@ extension SPMineMemberView {
|
||||
private func _setupUI() {
|
||||
addSubview(bgImageView)
|
||||
addSubview(noView)
|
||||
addSubview(yesView)
|
||||
|
||||
let width = kSPScreenWidth - 32
|
||||
bgImageView.snp.makeConstraints { make in
|
||||
@ -68,6 +78,10 @@ extension SPMineMemberView {
|
||||
make.edges.equalTo(bgImageView)
|
||||
}
|
||||
|
||||
yesView.snp.makeConstraints { make in
|
||||
make.edges.equalTo(bgImageView)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
64
MoviaBox/Class/Mine/View/SPMineMemberYesView.swift
Normal file
64
MoviaBox/Class/Mine/View/SPMineMemberYesView.swift
Normal file
@ -0,0 +1,64 @@
|
||||
//
|
||||
// SPMineMemberYesView.swift
|
||||
// MoviaBox
|
||||
//
|
||||
// Created by 佳尔 on 2025/4/27.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SPMineMemberYesView: UIView {
|
||||
|
||||
|
||||
private lazy var iconImageView: UIImageView = {
|
||||
let imageView = UIImageView(image: UIImage(named: "vip_icon_02"))
|
||||
return imageView
|
||||
}()
|
||||
|
||||
private lazy var titleLabel: UILabel = {
|
||||
let label = SPGradientLabel()
|
||||
label.gradientLayer.colors = [UIColor.colorFFFFC8().cgColor, UIColor.colorF76359().cgColor]
|
||||
label.font = .fontMedium(ofSize: 18)
|
||||
label.text = "VIP"
|
||||
return label
|
||||
}()
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
_setupUI()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
// titleLabelGradientLayer.frame = titleLabel.bounds
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SPMineMemberYesView {
|
||||
|
||||
private func _setupUI() {
|
||||
addSubview(iconImageView)
|
||||
addSubview(titleLabel)
|
||||
|
||||
iconImageView.snp.makeConstraints { make in
|
||||
make.left.equalToSuperview().offset(3)
|
||||
make.top.equalToSuperview().offset(6)
|
||||
}
|
||||
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.left.equalTo(iconImageView.snp.right).offset(-5)
|
||||
make.centerY.equalTo(iconImageView)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
22
MoviaBox/Source/Assets.xcassets/icon/vip_icon_02.imageset/Contents.json
vendored
Normal file
22
MoviaBox/Source/Assets.xcassets/icon/vip_icon_02.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "image 27@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "image 27@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
MoviaBox/Source/Assets.xcassets/icon/vip_icon_02.imageset/image 27@2x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/icon/vip_icon_02.imageset/image 27@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
BIN
MoviaBox/Source/Assets.xcassets/icon/vip_icon_02.imageset/image 27@3x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/icon/vip_icon_02.imageset/image 27@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Frame 208@2x.png",
|
||||
"filename" : "Frame_208@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "Frame 208@3x.png",
|
||||
"filename" : "Frame_208@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 174 KiB |
Binary file not shown.
Before Width: | Height: | Size: 351 KiB |
BIN
MoviaBox/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame_208@2x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame_208@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
BIN
MoviaBox/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame_208@3x.png
vendored
Normal file
BIN
MoviaBox/Source/Assets.xcassets/image/member_bg_image_02.imageset/Frame_208@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 340 KiB |
Loading…
x
Reference in New Issue
Block a user