Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
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
d1ad68bd
authored
Mar 02, 2026
by
ludi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成礼物暴奖的逻辑,还有ui
parent
f2bb5d1f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
292 additions
and
1 deletions
Modules/FUSShowRoomModule/FUSShowRoomModule.xcodeproj/project.pbxproj
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FFPKToolSet.swift
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSModel/FFPKViewModel.swift
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSModel/FFPKWinUserListModel.swift
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSOther/FFPKHelper.swift
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSView/FUSPKContentView/Model/FUSVSGiftBombModel.swift
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/Other/FUSPKHttpHelper.h
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/Other/FUSPKHttpHelper.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Others/FUSShowRoomURLs.h
Modules/FUSShowRoomModule/FUSShowRoomModule/Others/FUSShowRoomURLs.m
Modules/FUSShowRoomModule/FUSShowRoomModule.xcodeproj/project.pbxproj
View file @
d1ad68bd
...
@@ -604,6 +604,7 @@
...
@@ -604,6 +604,7 @@
00E6CD8E2F52EDF600B63797
/* FUSShowRoomUDKeyStore.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD8D2F52EDF600B63797
/* FUSShowRoomUDKeyStore.swift */
;
};
00E6CD8E2F52EDF600B63797
/* FUSShowRoomUDKeyStore.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD8D2F52EDF600B63797
/* FUSShowRoomUDKeyStore.swift */
;
};
00E6CD912F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD902F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.m */
;
};
00E6CD912F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD902F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.m */
;
};
00E6CD922F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD8F2F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.h */
;
};
00E6CD922F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD8F2F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.h */
;
};
00E6CD9F2F556B0B00B63797
/* FUSVSGiftBombModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00E6CD9E2F556B0B00B63797
/* FUSVSGiftBombModel.swift */
;
};
3E261EA32F2C5F680008C0C0
/* FUSByteHelper.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3E261EA12F2C5F680008C0C0
/* FUSByteHelper.h */
;
};
3E261EA32F2C5F680008C0C0
/* FUSByteHelper.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3E261EA12F2C5F680008C0C0
/* FUSByteHelper.h */
;
};
3E261EA42F2C5F680008C0C0
/* FUSByteHelper.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3E261EA22F2C5F680008C0C0
/* FUSByteHelper.m */
;
};
3E261EA42F2C5F680008C0C0
/* FUSByteHelper.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3E261EA22F2C5F680008C0C0
/* FUSByteHelper.m */
;
};
3E261EA72F2C5FAB0008C0C0
/* FUSLinkMicMediator.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3E261EA52F2C5FAB0008C0C0
/* FUSLinkMicMediator.h */
;
};
3E261EA72F2C5FAB0008C0C0
/* FUSLinkMicMediator.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3E261EA52F2C5FAB0008C0C0
/* FUSLinkMicMediator.h */
;
};
...
@@ -2472,6 +2473,7 @@
...
@@ -2472,6 +2473,7 @@
00E6CD8D2F52EDF600B63797
/* FUSShowRoomUDKeyStore.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FUSShowRoomUDKeyStore.swift
;
sourceTree
=
"<group>"
;
};
00E6CD8D2F52EDF600B63797
/* FUSShowRoomUDKeyStore.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FUSShowRoomUDKeyStore.swift
;
sourceTree
=
"<group>"
;
};
00E6CD8F2F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSLiveChatTableClickTypeRangeModel.h
;
sourceTree
=
"<group>"
;
};
00E6CD8F2F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSLiveChatTableClickTypeRangeModel.h
;
sourceTree
=
"<group>"
;
};
00E6CD902F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSLiveChatTableClickTypeRangeModel.m
;
sourceTree
=
"<group>"
;
};
00E6CD902F52FA3900B63797
/* FUSLiveChatTableClickTypeRangeModel.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSLiveChatTableClickTypeRangeModel.m
;
sourceTree
=
"<group>"
;
};
00E6CD9E2F556B0B00B63797
/* FUSVSGiftBombModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
FUSVSGiftBombModel.swift
;
sourceTree
=
"<group>"
;
};
3E261EA12F2C5F680008C0C0
/* FUSByteHelper.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSByteHelper.h
;
sourceTree
=
"<group>"
;
};
3E261EA12F2C5F680008C0C0
/* FUSByteHelper.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSByteHelper.h
;
sourceTree
=
"<group>"
;
};
3E261EA22F2C5F680008C0C0
/* FUSByteHelper.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSByteHelper.m
;
sourceTree
=
"<group>"
;
};
3E261EA22F2C5F680008C0C0
/* FUSByteHelper.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSByteHelper.m
;
sourceTree
=
"<group>"
;
};
3E261EA52F2C5FAB0008C0C0
/* FUSLinkMicMediator.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSLinkMicMediator.h
;
sourceTree
=
"<group>"
;
};
3E261EA52F2C5FAB0008C0C0
/* FUSLinkMicMediator.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSLinkMicMediator.h
;
sourceTree
=
"<group>"
;
};
...
@@ -4082,6 +4084,7 @@
...
@@ -4082,6 +4084,7 @@
00E2A4052F1E1614003B779E
/* FUSPKContentView */
=
{
00E2A4052F1E1614003B779E
/* FUSPKContentView */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
00E6CD9D2F556AFB00B63797
/* Model */
,
00E2A3F42F1E1614003B779E
/* Anims */
,
00E2A3F42F1E1614003B779E
/* Anims */
,
00E2A4022F1E1614003B779E
/* SubViews */
,
00E2A4022F1E1614003B779E
/* SubViews */
,
00E2A4032F1E1614003B779E
/* FFPKContentView.swift */
,
00E2A4032F1E1614003B779E
/* FFPKContentView.swift */
,
...
@@ -4623,6 +4626,14 @@
...
@@ -4623,6 +4626,14 @@
path
=
Model
;
path
=
Model
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
00E6CD9D2F556AFB00B63797
/* Model */
=
{
isa
=
PBXGroup
;
children
=
(
00E6CD9E2F556B0B00B63797
/* FUSVSGiftBombModel.swift */
,
);
path
=
Model
;
sourceTree
=
"<group>"
;
};
BE189D0D2C733B450008418B
/* Models */
=
{
BE189D0D2C733B450008418B
/* Models */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -8539,6 +8550,7 @@
...
@@ -8539,6 +8550,7 @@
files
=
(
files
=
(
3E261EA42F2C5F680008C0C0
/* FUSByteHelper.m in Sources */
,
3E261EA42F2C5F680008C0C0
/* FUSByteHelper.m in Sources */
,
BE189D9C2C733B450008418B
/* FSREffectModel.m in Sources */
,
BE189D9C2C733B450008418B
/* FSREffectModel.m in Sources */
,
00E6CD9F2F556B0B00B63797
/* FUSVSGiftBombModel.swift in Sources */
,
BE189DA42C733B450008418B
/* FSRGiftModel.m in Sources */
,
BE189DA42C733B450008418B
/* FSRGiftModel.m in Sources */
,
BE189DCC2C733B460008418B
/* FSRGiftShowRoomRoomGuarderViewController.m in Sources */
,
BE189DCC2C733B460008418B
/* FSRGiftShowRoomRoomGuarderViewController.m in Sources */
,
BED65AA12C5B745F00668116
/* FUSHomeLanguageGetlistModel.m in Sources */
,
BED65AA12C5B745F00668116
/* FUSHomeLanguageGetlistModel.m in Sources */
,
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FFPKToolSet.swift
View file @
d1ad68bd
...
@@ -44,6 +44,8 @@ enum FFPKSocketCID {
...
@@ -44,6 +44,8 @@ enum FFPKSocketCID {
static
let
punishStatusChange
=
40075
static
let
punishStatusChange
=
40075
/// PK续播
/// PK续播
static
let
continuePK
=
40076
static
let
continuePK
=
40076
/// 礼物暴击变化
static
let
vsGiftBombChange
=
40077
/// 重新旁路推流推送
/// 重新旁路推流推送
static
let
reconnectRtmpStreamPush
=
2100
static
let
reconnectRtmpStreamPush
=
2100
}
}
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSModel/FFPKViewModel.swift
View file @
d1ad68bd
...
@@ -141,6 +141,9 @@ import SwiftyJSON
...
@@ -141,6 +141,9 @@ import SwiftyJSON
return
activatedPunishInPKModel
.
value
return
activatedPunishInPKModel
.
value
}
}
/// 礼物暴击模型
public
let
giftBombModel
:
BehaviorRelay
<
FUSVSGiftBombModel
>
=
.
init
(
value
:
.
init
())
/// pK结果
/// pK结果
var
pkResultState
:
BehaviorRelay
<
(
state
:
FFPKResultState
,
anim
:
Bool
)
>
=
.
init
(
value
:
(
state
:
.
unknow
,
anim
:
false
))
var
pkResultState
:
BehaviorRelay
<
(
state
:
FFPKResultState
,
anim
:
Bool
)
>
=
.
init
(
value
:
(
state
:
.
unknow
,
anim
:
false
))
...
@@ -152,6 +155,9 @@ import SwiftyJSON
...
@@ -152,6 +155,9 @@ import SwiftyJSON
/// 领取奖励流程的推送
/// 领取奖励流程的推送
let
drawRewardFlowPublish
:
PublishRelay
<
(
flowState
:
FFPKDrawRewardFlowState
,
resaultState
:
FFPKResultState
,
effectType
:
Int
,
winUserList
:
[
FFPKWinUserListModel
],
winItemList
:
[
FUSDrawRewardAnimationItemModel
])
>
=
.
init
()
let
drawRewardFlowPublish
:
PublishRelay
<
(
flowState
:
FFPKDrawRewardFlowState
,
resaultState
:
FFPKResultState
,
effectType
:
Int
,
winUserList
:
[
FFPKWinUserListModel
],
winItemList
:
[
FUSDrawRewardAnimationItemModel
])
>
=
.
init
()
/// 胜者主播奖励,注意是主播的奖励,用户是没有的
let
winHostRewardDataModel
:
BehaviorRelay
<
FUSPKWinHostDataModel
?
>
=
.
init
(
value
:
nil
)
@objc
public
var
oc_remoteMute
:
Bool
{
@objc
public
var
oc_remoteMute
:
Bool
{
return
self
.
remoteAnchorModel
.
value
.
muted
.
value
return
self
.
remoteAnchorModel
.
value
.
muted
.
value
}
}
...
@@ -332,6 +338,69 @@ import SwiftyJSON
...
@@ -332,6 +338,69 @@ import SwiftyJSON
}
}
}
}
// 处理礼物暴击倒数信息
if
let
countdownTime
=
countdownTime
{
if
countdownTime
.
pkState
==
.
inPKTime
{
if
self
.
giftBombModel
.
value
.
status
!=
1
||
self
.
giftBombModel
.
value
.
inpktime
<=
0
{
// 数据不正确或者不在pk中不需要处理
return
}
// 计算跑过的时间
let
runTime
=
self
.
giftBombModel
.
value
.
inpktime
-
countdownTime
.
lastTime
/
1000
FUSLog
.
info
(
"ludy ----- runtime:
\(
runTime
)
"
)
if
runTime
<
self
.
giftBombModel
.
value
.
waittimestart
||
runTime
>
self
.
giftBombModel
.
value
.
exectimeend
{
// 不在时间段内不计算
if
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
value
.
remainingTime
!=
-
1
{
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
accept
((
.
other
,
-
1
))
}
return
}
if
runTime
>=
self
.
giftBombModel
.
value
.
waittimestart
&&
runTime
<=
self
.
giftBombModel
.
value
.
waittimeend
{
// 在等待时间阶段
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
accept
((
.
waiting
,
Int
(
self
.
giftBombModel
.
value
.
waittimeend
-
runTime
)))
}
else
if
runTime
>=
self
.
giftBombModel
.
value
.
exectimestart
&&
runTime
<=
self
.
giftBombModel
.
value
.
exectimeend
{
// 执行阶段
if
self
.
giftBombModel
.
value
.
status
==
1
&&
self
.
giftBombModel
.
value
.
compliant
==
1
{
// 执行阶段,校验开启并且完成才倒数
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
accept
((
.
exect
,
Int
(
self
.
giftBombModel
.
value
.
exectimeend
-
runTime
)))
}
else
{
// 如果上一个阶段还是等待,并且还没变成0,就将它变成0
if
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
value
.
stage
==
.
waiting
&&
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
value
.
remainingTime
!=
0
{
self
.
giftBombModel
.
value
.
ff_stageCountdown
.
accept
((
.
waiting
,
0
))
}
}
}
}
}
})
.
disposed
(
by
:
matchDisposeBag
)
// 礼物暴击重连模块
self
.
giftBombModel
.
flatMapLatest
({
$0
.
ff_stageCountdown
})
.
subscribe
(
onNext
:
{[
weak
self
]
stage
,
remainingTime
in
guard
let
self
=
self
else
{
return
}
if
stage
==
.
waiting
&&
remainingTime
==
0
{
// 当达到等待的最大期限,延迟5秒钟请求
self
.
isPrepareReloadGiftBombData
=
true
self
.
perform
(
#selector(
ff_reloadGiftBombDataHandle
)
,
afterDelay
:
5
)
}
else
{
if
self
.
isPrepareReloadGiftBombData
==
true
{
self
.
isPrepareReloadGiftBombData
=
false
NSObject
.
cancelPreviousPerformRequests
(
withTarget
:
self
,
selector
:
#selector(
ff_reloadGiftBombDataHandle
)
,
object
:
nil
)
}
}
})
})
.
disposed
(
by
:
matchDisposeBag
)
.
disposed
(
by
:
matchDisposeBag
)
}
}
...
@@ -347,6 +416,8 @@ import SwiftyJSON
...
@@ -347,6 +416,8 @@ import SwiftyJSON
self
.
remotePunishDataList
.
accept
([])
self
.
remotePunishDataList
.
accept
([])
self
.
activatedPunishInPKModel
.
accept
(
nil
)
self
.
activatedPunishInPKModel
.
accept
(
nil
)
self
.
pkPointChangedSocketJson
.
accept
(
nil
)
self
.
pkPointChangedSocketJson
.
accept
(
nil
)
self
.
giftBombModel
.
accept
(
.
init
())
self
.
winHostRewardDataModel
.
accept
(
nil
)
}
}
...
@@ -490,6 +561,20 @@ import SwiftyJSON
...
@@ -490,6 +561,20 @@ import SwiftyJSON
self
.
vsDataModel
.
accept
(
self
.
vsDataModel
.
value
)
self
.
vsDataModel
.
accept
(
self
.
vsDataModel
.
value
)
}
}
}
}
/// 是否准备重新请求礼物暴击信息
private
var
isPrepareReloadGiftBombData
:
Bool
=
false
/// 重新请求礼物暴击信息
@objc
public
func
ff_reloadGiftBombDataHandle
()
{
// if FFConfig.develop.environment != .release {
// FFToastIndicator.showToastMessage("----- 重新请求礼物暴击信息!")
// }
FUSSwiftLiveHelper
.
shared
.
pkHelper
.
ff_reloadPKGiftbombInfo
()
}
deinit
{
NSObject
.
cancelPreviousPerformRequests
(
withTarget
:
self
)
}
}
}
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSModel/FFPKWinUserListModel.swift
View file @
d1ad68bd
...
@@ -30,3 +30,25 @@ class FFPKWinUserListModel: FUSBaseModel {
...
@@ -30,3 +30,25 @@ class FFPKWinUserListModel: FUSBaseModel {
return
model
as!
Self
return
model
as!
Self
}
}
}
}
/// 胜者主播奖励
class
FUSPKWinHostDataModel
:
FUSBaseModel
{
/// 奖励ID
public
var
sid
:
String
=
""
/// 主播ID
public
var
uid
:
String
=
""
/// 动画(0:小、1:大)
public
var
effect
:
Int
=
0
/// 物品ID
public
var
item
:
FUSDrawRewardAnimationItemModel
=
.
init
()
static
func
createFrom
(
_
json
:
JSON
)
->
Self
{
let
model
=
FUSPKWinHostDataModel
()
model
.
sid
=
json
[
"sid"
]
.
stringValue
model
.
uid
=
json
[
"uid"
]
.
stringValue
model
.
effect
=
json
[
"effect"
]
.
intValue
model
.
item
=
.
ff_converSocketData
(
json
:
json
[
"item"
])
return
model
as!
Self
}
}
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSOther/FFPKHelper.swift
View file @
d1ad68bd
...
@@ -622,6 +622,9 @@ public extension FFPKHelper {
...
@@ -622,6 +622,9 @@ public extension FFPKHelper {
self
.
viewModel
.
value
.
ff_update
(
socketModel
.
vsUser
,
vsTeams
:
nil
,
vsData
:
socketModel
.
vsData
)
self
.
viewModel
.
value
.
ff_update
(
socketModel
.
vsUser
,
vsTeams
:
nil
,
vsData
:
socketModel
.
vsData
)
self
.
viewModel
.
value
.
ff_updatePKState
(
pkState
:
.
inPKTime
,
timeout
:
socketModel
.
timeout
,
difftime
:
socketModel
.
difftime
)
self
.
viewModel
.
value
.
ff_updatePKState
(
pkState
:
.
inPKTime
,
timeout
:
socketModel
.
timeout
,
difftime
:
socketModel
.
difftime
)
if
socketModel
.
jsonData
[
"vsGiftBomb"
]
.
isEmpty
==
false
{
self
.
viewModel
.
value
.
giftBombModel
.
accept
(
.
createFrom
(
socketModel
.
jsonData
[
"vsGiftBomb"
]))
}
})
.
disposed
(
by
:
socketAndNotiDisposeBag
)
})
.
disposed
(
by
:
socketAndNotiDisposeBag
)
...
@@ -797,6 +800,16 @@ public extension FFPKHelper {
...
@@ -797,6 +800,16 @@ public extension FFPKHelper {
})
})
.
disposed
(
by
:
socketAndNotiDisposeBag
)
.
disposed
(
by
:
socketAndNotiDisposeBag
)
// 礼物暴击变化
FUSSwiftSocketHelper
.
listenTo
(
FFPKSocketCID
.
vsGiftBombChange
)
.
mapToJSON
()
.
subscribe
(
onNext
:
{[
weak
self
]
json
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
value
.
giftBombModel
.
accept
(
.
createFrom
(
json
[
"vsGiftBomb"
]))
})
.
disposed
(
by
:
socketAndNotiDisposeBag
)
// PK已结束
// PK已结束
FUSSwiftSocketHelper
FUSSwiftSocketHelper
.
listenTo
(
FFPKSocketCID
.
PKhasEnded
)
.
listenTo
(
FFPKSocketCID
.
PKhasEnded
)
...
@@ -867,6 +880,11 @@ public extension FFPKHelper {
...
@@ -867,6 +880,11 @@ public extension FFPKHelper {
// 动画动效类型(0:小的、1:大的)
// 动画动效类型(0:小的、1:大的)
let
effectType
:
Int
=
data
[
"effectType"
]
.
intValue
let
effectType
:
Int
=
data
[
"effectType"
]
.
intValue
// 主播的奖励结果
if
data
[
"winHostData"
]
.
isEmpty
==
false
{
self
.
viewModel
.
value
.
winHostRewardDataModel
.
accept
(
.
createFrom
(
data
[
"winHostData"
]))
}
self
.
ff_showResaultAlertView
(
winItemList
:
winItemList
,
winUserList
:
winUserList
,
issueType
:
issueType
,
effectType
:
effectType
)
self
.
ff_showResaultAlertView
(
winItemList
:
winItemList
,
winUserList
:
winUserList
,
issueType
:
issueType
,
effectType
:
effectType
)
}
}
...
@@ -982,6 +1000,11 @@ public extension FFPKHelper {
...
@@ -982,6 +1000,11 @@ public extension FFPKHelper {
canDraw
=
false
canDraw
=
false
}
}
if
canDraw
==
false
{
// 没有奖励,那么就不弹了
return
}
self
.
pkResaultView
=
FFPKResaultRewardAlertView
.
ff_create
(
showOn
:
FUSSwiftLiveHelper
.
shared
.
currentFunctionView
?
.
fus_view
(
with
:
.
autoPopView
),
state
:
state
,
winStraek
:
self
.
viewModel
.
value
.
localAnchorModel
.
value
.
winStreak
.
value
,
itemList
:
canDraw
?
drawItemList
:
[])
{[
weak
self
]
isClicked
in
self
.
pkResaultView
=
FFPKResaultRewardAlertView
.
ff_create
(
showOn
:
FUSSwiftLiveHelper
.
shared
.
currentFunctionView
?
.
fus_view
(
with
:
.
autoPopView
),
state
:
state
,
winStraek
:
self
.
viewModel
.
value
.
localAnchorModel
.
value
.
winStreak
.
value
,
itemList
:
canDraw
?
drawItemList
:
[])
{[
weak
self
]
isClicked
in
if
canDraw
==
true
&&
isClicked
==
true
{
if
canDraw
==
true
&&
isClicked
==
true
{
...
@@ -1206,6 +1229,10 @@ public extension FFPKHelper {
...
@@ -1206,6 +1229,10 @@ public extension FFPKHelper {
let
difftime
=
json
[
"difftime"
]
.
intValue
let
difftime
=
json
[
"difftime"
]
.
intValue
self
.
viewModel
.
value
.
ff_updatePKState
(
pkState
:
.
linking
,
timeout
:
timeout
,
difftime
:
difftime
)
self
.
viewModel
.
value
.
ff_updatePKState
(
pkState
:
.
linking
,
timeout
:
timeout
,
difftime
:
difftime
)
self
.
viewModel
.
value
.
pkMsgDisplayControl
.
accept
(
.
createFrom
(
json
))
self
.
viewModel
.
value
.
pkMsgDisplayControl
.
accept
(
.
createFrom
(
json
))
if
json
[
"vsGiftBomb"
]
.
isEmpty
==
false
{
self
.
viewModel
.
value
.
giftBombModel
.
accept
(
.
createFrom
(
json
[
"vsGiftBomb"
]))
}
}
}
}
failure
:
{[
weak
self
]
msg
,
code
in
}
failure
:
{[
weak
self
]
msg
,
code
in
...
@@ -1472,6 +1499,11 @@ public extension FFPKHelper {
...
@@ -1472,6 +1499,11 @@ public extension FFPKHelper {
viewModel
.
ff_updatePKState
(
pkState
:
pkState
,
timeout
:
remaintime
,
difftime
:
0
)
viewModel
.
ff_updatePKState
(
pkState
:
pkState
,
timeout
:
remaintime
,
difftime
:
0
)
FFPKControlDataHelper
.
share
.
ff_reloadPKTypeAndGamePlayIfInneed
()
FFPKControlDataHelper
.
share
.
ff_reloadPKTypeAndGamePlayIfInneed
()
// 礼物暴奖
if
json
[
"vsGiftBomb"
]
.
isEmpty
==
false
{
viewModel
.
giftBombModel
.
accept
(
.
createFrom
(
json
[
"vsGiftBomb"
]))
}
self
.
viewModel
.
accept
(
viewModel
)
self
.
viewModel
.
accept
(
viewModel
)
/// 载入惩罚, 得先有viewmodel
/// 载入惩罚, 得先有viewmodel
self
.
ff_reloadPunishSelectData
(
punishSelectList
:
punishSelectList
)
self
.
ff_reloadPunishSelectData
(
punishSelectList
:
punishSelectList
)
...
@@ -1580,6 +1612,11 @@ public extension FFPKHelper {
...
@@ -1580,6 +1612,11 @@ public extension FFPKHelper {
// 动画动效类型(0:小的、1:大的)
// 动画动效类型(0:小的、1:大的)
let
effectType
:
Int
=
json
[
"effectType"
]
.
intValue
let
effectType
:
Int
=
json
[
"effectType"
]
.
intValue
// 主播的奖励结果
if
json
[
"winHostData"
]
.
isEmpty
==
false
{
viewModel
.
winHostRewardDataModel
.
accept
(
.
createFrom
(
json
[
"winHostData"
]))
}
self
.
ff_showResaultAlertView
(
winItemList
:
winItemList
,
winUserList
:
winUserList
,
issueType
:
issueType
,
effectType
:
effectType
)
self
.
ff_showResaultAlertView
(
winItemList
:
winItemList
,
winUserList
:
winUserList
,
issueType
:
issueType
,
effectType
:
effectType
)
}
}
}
}
...
@@ -1664,6 +1701,11 @@ public extension FFPKHelper {
...
@@ -1664,6 +1701,11 @@ public extension FFPKHelper {
self
.
viewModel
.
value
.
vsMultiRound
.
accept
(
nextStepModel
.
vsMultiRound
)
self
.
viewModel
.
value
.
vsMultiRound
.
accept
(
nextStepModel
.
vsMultiRound
)
// 主播的奖励结果
if
nextStepModel
.
jsonData
[
"winHostData"
]
.
isEmpty
==
false
{
self
.
viewModel
.
value
.
winHostRewardDataModel
.
accept
(
.
createFrom
(
nextStepModel
.
jsonData
[
"winHostData"
]))
}
// 连续pk再来一次pk
// 连续pk再来一次pk
if
nextStepModel
.
timeoutAgent
!=
-
1
&&
nextStepModel
.
timeoutAgent
>
0
{
if
nextStepModel
.
timeoutAgent
!=
-
1
&&
nextStepModel
.
timeoutAgent
>
0
{
self
.
pkAgentPlayRequestDisposebag
=
.
init
()
self
.
pkAgentPlayRequestDisposebag
=
.
init
()
...
@@ -1678,7 +1720,7 @@ public extension FFPKHelper {
...
@@ -1678,7 +1720,7 @@ public extension FFPKHelper {
}
}
}
failure
:
{[
weak
self
]
msg
,
code
in
}
failure
:
{[
weak
self
]
msg
,
code
in
self
?
.
isRequestingPKNextStep
=
false
self
?
.
isRequestingPKNextStep
=
false
print
(
"suolong::: 断网弹窗"
)
FUSLog
.
info
(
"suolong::: 断网弹窗"
)
//索隆:显示重试弹窗
//索隆:显示重试弹窗
self
?
.
handleNetworkFailure
()
self
?
.
handleNetworkFailure
()
...
@@ -1787,6 +1829,10 @@ public extension FFPKHelper {
...
@@ -1787,6 +1829,10 @@ public extension FFPKHelper {
self
?
.
viewModel
.
value
.
ff_update
(
vsTeams
:
pkModel
.
vsTeams
,
vsData
:
pkModel
.
vsData
)
self
?
.
viewModel
.
value
.
ff_update
(
vsTeams
:
pkModel
.
vsTeams
,
vsData
:
pkModel
.
vsData
)
self
?
.
viewModel
.
value
.
ff_updatePKState
(
pkState
:
.
inPKTime
,
timeout
:
pkModel
.
timeout
,
difftime
:
pkModel
.
difftime
)
self
?
.
viewModel
.
value
.
ff_updatePKState
(
pkState
:
.
inPKTime
,
timeout
:
pkModel
.
timeout
,
difftime
:
pkModel
.
difftime
)
if
pkModel
.
jsonData
[
"vsGiftBomb"
]
.
isEmpty
==
false
{
self
?
.
viewModel
.
value
.
giftBombModel
.
accept
(
.
createFrom
(
pkModel
.
jsonData
[
"vsGiftBomb"
]))
}
}
failure
:
{[
weak
self
]
msg
,
code
in
}
failure
:
{[
weak
self
]
msg
,
code
in
FUSLoadingIndicator
.
fus_dismiss
()
FUSLoadingIndicator
.
fus_dismiss
()
...
@@ -1798,6 +1844,41 @@ public extension FFPKHelper {
...
@@ -1798,6 +1844,41 @@ public extension FFPKHelper {
}
}
}
}
/// 获取礼物暴击信息(建议仅在过了阶段但是又没有获取到最新结果的时候调取)
func
ff_reloadPKGiftbombInfo
(
success
:(()
->
Void
)?
=
nil
,
failure
:
((
String
,
Int
)
->
Void
)?
=
nil
)
{
FUSLog
.
info
(
"pidan pk log: ff_reloadPKGiftbombInfo"
)
if
let
roomId
=
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
?
.
roomId
{
let
matchId
=
self
.
viewModel
.
value
.
vsDataModel
.
value
.
matchId
if
isValidString
(
matchId
)
==
false
{
return
}
FUSLog
.
info
(
"pidan pk log: request roomId =
\(
roomId
)
, matchId =
\(
matchId
)
"
)
FUSPKHttpHelper
.
fus_requestVsGiftbombInfo
(
roomId
,
matchId
:
matchId
)
{[
weak
self
]
dataDict
in
guard
let
self
=
self
else
{
return
}
let
json
=
JSON
(
dataDict
)
let
matchId
=
json
[
"vsData"
][
"matchId"
]
.
stringValue
if
matchId
!=
self
.
viewModel
.
value
.
vsDataModel
.
value
.
matchId
{
return
}
self
.
viewModel
.
value
.
giftBombModel
.
accept
(
.
createFrom
(
json
[
"vsGiftBomb"
]))
}
failure
:
{[
weak
self
]
msg
,
code
in
FUSLog
.
info
(
"suolong::: 断网弹窗"
)
//索隆:显示重试弹窗
self
?
.
handleNetworkFailure
()
failure
?(
msg
,
code
)
FUSDialogView
.
fus_showDialog
(
msg
)
}
}
}
/// 处理网络请求失败,添加断网重试功能
/// 处理网络请求失败,添加断网重试功能
private
func
handleNetworkFailure
()
{
private
func
handleNetworkFailure
()
{
// 显示重试弹窗
// 显示重试弹窗
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/FUSPKNew/FUSView/FUSPKContentView/Model/FUSVSGiftBombModel.swift
0 → 100644
View file @
d1ad68bd
//
// FUSVSGiftBombModel.swift
// FUSShowRoomModule
//
// Created by aaa on 2026/3/2.
//
import
UIKit
import
RxSwift
import
RxCocoa
import
SwiftyJSON
public
class
FUSVSGiftBombModel
:
FUSBaseModel
{
public
enum
FUSVSGiftBombStage
{
case
other
case
waiting
case
exect
}
/// 状态(-1:关闭\1:开启)
public
var
status
:
Int
=
-
1
/// 达标(0:不达标、1:已达标)
public
var
compliant
:
Int
=
0
/// 倍率
public
var
multiple
:
String
=
"0"
/// 人气值阈值
public
var
threshold
:
Int
=
0
/// 等待时间开始
public
var
waittimestart
:
Int
=
0
/// 等待时间结束
public
var
waittimeend
:
Int
=
0
/// 执行时间开始
public
var
exectimestart
:
Int
=
0
/// 执行时间结束
public
var
exectimeend
:
Int
=
0
/// pk总时长
public
var
inpktime
:
Int
=
0
/// 阶段的倒数
public
var
ff_stageCountdown
:
BehaviorRelay
<
(
stage
:
FUSVSGiftBombStage
,
remainingTime
:
Int
)
>
=
.
init
(
value
:
(
.
other
,
-
1
))
public
static
func
createFrom
(
_
json
:
JSON
)
->
Self
{
let
model
=
FUSVSGiftBombModel
()
model
.
status
=
json
[
"status"
]
.
intValue
model
.
multiple
=
json
[
"multiple"
]
.
stringValue
model
.
threshold
=
json
[
"threshold"
]
.
intValue
model
.
waittimestart
=
json
[
"waittimestart"
]
.
intValue
model
.
waittimeend
=
json
[
"waittimeend"
]
.
intValue
model
.
exectimestart
=
json
[
"exectimestart"
]
.
intValue
model
.
exectimeend
=
json
[
"exectimeend"
]
.
intValue
model
.
inpktime
=
json
[
"inpktime"
]
.
intValue
model
.
compliant
=
json
[
"compliant"
]
.
intValue
return
model
as!
Self
}
}
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/Other/FUSPKHttpHelper.h
View file @
d1ad68bd
...
@@ -519,6 +519,16 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -519,6 +519,16 @@ NS_ASSUME_NONNULL_BEGIN
succeed
:(
void
(
^
)(
NSArray
<
FUSLiveRoomPunishListModel
*>
*
modelList
,
NSTimeInterval
systemTimestamp
))
succeed
succeed
:(
void
(
^
)(
NSArray
<
FUSLiveRoomPunishListModel
*>
*
modelList
,
NSTimeInterval
systemTimestamp
))
succeed
failure
:(
void
(
^
)(
NSString
*
msg
,
NSInteger
code
))
failure
;
failure
:(
void
(
^
)(
NSString
*
msg
,
NSInteger
code
))
failure
;
/// 获取礼物暴击信息
/// @param roomId 房间ID
/// @param matchId 比赛id
/// @param succeed 1
/// @param failure 0
+
(
void
)
fus_requestVsGiftbombInfo
:(
NSString
*
)
roomId
matchId
:(
NSString
*
)
matchId
succeed
:(
void
(
^
)(
NSDictionary
*
dataDict
))
succeed
failure
:(
void
(
^
)(
NSString
*
msg
,
NSInteger
code
))
failure
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/PK/Other/FUSPKHttpHelper.m
View file @
d1ad68bd
...
@@ -910,4 +910,18 @@
...
@@ -910,4 +910,18 @@
}];
}];
}
}
+
(
void
)
fus_requestVsGiftbombInfo
:
(
NSString
*
)
roomId
matchId
:
(
NSString
*
)
matchId
succeed
:
(
void
(
^
)(
NSDictionary
*
_Nonnull
))
succeed
failure
:
(
void
(
^
)(
NSString
*
_Nonnull
,
NSInteger
))
failure
{
NSDictionary
*
parm
=
@{
@"roomId"
:
roomId
,
@"matchId"
:
matchId
};
[
FUSHttpHelper
postRequestBinaryWithUrl
:
FUSShowRoomURLs
.
fus_URL_vsGiftbombInfo
params
:
parm
retryTimes
:
0
success
:^
(
NSDictionary
*
_Nullable
dataDict
,
int
code
)
{
if
(
succeed
)
{
succeed
(
dataDict
);
}
}
failure
:^
(
NSDictionary
*
_Nullable
dataDict
,
int
code
)
{
if
(
failure
)
{
failure
(
FAILURE_MESSAGE
,
code
);
}
}];
}
@end
@end
Modules/FUSShowRoomModule/FUSShowRoomModule/Others/FUSShowRoomURLs.h
View file @
d1ad68bd
...
@@ -532,6 +532,9 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -532,6 +532,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取房间惩罚列表
/// 获取房间惩罚列表
+
(
NSString
*
)
fus_URL_roomPunishList
;
+
(
NSString
*
)
fus_URL_roomPunishList
;
/// 获取礼物暴击信息
+
(
NSString
*
)
fus_URL_vsGiftbombInfo
;
@end
@end
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Others/FUSShowRoomURLs.m
View file @
d1ad68bd
...
@@ -858,6 +858,10 @@
...
@@ -858,6 +858,10 @@
+
(
NSString
*
)
fus_URL_roomPunishList
{
+
(
NSString
*
)
fus_URL_roomPunishList
{
return
[
FUSConfig
.
sharedInstanced
.
pathConfigs
apiUrl
:
@"/room/punish/list"
];
return
[
FUSConfig
.
sharedInstanced
.
pathConfigs
apiUrl
:
@"/room/punish/list"
];
}
}
/// 获取礼物暴击信息
+
(
NSString
*
)
fus_URL_vsGiftbombInfo
{
return
[
FUSConfig
.
sharedInstanced
.
pathConfigs
apiUrl
:
@"/vs/giftbomb/info"
];
}
@end
@end
...
...
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