Commit 986e92fc authored by Steven杜宇's avatar Steven杜宇

// 我的首页

parent 1123ab9a
...@@ -1193,6 +1193,7 @@ ...@@ -1193,6 +1193,7 @@
04AFEF452D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF442D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift */; }; 04AFEF452D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF442D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift */; };
04AFEF492D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF482D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift */; }; 04AFEF492D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF482D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift */; };
04AFEF4B2D5DF3710007A011 /* YHMyUserInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */; }; 04AFEF4B2D5DF3710007A011 /* YHMyUserInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */; };
04AFEF4D2D5EEF860007A011 /* YHUserVipInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04AFEF4C2D5EEF860007A011 /* YHUserVipInfoView.swift */; };
04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; }; 04E4CF3E2D5C6D32004D4013 /* YHCountryMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */; };
04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; }; 04E4CF402D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */; };
04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */; }; 04EA376D2BEA06EF00DBAF64 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */; };
...@@ -2424,6 +2425,7 @@ ...@@ -2424,6 +2425,7 @@
04AFEF442D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFunctionGroup2Cell.swift; sourceTree = "<group>"; }; 04AFEF442D5DDCCB0007A011 /* YHMyFunctionGroup2Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFunctionGroup2Cell.swift; sourceTree = "<group>"; };
04AFEF482D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFunctionGroupItem2Cell.swift; sourceTree = "<group>"; }; 04AFEF482D5DDE180007A011 /* YHMyFunctionGroupItem2Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFunctionGroupItem2Cell.swift; sourceTree = "<group>"; };
04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyUserInfoView.swift; sourceTree = "<group>"; }; 04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyUserInfoView.swift; sourceTree = "<group>"; };
04AFEF4C2D5EEF860007A011 /* YHUserVipInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserVipInfoView.swift; sourceTree = "<group>"; };
04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.swift; sourceTree = "<group>"; }; 04E4CF3D2D5C6D32004D4013 /* YHCountryMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCountryMessageView.swift; sourceTree = "<group>"; };
04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; }; 04E4CF3F2D5C83AE004D4013 /* YHSelectPhoneCountryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSelectPhoneCountryViewController.swift; sourceTree = "<group>"; };
04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 04EA376C2BEA06EF00DBAF64 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
...@@ -5781,6 +5783,7 @@ ...@@ -5781,6 +5783,7 @@
045C0EF82D12CA5E00BD2DC0 /* YHPersonalCenterCell.swift */, 045C0EF82D12CA5E00BD2DC0 /* YHPersonalCenterCell.swift */,
045C0EF92D12CA5E00BD2DC0 /* YHUserInfoHeaderView.swift */, 045C0EF92D12CA5E00BD2DC0 /* YHUserInfoHeaderView.swift */,
04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */, 04AFEF4A2D5DF3710007A011 /* YHMyUserInfoView.swift */,
04AFEF4C2D5EEF860007A011 /* YHUserVipInfoView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -7239,6 +7242,7 @@ ...@@ -7239,6 +7242,7 @@
045C11282D12CA5F00BD2DC0 /* YHH5WebViewVC.swift in Sources */, 045C11282D12CA5F00BD2DC0 /* YHH5WebViewVC.swift in Sources */,
045C11292D12CA5F00BD2DC0 /* YHAIMessageModel.swift in Sources */, 045C11292D12CA5F00BD2DC0 /* YHAIMessageModel.swift in Sources */,
045C112A2D12CA5F00BD2DC0 /* YHBasicInfoFillBottomView.swift in Sources */, 045C112A2D12CA5F00BD2DC0 /* YHBasicInfoFillBottomView.swift in Sources */,
04AFEF4D2D5EEF860007A011 /* YHUserVipInfoView.swift in Sources */,
045C112B2D12CA5F00BD2DC0 /* YHResignUploadDocListProgressModel.swift in Sources */, 045C112B2D12CA5F00BD2DC0 /* YHResignUploadDocListProgressModel.swift in Sources */,
045C112C2D12CA5F00BD2DC0 /* YHPersonalCenterCell.swift in Sources */, 045C112C2D12CA5F00BD2DC0 /* YHPersonalCenterCell.swift in Sources */,
045C112D2D12CA5F00BD2DC0 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */, 045C112D2D12CA5F00BD2DC0 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */,
......
...@@ -346,7 +346,8 @@ extension YHMyNewViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -346,7 +346,8 @@ extension YHMyNewViewController : UITableViewDelegate, UITableViewDataSource {
// } // }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
return 113.0
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
...@@ -359,8 +360,8 @@ extension YHMyNewViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -359,8 +360,8 @@ extension YHMyNewViewController : UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let v = YHUserVipInfoView(frame: CGRectMake(0, 0, tableView.width, 113))
return UIView() return v
} }
} }
...@@ -99,6 +99,12 @@ class YHMyUserInfoView: UIView { ...@@ -99,6 +99,12 @@ class YHMyUserInfoView: UIView {
return line return line
}() }()
lazy var vipImgView: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "mine_vip_1")
return imgV
}()
lazy var arrowImgView: UIImageView = { lazy var arrowImgView: UIImageView = {
let imgV = UIImageView() let imgV = UIImageView()
imgV.image = UIImage(named: "form_right_arrow") imgV.image = UIImage(named: "form_right_arrow")
...@@ -125,6 +131,7 @@ class YHMyUserInfoView: UIView { ...@@ -125,6 +131,7 @@ class YHMyUserInfoView: UIView {
self.addSubview(contentView) self.addSubview(contentView)
contentView.addSubview(avarImgView) contentView.addSubview(avarImgView)
contentView.addSubview(userNameLabel) contentView.addSubview(userNameLabel)
contentView.addSubview(vipImgView)
contentView.addSubview(likeLabel) contentView.addSubview(likeLabel)
contentView.addSubview(collectLabel) contentView.addSubview(collectLabel)
...@@ -150,10 +157,17 @@ class YHMyUserInfoView: UIView { ...@@ -150,10 +157,17 @@ class YHMyUserInfoView: UIView {
userNameLabel.snp.makeConstraints { make in userNameLabel.snp.makeConstraints { make in
make.left.equalTo(avarImgView.snp.right).offset(16) make.left.equalTo(avarImgView.snp.right).offset(16)
make.top.equalTo(avarImgView) make.top.equalTo(avarImgView)
make.right.equalTo(arrowImgView.snp.left)
make.height.equalTo(29.0) make.height.equalTo(29.0)
} }
vipImgView.snp.makeConstraints { make in
make.width.equalTo(43)
make.height.equalTo(16)
make.centerY.equalTo(userNameLabel)
make.left.equalTo(userNameLabel.snp.right).offset(8)
make.right.lessThanOrEqualTo(arrowImgView.snp.left).offset(0)
}
likeLabel.snp.makeConstraints { make in likeLabel.snp.makeConstraints { make in
make.left.equalTo(userNameLabel) make.left.equalTo(userNameLabel)
make.right.equalTo(line1View.snp.left).offset(-12) make.right.equalTo(line1View.snp.left).offset(-12)
...@@ -215,7 +229,6 @@ class YHMyUserInfoView: UIView { ...@@ -215,7 +229,6 @@ class YHMyUserInfoView: UIView {
} else if label.tag == Self.scanTag { } else if label.tag == Self.scanTag {
text = "最近浏览" text = "最近浏览"
} }
let attrStr = NSMutableAttributedString(string: "") let attrStr = NSMutableAttributedString(string: "")
......
//
// YHUserVipInfoView.swift
// galaxy
//
// Created by Dufet on 2025/2/14.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHUserVipFunctionInfoView: UIView {
var title: String = "" {
didSet {
titleLabel.text = title
}
}
var desc: String = "" {
didSet {
descLabel.text = title
}
}
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .white
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize: 12)
return label
}()
lazy var descLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor(hex: 0xFFFFFF, alpha: 0.6)
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize: 10)
return label
}()
lazy var lineView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xFFFFFF, alpha: 0.16)
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.clipsToBounds = true
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func createUI() {
self.addSubview(lineView)
self.addSubview(titleLabel)
self.addSubview(descLabel)
lineView.snp.makeConstraints { make in
make.width.equalTo(1)
make.height.equalTo(33)
make.left.equalTo(0)
make.centerY.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(12)
make.height.equalTo(17)
}
descLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(2)
make.height.equalTo(14)
}
}
}
class YHUserVipInfoView: UIView {
lazy var bgImgView: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "mine_member_bg_vip_1")
return imgV
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.text = "大众会员"
label.textColor = .white
label.textAlignment = .left
label.font = UIFont.PFSC_B(ofSize: 17)
return label
}()
lazy var growValueLabel: UILabel = {
let label = UILabel()
label.textAlignment = .left
return label
}()
lazy var function1View: YHUserVipFunctionInfoView = {
let v = YHUserVipFunctionInfoView(frame: .zero)
v.lineView.isHidden = true
v.title = "舒适出行"
v.desc = "深港专车服务"
return v
}()
lazy var function2View: YHUserVipFunctionInfoView = {
let v = YHUserVipFunctionInfoView(frame: .zero)
v.title = "奢华会客"
v.desc = "北上深港体验中心"
return v
}()
lazy var function3View: YHUserVipFunctionInfoView = {
let v = YHUserVipFunctionInfoView(frame: .zero)
v.title = "高端私董会"
v.desc = "打造高端人脉圈子"
return v
}()
lazy var rightBtn: UIButton = {
let btn = UIButton()
btn.backgroundColor = .init(hex:0x323849)
btn.titleLabel?.font = .PFSC_M(ofSize:10)
btn.setTitle("更多权益", for: .normal)
btn.setTitleColor(.white, for: .normal)
btn.layer.cornerRadius = 15.0
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.clipsToBounds = true
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func createUI() {
self.addSubview(bgImgView)
self.addSubview(titleLabel)
self.addSubview(growValueLabel)
self.addSubview(rightBtn)
self.addSubview(function1View)
self.addSubview(function2View)
self.addSubview(function3View)
bgImgView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.bottom.equalTo(self.snp.centerY).offset(-16)
make.left.equalTo(16)
make.height.equalTo(24)
make.width.equalTo(68)
}
growValueLabel.snp.makeConstraints { make in
make.centerY.equalTo(titleLabel)
make.left.equalTo(titleLabel.snp.right).offset(4)
make.height.equalTo(17)
make.right.equalTo(rightBtn.snp.left).offset(-16)
}
rightBtn.snp.makeConstraints { make in
make.height.equalTo(30)
make.width.equalTo(72)
make.centerY.equalTo(titleLabel)
make.right.equalTo(-16)
}
function1View.snp.makeConstraints { make in
make.left.equalTo(0)
make.top.equalTo(self.snp.centerY)
make.bottom.equalTo(0)
make.width.equalTo(function2View)
}
function2View.snp.makeConstraints { make in
make.left.equalTo(function1View.snp.right)
make.top.equalTo(function1View)
make.bottom.equalTo(0)
make.width.equalTo(function3View)
}
function3View.snp.makeConstraints { make in
make.left.equalTo(function2View.snp.right)
make.right.equalTo(0)
make.top.equalTo(function1View)
make.bottom.equalTo(0)
}
self.update(growValue: 0)
}
func update(growValue: Int) {
let text = "当前成长值"
let count = "\(growValue)"
let attrStr = NSMutableAttributedString(string: "")
let countAttrStr = NSAttributedString(
string: count,
attributes: [NSAttributedString.Key.foregroundColor: UIColor(hex: 0xFFFFFF, alpha: 0.6),
NSAttributedString.Key.font: UIFont(name: "DINAlternate-Bold", size: 13)!])
let titleAttrStr = NSAttributedString(
string: text,
attributes: [NSAttributedString.Key.foregroundColor: UIColor(hex: 0xFFFFFF, alpha: 0.6),
NSAttributedString.Key.font: UIFont.PFSC_R(ofSize: 12)])
attrStr.append(titleAttrStr)
attrStr.append(countAttrStr)
growValueLabel.attributedText = attrStr
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197226@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197226@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197225@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197225@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197211@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197211@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197212@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197212@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment