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
116605e5
Commit
116605e5
authored
Dec 12, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播间流程优化,下播的leaveChannel, ui走查bug修复
parent
e747a779
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
15 deletions
+20
-15
YHLivePlayerViewController.swift
.../LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
+11
-7
YHLiveStateViewController.swift
...s/LivestreamSales(直播销售)/C/YHLiveStateViewController.swift
+3
-2
YHLiveDetailModel.swift
...s/Modules/LivestreamSales(直播销售)/M/YHLiveDetailModel.swift
+2
-2
YHLiveShopView.swift
...sses/Modules/LivestreamSales(直播销售)/V/YHLiveShopView.swift
+4
-4
No files found.
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
View file @
116605e5
...
@@ -275,9 +275,14 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
...
@@ -275,9 +275,14 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
playbackInfo
?
.
title
=
liveDetail
.
live_title
playbackInfo
?
.
title
=
liveDetail
.
live_title
playbackInfo
?
.
uid
=
UInt
(
liveDetail
.
user_id
)
playbackInfo
?
.
uid
=
UInt
(
liveDetail
.
user_id
)
messageListView
.
anchorName
=
liveDetail
.
hxNickname
messageListView
.
anchorName
=
liveDetail
.
hxNickname
let
isOnLive
=
liveDetail
.
getLiveState
()
==
.
onLive
||
liveDetail
.
getLiveState
()
==
.
stop
if
needJoinLiveChannel
{
if
needJoinLiveChannel
{
if
!
liveDetail
.
rtmp_channel
.
isEmpty
,
!
liveDetail
.
token
.
isEmpty
,
let
uid
=
playbackInfo
?
.
uid
,
let
player
=
player
,
!
player
.
isJoined
{
if
!
liveDetail
.
rtmp_channel
.
isEmpty
,
!
liveDetail
.
token
.
isEmpty
,
let
uid
=
playbackInfo
?
.
uid
,
let
player
=
player
,
isOnLive
{
YHPlayerManager
.
shared
.
joinChannel
(
for
:
player
,
token
:
liveDetail
.
token
,
channelId
:
liveDetail
.
rtmp_channel
,
uid
:
uid
,
view
:
playerView
,
defaultMuted
:
false
)
YHPlayerManager
.
shared
.
joinChannel
(
for
:
player
,
token
:
liveDetail
.
token
,
channelId
:
liveDetail
.
rtmp_channel
,
uid
:
uid
,
view
:
playerView
,
defaultMuted
:
false
)
}
else
if
!
isOnLive
{
if
let
player
=
player
{
YHPlayerManager
.
shared
.
leaveChannel
(
for
:
player
)
}
}
}
}
}
// 如果没有预设roomId,使用接口返回的roomId
// 如果没有预设roomId,使用接口返回的roomId
...
@@ -601,21 +606,20 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
...
@@ -601,21 +606,20 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
case
.
liveStart
:
case
.
liveStart
:
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
true
)
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
true
)
case
.
liveEnd
:
case
.
liveEnd
:
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
fals
e
)
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
tru
e
)
case
.
livePause
:
case
.
livePause
:
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
false
)
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
false
)
case
.
liveResume
:
case
.
liveResume
:
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
fals
e
)
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
tru
e
)
case
.
liveGoodsRefresh
:
case
.
liveGoodsRefresh
:
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
false
)
self
.
handleLiveDetailSuccess
(
liveDetail
,
needJoinIMRoom
:
false
,
needJoinLiveChannel
:
false
)
self
.
goodsListView
?
.
dataSource
=
liveDetail
.
goods
self
.
goodsListView
?
.
dataSource
=
liveDetail
.
goods
}
}
}
else
{
}
else
{
printLog
(
"YHLivePlayerViewController: 请求失败"
)
printLog
(
"YHLivePlayerViewController: 请求失败"
)
if
let
errorMsg
=
error
?
.
errorMsg
,
!
errorMsg
.
isEmpty
{
// if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
YHHUD
.
flash
(
message
:
errorMsg
)
// YHHUD.flash(message: errorMsg)
}
// }
return
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHLiveStateViewController.swift
View file @
116605e5
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
import
UIKit
import
UIKit
enum
YHLiveState
:
Int
{
enum
YHLiveState
:
Int
{
case
unknown
=
-
1
case
start
=
0
case
start
=
0
case
stop
=
1
case
stop
=
1
case
end
=
2
case
end
=
2
...
@@ -122,7 +123,7 @@ class YHLiveStateViewController: YHBaseViewController {
...
@@ -122,7 +123,7 @@ class YHLiveStateViewController: YHBaseViewController {
view
.
addSubview
(
logImageView
)
view
.
addSubview
(
logImageView
)
logImageView
.
snp
.
makeConstraints
{
make
in
logImageView
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
make
.
top
.
equalTo
(
196
)
make
.
top
.
equalTo
(
240
)
make
.
width
.
height
.
equalTo
(
78
)
make
.
width
.
height
.
equalTo
(
78
)
}
}
...
@@ -229,7 +230,7 @@ class YHLiveStateViewController: YHBaseViewController {
...
@@ -229,7 +230,7 @@ class YHLiveStateViewController: YHBaseViewController {
loginSubTitleLabel
.
text
=
"直播已结束"
loginSubTitleLabel
.
text
=
"直播已结束"
messageLabel
.
text
=
"直播已结束,去首页逛逛吧~"
messageLabel
.
text
=
"直播已结束,去首页逛逛吧~"
getCodeButton
.
isHidden
=
false
getCodeButton
.
isHidden
=
false
case
.
onLive
:
case
.
onLive
,
.
unknown
:
break
break
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/M/YHLiveDetailModel.swift
View file @
116605e5
...
@@ -48,7 +48,7 @@ class YHLiveDetailModel: SmartCodable {
...
@@ -48,7 +48,7 @@ class YHLiveDetailModel: SmartCodable {
func
getLiveState
()
->
YHLiveState
{
func
getLiveState
()
->
YHLiveState
{
switch
status
{
switch
status
{
case
0
:
case
0
:
return
.
onLive
return
.
unknown
case
1
:
case
1
:
if
stream_status
==
3
{
if
stream_status
==
3
{
return
.
stop
return
.
stop
...
@@ -59,7 +59,7 @@ class YHLiveDetailModel: SmartCodable {
...
@@ -59,7 +59,7 @@ class YHLiveDetailModel: SmartCodable {
case
3
:
case
3
:
return
.
end
return
.
end
default
:
default
:
return
.
onLive
return
.
unknown
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHLiveShopView.swift
View file @
116605e5
...
@@ -39,7 +39,6 @@ class YHLiveShopView: UIView {
...
@@ -39,7 +39,6 @@ class YHLiveShopView: UIView {
override
init
(
frame
:
CGRect
)
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
super
.
init
(
frame
:
frame
)
//backgroundColor = UIColor(white: 0.5, alpha: 0.1)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
handleTap
)
)
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
handleTap
)
)
tap
.
delegate
=
self
tap
.
delegate
=
self
addGestureRecognizer
(
tap
)
addGestureRecognizer
(
tap
)
...
@@ -51,7 +50,6 @@ class YHLiveShopView: UIView {
...
@@ -51,7 +50,6 @@ class YHLiveShopView: UIView {
}
}
func
setView
()
{
func
setView
()
{
backgroundColor
=
UIColor
(
hex
:
0x0000
,
alpha
:
0.5
)
centerView
=
{
centerView
=
{
let
view
=
UIView
()
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
view
.
backgroundColor
=
.
white
...
@@ -61,7 +59,6 @@ class YHLiveShopView: UIView {
...
@@ -61,7 +59,6 @@ class YHLiveShopView: UIView {
centerView
.
snp
.
makeConstraints
{
make
in
centerView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
295
)
make
.
top
.
equalToSuperview
()
.
offset
(
295
)
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
left
.
right
.
bottom
.
equalToSuperview
()
// make.height.equalTo(518)
}
}
let
headImageView
=
{
let
headImageView
=
{
...
@@ -150,10 +147,13 @@ class YHLiveShopView: UIView {
...
@@ -150,10 +147,13 @@ class YHLiveShopView: UIView {
}
}
static
func
show
(
callBack
:
@escaping
((
Int
)
->
Void
))
->
YHLiveShopView
{
static
func
show
(
callBack
:
@escaping
((
Int
)
->
Void
))
->
YHLiveShopView
{
let
view
=
YHLiveShopView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
let
view
=
YHLiveShopView
(
frame
:
CGRect
(
x
:
0
,
y
:
KScreenWidth
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
view
.
backData
=
callBack
view
.
backData
=
callBack
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
window
?
.
addSubview
(
view
)
window
?
.
addSubview
(
view
)
UIView
.
animate
(
withDuration
:
0.25
,
delay
:
0
,
options
:
.
curveEaseOut
)
{
view
.
frame
.
origin
.
y
=
0
}
completion
:
{
_
in
}
return
view
return
view
}
}
...
...
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