Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
iOSTeam
/
Majiabao
/
TealiveModule
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1191ddcb
authored
May 28, 2024
by
pierce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugs
parent
f547837b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
54 deletions
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/RecommendListView.swift
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/View/GDRoomListThemeLabel.swift
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/View/RecommendListCollectionViewCell.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/HeadView/GDLiveTitleView.swift
Module/GDUserInfoManager/GDUserInfoManager/UserInfo/GDUserCenter.swift
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/RecommendListView.swift
View file @
1191ddcb
...
...
@@ -358,7 +358,8 @@ extension GDRecommendListView: UICollectionViewDelegate, UICollectionViewDataSou
let
sectionModel
=
viewModel
.
dataSubject
.
value
[
indexPath
.
section
]
if
sectionModel
.
sectionType
==
.
none
{
let
width
=
(
self
.
width
-
layout
.
sectionInset
.
left
-
layout
.
sectionInset
.
right
-
layout
.
minimumInteritemSpacing
)
/
2.0
let
line
=
2.0
+
(
GDRouter
.
BaseBusinessRouter
?
.
isCurrentVersionVerified
.
value
==
true
?
1.0
:
0
)
let
width
=
(
self
.
width
-
layout
.
sectionInset
.
left
-
layout
.
sectionInset
.
right
-
layout
.
minimumInteritemSpacing
*
(
line
-
1
))
/
line
return
CGSize
(
width
:
width
,
height
:
width
+
40
)
}
else
if
sectionModel
.
sectionType
==
.
banner
{
return
.
init
(
width
:
GDScreen
.
width
,
height
:
(
GDScreen
.
width
*
0.3
)
+
10
)
...
...
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/View/GDRoomListThemeLabel.swift
View file @
1191ddcb
...
...
@@ -14,15 +14,15 @@ class GDRoomListThemeLabel: BaseView {
var
theme
:
String
?
{
didSet
{
stopAnimation
()
//
stopAnimation()
contentLabel
.
text
=
theme
contentLabel
.
sizeToFit
()
if
contentLabel
.
width
>
self
.
width
{
startAnimation
()
}
//
if contentLabel.width > self.width {
//
startAnimation()
//
}
}
}
...
...
@@ -33,7 +33,7 @@ class GDRoomListThemeLabel: BaseView {
self
.
backgroundColor
=
.
clear
contentLabel
.
font
=
.
gd_pingfang
(
1
2
)
contentLabel
.
font
=
.
gd_pingfang
(
1
1
)
contentLabel
.
textColor
=
.
hexColor
(
"808080"
)
contentLabel
.
numberOfLines
=
1
self
.
addSubview
(
contentLabel
)
...
...
@@ -41,6 +41,7 @@ class GDRoomListThemeLabel: BaseView {
contentLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
}
}
...
...
@@ -51,32 +52,33 @@ class GDRoomListThemeLabel: BaseView {
super
.
bindViewModel
()
}
// MARK: Method
func
startAnimation
()
{
let
animation
=
CAKeyframeAnimation
(
keyPath
:
"position.x"
)
animation
.
repeatCount
=
.
infinity
animation
.
values
=
[
contentLabel
.
width
/
2.0
,
contentLabel
.
width
/
2.0
,
-
contentLabel
.
width
/
2.0
]
let
duration
=
30
+
CFTimeInterval
(
contentLabel
.
width
*
0.02
)
animation
.
duration
=
duration
animation
.
keyTimes
=
[
0
,
NSNumber
(
floatLiteral
:
30.0
/
duration
),
1
]
animation
.
isRemovedOnCompletion
=
true
contentLabel
.
layer
.
add
(
animation
,
forKey
:
"ani"
)
}
func
stopAnimation
()
{
contentLabel
.
layer
.
removeAllAnimations
()
}
override
func
layoutSubviews
()
{
superview
?
.
layoutSubviews
()
if
contentLabel
.
width
>
self
.
width
{
startAnimation
()
}
else
{
stopAnimation
()
}
}
// sh布局容易出问题,所以先不要这个动画: added By Pidan
// // MARK: Method
// func startAnimation() {
// let animation = CAKeyframeAnimation(keyPath: "position.x")
// animation.repeatCount = .infinity
// animation.values = [contentLabel.width / 2.0, contentLabel.width / 2.0, -contentLabel.width / 2.0]
// let duration = 30 + CFTimeInterval(contentLabel.width * 0.02)
// animation.duration = duration
// animation.keyTimes = [0, NSNumber(floatLiteral: 30.0 / duration), 1]
// animation.isRemovedOnCompletion = true
// contentLabel.layer.add(animation, forKey: "ani")
// }
//
// func stopAnimation() {
//
// contentLabel.layer.removeAllAnimations()
//
// }
//
// override func layoutSubviews() {
// superview?.layoutSubviews()
//
// if contentLabel.width > self.width {
// startAnimation()
// } else {
// stopAnimation()
// }
// }
//
}
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/View/RecommendListCollectionViewCell.swift
View file @
1191ddcb
...
...
@@ -103,11 +103,15 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
// 昵称 Label 搭建
nicknameLabel
.
textColor
=
.
hexColor
(
"333333"
)
nicknameLabel
.
font
=
UIFont
.
gd_defaultBold
(
14
)
nicknameLabel
.
adjustsFontSizeToFitWidth
=
true
nicknameLabel
.
minimumScaleFactor
=
0.8
nicknameLabel
.
lineBreakMode
=
.
byTruncatingTail
self
.
contentView
.
addSubview
(
nicknameLabel
)
// 直播中以及观看人数
self
.
contentView
.
addSubview
(
livingView
)
let
showLocation
=
GDRouter
.
BaseBusinessRouter
?
.
isCurrentVersionVerified
.
value
==
false
if
showLocation
{
// 地址btn
locationBtn
.
setImage
(
GDShowRoomListBundle
.
imageNamed
(
"roomlist_city_icon"
),
for
:
.
normal
)
...
...
@@ -117,6 +121,7 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
locationBtn
.
setTitleColor
(
.
hexColor
(
"999999"
),
for
:
.
normal
)
locationBtn
.
titleEdgeInsets
=
UIEdgeInsets
(
top
:
-
1
,
left
:
3
,
bottom
:
0
,
right
:
0
)
self
.
contentView
.
addSubview
(
locationBtn
)
}
self
.
contentView
.
addSubview
(
themeLabel
)
...
...
@@ -153,7 +158,11 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
nicknameLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
blockView
.
snp
.
right
)
.
offset
(
2
)
make
.
centerY
.
equalTo
(
blockView
)
if
showLocation
{
make
.
right
.
equalTo
(
locationBtn
.
snp
.
left
)
.
priority
(
.
high
)
}
else
{
make
.
right
.
equalToSuperview
()
.
offset
(
-
2
)
}
make
.
right
.
equalToSuperview
()
.
priority
(
.
low
)
}
...
...
@@ -297,20 +306,4 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
liveTimeUpdate
.
accept
(
liveTimeUpdate
.
value
)
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
// nicknameLabel.sizeToFit()
// if nicknameLabel.width > self.width {
// nicknameLabel.width = self.width
// }
//
// if locationBtn.isHidden == false && nicknameLabel.maxX > locationBtn.x {
// nicknameLabel.width = locationBtn.x - nicknameLabel.x
// } else {
// nicknameLabel.width = self.width - nicknameLabel.x
// }
}
}
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/HeadView/GDLiveTitleView.swift
View file @
1191ddcb
...
...
@@ -111,7 +111,7 @@ class GDLiveTitleView: BaseView {
followBtn
.
frame
=
CGRect
(
x
:
audienceNumLabel
.
maxX
+
12
,
y
:
0
,
width
:
50
,
height
:
30
)
followBtn
.
centerY
=
self
.
height
/
2.0
followBtn
.
setTitle
(
"关注"
,
for
:
.
normal
)
followBtn
.
setTitleColor
(
.
black
,
for
:
.
normal
)
followBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
followBtn
.
titleLabel
?
.
font
=
.
gd_pingfang
(
11
)
followBtn
.
isEnabled
=
true
self
.
addSubview
(
followBtn
)
...
...
Module/GDUserInfoManager/GDUserInfoManager/UserInfo/GDUserCenter.swift
View file @
1191ddcb
...
...
@@ -214,10 +214,9 @@ extension UserModel {
if
var
array
:
Array
<
Dictionary
<
String
,
Any
>
?
>
=
UserModel
.
getAllHistoryUser
()
{
if
let
dict
=
self
.
convertToDict
()
{
if
let
index
=
array
.
firstIndex
(
where
:
{
$0
?[
"uid"
]
as!
String
==
uid
})
{
array
[
index
]
=
dict
}
else
{
array
.
append
(
dict
)
array
.
remove
(
at
:
index
)
}
array
.
append
(
dict
)
UserDefaults
.
standard
.
setValue
(
array
,
forKey
:
GDUserManagerPublicUDKey
.
historyUserArray
)
UserDefaults
.
standard
.
setValue
(
dict
,
forKey
:
GDUserManagerUDKey
.
lastUser
)
}
...
...
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