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
7372c7a2
Commit
7372c7a2
authored
Jun 19, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 卡片动效
parent
2dfdddd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
12 deletions
+62
-12
YHMatchPeopleViewController.swift
...Modules/Community(社区)/C/YHMatchPeopleViewController.swift
+61
-11
YHNameCardInfoView.swift
.../Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
+1
-1
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMatchPeopleViewController.swift
View file @
7372c7a2
...
@@ -11,7 +11,6 @@ import DragCardContainer
...
@@ -11,7 +11,6 @@ import DragCardContainer
class
YHMatchPeopleViewController
:
YHBaseViewController
{
class
YHMatchPeopleViewController
:
YHBaseViewController
{
var
matchCardsArr
:[
String
]
=
[
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
]
var
matchCardsArr
:[
String
]
=
[
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
]
lazy
var
bgImgV
:
UIImageView
=
{
lazy
var
bgImgV
:
UIImageView
=
{
...
@@ -19,6 +18,25 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -19,6 +18,25 @@ class YHMatchPeopleViewController: YHBaseViewController {
return
bg
return
bg
}()
}()
lazy
var
navBar
:
YHCustomNavigationBar
=
{
let
bar
=
YHCustomNavigationBar
.
navBar
()
bar
.
backgroundColor
=
.
clear
bar
.
title
=
"AI人脉雷达"
bar
.
titleColor
=
.
white
bar
.
backButton
.
setImage
(
UIImage
(
named
:
"back_icon_for_code_input"
),
for
:
.
normal
)
bar
.
backBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
bar
.
rightBtnClick
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
}
return
bar
}()
lazy
var
topLabel
:
UILabel
=
{
lazy
var
topLabel
:
UILabel
=
{
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
textAlignment
=
.
center
label
.
textAlignment
=
.
center
...
@@ -34,7 +52,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -34,7 +52,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
btn
.
setTitle
(
"换一换"
,
for
:
.
normal
)
btn
.
setTitle
(
"换一换"
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
btn
.
addTarget
(
self
,
action
:
#selector(
didchangeBtnClicked
)
,
for
:
.
touchUpInside
)
return
btn
return
btn
}()
}()
...
@@ -44,6 +62,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -44,6 +62,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
btn
.
setTitle
(
"我的名片"
,
for
:
.
normal
)
btn
.
setTitle
(
"我的名片"
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
btn
.
addTarget
(
self
,
action
:
#selector(
didMyCardBtnClicked
)
,
for
:
.
touchUpInside
)
return
btn
return
btn
}()
}()
...
@@ -80,13 +99,29 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -80,13 +99,29 @@ class YHMatchPeopleViewController: YHBaseViewController {
return
cardContainer
return
cardContainer
}()
}()
lazy
var
cardActionView
:
UIView
=
{
let
view
=
UIView
()
return
view
}()
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
createUI
()
createUI
()
}
}
@objc
func
didchangeBtnClicked
()
{
self
.
cardContainer
.
swipeTopCard
(
to
:
.
right
)
}
@objc
func
didMyCardBtnClicked
()
{
let
vc
=
YHMyNameCardViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
func
createUI
()
{
func
createUI
()
{
gk_navigationBar
.
isHidden
=
true
self
.
view
.
addSubview
(
bgImgV
)
self
.
view
.
addSubview
(
bgImgV
)
self
.
view
.
addSubview
(
self
.
cardActionView
)
self
.
view
.
addSubview
(
topLabel
)
self
.
view
.
addSubview
(
topLabel
)
self
.
view
.
addSubview
(
changeBtn
)
self
.
view
.
addSubview
(
changeBtn
)
self
.
view
.
addSubview
(
myCardBtn
)
self
.
view
.
addSubview
(
myCardBtn
)
...
@@ -100,11 +135,18 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -100,11 +135,18 @@ class YHMatchPeopleViewController: YHBaseViewController {
let
wingRightImgV
=
UIImageView
(
image
:
UIImage
(
named
:
"people_match_wing_right"
))
let
wingRightImgV
=
UIImageView
(
image
:
UIImage
(
named
:
"people_match_wing_right"
))
self
.
view
.
addSubview
(
wingRightImgV
)
self
.
view
.
addSubview
(
wingRightImgV
)
self
.
view
.
addSubview
(
cardContainer
)
self
.
cardActionView
.
addSubview
(
cardContainer
)
self
.
view
.
addSubview
(
navBar
)
self
.
bgImgV
.
snp
.
makeConstraints
{
make
in
self
.
bgImgV
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
make
.
edges
.
equalToSuperview
()
}
}
self
.
navBar
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_statusBar
())
make
.
height
.
equalTo
(
k_Height_NavContentBar
)
}
self
.
topLabel
.
snp
.
makeConstraints
{
make
in
self
.
topLabel
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
make
.
top
.
equalTo
(
50
+
k_Height_NavigationtBarAndStatuBar
)
make
.
top
.
equalTo
(
50
+
k_Height_NavigationtBarAndStatuBar
)
...
@@ -140,12 +182,16 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -140,12 +182,16 @@ class YHMatchPeopleViewController: YHBaseViewController {
make
.
centerY
.
equalTo
(
self
.
topLabel
)
make
.
centerY
.
equalTo
(
self
.
topLabel
)
}
}
cardContainer
.
snp
.
makeConstraints
{
make
in
self
.
cardActionView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
self
.
cardContainer
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
make
.
left
.
equalTo
(
36
)
make
.
left
.
equalTo
(
36
)
make
.
right
.
equalTo
(
-
36
)
make
.
right
.
equalTo
(
-
36
)
make
.
top
.
equalToSuperview
()
.
offset
(
102
+
k_Height_NavigationtBarAndStatuBar
)
make
.
top
.
equalToSuperview
()
.
offset
(
102
+
k_Height_NavigationtBarAndStatuBar
)
make
.
height
.
equalTo
(
4
5
6.0
)
make
.
height
.
equalTo
(
4
6
6.0
)
}
}
animaiton
()
animaiton
()
}
}
...
@@ -154,16 +200,16 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -154,16 +200,16 @@ class YHMatchPeopleViewController: YHBaseViewController {
let
view1
=
YHNameCardInfoView
.
createCardView
()
let
view1
=
YHNameCardInfoView
.
createCardView
()
view1
.
y
=
-
YHNameCardInfoView
.
height
view1
.
y
=
-
YHNameCardInfoView
.
height
view1
.
x
=
3
8
view1
.
x
=
3
6
let
view2
=
YHNameCardInfoView
.
createCardView
()
let
view2
=
YHNameCardInfoView
.
createCardView
()
view2
.
cardView
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xE7EBF3
)
view2
.
cardView
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xE7EBF3
)
view2
.
y
=
-
YHNameCardInfoView
.
height
view2
.
y
=
-
YHNameCardInfoView
.
height
view2
.
x
=
3
8
+
5
view2
.
x
=
3
6
+
5
view2
.
width
=
YHNameCardInfoView
.
width
-
5*
2
view2
.
width
=
YHNameCardInfoView
.
width
-
5*
2
let
view3
=
YHNameCardInfoView
.
createCardView
()
let
view3
=
YHNameCardInfoView
.
createCardView
()
view3
.
cardView
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xC4CEE3
)
view3
.
cardView
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xC4CEE3
)
view3
.
y
=
-
YHNameCardInfoView
.
height
view3
.
y
=
-
YHNameCardInfoView
.
height
view3
.
x
=
3
8
+
10
view3
.
x
=
3
6
+
10
view3
.
width
=
YHNameCardInfoView
.
width
-
5*
4
view3
.
width
=
YHNameCardInfoView
.
width
-
5*
4
self
.
view
.
addSubview
(
view3
)
self
.
view
.
addSubview
(
view3
)
...
@@ -184,9 +230,9 @@ class YHMatchPeopleViewController: YHBaseViewController {
...
@@ -184,9 +230,9 @@ class YHMatchPeopleViewController: YHBaseViewController {
[
weak
self
]
finish
in
[
weak
self
]
finish
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
cardContainer
.
isHidden
=
false
self
.
cardContainer
.
isHidden
=
false
view1
.
isHidden
=
true
view1
.
removeFromSuperview
()
view2
.
isHidden
=
true
view2
.
removeFromSuperview
()
view3
.
isHidden
=
true
view3
.
removeFromSuperview
()
}
}
}
}
}
}
...
@@ -216,6 +262,10 @@ extension YHMatchPeopleViewController: DragCardDataSource {
...
@@ -216,6 +262,10 @@ extension YHMatchPeopleViewController: DragCardDataSource {
extension
YHMatchPeopleViewController
:
DragCardDelegate
{
extension
YHMatchPeopleViewController
:
DragCardDelegate
{
public
func
dragCard
(
_
dragCard
:
DragCardContainer
,
displayTopCardAt
index
:
Int
,
with
cardView
:
DragCardView
)
{
public
func
dragCard
(
_
dragCard
:
DragCardContainer
,
displayTopCardAt
index
:
Int
,
with
cardView
:
DragCardView
)
{
print
(
"displayTopCardAt:
\(
index
)
"
)
print
(
"displayTopCardAt:
\(
index
)
"
)
if
cardView
is
YHNameCardInfoView
{
let
cardInfoView
=
cardView
as!
YHNameCardInfoView
cardInfoView
.
cardView
.
backgroundColor
=
.
white
}
}
}
public
func
dragCard
(
_
dragCard
:
DragCardContainer
,
didRemovedTopCardAt
index
:
Int
,
direction
:
Direction
,
with
cardView
:
DragCardView
)
{
public
func
dragCard
(
_
dragCard
:
DragCardContainer
,
didRemovedTopCardAt
index
:
Int
,
direction
:
Direction
,
with
cardView
:
DragCardView
)
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
View file @
7372c7a2
...
@@ -138,7 +138,7 @@ class YHNameCardInfoView: DragCardView {
...
@@ -138,7 +138,7 @@ class YHNameCardInfoView: DragCardView {
self
.
headImgV
.
snp
.
makeConstraints
{
make
in
self
.
headImgV
.
snp
.
makeConstraints
{
make
in
make
.
width
.
height
.
equalTo
(
98
)
make
.
width
.
height
.
equalTo
(
98
)
make
.
centerX
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
self
.
bgImgV
)
.
offset
(
3
0
)
make
.
bottom
.
equalTo
(
self
.
bgImgV
)
.
offset
(
2
0
)
}
}
self
.
signImgV
.
snp
.
makeConstraints
{
make
in
self
.
signImgV
.
snp
.
makeConstraints
{
make
in
...
...
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