Commit a88fbdcb authored by Steven杜宇's avatar Steven杜宇

// 我的好友

parent 4cc2e39e
...@@ -313,6 +313,7 @@ ...@@ -313,6 +313,7 @@
04F957452C1FEC4A003C631C /* YHMessageBellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F957442C1FEC4A003C631C /* YHMessageBellView.swift */; }; 04F957452C1FEC4A003C631C /* YHMessageBellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F957442C1FEC4A003C631C /* YHMessageBellView.swift */; };
04F957472C203033003C631C /* YHMyGoodFriendsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F957462C203033003C631C /* YHMyGoodFriendsVC.swift */; }; 04F957472C203033003C631C /* YHMyGoodFriendsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F957462C203033003C631C /* YHMyGoodFriendsVC.swift */; };
04F9574B2C2032D8003C631C /* YHMyFriendsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */; }; 04F9574B2C2032D8003C631C /* YHMyFriendsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */; };
04F9574D2C20644E003C631C /* YHFriendsRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F9574C2C20644E003C631C /* YHFriendsRequestView.swift */; };
04FA8B2B2C06F59D00ABE43F /* YHAppleLoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B2A2C06F59D00ABE43F /* YHAppleLoginManager.swift */; }; 04FA8B2B2C06F59D00ABE43F /* YHAppleLoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B2A2C06F59D00ABE43F /* YHAppleLoginManager.swift */; };
04FA8B2E2C084C7E00ABE43F /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */; }; 04FA8B2E2C084C7E00ABE43F /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */; };
04FA8B302C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */; }; 04FA8B302C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */; };
...@@ -806,6 +807,7 @@ ...@@ -806,6 +807,7 @@
04F957442C1FEC4A003C631C /* YHMessageBellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMessageBellView.swift; sourceTree = "<group>"; }; 04F957442C1FEC4A003C631C /* YHMessageBellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMessageBellView.swift; sourceTree = "<group>"; };
04F957462C203033003C631C /* YHMyGoodFriendsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyGoodFriendsVC.swift; sourceTree = "<group>"; }; 04F957462C203033003C631C /* YHMyGoodFriendsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyGoodFriendsVC.swift; sourceTree = "<group>"; };
04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFriendsCell.swift; sourceTree = "<group>"; }; 04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFriendsCell.swift; sourceTree = "<group>"; };
04F9574C2C20644E003C631C /* YHFriendsRequestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFriendsRequestView.swift; sourceTree = "<group>"; };
04FA8B2A2C06F59D00ABE43F /* YHAppleLoginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAppleLoginManager.swift; sourceTree = "<group>"; }; 04FA8B2A2C06F59D00ABE43F /* YHAppleLoginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAppleLoginManager.swift; sourceTree = "<group>"; };
04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = ATAuthSDK.bundle; path = "galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"; sourceTree = "<group>"; }; 04FA8B2D2C084C7E00ABE43F /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = ATAuthSDK.bundle; path = "galaxy/Classes/Modules/AutoLogin(一键登录)/framework/ATAuthSDK_D.framework/ATAuthSDK.bundle"; sourceTree = "<group>"; };
04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOneKeyLoginViewModel.swift; sourceTree = "<group>"; }; 04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOneKeyLoginViewModel.swift; sourceTree = "<group>"; };
...@@ -1972,6 +1974,7 @@ ...@@ -1972,6 +1974,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */, 04F9574A2C2032D8003C631C /* YHMyFriendsCell.swift */,
04F9574C2C20644E003C631C /* YHFriendsRequestView.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2870,6 +2873,7 @@ ...@@ -2870,6 +2873,7 @@
045EEF132B9F171A0022A143 /* YHCountryMessage.swift in Sources */, 045EEF132B9F171A0022A143 /* YHCountryMessage.swift in Sources */,
045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */, 045EEE7B2B9F171A0022A143 /* YHPersonInfoCellModel2.swift in Sources */,
A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */, A53B61122BB128AF0010B573 /* YHFileListItemsView2.swift in Sources */,
04F9574D2C20644E003C631C /* YHFriendsRequestView.swift in Sources */,
04F5F8702C1AC4C2004A463C /* YHHKEventWebViewController.swift in Sources */, 04F5F8702C1AC4C2004A463C /* YHHKEventWebViewController.swift in Sources */,
045EEE892B9F171A0022A143 /* YHPreviewBaseViewController.swift in Sources */, 045EEE892B9F171A0022A143 /* YHPreviewBaseViewController.swift in Sources */,
045EEEA42B9F171A0022A143 /* YHImageResultViewController.swift in Sources */, 045EEEA42B9F171A0022A143 /* YHImageResultViewController.swift in Sources */,
......
...@@ -11,30 +11,38 @@ import UIKit ...@@ -11,30 +11,38 @@ import UIKit
class YHMyGoodFriendsVC: YHBaseViewController { class YHMyGoodFriendsVC: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped) let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 1.0 tableView.estimatedSectionHeaderHeight = 100
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = .white tableView.backgroundColor = UIColor(hex: 0xF8FAFB)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHMyFriendsCell.self, forCellReuseIdentifier: YHMyFriendsCell.cellReuseIdentifier) tableView.register(YHMyFriendsCell.self, forCellReuseIdentifier: YHMyFriendsCell.cellReuseIdentifier)
tableView.contentInset = UIEdgeInsets(top: YHFriendsRequestView.height+16, left: 0, bottom: 0, right: 0)
tableView.addSubview(self.friendRequestView)
return tableView return tableView
}() }()
lazy var friendRequestView:YHFriendsRequestView = {
let view = YHFriendsRequestView(frame: CGRectMake(0, -16-YHFriendsRequestView.height, KScreenWidth-16*2, YHFriendsRequestView.height))
return view
}()
var friendsArr:[String] = ["", "", "", ""] var friendsArr:[String] = ["", "", "", ""]
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navTitle = "我的好友" gk_navTitle = "我的好友"
gk_navBackgroundColor = .white gk_navigationBar.backgroundColor = .white
self.view.backgroundColor = UIColor(hex: 0xF8FAFB)
self.view.addSubview(self.tableView) self.view.addSubview(self.tableView)
self.tableView.snp.makeConstraints { make in self.tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.equalTo(16)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.right.equalTo(-16)
make.bottom.equalToSuperview()
make.top.equalToSuperview().offset(16+k_Height_NavigationtBarAndStatuBar)
} }
} }
} }
...@@ -50,7 +58,6 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { ...@@ -50,7 +58,6 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFriendsCell.cellReuseIdentifier, for: indexPath) as! YHMyFriendsCell let cell = tableView.dequeueReusableCell(withIdentifier: YHMyFriendsCell.cellReuseIdentifier, for: indexPath) as! YHMyFriendsCell
if 0 <= indexPath.row && indexPath.row < friendsArr.count { if 0 <= indexPath.row && indexPath.row < friendsArr.count {
} }
...@@ -67,4 +74,35 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource { ...@@ -67,4 +74,35 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
} }
} }
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 52.0
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth-16.0*2, height: 52))
view.backgroundColor = .white
let titleLabel = UILabel()
titleLabel.text = "好友列表"
titleLabel.textColor = UIColor.mainTextColor
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:16)
view.addSubview(titleLabel)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:view.bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(6.0, 6.0))
let layer = CAShapeLayer()
layer.frame = view.bounds
layer.path = path.cgPath
view.layer.mask = layer
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(16)
make.height.equalTo(22)
}
return view
}
} }
//
// YHFriendsRequestView.swift
// galaxy
//
// Created by edy on 2024/6/17.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFriendsRequestView: UIView {
static let height = 218.0
lazy var titleLabel: UILabel = {
let titleLabel = UILabel()
titleLabel.text = "好友请求"
titleLabel.textColor = UIColor.mainTextColor
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:16)
return titleLabel
}()
lazy var cardView: UIView = {
let view = UIView()
view.backgroundColor = .white
let bgImgView = UIImageView(image: UIImage(named: "people_add_friend_bg"))
view.addSubview(bgImgView)
view.layer.cornerRadius = 3.0
return view
}()
lazy var headImgV:UIImageView = {
let view = UIImageView()
view.layer.cornerRadius = 23.0
return view
}()
lazy var nameLabel:UILabel = {
let nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.font = UIFont.PFSC_B(ofSize:16)
return nameLabel
}()
lazy var signImgV:UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "people_sign")
return view
}()
lazy var professionalLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor70
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
return label
}()
lazy var msgContentView:UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0xF4F6FA)
view.layer.cornerRadius = 3.0
return view
}()
lazy var msgLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor50
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
return label
}()
lazy var ignoreBtn:UIButton = {
let btn = UIButton()
btn.setTitle("忽略", for: .normal)
btn.backgroundColor = UIColor(hexString:"#F8F9FB")
btn.setTitleColor(UIColor(hexString: "#222222"), for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 13.6)
btn.layer.cornerRadius = 2.75
return btn
}()
lazy var acceptBtn:UIButton = {
let btn = UIButton()
btn.setTitle("接受", for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.setTitleColor(UIColor.white, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 13.6)
btn.layer.cornerRadius = 2.75
return btn
}()
override init(frame: CGRect) {
super.init(frame: frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func createUI() {
self.addSubview(titleLabel)
self.addSubview(cardView)
cardView.addSubview(headImgV)
cardView.addSubview(nameLabel)
cardView.addSubview(signImgV)
cardView.addSubview(professionalLabel)
cardView.addSubview(msgContentView)
msgContentView.addSubview(msgLabel)
cardView.addSubview(ignoreBtn)
cardView.addSubview(acceptBtn)
self.headImgV.backgroundColor = .red
self.nameLabel.text = "XASAFSDFASDXASAFSDFASDXASAFSDFASDXASAFSDFASD"
self.professionalLabel.text = "咨询副总监 | 资讯科技及电讯"
self.msgLabel.text = "sdfasdfasdfasfasfasfasfasdfasdfas"
titleLabel.snp.makeConstraints { make in
make.left.top.right.equalToSuperview()
make.height.equalTo(22.0)
}
cardView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(titleLabel.snp.bottom).offset(16)
make.height.equalTo(180.0)
}
headImgV.snp.makeConstraints { make in
make.width.height.equalTo(46.0)
make.left.equalTo(16)
make.top.equalTo(16)
}
self.nameLabel.snp.makeConstraints { make in
make.left.equalTo(self.headImgV.snp.right).offset(10)
make.height.equalTo(22.0)
make.top.equalTo(self.headImgV)
}
self.signImgV.snp.makeConstraints { make in
make.width.equalTo(49)
make.height.equalTo(16)
make.centerY.equalTo(self.nameLabel)
make.left.equalTo(self.nameLabel.snp.right).offset(8)
make.right.lessThanOrEqualToSuperview().offset(-16)
}
self.professionalLabel.snp.makeConstraints { make in
make.left.equalTo(self.nameLabel)
make.right.equalTo(-16)
make.top.equalTo(self.nameLabel.snp.bottom).offset(6)
make.height.equalTo(18)
}
self.msgContentView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(self.headImgV.snp.bottom).offset(16)
make.height.equalTo(30)
}
self.msgLabel.snp.makeConstraints { make in
make.left.top.equalTo(6)
make.right.bottom.equalTo(-6)
}
self.ignoreBtn.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(self.msgContentView.snp.bottom).offset(16)
make.width.equalTo(78)
make.height.equalTo(40)
}
self.acceptBtn.snp.makeConstraints { make in
make.left.equalTo(self.ignoreBtn.snp.right).offset(10)
make.right.equalTo(-16)
make.centerY.equalTo(self.ignoreBtn)
make.height.equalTo(40)
}
}
}
...@@ -66,6 +66,7 @@ class YHMyFriendsCell: UITableViewCell { ...@@ -66,6 +66,7 @@ class YHMyFriendsCell: UITableViewCell {
func setupUI() { func setupUI() {
self.backgroundColor = .white self.backgroundColor = .white
self.selectionStyle = .none
self.contentView.addSubview(self.headImgV) self.contentView.addSubview(self.headImgV)
self.contentView.addSubview(self.nameLabel) self.contentView.addSubview(self.nameLabel)
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Rectangle 346241348@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Rectangle 346241348@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