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
06b601d7
Commit
06b601d7
authored
Jun 25, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 好友未读消息
parent
fffea899
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
6 deletions
+70
-6
YHCommunityViewController.swift
...s/Modules/Community(社区)/C/YHCommunityViewController.swift
+66
-6
YHPeopleViewController.swift
...sses/Modules/Community(社区)/C/YHPeopleViewController.swift
+4
-0
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHCommunityViewController.swift
View file @
06b601d7
...
@@ -11,7 +11,7 @@ import JXSegmentedView
...
@@ -11,7 +11,7 @@ import JXSegmentedView
class
YHCommunityViewController
:
YHBaseViewController
{
class
YHCommunityViewController
:
YHBaseViewController
{
var
defaltIndex
:
Int
=
0
var
defaltIndex
:
Int
=
0
let
friendViewModel
=
YHMatchUserViewModel
()
let
arrItemTitles
=
[
"人脉"
,
"活动"
]
let
arrItemTitles
=
[
"人脉"
,
"活动"
]
var
arrItemVCs
:
[
YHBaseViewController
]
=
[]
var
arrItemVCs
:
[
YHBaseViewController
]
=
[]
...
@@ -56,16 +56,58 @@ class YHCommunityViewController: YHBaseViewController {
...
@@ -56,16 +56,58 @@ class YHCommunityViewController: YHBaseViewController {
btn
.
setImage
(
UIImage
(
named
:
"people_friends_btn"
),
for
:
.
normal
)
btn
.
setImage
(
UIImage
(
named
:
"people_friends_btn"
),
for
:
.
normal
)
btn
.
setTitle
(
"好友"
,
for
:
.
normal
)
btn
.
setTitle
(
"好友"
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
btn
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
btn
.
iconInLeft
(
spacing
:
4.0
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
15
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
15
)
btn
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
20
,
left
:
20
,
bottom
:
20
,
right
:
20
)
btn
.
addTarget
(
self
,
action
:
#selector(
didFriendsBtnClicked
)
,
for
:
.
touchUpInside
)
btn
.
addTarget
(
self
,
action
:
#selector(
didFriendsBtnClicked
)
,
for
:
.
touchUpInside
)
return
btn
return
btn
}()
}()
let
unreadHeight
=
16.0
lazy
var
unreadLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
.
white
label
.
textAlignment
=
.
center
label
.
backgroundColor
=
.
failColor
label
.
font
=
.
PFSC_M
(
ofSize
:
10
)
label
.
layer
.
cornerRadius
=
unreadHeight
/
2.0
label
.
clipsToBounds
=
true
label
.
isHidden
=
true
return
label
}()
var
unreadCount
:
Int
=
0
{
didSet
{
self
.
unreadLabel
.
isHidden
=
(
self
.
unreadCount
<=
0
)
if
0
<
self
.
unreadCount
&&
self
.
unreadCount
<
100
{
self
.
unreadLabel
.
text
=
"
\(
self
.
unreadCount
)
"
}
else
if
self
.
unreadCount
>=
100
{
self
.
unreadLabel
.
text
=
"99+"
}
var
width
=
unreadHeight
var
leftMargin
=
-
8
if
10
<=
self
.
unreadCount
&&
self
.
unreadCount
<
100
{
width
=
22.0
}
else
if
self
.
unreadCount
>=
100
{
width
=
30.0
leftMargin
=
-
14
}
self
.
unreadLabel
.
snp
.
updateConstraints
{
make
in
make
.
width
.
equalTo
(
width
)
make
.
left
.
equalTo
(
self
.
friendsBtn
.
snp
.
right
)
.
offset
(
leftMargin
)
}
}
}
@objc
func
didBackBtnClicked
()
{
@objc
func
didBackBtnClicked
()
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
@objc
func
didFriendsBtnClicked
()
{
@objc
func
didFriendsBtnClicked
()
{
if
!
YHLoginManager
.
shared
.
isLogin
()
{
YHOneKeyLoginManager
.
shared
.
oneKeyLogin
()
return
}
let
vc
=
YHMyGoodFriendsVC
()
let
vc
=
YHMyGoodFriendsVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
...
@@ -111,16 +153,23 @@ class YHCommunityViewController: YHBaseViewController {
...
@@ -111,16 +153,23 @@ class YHCommunityViewController: YHBaseViewController {
self
.
view
.
addSubview
(
friendsBtn
)
self
.
view
.
addSubview
(
friendsBtn
)
friendsBtn
.
snp
.
makeConstraints
{
make
in
friendsBtn
.
snp
.
makeConstraints
{
make
in
make
.
width
.
equalTo
(
82.0
)
make
.
width
.
equalTo
(
54.0
)
make
.
height
.
equalTo
(
48
)
make
.
height
.
equalTo
(
21
)
make
.
right
.
equalToSuperview
()
make
.
right
.
equalTo
(
-
20
)
make
.
top
.
equalTo
(
k_Height_safeAreaInsetsTop
())
make
.
top
.
equalTo
(
12
+
k_Height_safeAreaInsetsTop
())
}
self
.
view
.
addSubview
(
self
.
unreadLabel
)
self
.
unreadLabel
.
snp
.
makeConstraints
{
make
in
make
.
width
.
height
.
equalTo
(
unreadHeight
)
make
.
left
.
equalTo
(
self
.
friendsBtn
.
snp
.
right
)
.
offset
(
-
8
)
make
.
top
.
equalTo
(
self
.
friendsBtn
.
snp
.
top
)
.
offset
(
-
8
)
}
}
}
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
super
.
viewWillAppear
(
animated
)
requestFriendRequest
()
//处于第一个item的时候,才允许屏幕边缘手势返回
//处于第一个item的时候,才允许屏幕边缘手势返回
navigationController
?
.
interactivePopGestureRecognizer
?
.
isEnabled
=
(
segmentedView
.
selectedIndex
==
0
)
navigationController
?
.
interactivePopGestureRecognizer
?
.
isEnabled
=
(
segmentedView
.
selectedIndex
==
0
)
}
}
...
@@ -138,6 +187,17 @@ class YHCommunityViewController: YHBaseViewController {
...
@@ -138,6 +187,17 @@ class YHCommunityViewController: YHBaseViewController {
segmentedView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
(),
width
:
view
.
bounds
.
size
.
width
,
height
:
48
)
segmentedView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
(),
width
:
view
.
bounds
.
size
.
width
,
height
:
48
)
listContainerView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
()
+
48
,
width
:
view
.
bounds
.
size
.
width
,
height
:
view
.
bounds
.
size
.
height
-
48
-
k_Height_safeAreaInsetsTop
())
listContainerView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
()
+
48
,
width
:
view
.
bounds
.
size
.
width
,
height
:
view
.
bounds
.
size
.
height
-
48
-
k_Height_safeAreaInsetsTop
())
}
}
func
requestFriendRequest
()
{
if
YHLoginManager
.
shared
.
isLogin
()
{
self
.
friendViewModel
.
getMyFriendList
{
success
,
error
in
let
unreadCount
=
self
.
friendViewModel
.
friendListModel
.
applyFriends
.
count
self
.
unreadCount
=
unreadCount
}
}
else
{
self
.
unreadCount
=
0
}
}
}
}
extension
YHCommunityViewController
:
JXSegmentedViewDelegate
{
extension
YHCommunityViewController
:
JXSegmentedViewDelegate
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHPeopleViewController.swift
View file @
06b601d7
...
@@ -170,6 +170,10 @@ class YHPeopleViewController: YHBaseViewController {
...
@@ -170,6 +170,10 @@ class YHPeopleViewController: YHBaseViewController {
@objc
func
didMatchBtnClicked
()
{
@objc
func
didMatchBtnClicked
()
{
if
!
YHLoginManager
.
shared
.
isLogin
()
{
YHOneKeyLoginManager
.
shared
.
oneKeyLogin
()
return
}
if
informationAuthorizeViewModel
.
model
.
is_fillin
==
1
{
if
informationAuthorizeViewModel
.
model
.
is_fillin
==
1
{
startMatchUsers
()
startMatchUsers
()
}
else
{
}
else
{
...
...
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