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
...
@@ -358,7 +358,8 @@ extension GDRecommendListView: UICollectionViewDelegate, UICollectionViewDataSou
let
sectionModel
=
viewModel
.
dataSubject
.
value
[
indexPath
.
section
]
let
sectionModel
=
viewModel
.
dataSubject
.
value
[
indexPath
.
section
]
if
sectionModel
.
sectionType
==
.
none
{
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
)
return
CGSize
(
width
:
width
,
height
:
width
+
40
)
}
else
if
sectionModel
.
sectionType
==
.
banner
{
}
else
if
sectionModel
.
sectionType
==
.
banner
{
return
.
init
(
width
:
GDScreen
.
width
,
height
:
(
GDScreen
.
width
*
0.3
)
+
10
)
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 {
...
@@ -14,15 +14,15 @@ class GDRoomListThemeLabel: BaseView {
var
theme
:
String
?
{
var
theme
:
String
?
{
didSet
{
didSet
{
stopAnimation
()
//
stopAnimation()
contentLabel
.
text
=
theme
contentLabel
.
text
=
theme
contentLabel
.
sizeToFit
()
contentLabel
.
sizeToFit
()
if
contentLabel
.
width
>
self
.
width
{
//
if contentLabel.width > self.width {
startAnimation
()
//
startAnimation()
}
//
}
}
}
}
}
...
@@ -33,7 +33,7 @@ class GDRoomListThemeLabel: BaseView {
...
@@ -33,7 +33,7 @@ class GDRoomListThemeLabel: BaseView {
self
.
backgroundColor
=
.
clear
self
.
backgroundColor
=
.
clear
contentLabel
.
font
=
.
gd_pingfang
(
1
2
)
contentLabel
.
font
=
.
gd_pingfang
(
1
1
)
contentLabel
.
textColor
=
.
hexColor
(
"808080"
)
contentLabel
.
textColor
=
.
hexColor
(
"808080"
)
contentLabel
.
numberOfLines
=
1
contentLabel
.
numberOfLines
=
1
self
.
addSubview
(
contentLabel
)
self
.
addSubview
(
contentLabel
)
...
@@ -41,6 +41,7 @@ class GDRoomListThemeLabel: BaseView {
...
@@ -41,6 +41,7 @@ class GDRoomListThemeLabel: BaseView {
contentLabel
.
snp
.
makeConstraints
{
(
make
)
in
contentLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalToSuperview
()
make
.
top
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
}
}
}
}
...
@@ -51,32 +52,33 @@ class GDRoomListThemeLabel: BaseView {
...
@@ -51,32 +52,33 @@ class GDRoomListThemeLabel: BaseView {
super
.
bindViewModel
()
super
.
bindViewModel
()
}
}
// MARK: Method
// sh布局容易出问题,所以先不要这个动画: added By Pidan
func
startAnimation
()
{
// // MARK: Method
let
animation
=
CAKeyframeAnimation
(
keyPath
:
"position.x"
)
// func startAnimation() {
animation
.
repeatCount
=
.
infinity
// let animation = CAKeyframeAnimation(keyPath: "position.x")
animation
.
values
=
[
contentLabel
.
width
/
2.0
,
contentLabel
.
width
/
2.0
,
-
contentLabel
.
width
/
2.0
]
// animation.repeatCount = .infinity
let
duration
=
30
+
CFTimeInterval
(
contentLabel
.
width
*
0.02
)
// animation.values = [contentLabel.width / 2.0, contentLabel.width / 2.0, -contentLabel.width / 2.0]
animation
.
duration
=
duration
// let duration = 30 + CFTimeInterval(contentLabel.width * 0.02)
animation
.
keyTimes
=
[
0
,
NSNumber
(
floatLiteral
:
30.0
/
duration
),
1
]
// animation.duration = duration
animation
.
isRemovedOnCompletion
=
true
// animation.keyTimes = [0, NSNumber(floatLiteral: 30.0 / duration), 1]
contentLabel
.
layer
.
add
(
animation
,
forKey
:
"ani"
)
// animation.isRemovedOnCompletion = true
}
// contentLabel.layer.add(animation, forKey: "ani")
// }
func
stopAnimation
()
{
//
// func stopAnimation() {
contentLabel
.
layer
.
removeAllAnimations
()
//
// contentLabel.layer.removeAllAnimations()
}
//
// }
override
func
layoutSubviews
()
{
//
superview
?
.
layoutSubviews
()
// override func layoutSubviews() {
// superview?.layoutSubviews()
if
contentLabel
.
width
>
self
.
width
{
//
startAnimation
()
// if contentLabel.width > self.width {
}
else
{
// startAnimation()
stopAnimation
()
// } else {
}
// stopAnimation()
}
// }
// }
//
}
}
Module/GDShowRoomListModule/GDShowRoomListModule/Features/View/RecommendListView/View/RecommendListCollectionViewCell.swift
View file @
1191ddcb
...
@@ -103,11 +103,15 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
...
@@ -103,11 +103,15 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
// 昵称 Label 搭建
// 昵称 Label 搭建
nicknameLabel
.
textColor
=
.
hexColor
(
"333333"
)
nicknameLabel
.
textColor
=
.
hexColor
(
"333333"
)
nicknameLabel
.
font
=
UIFont
.
gd_defaultBold
(
14
)
nicknameLabel
.
font
=
UIFont
.
gd_defaultBold
(
14
)
nicknameLabel
.
adjustsFontSizeToFitWidth
=
true
nicknameLabel
.
minimumScaleFactor
=
0.8
nicknameLabel
.
lineBreakMode
=
.
byTruncatingTail
nicknameLabel
.
lineBreakMode
=
.
byTruncatingTail
self
.
contentView
.
addSubview
(
nicknameLabel
)
self
.
contentView
.
addSubview
(
nicknameLabel
)
// 直播中以及观看人数
// 直播中以及观看人数
self
.
contentView
.
addSubview
(
livingView
)
self
.
contentView
.
addSubview
(
livingView
)
let
showLocation
=
GDRouter
.
BaseBusinessRouter
?
.
isCurrentVersionVerified
.
value
==
false
if
showLocation
{
// 地址btn
// 地址btn
locationBtn
.
setImage
(
GDShowRoomListBundle
.
imageNamed
(
"roomlist_city_icon"
),
for
:
.
normal
)
locationBtn
.
setImage
(
GDShowRoomListBundle
.
imageNamed
(
"roomlist_city_icon"
),
for
:
.
normal
)
...
@@ -117,6 +121,7 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
...
@@ -117,6 +121,7 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
locationBtn
.
setTitleColor
(
.
hexColor
(
"999999"
),
for
:
.
normal
)
locationBtn
.
setTitleColor
(
.
hexColor
(
"999999"
),
for
:
.
normal
)
locationBtn
.
titleEdgeInsets
=
UIEdgeInsets
(
top
:
-
1
,
left
:
3
,
bottom
:
0
,
right
:
0
)
locationBtn
.
titleEdgeInsets
=
UIEdgeInsets
(
top
:
-
1
,
left
:
3
,
bottom
:
0
,
right
:
0
)
self
.
contentView
.
addSubview
(
locationBtn
)
self
.
contentView
.
addSubview
(
locationBtn
)
}
self
.
contentView
.
addSubview
(
themeLabel
)
self
.
contentView
.
addSubview
(
themeLabel
)
...
@@ -153,7 +158,11 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
...
@@ -153,7 +158,11 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
nicknameLabel
.
snp
.
makeConstraints
{
make
in
nicknameLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
blockView
.
snp
.
right
)
.
offset
(
2
)
make
.
left
.
equalTo
(
blockView
.
snp
.
right
)
.
offset
(
2
)
make
.
centerY
.
equalTo
(
blockView
)
make
.
centerY
.
equalTo
(
blockView
)
if
showLocation
{
make
.
right
.
equalTo
(
locationBtn
.
snp
.
left
)
.
priority
(
.
high
)
make
.
right
.
equalTo
(
locationBtn
.
snp
.
left
)
.
priority
(
.
high
)
}
else
{
make
.
right
.
equalToSuperview
()
.
offset
(
-
2
)
}
make
.
right
.
equalToSuperview
()
.
priority
(
.
low
)
make
.
right
.
equalToSuperview
()
.
priority
(
.
low
)
}
}
...
@@ -297,20 +306,4 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
...
@@ -297,20 +306,4 @@ class RecommendListCollectionViewCell: GDRecommendListBaseCollectionViewCell {
liveTimeUpdate
.
accept
(
liveTimeUpdate
.
value
)
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 {
...
@@ -111,7 +111,7 @@ class GDLiveTitleView: BaseView {
followBtn
.
frame
=
CGRect
(
x
:
audienceNumLabel
.
maxX
+
12
,
y
:
0
,
width
:
50
,
height
:
30
)
followBtn
.
frame
=
CGRect
(
x
:
audienceNumLabel
.
maxX
+
12
,
y
:
0
,
width
:
50
,
height
:
30
)
followBtn
.
centerY
=
self
.
height
/
2.0
followBtn
.
centerY
=
self
.
height
/
2.0
followBtn
.
setTitle
(
"关注"
,
for
:
.
normal
)
followBtn
.
setTitle
(
"关注"
,
for
:
.
normal
)
followBtn
.
setTitleColor
(
.
black
,
for
:
.
normal
)
followBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
followBtn
.
titleLabel
?
.
font
=
.
gd_pingfang
(
11
)
followBtn
.
titleLabel
?
.
font
=
.
gd_pingfang
(
11
)
followBtn
.
isEnabled
=
true
followBtn
.
isEnabled
=
true
self
.
addSubview
(
followBtn
)
self
.
addSubview
(
followBtn
)
...
...
Module/GDUserInfoManager/GDUserInfoManager/UserInfo/GDUserCenter.swift
View file @
1191ddcb
...
@@ -214,10 +214,9 @@ extension UserModel {
...
@@ -214,10 +214,9 @@ extension UserModel {
if
var
array
:
Array
<
Dictionary
<
String
,
Any
>
?
>
=
UserModel
.
getAllHistoryUser
()
{
if
var
array
:
Array
<
Dictionary
<
String
,
Any
>
?
>
=
UserModel
.
getAllHistoryUser
()
{
if
let
dict
=
self
.
convertToDict
()
{
if
let
dict
=
self
.
convertToDict
()
{
if
let
index
=
array
.
firstIndex
(
where
:
{
$0
?[
"uid"
]
as!
String
==
uid
})
{
if
let
index
=
array
.
firstIndex
(
where
:
{
$0
?[
"uid"
]
as!
String
==
uid
})
{
array
[
index
]
=
dict
array
.
remove
(
at
:
index
)
}
else
{
array
.
append
(
dict
)
}
}
array
.
append
(
dict
)
UserDefaults
.
standard
.
setValue
(
array
,
forKey
:
GDUserManagerPublicUDKey
.
historyUserArray
)
UserDefaults
.
standard
.
setValue
(
array
,
forKey
:
GDUserManagerPublicUDKey
.
historyUserArray
)
UserDefaults
.
standard
.
setValue
(
dict
,
forKey
:
GDUserManagerUDKey
.
lastUser
)
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