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
106fae0d
authored
Jul 22, 2024
by
pierce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
战队完整功能、UI未改色
parent
c6778031
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
577 additions
and
59 deletions
LocalPodSpec/GDRouter/GDRouter/Classes/Service/Module/GDFightTeamRouter.swift
LocalPodSpec/GDRouter/GDRouter/Classes/Service/Module/GDUserZoneRouter.swift
Module/GDFightTeamModule/GDFightTeamModule/Features/FightTeamZone/Model/GDFightTeamZoneModel.swift
Module/GDFightTeamModule/GDFightTeamModule/Features/FightTeamZone/ViewModel/GDFightTeamZoneViewModel.swift
Module/GDFightTeamModule/GDFightTeamModule/Features/Live/FunctionView/Channel/GDFightTeamMemberLevelView.swift
Module/GDFightTeamModule/GDFightTeamModule/Features/Live/GDLiveFightTeamView.swift
Module/GDFightTeamModule/GDFightTeamModule/Module/GDFightTeamRouterModule.swift
Module/GDPersonalModule/GDPersonalModule/Features/Main/View/GDMyPageController.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/GDLiveFunctionView.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/Model/GDLiveChatModel.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/Model/GDStyleMessage.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/AnchorPanelView/GDLiveAnchorPanelView.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/AudiencePanelView/GDLiveAudiencePanelView.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/ChatInputView/GDLiveChatInputView.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/UserInfoCard/GDUserInfoCardView.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/ViewModel/GDLiveChatListViewModel.swift
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/ViewModel/GDUserInfoCardViewModel.swift
Module/GDShowRoomModule/GDShowRoomModule/Module/GDShowRoomConfigs.swift
Module/GDShowRoomModule/GDShowRoomModule/Network/GDShowRoomSocketHelper.swift
Module/GDUserZoneModule/GDUserZoneModule/Feature/Zone/Main/View/AchievementView/GDAchievementView.swift
LocalPodSpec/GDRouter/GDRouter/Classes/Service/Module/GDFightTeamRouter.swift
View file @
106fae0d
...
@@ -46,16 +46,29 @@ public protocol GDFightTeamSwiftRouter: GDFightTeamRouter {
...
@@ -46,16 +46,29 @@ public protocol GDFightTeamSwiftRouter: GDFightTeamRouter {
func
pushFightApplicationVC
(
fid
:
String
,
rootVC
:
UIViewController
?)
func
pushFightApplicationVC
(
fid
:
String
,
rootVC
:
UIViewController
?)
func
fightTeamEnterShowView
(
frame
:
CGRect
,
resUrl
:
String
,
teamLogo
:
String
?,
enterMsg
:
String
?)
->
GDPublicFightTeamEnterShowView
func
fightTeamEnterShowView
(
frame
:
CGRect
,
resUrl
:
String
,
teamLogo
:
String
?,
enterMsg
:
String
?)
->
GDPublicFightTeamEnterShowView
func
liveFightTeamView
(
uid
:
String
,
tid
:
String
?)
->
GDPublicLiveFightTeamView
func
fightTeamMemberLevelView
()
->
GDPublicFightTeamMemberLevelView
func
inviteUserToJoinFightTeam
(
fid
:
String
)
->
Single
<
JSON
>
func
getFightTeamCallInfo
()
->
Single
<
JSON
>
func
getFightTeamDetail
(
with
uid
:
String
,
tid
:
String
?,
page
:
Int
,
success
:
((
GDFightTeamZoneRequestModel
)
->
Void
)?,
failure
:
((
GDMoyaError
)
->
Void
)?)
}
}
//MARK: Socket
open
class
GDPublicFightTeamMedalView
:
BaseView
{
public
struct
GDPublicFightTeamCid
{
open
func
setupFightTeam
(
with
teamName
:
String
,
url
:
String
?,
completionHandler
:
((
GDPublicFightTeamMedalView
)
->
Void
)?)
{
/// 战队入场秀
public
static
let
enterFightTeamShow
=
9987
}
/// 战队消息
public
static
let
fightTeamMsg
=
9988
}
}
//MARK: Models
public
class
GDWearCenterFightTeamMedalModel
:
BaseModel
,
NetworkModelType
{
public
class
GDWearCenterFightTeamMedalModel
:
BaseModel
,
NetworkModelType
{
public
var
firenum
:
String
?
public
var
firenum
:
String
?
...
@@ -150,6 +163,463 @@ public class GDFightTeamZoneModel: BaseModel {
...
@@ -150,6 +163,463 @@ public class GDFightTeamZoneModel: BaseModel {
// 保障状态,跟当前战队装备的入场秀有关 1保障 2未保障
// 保障状态,跟当前战队装备的入场秀有关 1保障 2未保障
public
var
guaranteeStatus
:
Int
=
0
public
var
guaranteeStatus
:
Int
=
0
}
}
public
class
GDFightTeamMessageModel
:
BaseModel
,
GDSocketModelType
{
public
let
levelImageWidth
=
17.5
public
let
hidemanIconWidth
=
17.5
public
let
newerIconWidth
=
15.0
public
let
niceIdImageWidth
=
17.5
public
let
kFansGroupMedalWidth
=
49
public
let
kFansGroupMedalHeight
=
17
public
var
cid
:
Int
=
9988
public
var
roomid
:
String
?
public
var
clickdata
:
GDFightTeamMessageClickDataModel
?
public
var
clicktype
:
String
?
public
var
entershow
:
String
?
public
var
msgbody
:
[
GDMessageBodyModel
]
=
[]
public
var
oldMsgBody
:
[
GDMessageBodyModel
]
=
[]
public
var
msgid
:
String
?
public
var
teamid
:
String
?
public
var
time
:
Int
=
0
public
var
type
:
Int
=
0
// 自定义数据
public
var
font
:
UIFont
=
.
gd_pingfang
(
13
)
public
var
attr
:
NSAttributedString
?
public
var
isTimeCell
=
false
public
var
attrSize
:
CGSize
=
.
zero
public
var
contentMaxWidth
=
GDScreen
.
width
-
16
-
16
-
16
public
var
zoneAttr
:
NSAttributedString
?
var
zoneAttrSize
:
CGSize
=
.
zero
public
static
func
socketModelFrom
(
_
json
:
JSON
,
socketModel
:
GDSocketModel
)
->
Self
{
let
model
=
GDFightTeamMessageModel
()
model
.
clicktype
=
json
[
"clicktype"
]
.
stringValue
model
.
entershow
=
json
[
"entershow"
]
.
stringValue
model
.
msgid
=
json
[
"msgid"
]
.
stringValue
model
.
teamid
=
json
[
"teamid"
]
.
stringValue
model
.
time
=
json
[
"time"
]
.
intValue
model
.
type
=
json
[
"type"
]
.
intValue
model
.
clickdata
=
GDFightTeamMessageClickDataModel
.
createFrom
(
json
[
"clickdata"
])
if
json
[
"msgGroup"
][
"msgbody"
]
.
isEmpty
==
false
{
model
.
msgbody
=
json
[
"msgGroup"
][
"msgbody"
]
.
arrayValue
.
map
({
msgbodyJson
in
GDMessageBodyModel
.
createFrom
(
msgbodyJson
)
})
}
else
if
json
[
"msgbody"
]
.
isEmpty
==
false
{
model
.
msgbody
=
json
[
"msgbody"
]
.
arrayValue
.
map
({
msgbodyJson
in
GDMessageBodyModel
.
createFrom
(
msgbodyJson
)
})
}
model
.
oldMsgBody
=
json
[
"msgbody"
]
.
arrayValue
.
map
({
msgbodyJson
in
GDMessageBodyModel
.
createFrom
(
msgbodyJson
)
})
return
model
as!
Self
}
public
static
func
createModelFrom
(
_
json
:
JSON
)
->
GDFightTeamMessageModel
{
let
model
=
GDFightTeamMessageModel
()
model
.
clicktype
=
json
[
"clicktype"
]
.
stringValue
model
.
entershow
=
json
[
"entershow"
]
.
stringValue
model
.
msgid
=
json
[
"msgid"
]
.
stringValue
model
.
teamid
=
json
[
"teamid"
]
.
stringValue
model
.
time
=
json
[
"time"
]
.
intValue
model
.
type
=
json
[
"type"
]
.
intValue
model
.
clickdata
=
GDFightTeamMessageClickDataModel
.
createFrom
(
json
[
"clickdata"
])
model
.
msgbody
=
json
[
"msgGroup"
][
"msgbody"
]
.
arrayValue
.
map
({
msgbodyJson
in
GDMessageBodyModel
.
createFrom
(
msgbodyJson
)
})
model
.
oldMsgBody
=
json
[
"msgbody"
]
.
arrayValue
.
map
({
msgbodyJson
in
GDMessageBodyModel
.
createFrom
(
msgbodyJson
)
})
return
model
as!
Self
}
public
func
parse
(
isZoneUI
:
Bool
)
{
let
attr
=
NSMutableAttributedString
(
string
:
""
)
for
body
in
oldMsgBody
{
switch
body
.
type
{
case
0
:
var
color
:
UIColor
=
.
hexColor
(
"5F7373"
)
if
isZoneUI
{
color
=
.
hexColor
(
"C0C3C4"
)
}
if
clicktype
==
"TEAM_TRANSFER"
{
if
entershow
?
.
intValue
??
0
>
0
{
if
isZoneUI
{
color
=
.
hexColor
(
"FF9EF3"
)
}
else
{
color
=
.
hexColor
(
"C550B7"
)
}
}
else
{
if
isZoneUI
{
color
=
.
hexColor
(
"4BFFFD"
)
}
else
{
color
=
.
hexColor
(
"12A1A0"
)
}
}
}
let
colorArr
=
body
.
color
?
.
components
(
separatedBy
:
","
)
.
filter
({
isValidString
(
$0
)
})
??
[]
var
bodyAttr
:
NSMutableAttributedString
?
if
colorArr
.
count
==
0
{
bodyAttr
=
createAttr
(
for
:
body
.
content
??
""
,
defaultColor
:
color
)
}
else
if
colorArr
.
count
==
1
{
color
=
.
hexColor
(
colorArr
.
first
??
""
)
bodyAttr
=
createAttr
(
for
:
body
.
content
??
""
,
defaultColor
:
color
)
let
shadow
=
NSShadow
()
shadow
.
shadowColor
=
UIColor
.
init
(
white
:
0
,
alpha
:
0.5
)
shadow
.
shadowOffset
=
CGSize
(
width
:
0.5
,
height
:
0.5
)
shadow
.
shadowBlurRadius
=
1.5
bodyAttr
?
.
addAttributes
([
.
shadow
:
shadow
],
range
:
bodyAttr
?
.
rangeOfAll
()
??
.
init
())
}
else
{
let
gradientLabel
=
createGradientLabel
(
for
:
body
.
content
??
""
,
colorArr
:
colorArr
)
bodyAttr
=
NSMutableAttributedString
.
attachmentString
(
withContent
:
gradientLabel
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
gradientLabel
.
size
,
alignTo
:
font
,
alignment
:
.
center
)
}
if
let
bodyAttr
=
bodyAttr
{
var
index
=
attr
.
length
attr
.
append
(
bodyAttr
)
if
body
.
clicktype
==
"USER_INFO_CARD"
{
// 添加点击事件
attr
.
setTextHighlight
(
.
init
(
location
:
index
,
length
:
bodyAttr
.
length
),
color
:
nil
,
backgroundColor
:
nil
)
{
_
,
_
,
_
,
_
in
let
realuid
=
body
.
clickdata
?
.
json
?[
"realuid"
]
.
stringValue
??
""
let
uid
=
body
.
clickdata
?
.
json
?[
"uid"
]
.
stringValue
??
""
let
nickname
=
body
.
clickdata
?
.
json
?[
"nickname"
]
.
stringValue
??
""
GDRouter
.
LiveRoomRouter
?
.
postShowUserInfoCard
(
realuid
:
realuid
,
uid
:
uid
,
nickname
:
nickname
,
isFightTeam
:
true
)
}
}
}
case
1
:
// 普通图片
let
imageView
=
UIImageView
()
imageView
.
size
=
.
init
(
width
:
font
.
lineHeight
,
height
:
font
.
lineHeight
)
let
attachment
=
NSAttributedString
.
attachmentString
(
withContent
:
imageView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
imageView
.
size
,
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
attachment
)
imageView
.
setWebImage
(
body
.
background
)
case
2
:
// 间隔
attr
.
appendString
(
body
.
content
??
""
)
case
1000
:
// 靓号
if
let
uidType
=
body
.
data
?[
"uidtype"
]
.
string
{
if
uidType
.
intValue
>
0
{
let
niceIdImageView
=
UIImageView
(
image
:
UIImage
(
named
:
"zone_info_niceid_icon"
,
in
:
GDRouter
.
UserZone
?
.
bundle
,
with
:
nil
))
niceIdImageView
.
contentMode
=
.
scaleAspectFit
// 靓号
if
let
iconUrl
=
GDRouter
.
DataRouter
?
.
specialIDData
[
uidType
]?
.
icon
{
niceIdImageView
.
setWebImage
(
iconUrl
,
placeholderImage
:
UIImage
(
named
:
"zone_info_niceid_icon"
,
in
:
GDRouter
.
UserZone
?
.
bundle
,
with
:
nil
)
)
}
let
niceidAttr
=
NSMutableAttributedString
.
attachmentString
(
withContent
:
niceIdImageView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
.
init
(
width
:
niceIdImageWidth
,
height
:
niceIdImageWidth
),
alignTo
:
font
,
alignment
:
.
bottom
)
attr
.
append
(
niceidAttr
)
}
}
case
1001
:
// 粉丝团徽章
let
medalView
=
GDRouter
.
FansGroupRouter
?
.
fansGroupMedalView
()
let
name
=
body
.
data
?[
"name"
]
.
stringValue
??
""
let
level
=
body
.
data
?[
"levelV2"
]
.
intValue
??
0
let
icon
=
body
.
data
?[
"icon"
]
.
stringValue
??
""
let
titleColor
=
body
.
data
?[
"titlecolor"
]
.
stringValue
??
""
let
strokeColor
=
body
.
data
?[
"strokecolor"
]
.
stringValue
??
""
medalView
?
.
setupMedal
(
with
:
name
,
level
:
level
,
icon
:
icon
,
nameColor
:
UIColor
.
hexColor
(
titleColor
),
strokeColor
:
UIColor
.
hexColor
(
strokeColor
))
let
attachmentAttr
=
NSAttributedString
.
attachmentString
(
withContent
:
medalView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
.
init
(
width
:
kFansGroupMedalWidth
+
4
,
height
:
kFansGroupMedalHeight
),
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
attachmentAttr
)
case
1002
:
// 称号
let
titleModel
=
GDZoneTitleModel
.
createFrom
(
body
.
data
??
.
init
())
let
index
=
attr
.
length
-
1
titleModel
.
makeTitleImage
{[
weak
self
]
(
image
)
in
guard
let
self
=
self
else
{
return
}
let
titleAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
image
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
CGSize
(
width
:
levelImageWidth
*
Double
((
image
?
.
size
.
width
??
0
)
/
(
image
?
.
size
.
height
??
1
)),
height
:
levelImageWidth
),
alignTo
:
self
.
font
,
alignment
:
.
center
)
attr
.
insert
(
titleAttachment
,
at
:
index
)
}
case
1003
:
// 战队勋章
let
fightTeamMedal
=
GDRouter
.
FightTeamRouter
?
.
getFightTeamMedalView
()
??
GDPublicFightTeamMedalView
()
let
teamName
=
body
.
data
?[
"richteamname"
]
.
stringValue
??
""
let
teamMedalUrl
=
body
.
data
?[
"richteammedal"
]
.
stringValue
??
""
fightTeamMedal
.
setupFightTeam
(
with
:
teamName
,
url
:
teamMedalUrl
,
completionHandler
:
nil
)
let
titleAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
fightTeamMedal
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
CGSize
(
width
:
fightTeamMedal
.
width
,
height
:
fightTeamMedal
.
height
),
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
titleAttachment
)
case
1004
:
// 守护
let
guardianAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
UIImage
(
named
:
"icon_live_guard_icon"
,
in
:
GDRouter
.
LiveRoomRouter
?
.
bundle
,
with
:
nil
),
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
CGSize
(
width
:
levelImageWidth
*
1.7
,
height
:
levelImageWidth
*
1.2
),
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
guardianAttachment
)
case
1005
:
// 富豪等级
let
level
=
body
.
data
?[
"richlevel"
]
.
stringValue
??
""
if
let
levelModel
=
GDRouter
.
DataRouter
?
.
levelDict
[
level
]
{
// 有等级数据
let
levelImageView
=
UIImageView
()
levelImageView
.
size
=
.
init
(
width
:
levelImageWidth
,
height
:
levelImageWidth
)
levelImageView
.
contentMode
=
.
scaleAspectFit
levelImageView
.
setWebImage
(
levelModel
.
icon
??
""
)
let
levelAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
levelImageView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
.
init
(
width
:
levelImageWidth
,
height
:
levelImageWidth
),
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
levelAttachment
)
}
case
1006
:
// 神秘人
let
hidemanAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
GDLevelModel
.
hideManImage
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
CGSize
(
width
:
hidemanIconWidth
,
height
:
hidemanIconWidth
),
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
hidemanAttachment
)
case
1007
:
// 新人
let
newerAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
UIImage
(
named
:
"icon_newer"
,
in
:
GDRouter
.
LiveRoomRouter
?
.
bundle
,
with
:
nil
),
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
CGSize
(
width
:
newerIconWidth
,
height
:
newerIconWidth
),
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
newerAttachment
)
case
1008
:
// 战队成员等级
let
teamLevel
=
body
.
data
?[
"teamlevel"
]
.
intValue
??
0
let
teamLevelView
=
GDRouter
.
FightTeamRouter
?
.
fightTeamMemberLevelView
()
??
GDPublicFightTeamMemberLevelView
()
teamLevelView
.
teamLevel
=
teamLevel
let
levelAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
teamLevelView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
teamLevelView
.
size
,
alignTo
:
font
,
alignment
:
.
center
)
if
teamLevel
>
0
&&
teamLevel
<=
3
{
attr
.
append
(
levelAttachment
)
}
case
1009
:
// 战队角色
let
role
=
body
.
data
?[
"role"
]
.
intValue
??
0
if
role
==
0
{
}
else
if
role
==
1
{
// 副队长
let
bgImageView
=
UIImageView
(
frame
:
.
zero
)
bgImageView
.
image
=
UIImage
(
named
:
"fightTeam_zone_role_bg"
,
in
:
GDRouter
.
FightTeamRouter
?
.
bundle
,
with
:
nil
)
bgImageView
.
contentMode
=
.
scaleToFill
bgImageView
.
size
=
.
init
(
width
:
30
,
height
:
15
)
let
roleNameLabel
=
UILabel
(
frame
:
.
zero
)
roleNameLabel
.
font
=
.
gd_pingfang
(
7
)
roleNameLabel
.
textColor
=
.
hexColor
(
"0F677A"
)
roleNameLabel
.
text
=
"副队长"
bgImageView
.
addSubview
(
roleNameLabel
)
roleNameLabel
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
.
offset
(
-
4
)
}
let
roleAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
bgImageView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
bgImageView
.
size
,
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
roleAttachment
)
}
else
if
role
==
2
{
// 队长
let
bgImageView
=
UIImageView
(
frame
:
.
zero
)
bgImageView
.
image
=
UIImage
(
named
:
"fightTeam_zone_role_bg"
,
in
:
GDRouter
.
FightTeamRouter
?
.
bundle
,
with
:
nil
)
bgImageView
.
contentMode
=
.
scaleToFill
bgImageView
.
size
=
.
init
(
width
:
30
,
height
:
15
)
let
roleNameLabel
=
UILabel
(
frame
:
.
zero
)
roleNameLabel
.
font
=
.
gd_pingfang
(
7
)
roleNameLabel
.
textColor
=
.
hexColor
(
"0F677A"
)
roleNameLabel
.
text
=
"队长"
bgImageView
.
addSubview
(
roleNameLabel
)
roleNameLabel
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
.
offset
(
-
4
)
}
let
roleAttachment
=
NSAttributedString
.
attachmentString
(
withContent
:
bgImageView
,
contentMode
:
.
scaleAspectFit
,
attachmentSize
:
bgImageView
.
size
,
alignTo
:
font
,
alignment
:
.
center
)
attr
.
append
(
roleAttachment
)
}
default
:
if
isValidString
(
body
.
tips
)
{
attr
.
appendString
(
body
.
tips
??
""
)
}
}
}
if
clicktype
==
"TEAM_TRANSFER"
{
attr
.
setTextHighlight
(
attr
.
rangeOfAll
(),
color
:
nil
,
backgroundColor
:
nil
)
{[
weak
self
]
_
,
_
,
_
,
_
in
if
GDRouter
.
LiveRoomRouter
?
.
role
.
value
==
.
anchor
{
FTIndicator
.
showToastMessage
(
"正在直播中,无法参与战队召集"
)
return
}
if
let
roomid
=
self
?
.
clickdata
?
.
roomid
{
if
roomid
!=
GDRouter
.
LiveRoomRouter
?
.
roomid
.
value
{
let
anchorModel
=
GDRoomListAnchorModel
()
anchorModel
.
uid
=
roomid
GDRouter
.
LiveRoomRouter
?
.
playLive
(
model
:
anchorModel
,
joinType
:
.
undefine
,
subtype
:
.
undefine
)
}
}
}
}
else
if
clicktype
==
"USER_INFO_CARD"
{
// 添加点击事件
attr
.
setTextHighlight
(
attr
.
rangeOfAll
(),
color
:
nil
,
backgroundColor
:
nil
)
{[
weak
self
]
_
,
_
,
_
,
_
in
let
realuid
=
self
?
.
clickdata
?
.
json
?[
"realuid"
]
.
stringValue
??
""
let
uid
=
self
?
.
clickdata
?
.
json
?[
"uid"
]
.
stringValue
??
""
let
nickname
=
self
?
.
clickdata
?
.
json
?[
"nickname"
]
.
stringValue
??
""
GDRouter
.
LiveRoomRouter
?
.
postShowUserInfoCard
(
realuid
:
realuid
,
uid
:
uid
,
nickname
:
nickname
,
isFightTeam
:
false
)
}
}
if
isZoneUI
{
self
.
zoneAttr
=
attr
if
let
attr
=
self
.
zoneAttr
{
// 计算高度
let
container
=
YYTextContainer
()
container
.
size
=
CGSize
(
width
:
contentMaxWidth
,
height
:
CGFloat
.
greatestFiniteMagnitude
)
if
let
layout
=
YYTextLayout
(
container
:
container
,
text
:
attr
)
{
self
.
zoneAttrSize
=
.
init
(
width
:
ceil
(
layout
.
textBoundingSize
.
width
),
height
:
ceil
(
layout
.
textBoundingSize
.
height
))
}
}
}
else
{
self
.
attr
=
attr
if
let
attr
=
self
.
attr
{
// 计算高度
let
container
=
YYTextContainer
()
container
.
size
=
CGSize
(
width
:
contentMaxWidth
,
height
:
CGFloat
.
greatestFiniteMagnitude
)
if
let
layout
=
YYTextLayout
(
container
:
container
,
text
:
attr
)
{
self
.
attrSize
=
.
init
(
width
:
ceil
(
layout
.
textBoundingSize
.
width
),
height
:
ceil
(
layout
.
textBoundingSize
.
height
))
}
}
}
}
/// 默认富文本
/// - Parameter content: 内容
/// - Returns:
private
func
createAttr
(
for
content
:
String
,
defaultColor
:
UIColor
=
.
white
)
->
NSMutableAttributedString
{
let
attr
=
NSMutableAttributedString
(
string
:
content
)
// let shadow = NSShadow()
// shadow.shadowColor = UIColor(hexString: "000000", alpha: 0.3)
// shadow.shadowOffset = CGSize(width: 0.5, height: 0.5)
// shadow.shadowBlurRadius = 1.5
let
paragrahStyle
=
NSMutableParagraphStyle
()
paragrahStyle
.
setParagraphStyle
(
NSParagraphStyle
.
default
)
paragrahStyle
.
lineSpacing
=
1.5
attr
.
addAttributes
([
.
foregroundColor
:
defaultColor
,
.
font
:
font
,
.
paragraphStyle
:
paragrahStyle
],
range
:
attr
.
rangeOfAll
())
return
attr
}
/// 生成渐变label
/// - Parameters:
/// - content: 内容
/// - colorArr: 渐变颜色
/// - Returns:
public
func
createGradientLabel
(
for
content
:
String
,
colorArr
:
[
String
])
->
GDGradientLabel
{
let
gradientLabel
=
GDGradientLabel
()
gradientLabel
.
text
=
content
gradientLabel
.
font
=
font
if
colorArr
.
count
>
1
{
// 有渐变
gradientLabel
.
colors
=
colorArr
.
map
({
.
hexColor
(
$0
)
})
gradientLabel
.
startPoint
=
CGPoint
(
x
:
0
,
y
:
0.5
)
gradientLabel
.
endPoint
=
CGPoint
(
x
:
1
,
y
:
0.5
)
}
else
{
gradientLabel
.
textColor
=
UIColor
(
hexString
:
colorArr
.
first
??
"FFFFFF"
)
}
// let shadow = NSShadow()
// shadow.shadowColor = UIColor(hexString: "000000", alpha: 0.3)
// shadow.shadowOffset = CGSize(width: 0.5, height: 0.5)
// shadow.shadowBlurRadius = 1.5
// gradientLabel.shadow = shadow
gradientLabel
.
updateContent
()
gradientLabel
.
updateFrame
()
gradientLabel
.
sizeUpdate
()
return
gradientLabel
}
}
public
class
GDMessageBodyModel
:
BaseModel
,
NetworkModelType
{
public
var
clickdata
:
GDFightTeamMessageClickDataModel
?
public
var
clicktype
:
String
?
public
var
color
:
String
?
public
var
content
:
String
?
public
var
tips
:
String
?
public
var
type
:
Int
=
0
public
var
background
:
String
?
public
var
data
:
JSON
?
=
nil
public
static
func
createFrom
(
_
json
:
JSON
)
->
Self
{
let
model
=
GDMessageBodyModel
()
model
.
clickdata
=
GDFightTeamMessageClickDataModel
.
createFrom
(
json
[
"clickdata"
])
model
.
clicktype
=
json
[
"clicktype"
]
.
stringValue
model
.
color
=
json
[
"color"
]
.
stringValue
model
.
content
=
json
[
"content"
]
.
stringValue
model
.
tips
=
json
[
"tips"
]
.
stringValue
model
.
type
=
json
[
"type"
]
.
intValue
model
.
background
=
json
[
"background"
]
.
stringValue
model
.
data
=
json
[
"data"
]
return
model
as!
Self
}
}
public
class
GDFightTeamMessageClickDataModel
:
BaseModel
,
NetworkModelType
{
public
var
roomid
:
String
?
public
var
summonid
:
String
?
public
var
json
:
JSON
?
public
static
func
createFrom
(
_
json
:
JSON
)
->
Self
{
let
model
=
GDFightTeamMessageClickDataModel
()
model
.
roomid
=
json
[
"roomid"
]
.
stringValue
model
.
summonid
=
json
[
"summonid"
]
.
stringValue
model
.
json
=
json
return
model
as!
Self
}
}
public
class
GDFightTeamZoneRequestModel
:
BaseModel
{
/// 是否是成员
public
var
ismember
:
Bool
=
false
/// 角色身份 :-1无 0普通 1管理 2队长
public
var
role
:
GDFightTeamRole
=
.
none
public
var
memberlist
:
[
GDFightTeamMemberModel
]
=
[]
public
var
richteam
:
GDFightTeamZoneModel
?
public
var
surplusTime
:
Int
=
0
public
var
applyPendingCount
:
Int
=
0
}
//MARK: Public Views
//MARK: Public Views
open
class
GDPublicFightTeamEnterShowView
:
BaseView
{
open
class
GDPublicFightTeamEnterShowView
:
BaseView
{
...
@@ -164,4 +634,22 @@ open class GDPublicFightTeamEnterShowView: BaseView {
...
@@ -164,4 +634,22 @@ open class GDPublicFightTeamEnterShowView: BaseView {
open
class
GDPublicLiveFightTeamView
:
BaseView
{
open
class
GDPublicLiveFightTeamView
:
BaseView
{
public
var
dismissHandler
:
EmptyClosure
?
open
func
show
(
on
view
:
UIView
,
animate
:
Bool
=
true
)
{
}
open
func
dismiss
(
animate
:
Bool
=
true
)
{
}
open
func
refreshEntranceShowData
()
{
}
open
func
insertChannelContent
(
content
:
String
)
{
}
}
open
class
GDPublicFightTeamMedalView
:
BaseView
{
open
func
setupFightTeam
(
with
teamName
:
String
,
url
:
String
?,
completionHandler
:
((
GDPublicFightTeamMedalView
)
->
Void
)?)
{
}
}
open
class
GDPublicFightTeamMemberLevelView
:
BaseView
{
open
var
teamLevel
:
Int
=
0
}
}
LocalPodSpec/GDRouter/GDRouter/Classes/Service/Module/GDUserZoneRouter.swift
View file @
106fae0d
...
@@ -357,6 +357,7 @@ open class GDPublicAchievementView: BaseView {
...
@@ -357,6 +357,7 @@ open class GDPublicAchievementView: BaseView {
strokeColor
:
UIColor
?)
{}
strokeColor
:
UIColor
?)
{}
open
func
cleanFansGroupMedalView
()
{}
open
func
cleanFansGroupMedalView
()
{}
open
func
setupFightTeamMedal
(
with
name
:
String
,
medalUrl
:
String
?){}
open
func
setupFightTeamMedal
(
with
name
:
String
,
medalUrl
:
String
?){}
open
func
cleanFightTeamMedal
()
{
}
open
func
updateFrame
()
{}
open
func
updateFrame
()
{}
open
func
clean
()
{}
open
func
clean
()
{}
}
}
Module/GDFightTeamModule/GDFightTeamModule/Features/FightTeamZone/Model/GDFightTeamZoneModel.swift
View file @
106fae0d
...
@@ -10,18 +10,9 @@ import UIKit
...
@@ -10,18 +10,9 @@ import UIKit
import
GDToolBox
import
GDToolBox
import
GDRouter
import
GDRouter
class
GDFightTeamZoneRequestModel
:
BaseModel
,
NetworkModelType
{
extension
GDFightTeamZoneRequestModel
:
NetworkModelType
{
/// 是否是成员
public
static
func
createFrom
(
_
json
:
JSON
)
->
Self
{
var
ismember
:
Bool
=
false
/// 角色身份 :-1无 0普通 1管理 2队长
var
role
:
GDFightTeamRole
=
.
none
var
memberlist
:
[
GDFightTeamMemberModel
]
=
[]
var
richteam
:
GDFightTeamZoneModel
?
var
surplusTime
:
Int
=
0
var
applyPendingCount
:
Int
=
0
static
func
createFrom
(
_
json
:
JSON
)
->
Self
{
let
model
=
GDFightTeamZoneRequestModel
()
let
model
=
GDFightTeamZoneRequestModel
()
model
.
ismember
=
json
[
"data"
][
"ismember"
]
.
boolValue
model
.
ismember
=
json
[
"data"
][
"ismember"
]
.
boolValue
model
.
role
=
GDFightTeamRole
.
create
(
for
:
json
[
"data"
][
"role"
]
.
intValue
)
model
.
role
=
GDFightTeamRole
.
create
(
for
:
json
[
"data"
][
"role"
]
.
intValue
)
...
...
Module/GDFightTeamModule/GDFightTeamModule/Features/FightTeamZone/ViewModel/GDFightTeamZoneViewModel.swift
View file @
106fae0d
...
@@ -100,15 +100,6 @@ class GDFightTeamZoneViewModel: BaseViewModel {
...
@@ -100,15 +100,6 @@ class GDFightTeamZoneViewModel: BaseViewModel {
self
?
.
refreshState
.
accept
(
.
idle
)
self
?
.
refreshState
.
accept
(
.
idle
)
FTIndicator
.
showToastMessage
(
error
.
msg
)
FTIndicator
.
showToastMessage
(
error
.
msg
)
}
}
// GDFightTeamHttpHelper.shared.getFightTeamDetail(with: uid, tid: tid, page: page).subscribe {[weak self] model in
//
//
//
// } onFailure: {[weak self] error in
//
// }.disposed(by: disposeBag)
}
}
func
operateUser
(
as
manage
:
Bool
,
uid
:
String
)
{
func
operateUser
(
as
manage
:
Bool
,
uid
:
String
)
{
...
...
Module/GDFightTeamModule/GDFightTeamModule/Features/Live/FunctionView/Channel/GDFightTeamMemberLevelView.swift
View file @
106fae0d
...
@@ -8,8 +8,9 @@
...
@@ -8,8 +8,9 @@
import
UIKit
import
UIKit
import
GDToolBox
import
GDToolBox
import
GDRouter
class
GDFightTeamMemberLevelView
:
Base
View
{
class
GDFightTeamMemberLevelView
:
GDPublicFightTeamMemberLevel
View
{
init
()
{
init
()
{
super
.
init
(
frame
:
.
init
(
x
:
0
,
y
:
0
,
width
:
40.5
,
height
:
17
))
super
.
init
(
frame
:
.
init
(
x
:
0
,
y
:
0
,
width
:
40.5
,
height
:
17
))
...
@@ -19,7 +20,7 @@ class GDFightTeamMemberLevelView: BaseView {
...
@@ -19,7 +20,7 @@ class GDFightTeamMemberLevelView: BaseView {
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
var
teamLevel
:
Int
=
0
{
override
var
teamLevel
:
Int
{
didSet
{
didSet
{
switch
teamLevel
{
switch
teamLevel
{
case
1
:
case
1
:
...
...
Module/GDFightTeamModule/GDFightTeamModule/Features/Live/GDLiveFightTeamView.swift
View file @
106fae0d
...
@@ -11,9 +11,7 @@ import Lottie
...
@@ -11,9 +11,7 @@ import Lottie
import
GDToolBox
import
GDToolBox
import
GDRouter
import
GDRouter
class
GDLiveFightTeamView
:
BaseView
{
class
GDLiveFightTeamView
:
GDPublicLiveFightTeamView
{
var
dismissHandler
:
EmptyClosure
?
// MARK: Init
// MARK: Init
// MARK: Init
// MARK: Init
...
@@ -227,7 +225,7 @@ class GDLiveFightTeamView: BaseView {
...
@@ -227,7 +225,7 @@ class GDLiveFightTeamView: BaseView {
}
}
// MARK: Method
// MARK: Method
func
show
(
on
view
:
UIView
,
animate
:
Bool
=
true
)
{
override
func
show
(
on
view
:
UIView
,
animate
:
Bool
=
true
)
{
guard
self
.
superview
==
nil
else
{
return
}
guard
self
.
superview
==
nil
else
{
return
}
view
.
addSubview
(
self
)
view
.
addSubview
(
self
)
// 记录已读的最后一条
// 记录已读的最后一条
...
@@ -245,7 +243,7 @@ class GDLiveFightTeamView: BaseView {
...
@@ -245,7 +243,7 @@ class GDLiveFightTeamView: BaseView {
}
}
}
}
func
dismiss
(
animate
:
Bool
=
true
)
{
override
func
dismiss
(
animate
:
Bool
=
true
)
{
// 记录已读的最后一条
// 记录已读的最后一条
UserDefaults
.
standard
.
setValue
(
GDFightTeamCenter
.
shared
.
msgList
.
value
.
last
?
.
msgid
??
""
,
forKey
:
GDFightTeamUDKeys
.
lastReadFightTeamMsgid
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
UserDefaults
.
standard
.
setValue
(
GDFightTeamCenter
.
shared
.
msgList
.
value
.
last
?
.
msgid
??
""
,
forKey
:
GDFightTeamUDKeys
.
lastReadFightTeamMsgid
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
GDFightTeamCenter
.
shared
.
hadUnreadMsg
.
accept
(
false
)
GDFightTeamCenter
.
shared
.
hadUnreadMsg
.
accept
(
false
)
...
@@ -263,6 +261,15 @@ class GDLiveFightTeamView: BaseView {
...
@@ -263,6 +261,15 @@ class GDLiveFightTeamView: BaseView {
dismissHandler
?()
dismissHandler
?()
}
}
}
}
override
func
refreshEntranceShowData
()
{
self
.
mainView
?
.
enterShowView
?
.
viewModel
.
refreshEntranceShowData
(
with
:
1
)
}
override
func
insertChannelContent
(
content
:
String
)
{
self
.
mainView
?
.
channelView
?
.
insertContent
(
content
:
content
)
}
deinit
{
deinit
{
GDlog
.
verbose
()
GDlog
.
verbose
()
...
...
Module/GDFightTeamModule/GDFightTeamModule/Module/GDFightTeamRouterModule.swift
View file @
106fae0d
...
@@ -75,6 +75,27 @@ public class GDFightTeamRouterModule: NSObject, GDFightTeamSwiftRouter {
...
@@ -75,6 +75,27 @@ public class GDFightTeamRouterModule: NSObject, GDFightTeamSwiftRouter {
public
func
fightTeamEnterShowView
(
frame
:
CGRect
,
resUrl
:
String
,
teamLogo
:
String
?,
enterMsg
:
String
?)
->
GDPublicFightTeamEnterShowView
{
public
func
fightTeamEnterShowView
(
frame
:
CGRect
,
resUrl
:
String
,
teamLogo
:
String
?,
enterMsg
:
String
?)
->
GDPublicFightTeamEnterShowView
{
GDFightTeamEnterShowView
(
with
:
frame
,
resUrl
:
resUrl
,
teamLogo
:
teamLogo
,
enterMsg
:
enterMsg
)
GDFightTeamEnterShowView
(
with
:
frame
,
resUrl
:
resUrl
,
teamLogo
:
teamLogo
,
enterMsg
:
enterMsg
)
}
}
public
func
liveFightTeamView
(
uid
:
String
,
tid
:
String
?)
->
GDPublicLiveFightTeamView
{
GDLiveFightTeamView
(
with
:
uid
,
tid
:
tid
)
}
public
func
fightTeamMemberLevelView
()
->
GDPublicFightTeamMemberLevelView
{
return
GDFightTeamMemberLevelView
()
}
public
func
inviteUserToJoinFightTeam
(
fid
:
String
)
->
Single
<
JSON
>
{
GDFightTeamHttpHelper
.
shared
.
inviteUserToJoinFightTeam
(
fid
:
fid
)
}
public
func
getFightTeamCallInfo
()
->
Single
<
JSON
>
{
GDFightTeamHttpHelper
.
shared
.
getFightTeamCallInfo
()
}
public
func
getFightTeamDetail
(
with
uid
:
String
,
tid
:
String
?,
page
:
Int
,
success
:
((
GDFightTeamZoneRequestModel
)
->
Void
)?,
failure
:
((
GDMoyaError
)
->
Void
)?)
{
GDFightTeamCenter
.
shared
.
getFightTeamDetail
(
with
:
uid
,
tid
:
tid
,
page
:
page
,
success
:
success
,
failure
:
failure
)
}
}
}
extension
GDFightTeamRouterModule
:
GDRouterProtocol
{
extension
GDFightTeamRouterModule
:
GDRouterProtocol
{
...
...
Module/GDPersonalModule/GDPersonalModule/Features/Main/View/GDMyPageController.swift
View file @
106fae0d
...
@@ -443,9 +443,7 @@ class GDMyPageController: BaseViewController {
...
@@ -443,9 +443,7 @@ class GDMyPageController: BaseViewController {
arr
.
append
(
.
subfunction
)
arr
.
append
(
.
subfunction
)
}
else
{
}
else
{
arr
.
append
(
.
diamondAndCoin
)
arr
.
append
(
.
diamondAndCoin
)
if
GDRouter
.
BaseBusinessRouter
?
.
isCurrentVersionVerified
.
value
==
false
{
arr
.
append
(
.
function
)
arr
.
append
(
.
function
)
}
if
dailySignSwitch
{
if
dailySignSwitch
{
arr
.
append
(
.
dailySign
)
arr
.
append
(
.
dailySign
)
}
}
...
@@ -558,7 +556,7 @@ extension GDMyPageController: UITableViewDelegate, UITableViewDataSource {
...
@@ -558,7 +556,7 @@ extension GDMyPageController: UITableViewDelegate, UITableViewDataSource {
$0
.
modulekey
!=
kMyPageFunctionStore
$0
.
modulekey
!=
kMyPageFunctionStore
&&
$0
.
modulekey
!=
kMyPageFunctionTurnplate
&&
$0
.
modulekey
!=
kMyPageFunctionTurnplate
&&
$0
.
modulekey
!=
kMyPageFunctionFansGroup
&&
$0
.
modulekey
!=
kMyPageFunctionFansGroup
//
&& $0.modulekey != kMyPageFunctionFightTeam
&&
$0
.
modulekey
!=
kMyPageFunctionFightTeam
}
.
count
??
0
)
}
.
count
??
0
)
if
GDRouter
.
DataRouter
?
.
dailySignSwitch
.
value
==
false
{
if
GDRouter
.
DataRouter
?
.
dailySignSwitch
.
value
==
false
{
itemCount
+=
1
itemCount
+=
1
...
@@ -602,7 +600,7 @@ extension GDMyPageController: UITableViewDelegate, UITableViewDataSource {
...
@@ -602,7 +600,7 @@ extension GDMyPageController: UITableViewDelegate, UITableViewDataSource {
}
.
map
{
$0
.
filter
{
$0
.
modulekey
!=
kMyPageFunctionStore
}
.
map
{
$0
.
filter
{
$0
.
modulekey
!=
kMyPageFunctionStore
&&
$0
.
modulekey
!=
kMyPageFunctionTurnplate
&&
$0
.
modulekey
!=
kMyPageFunctionTurnplate
&&
$0
.
modulekey
!=
kMyPageFunctionFansGroup
&&
$0
.
modulekey
!=
kMyPageFunctionFansGroup
//
&& $0.modulekey != kMyPageFunctionFightTeam
&&
$0
.
modulekey
!=
kMyPageFunctionFightTeam
}}
}}
.
map
({
arr
in
.
map
({
arr
in
var
arr
=
arr
var
arr
=
arr
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/GDLiveFunctionView.swift
View file @
106fae0d
...
@@ -1080,7 +1080,7 @@ class GDLiveFunctionView: BaseView {
...
@@ -1080,7 +1080,7 @@ class GDLiveFunctionView: BaseView {
})
.
disposed
(
by
:
disposeBag
)
})
.
disposed
(
by
:
disposeBag
)
GDS
ocketPublisher
.
FightTeam
.
enter
Show
.
subscribe
(
onNext
:
{[
weak
self
]
json
in
GDS
howRoomSocketPublisher
.
enterFightTeam
Show
.
subscribe
(
onNext
:
{[
weak
self
]
json
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
guard
self
.
fightTeamEnterShowView
?
.
superview
==
nil
else
{
return
}
guard
self
.
fightTeamEnterShowView
?
.
superview
==
nil
else
{
return
}
...
@@ -1097,6 +1097,7 @@ class GDLiveFunctionView: BaseView {
...
@@ -1097,6 +1097,7 @@ class GDLiveFunctionView: BaseView {
self
.
fightTeamEnterShowView
?
.
dismiss
()
self
.
fightTeamEnterShowView
?
.
dismiss
()
self
.
fightTeamEnterShowView
=
GDRouter
.
FightTeamRouter
?
.
fightTeamEnterShowView
(
frame
:
GDScreen
.
frame
,
resUrl
:
model
.
res
??
""
,
teamLogo
:
logoUrl
,
enterMsg
:
enterMsg
)
self
.
fightTeamEnterShowView
=
GDRouter
.
FightTeamRouter
?
.
fightTeamEnterShowView
(
frame
:
GDScreen
.
frame
,
resUrl
:
model
.
res
??
""
,
teamLogo
:
logoUrl
,
enterMsg
:
enterMsg
)
self
.
fightTeamEnterShowView
?
.
show
(
on
:
self
,
animate
:
true
,
repeatCount
:
1
)
self
.
fightTeamEnterShowView
?
.
show
(
on
:
self
,
animate
:
true
,
repeatCount
:
1
)
self
.
entranceEffectView
.
clean
()
self
.
entranceEffectView
.
clean
()
...
@@ -1779,7 +1780,7 @@ extension GDLiveFunctionView: LiveFunctionType {
...
@@ -1779,7 +1780,7 @@ extension GDLiveFunctionView: LiveFunctionType {
}
}
func
refreshFightTeamEntershowData
()
{
func
refreshFightTeamEntershowData
()
{
fightTeamView
?
.
mainView
?
.
enterShowView
?
.
viewModel
.
refreshEntranceShowData
(
with
:
1
)
fightTeamView
?
.
refreshEntranceShowData
(
)
}
}
}
}
...
@@ -1867,7 +1868,7 @@ extension GDLiveFunctionView {
...
@@ -1867,7 +1868,7 @@ extension GDLiveFunctionView {
let
model
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
userModel
]
as?
GDUserInfoCardModel
let
model
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
userModel
]
as?
GDUserInfoCardModel
let
isHideman
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
isHideMan
]
as?
Bool
??
false
let
isHideman
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
isHideMan
]
as?
Bool
??
false
let
isOtherRoom
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
isOtherRoom
]
as?
Bool
??
false
let
isOtherRoom
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
isOtherRoom
]
as?
Bool
??
false
//
let isFightTeam = notification.userInfo?[GDLiveNotificationKey.isFightTeam] as? Bool ?? false
let
isFightTeam
=
notification
.
userInfo
?[
GDLiveNotificationKey
.
isFightTeam
]
as?
Bool
??
false
target
.
endEditing
(
true
)
target
.
endEditing
(
true
)
...
@@ -2301,7 +2302,7 @@ extension GDLiveFunctionView {
...
@@ -2301,7 +2302,7 @@ extension GDLiveFunctionView {
GDLiveHelper
.
shared
.
liveVC
?
.
setupIsToggleViewOnShow
(
onShow
:
true
)
GDLiveHelper
.
shared
.
liveVC
?
.
setupIsToggleViewOnShow
(
onShow
:
true
)
self
.
fightTeamView
?
.
removeFromSuperview
()
self
.
fightTeamView
?
.
removeFromSuperview
()
self
.
fightTeamView
=
GD
LiveFightTeamView
(
with
:
GDRouter
.
UserRouter
?
.
uid
,
tid
:
nil
)
self
.
fightTeamView
=
GD
Router
.
FightTeamRouter
?
.
liveFightTeamView
(
uid
:
GDRouter
.
UserRouter
?
.
uid
??
""
,
tid
:
nil
)
self
.
fightTeamView
?
.
show
(
on
:
self
)
self
.
fightTeamView
?
.
show
(
on
:
self
)
self
.
fightTeamView
?
.
dismissHandler
=
{[
weak
self
]
in
self
.
fightTeamView
?
.
dismissHandler
=
{[
weak
self
]
in
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/Model/GDLiveChatModel.swift
View file @
106fae0d
...
@@ -484,7 +484,7 @@ class GDLiveChatModel: BaseModel {
...
@@ -484,7 +484,7 @@ class GDLiveChatModel: BaseModel {
/// FIXME: 战队徽章
/// FIXME: 战队徽章
if
isValidString
(
self
.
richteamname
)
{
if
isValidString
(
self
.
richteamname
)
{
let
fightTeamMedal
=
GDFightTeamMedalView
()
let
fightTeamMedal
=
GD
Router
.
FightTeamRouter
?
.
getFightTeamMedalView
()
??
GDPublic
FightTeamMedalView
()
let
teamName
=
self
.
richteamname
??
""
let
teamName
=
self
.
richteamname
??
""
let
teamMedalUrl
=
self
.
richteammedal
let
teamMedalUrl
=
self
.
richteammedal
fightTeamMedal
.
setupFightTeam
(
with
:
teamName
,
url
:
teamMedalUrl
,
completionHandler
:
nil
)
fightTeamMedal
.
setupFightTeam
(
with
:
teamName
,
url
:
teamMedalUrl
,
completionHandler
:
nil
)
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/Model/GDStyleMessage.swift
View file @
106fae0d
...
@@ -153,7 +153,7 @@ extension NSMutableAttributedString {
...
@@ -153,7 +153,7 @@ extension NSMutableAttributedString {
}
}
case
"1003"
:
// 战队徽章
case
"1003"
:
// 战队徽章
let
fightTeamMedal
=
GDFightTeamMedalView
()
let
fightTeamMedal
=
GD
Router
.
FightTeamRouter
?
.
getFightTeamMedalView
()
??
GDPublic
FightTeamMedalView
()
let
teamName
=
json
[
"data"
][
"richteamname"
]
.
gd_stringValue
let
teamName
=
json
[
"data"
][
"richteamname"
]
.
gd_stringValue
let
teamMedalUrl
=
json
[
"data"
][
"richteammedal"
]
.
gd_stringValue
let
teamMedalUrl
=
json
[
"data"
][
"richteammedal"
]
.
gd_stringValue
fightTeamMedal
.
setupFightTeam
(
with
:
teamName
,
url
:
teamMedalUrl
,
completionHandler
:
nil
)
fightTeamMedal
.
setupFightTeam
(
with
:
teamName
,
url
:
teamMedalUrl
,
completionHandler
:
nil
)
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/AnchorPanelView/GDLiveAnchorPanelView.swift
View file @
106fae0d
...
@@ -296,7 +296,8 @@ class GDLiveAnchorPanelView: BaseView {
...
@@ -296,7 +296,8 @@ class GDLiveAnchorPanelView: BaseView {
model
.
isRead
.
bind
(
to
:
btn
.
unreadView
.
rx
.
isHidden
)
.
disposed
(
by
:
disposeBag
)
model
.
isRead
.
bind
(
to
:
btn
.
unreadView
.
rx
.
isHidden
)
.
disposed
(
by
:
disposeBag
)
case
.
fightTeam
:
case
.
fightTeam
:
Observable
.
combineLatest
(
GDRouter
.
FightTeamRouter
?
.
hadUnreadMsg
,
GDRouter
.
FightTeamRouter
?
.
hadFightTeamInvite
,
GDRouter
.
FightTeamRouter
?
.
applyCount
)
.
subscribe
(
onNext
:
{
hadUnreadMsg
,
hadFightTeamInvite
,
applyCount
in
guard
let
fightTeamRouter
=
GDRouter
.
FightTeamRouter
else
{
break
}
Observable
.
combineLatest
(
fightTeamRouter
.
hadUnreadMsg
,
fightTeamRouter
.
hadFightTeamInvite
,
fightTeamRouter
.
applyCount
)
.
subscribe
(
onNext
:
{
hadUnreadMsg
,
hadFightTeamInvite
,
applyCount
in
if
hadUnreadMsg
==
false
&&
hadFightTeamInvite
==
false
&&
applyCount
<=
0
{
if
hadUnreadMsg
==
false
&&
hadFightTeamInvite
==
false
&&
applyCount
<=
0
{
btn
.
unreadView
.
isHidden
=
true
btn
.
unreadView
.
isHidden
=
true
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/AudiencePanelView/GDLiveAudiencePanelView.swift
View file @
106fae0d
...
@@ -283,7 +283,8 @@ class GDLiveAudiencePanelView: BaseView {
...
@@ -283,7 +283,8 @@ class GDLiveAudiencePanelView: BaseView {
})
.
disposed
(
by
:
disposeBag
)
})
.
disposed
(
by
:
disposeBag
)
case
.
fightTeam
:
case
.
fightTeam
:
Observable
.
combineLatest
(
GDRouter
.
FightTeamRouter
?
.
hadUnreadMsg
,
GDRouter
.
FightTeamRouter
?
.
hadFightTeamInvite
,
GDRouter
.
FightTeamRouter
?
.
applyCount
)
.
subscribe
(
onNext
:
{
hadUnreadMsg
,
hadFightTeamInvite
,
applyCount
in
guard
let
fightTeamRouter
=
GDRouter
.
FightTeamRouter
else
{
break
}
Observable
.
combineLatest
(
fightTeamRouter
.
hadUnreadMsg
,
fightTeamRouter
.
hadFightTeamInvite
,
fightTeamRouter
.
applyCount
)
.
subscribe
(
onNext
:
{
hadUnreadMsg
,
hadFightTeamInvite
,
applyCount
in
if
hadUnreadMsg
==
false
&&
hadFightTeamInvite
==
false
&&
applyCount
<=
0
{
if
hadUnreadMsg
==
false
&&
hadFightTeamInvite
==
false
&&
applyCount
<=
0
{
itemView
.
unreadView
.
isHidden
=
true
itemView
.
unreadView
.
isHidden
=
true
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/ChatInputView/GDLiveChatInputView.swift
View file @
106fae0d
...
@@ -162,8 +162,9 @@ class GDLiveChatInputView: BaseView {
...
@@ -162,8 +162,9 @@ class GDLiveChatInputView: BaseView {
func
refreshFightTeamUnread
(
for
unreadView
:
UIView
)
{
func
refreshFightTeamUnread
(
for
unreadView
:
UIView
)
{
guard
let
fightTeamRouter
=
GDRouter
.
FightTeamRouter
else
{
return
}
if
GDLiveHelper
.
shared
.
liveConfig
.
value
.
liveMoreButon
.
filter
({
$0
.
isRead
.
value
==
false
})
.
count
<=
0
if
GDLiveHelper
.
shared
.
liveConfig
.
value
.
liveMoreButon
.
filter
({
$0
.
isRead
.
value
==
false
})
.
count
<=
0
&&
GDRouter
.
FightTeamRouter
?
.
hadUnreadMsg
.
value
==
false
&&
GDRouter
.
FightTeamRouter
?
.
hadFightTeamInvite
.
value
==
false
&&
GDRouter
.
FightTeamRouter
?
.
applyCount
.
value
<=
0
&&
fightTeamRouter
.
hadUnreadMsg
.
value
==
false
&&
fightTeamRouter
.
hadFightTeamInvite
.
value
==
false
&&
fightTeamRouter
.
applyCount
.
value
<=
0
&&
(
GDRouter
.
UserRouter
?
.
rewardCount
.
value
??
0
)
<=
0
{
&&
(
GDRouter
.
UserRouter
?
.
rewardCount
.
value
??
0
)
<=
0
{
unreadView
.
isHidden
=
true
unreadView
.
isHidden
=
true
}
else
{
}
else
{
...
@@ -206,10 +207,11 @@ class GDLiveChatInputView: BaseView {
...
@@ -206,10 +207,11 @@ class GDLiveChatInputView: BaseView {
make
.
right
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
}
}
func
refreshFightTeamUnread
(
for
unreadView
:
UIView
)
{
func
refreshFightTeamUnread
(
for
unreadView
:
UIView
)
{
guard
let
fightTeamRouter
=
GDRouter
.
FightTeamRouter
else
{
return
}
if
GDLiveHelper
.
shared
.
liveConfig
.
value
.
liveMoreButon
.
filter
({
$0
.
isRead
.
value
==
false
})
.
count
<=
0
if
GDLiveHelper
.
shared
.
liveConfig
.
value
.
liveMoreButon
.
filter
({
$0
.
isRead
.
value
==
false
})
.
count
<=
0
&&
GDRouter
.
FightTeamRouter
?
.
hadUnreadMsg
.
value
==
false
&&
GDRouter
.
FightTeamRouter
?
.
hadFightTeamInvite
.
value
==
false
&&
GDRouter
.
FightTeamRouter
?
.
applyCount
.
value
<=
0
&&
fightTeamRouter
.
hadUnreadMsg
.
value
==
false
&&
fightTeamRouter
.
hadFightTeamInvite
.
value
==
false
&&
fightTeamRouter
.
applyCount
.
value
<=
0
{
{
unreadView
.
isHidden
=
true
unreadView
.
isHidden
=
true
}
else
{
}
else
{
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/View/UserInfoCard/GDUserInfoCardView.swift
View file @
106fae0d
...
@@ -660,7 +660,7 @@ class GDUserInfoCardView: BaseView {
...
@@ -660,7 +660,7 @@ class GDUserInfoCardView: BaseView {
/// - animate: 是否动画展示,默认true
/// - animate: 是否动画展示,默认true
func
show
(
on
view
:
UIView
,
for
uid
:
String
,
model
:
GDUserInfoCardModel
?
=
nil
,
animate
:
Bool
=
true
,
isHideMan
:
Bool
=
false
,
isOtherRoom
:
Bool
=
false
,
isFightTeam
:
Bool
)
{
func
show
(
on
view
:
UIView
,
for
uid
:
String
,
model
:
GDUserInfoCardModel
?
=
nil
,
animate
:
Bool
=
true
,
isHideMan
:
Bool
=
false
,
isOtherRoom
:
Bool
=
false
,
isFightTeam
:
Bool
)
{
GDRouter
.
FightTeamRouter
?
.
getFightTeamDetail
(
with
:
GDRouter
.
UserRouter
?
.
uid
,
tid
:
nil
,
page
:
1
)
{[
weak
self
]
_
in
GDRouter
.
FightTeamRouter
?
.
getFightTeamDetail
(
with
:
GDRouter
.
UserRouter
?
.
uid
??
""
,
tid
:
nil
,
page
:
1
)
{[
weak
self
]
_
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -974,7 +974,7 @@ class GDUserInfoCardView: BaseView {
...
@@ -974,7 +974,7 @@ class GDUserInfoCardView: BaseView {
if
let
functionView
=
GDLiveHelper
.
shared
.
liveVC
?
.
functionView
as?
GDLiveFunctionView
{
if
let
functionView
=
GDLiveHelper
.
shared
.
liveVC
?
.
functionView
as?
GDLiveFunctionView
{
if
functionView
.
fightTeamView
?
.
superview
!=
nil
{
if
functionView
.
fightTeamView
?
.
superview
!=
nil
{
functionView
.
fightTeamView
?
.
mainView
?
.
channelView
?
.
insert
Content
(
content
:
"@
\(
nickname
)
"
)
functionView
.
fightTeamView
?
.
insertChannel
Content
(
content
:
"@
\(
nickname
)
"
)
}
else
{
}
else
{
functionView
.
insertInputText
(
content
:
"@
\(
nickname
)
"
)
functionView
.
insertInputText
(
content
:
"@
\(
nickname
)
"
)
}
}
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/ViewModel/GDLiveChatListViewModel.swift
View file @
106fae0d
...
@@ -122,7 +122,7 @@ class GDLiveChatListViewModel: BaseViewModel {
...
@@ -122,7 +122,7 @@ class GDLiveChatListViewModel: BaseViewModel {
.
map
{
(
roomid
:
$0
.
roomid
,
model
:
$0
.
messageModel
)
}
.
map
{
(
roomid
:
$0
.
roomid
,
model
:
$0
.
messageModel
)
}
.
buffer
(
timeSpan
:
.
milliseconds
(
500
),
count
:
50
,
scheduler
:
MainScheduler
.
instance
)
.
buffer
(
timeSpan
:
.
milliseconds
(
500
),
count
:
50
,
scheduler
:
MainScheduler
.
instance
)
GDS
ocketPublisher
.
FightTeam
.
m
essage
GDS
howRoomSocketPublisher
.
fightTeamM
essage
.
subscribe
(
onNext
:
{[
weak
self
]
msgModel
in
.
subscribe
(
onNext
:
{[
weak
self
]
msgModel
in
guard
GDLiveHelper
.
shared
.
liveState
.
value
==
.
living
else
{
return
}
guard
GDLiveHelper
.
shared
.
liveState
.
value
==
.
living
else
{
return
}
// 只展示召集消息
// 只展示召集消息
...
@@ -131,13 +131,13 @@ class GDLiveChatListViewModel: BaseViewModel {
...
@@ -131,13 +131,13 @@ class GDLiveChatListViewModel: BaseViewModel {
guard
let
msgid
=
msgModel
.
msgid
else
{
return
}
guard
let
msgid
=
msgModel
.
msgid
else
{
return
}
var
recordDict
=
var
recordDict
=
UserDefaults
.
standard
.
object
(
forKey
:
GD
UserDefault
.
Data
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
as?
[
String
:
Bool
]
??
[:]
UserDefaults
.
standard
.
object
(
forKey
:
GD
ShowRoomUDKeys
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
as?
[
String
:
Bool
]
??
[:]
if
recordDict
[
msgid
]
==
true
{
if
recordDict
[
msgid
]
==
true
{
return
return
}
}
recordDict
[
msgid
]
=
true
recordDict
[
msgid
]
=
true
UserDefaults
.
standard
.
setValue
(
recordDict
,
forKey
:
GD
UserDefault
.
Data
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
UserDefaults
.
standard
.
setValue
(
recordDict
,
forKey
:
GD
ShowRoomUDKeys
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
let
model
=
GDLiveChatModel
.
createFightTeamMessage
(
for
:
msgModel
)
let
model
=
GDLiveChatModel
.
createFightTeamMessage
(
for
:
msgModel
)
self
?
.
addMessages
([
model
])
self
?
.
addMessages
([
model
])
...
@@ -190,7 +190,7 @@ class GDLiveChatListViewModel: BaseViewModel {
...
@@ -190,7 +190,7 @@ class GDLiveChatListViewModel: BaseViewModel {
}
}
// 拉取是否有战队消息
// 拉取是否有战队消息
GD
ShowRoomHttpHelper
.
shared
.
getFightTeamCallInfo
()
.
subscribe
{[
weak
self
]
dataJson
in
GD
Router
.
FightTeamRouter
?
.
getFightTeamCallInfo
()
.
subscribe
{[
weak
self
]
dataJson
in
_
=
dataJson
[
"data"
]
.
arrayValue
.
map
{[
weak
self
]
json
in
_
=
dataJson
[
"data"
]
.
arrayValue
.
map
{[
weak
self
]
json
in
...
@@ -203,13 +203,13 @@ class GDLiveChatListViewModel: BaseViewModel {
...
@@ -203,13 +203,13 @@ class GDLiveChatListViewModel: BaseViewModel {
let
msgid
=
json
[
"msgid"
]
.
gd_stringValue
let
msgid
=
json
[
"msgid"
]
.
gd_stringValue
var
recordDict
=
UserDefaults
.
standard
.
object
(
forKey
:
GD
UserDefault
.
Data
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
as?
[
String
:
Bool
]
??
[:]
var
recordDict
=
UserDefaults
.
standard
.
object
(
forKey
:
GD
ShowRoomUDKeys
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
as?
[
String
:
Bool
]
??
[:]
if
recordDict
[
msgid
]
==
true
{
if
recordDict
[
msgid
]
==
true
{
return
return
}
}
recordDict
[
msgid
]
=
true
recordDict
[
msgid
]
=
true
UserDefaults
.
standard
.
setValue
(
recordDict
,
forKey
:
GD
UserDefault
.
Data
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
UserDefaults
.
standard
.
setValue
(
recordDict
,
forKey
:
GD
ShowRoomUDKeys
.
fightTeamCallMsgRecord
+
(
GDRouter
.
UserRouter
?
.
uid
??
""
))
let
fightTeamMsg
=
GDFightTeamMessageModel
.
createModelFrom
(
json
)
let
fightTeamMsg
=
GDFightTeamMessageModel
.
createModelFrom
(
json
)
...
...
Module/GDShowRoomModule/GDShowRoomModule/Features/Function/ViewModel/GDUserInfoCardViewModel.swift
View file @
106fae0d
...
@@ -238,9 +238,9 @@ class GDUserInfoCardViewModel: BaseViewModel, ViewModelType {
...
@@ -238,9 +238,9 @@ class GDUserInfoCardViewModel: BaseViewModel, ViewModelType {
func
inviteToJoinFightTeam
()
{
func
inviteToJoinFightTeam
()
{
guard
let
uid
=
currentUID
.
value
else
{
return
}
guard
let
uid
=
currentUID
.
value
else
{
return
}
GD
ShowRoomHttpHelper
.
shared
.
inviteUserToJoinFightTeam
(
fid
:
uid
)
.
subscribe
{
json
in
GD
Router
.
FightTeamRouter
?
.
inviteUserToJoinFightTeam
(
fid
:
uid
)
.
subscribe
{
json
in
FTIndicator
.
showToastMessage
(
"邀请成功"
)
FTIndicator
.
showToastMessage
(
"邀请成功"
)
}
on
Error
:
{
error
in
}
on
Failure
:
{
error
in
guard
let
error
=
error
as?
GDMoyaError
else
{
guard
let
error
=
error
as?
GDMoyaError
else
{
FTIndicator
.
showToastMessage
(
GDMoyaError
.
networkError
()
.
msg
)
FTIndicator
.
showToastMessage
(
GDMoyaError
.
networkError
()
.
msg
)
return
return
...
...
Module/GDShowRoomModule/GDShowRoomModule/Module/GDShowRoomConfigs.swift
View file @
106fae0d
...
@@ -32,6 +32,9 @@ struct GDShowRoomUDKeys {
...
@@ -32,6 +32,9 @@ struct GDShowRoomUDKeys {
static
let
fansGroupGuideAnchorList
=
"fansGroupGuideAnchorList"
static
let
fansGroupGuideAnchorList
=
"fansGroupGuideAnchorList"
/// 累计时长奖励计时
/// 累计时长奖励计时
static
let
showWatchTimeGuideTime
=
"showWatchTimeGuideTime_"
static
let
showWatchTimeGuideTime
=
"showWatchTimeGuideTime_"
/// 战队消息是否已经显示过的记录
static
let
fightTeamCallMsgRecord
=
"fightTeamCallMsgRecord_"
}
}
// 通知名
// 通知名
...
...
Module/GDShowRoomModule/GDShowRoomModule/Network/GDShowRoomSocketHelper.swift
View file @
106fae0d
...
@@ -251,6 +251,18 @@ struct GDShowRoomSocketPublisher {
...
@@ -251,6 +251,18 @@ struct GDShowRoomSocketPublisher {
.
listenTo
(
GDShowRoomSocketCID
.
anchorRecieveInvitableUser
)
.
listenTo
(
GDShowRoomSocketCID
.
anchorRecieveInvitableUser
)
.
mapToModel
(
GDLiveAnchorInviteSocketModel
.
self
)
.
mapToModel
(
GDLiveAnchorInviteSocketModel
.
self
)
/// 战队入场秀
static
let
enterFightTeamShow
:
Observable
<
JSON
>
=
GDSocketCenter
.
publisher
.
listenTo
(
GDPublicFightTeamCid
.
enterFightTeamShow
)
.
mapToJSON
()
static
let
fightTeamMessage
:
Observable
<
GDFightTeamMessageModel
>
=
GDSocketCenter
.
publisher
.
reply
()
.
listenTo
(
GDPublicFightTeamCid
.
fightTeamMsg
)
.
mapToModel
(
GDFightTeamMessageModel
.
self
)
// MARK: PK
// MARK: PK
struct
PK
{
struct
PK
{
/// 收到PK邀请
/// 收到PK邀请
...
...
Module/GDUserZoneModule/GDUserZoneModule/Feature/Zone/Main/View/AchievementView/GDAchievementView.swift
View file @
106fae0d
...
@@ -86,7 +86,7 @@ class GDAchievementView: GDPublicAchievementView {
...
@@ -86,7 +86,7 @@ class GDAchievementView: GDPublicAchievementView {
}
}
}
}
func
cleanFightTeamMedal
()
{
override
func
cleanFightTeamMedal
()
{
fightTeamMedalView
.
isHidden
=
true
fightTeamMedalView
.
isHidden
=
true
}
}
...
...
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