Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
f18a8cf1
Commit
f18a8cf1
authored
Jun 21, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 我的好友
parent
e5d91dbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
+76
-2
YHMyGoodFriendsVC.swift
...y/Classes/Modules/Community(社区)/C/YHMyGoodFriendsVC.swift
+16
-0
YHAddFriendCardCell.swift
...Classes/Modules/Community(社区)/V/YHAddFriendCardCell.swift
+60
-2
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMyGoodFriendsVC.swift
View file @
f18a8cf1
...
...
@@ -83,6 +83,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
if
indexPath
.
section
==
0
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHAddFriendCardCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHAddFriendCardCell
cell
.
cardCount
=
self
.
friendRequestArr
.
count
cell
.
acceptBlock
=
{
[
weak
self
]
accept
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -132,6 +133,21 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
return
0.1
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
if
section
==
0
{
if
friendRequestArr
.
count
>
0
{
return
12
}
return
0.1
}
return
0.1
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
()
return
view
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
()
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHAddFriendCardCell.swift
View file @
f18a8cf1
...
...
@@ -8,11 +8,36 @@
import
UIKit
class
YHAddFriendCardCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHAddFriendCardCell"
let
secondCardColor
=
UIColor
(
hex
:
0xF0F4FB
)
let
thirdCardColor
=
UIColor
(
hex
:
0xBBBBBB
,
alpha
:
0.1
)
var
acceptBlock
:((
Bool
)
->
())?
var
cardCount
:
Int
=
1
{
didSet
{
var
firstCardBottomMargin
=
0.0
var
secondCardBottomMargin
=
0.0
if
self
.
cardCount
<=
1
{
}
else
if
self
.
cardCount
==
2
{
firstCardBottomMargin
=
-
6.0
}
else
{
firstCardBottomMargin
=
-
6.0
secondCardBottomMargin
=
-
6.0
}
self
.
cardView
.
snp
.
updateConstraints
{
make
in
make
.
bottom
.
equalTo
(
self
.
secondCardView
)
.
offset
(
firstCardBottomMargin
)
}
self
.
secondCardView
.
snp
.
updateConstraints
{
make
in
make
.
bottom
.
equalTo
(
self
.
thirdCardView
)
.
offset
(
secondCardBottomMargin
)
}
self
.
setNeedsLayout
()
self
.
layoutIfNeeded
()
}
}
static
let
height
=
218.0
...
...
@@ -99,6 +124,20 @@ class YHAddFriendCardCell: UITableViewCell {
return
btn
}()
lazy
var
secondCardView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
self
.
secondCardColor
view
.
layer
.
cornerRadius
=
3.0
return
view
}()
lazy
var
thirdCardView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
self
.
thirdCardColor
view
.
layer
.
cornerRadius
=
3.0
return
view
}()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
createUI
()
...
...
@@ -118,6 +157,10 @@ class YHAddFriendCardCell: UITableViewCell {
func
createUI
()
{
self
.
backgroundColor
=
.
clear
self
.
contentView
.
backgroundColor
=
.
clear
self
.
contentView
.
addSubview
(
thirdCardView
)
self
.
contentView
.
addSubview
(
secondCardView
)
self
.
contentView
.
addSubview
(
cardView
)
cardView
.
addSubview
(
bgImageView
)
...
...
@@ -139,7 +182,8 @@ class YHAddFriendCardCell: UITableViewCell {
self
.
msgLabel
.
text
=
"资讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及讯科技及电讯资资讯科技及电讯资资讯科技及电讯资资讯科技及科技及电讯资资讯科技及讯科技及电讯资资讯科技及科技及电讯资资讯科技及讯科技及电讯资资讯科技及"
cardView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
self
.
secondCardView
)
.
offset
(
-
6
)
}
bgImageView
.
snp
.
makeConstraints
{
make
in
...
...
@@ -207,6 +251,20 @@ class YHAddFriendCardCell: UITableViewCell {
make
.
centerY
.
equalTo
(
self
.
ignoreBtn
)
make
.
height
.
equalTo
(
40
)
}
self
.
secondCardView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
self
.
cardView
)
.
offset
(
5
)
make
.
right
.
equalTo
(
self
.
cardView
)
.
offset
(
-
5
)
make
.
height
.
equalTo
(
50
)
make
.
bottom
.
equalTo
(
self
.
thirdCardView
)
.
offset
(
-
6
)
}
self
.
thirdCardView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
self
.
cardView
)
.
offset
(
10
)
make
.
right
.
equalTo
(
self
.
cardView
)
.
offset
(
-
10
)
make
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
50
)
}
}
func
getHeight
(
text
:
String
,
font
:
UIFont
,
width
:
CGFloat
)
->
CGFloat
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment