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
6d7cc837
Commit
6d7cc837
authored
Nov 26, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播相关UI调整
parent
49ea243c
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
481 additions
and
24 deletions
+481
-24
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+12
-0
YHBasePlayerViewController.swift
.../LivestreamSales(直播销售)/C/YHBasePlayerViewController.swift
+34
-7
YHLivePlayerViewController.swift
.../LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
+21
-10
YHVODPlayerViewController.swift
...s/LivestreamSales(直播销售)/C/YHVODPlayerViewController.swift
+1
-1
YHInputBottomBar.swift
...es/Modules/LivestreamSales(直播销售)/V/YHInputBottomBar.swift
+121
-0
YHMessageInputView.swift
.../Modules/LivestreamSales(直播销售)/V/YHMessageInputView.swift
+43
-6
YHPlayerTopBarView.swift
.../Modules/LivestreamSales(直播销售)/V/YHPlayerTopBarView.swift
+155
-0
live_room_test_bg.png
...ses/Modules/LivestreamSales(直播销售)/V/live_room_test_bg.png
+0
-0
Contents.json
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/Contents.json
+6
-0
Contents.json
...xcassets/YinHeLive/live_room_close.imageset/Contents.json
+22
-0
live_room_close@2x.png
...YinHeLive/live_room_close.imageset/live_room_close@2x.png
+0
-0
live_room_close@3x.png
...YinHeLive/live_room_close.imageset/live_room_close@3x.png
+0
-0
Contents.json
...ssets/YinHeLive/live_room_msg_gift.imageset/Contents.json
+22
-0
live_room_msg_gift@2x.png
...ive/live_room_msg_gift.imageset/live_room_msg_gift@2x.png
+0
-0
live_room_msg_gift@3x.png
...ive/live_room_msg_gift.imageset/live_room_msg_gift@3x.png
+0
-0
Contents.json
...xcassets/YinHeLive/live_room_share.imageset/Contents.json
+22
-0
live_room_share@2x.png
...YinHeLive/live_room_share.imageset/live_room_share@2x.png
+0
-0
live_room_share@3x.png
...YinHeLive/live_room_share.imageset/live_room_share@3x.png
+0
-0
Contents.json
....xcassets/YinHeLive/live_room_zoom.imageset/Contents.json
+22
-0
live_room_zoom@2x.png
...s/YinHeLive/live_room_zoom.imageset/live_room_zoom@2x.png
+0
-0
live_room_zoom@3x.png
...s/YinHeLive/live_room_zoom.imageset/live_room_zoom@3x.png
+0
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
6d7cc837
...
...
@@ -292,7 +292,10 @@
04564D4F2CF38E20004456E4
/* YHLiveMessageListView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D4E2CF38E20004456E4
/* YHLiveMessageListView.swift */
;
};
04564D512CF38EA4004456E4
/* YHMessageInputView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D502CF38EA4004456E4
/* YHMessageInputView.swift */
;
};
04564D532CF38FE2004456E4
/* YHVODPlayerViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D522CF38FE2004456E4
/* YHVODPlayerViewController.swift */
;
};
04564D562CF4467B004456E4
/* YHPlayerTopBarView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D552CF4467B004456E4
/* YHPlayerTopBarView.swift */
;
};
04564D592CF470B2004456E4
/* YHIncomeRecordCompanyTipsCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D582CF470B2004456E4
/* YHIncomeRecordCompanyTipsCell.swift */
;
};
04564D5D2CF49F0A004456E4
/* live_room_test_bg.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D5C2CF49F0A004456E4
/* live_room_test_bg.png */
;
};
04564D5F2CF565C7004456E4
/* YHInputBottomBar.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04564D5E2CF565C7004456E4
/* YHInputBottomBar.swift */
;
};
0457920B2CBCE7B200EBD99B
/* YHResignUploadTravelCardViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0457920A2CBCE7B200EBD99B
/* YHResignUploadTravelCardViewModel.swift */
;
};
0457920D2CBCE8A800EBD99B
/* YHResignUploadTravelCardListModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0457920C2CBCE8A800EBD99B
/* YHResignUploadTravelCardListModel.swift */
;
};
0457920F2CBCE9D000EBD99B
/* YHResignUploadTravelCardListTableViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0457920E2CBCE9D000EBD99B
/* YHResignUploadTravelCardListTableViewCell.swift */
;
};
...
...
@@ -1337,7 +1340,10 @@
04564D4E2CF38E20004456E4
/* YHLiveMessageListView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHLiveMessageListView.swift
;
sourceTree
=
"<group>"
;
};
04564D502CF38EA4004456E4
/* YHMessageInputView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMessageInputView.swift
;
sourceTree
=
"<group>"
;
};
04564D522CF38FE2004456E4
/* YHVODPlayerViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHVODPlayerViewController.swift
;
sourceTree
=
"<group>"
;
};
04564D552CF4467B004456E4
/* YHPlayerTopBarView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPlayerTopBarView.swift
;
sourceTree
=
"<group>"
;
};
04564D582CF470B2004456E4
/* YHIncomeRecordCompanyTipsCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHIncomeRecordCompanyTipsCell.swift
;
sourceTree
=
"<group>"
;
};
04564D5C2CF49F0A004456E4
/* live_room_test_bg.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
live_room_test_bg.png
;
sourceTree
=
"<group>"
;
};
04564D5E2CF565C7004456E4
/* YHInputBottomBar.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHInputBottomBar.swift
;
sourceTree
=
"<group>"
;
};
0457920A2CBCE7B200EBD99B
/* YHResignUploadTravelCardViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResignUploadTravelCardViewModel.swift
;
sourceTree
=
"<group>"
;
};
0457920C2CBCE8A800EBD99B
/* YHResignUploadTravelCardListModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResignUploadTravelCardListModel.swift
;
sourceTree
=
"<group>"
;
};
0457920E2CBCE9D000EBD99B
/* YHResignUploadTravelCardListTableViewCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHResignUploadTravelCardListTableViewCell.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -2886,10 +2892,13 @@
04564D412CF1BEA2004456E4
/* V */
=
{
isa
=
PBXGroup
;
children
=
(
04564D5C2CF49F0A004456E4
/* live_room_test_bg.png */
,
04564D462CF3851D004456E4
/* YHPlayerControlView.swift */
,
04564D4C2CF38D16004456E4
/* YHLiveMessageCell.swift */
,
04564D4E2CF38E20004456E4
/* YHLiveMessageListView.swift */
,
04564D502CF38EA4004456E4
/* YHMessageInputView.swift */
,
04564D552CF4467B004456E4
/* YHPlayerTopBarView.swift */
,
04564D5E2CF565C7004456E4
/* YHInputBottomBar.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -5632,6 +5641,7 @@
A51044182B493675006B60BB
/* README.md in Resources */
,
A5EE42012C216C78005BBA5D
/* img_0.png in Resources */
,
04F0ABF32C364F9400518C30
/* home.json in Resources */
,
04564D5D2CF49F0A004456E4
/* live_room_test_bg.png in Resources */
,
04943BE82CF0A0B500BF2255
/* submit_page_scroll.gif in Resources */
,
A5573EDB2B317C0000D98EC0
/* Assets.xcassets in Resources */
,
04F0ABF52C364F9400518C30
/* community.json in Resources */
,
...
...
@@ -5745,6 +5755,7 @@
04FD85722C21786900BEF9C5
/* YHNameCardInfoView.swift in Sources */
,
044D0C182C22AB7300C5CF5E
/* YHEditBaseInfoFootView.swift in Sources */
,
047AA3F42C50E5C7009C4554
/* YHInvitationWithGiftsViewModel.swift in Sources */
,
04564D562CF4467B004456E4
/* YHPlayerTopBarView.swift in Sources */
,
04CE1AD52C2AD91F001CB80A
/* YHActivityTravelViewController.swift in Sources */
,
044EE2482C93E49C00A2FE3A
/* YHResignCertificateHKTableViewCell.swift in Sources */
,
A5EF21372BA6E2D1005027E6
/* YHQuestionAndAnswerModel.swift in Sources */
,
...
...
@@ -6067,6 +6078,7 @@
0449EEF02C902A4100A397FD
/* YHResignMaterialUploadVC.swift in Sources */
,
04129E862CD0C8490072F87B
/* YHAliYunLogManager.swift in Sources */
,
04174D642BCD52BD000BA46D
/* YHDeviceInfoViewController.swift in Sources */
,
04564D5F2CF565C7004456E4
/* YHInputBottomBar.swift in Sources */
,
0472E25E2C534723008EAB6E
/* YHLifeDetailViewController.swift in Sources */
,
0457920D2CBCE8A800EBD99B
/* YHResignUploadTravelCardListModel.swift in Sources */
,
A5ACE92E2B4564F7002C94D2
/* YHValidateCodeInputView.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHBasePlayerViewController.swift
View file @
6d7cc837
...
...
@@ -9,7 +9,7 @@
import
AgoraRtcKit
import
UIKit
class
YHBasePlayerViewController
:
UI
ViewController
{
class
YHBasePlayerViewController
:
YHBase
ViewController
{
// MARK: - Properties
var
playerKit
:
AgoraRtcMediaPlayerProtocol
!
...
...
@@ -17,15 +17,23 @@ class YHBasePlayerViewController: UIViewController {
// MARK: - UI Components
private
lazy
var
containerView
:
UIView
=
{
lazy
var
containerView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
black
return
view
}()
lazy
var
bgIcon
:
UIImageView
=
{
let
imageView
=
UIImageView
()
if
let
path
=
Bundle
.
main
.
path
(
forResource
:
"live_room_test_bg"
,
ofType
:
"png"
)
{
imageView
.
image
=
UIImage
(
contentsOfFile
:
path
)
}
return
imageView
}()
lazy
var
playerView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
black
view
.
backgroundColor
=
.
clear
return
view
}()
...
...
@@ -35,6 +43,11 @@ class YHBasePlayerViewController: UIViewController {
return
view
}()
private
lazy
var
topBarView
:
YHPlayerTopBarView
=
{
let
view
=
YHPlayerTopBarView
(
frame
:
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
k_Height_NavigationtBarAndStatuBar
))
return
view
}()
// MARK: - Lifecycle
override
func
viewDidLoad
()
{
...
...
@@ -46,11 +59,14 @@ class YHBasePlayerViewController: UIViewController {
// MARK: - Setup
private
func
setupUI
()
{
gk_navBarAlpha
=
0
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
.
black
view
.
addSubview
(
containerView
)
containerView
.
addSubview
(
bgIcon
)
containerView
.
addSubview
(
playerView
)
containerView
.
addSubview
(
control
View
)
containerView
.
addSubview
(
topBar
View
)
setupConstraints
()
}
...
...
@@ -60,18 +76,29 @@ class YHBasePlayerViewController: UIViewController {
make
.
edges
.
equalToSuperview
()
}
playerView
.
snp
.
makeConstraints
{
make
in
bgIcon
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
control
View
.
snp
.
makeConstraints
{
make
in
player
View
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
topBarView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
}
// controlView.snp.makeConstraints { make in
// make.edges.equalToSuperview()
// }
}
private
func
setupAgoraKit
()
{
let
config
=
AgoraRtcEngineConfig
()
config
.
appId
=
YhConstant
.
AgoraRtcKit
.
appId
config
.
areaCode
=
.
global
config
.
channelProfile
=
.
liveBroadcasting
agoraKit
=
AgoraRtcEngineKit
.
sharedEngine
(
with
:
config
,
delegate
:
self
)
playerKit
=
agoraKit
.
createMediaPlayer
(
with
:
self
)
...
...
@@ -208,7 +235,7 @@ extension YHBasePlayerViewController {
return
String
(
format
:
"%02d:%02d"
,
minutes
,
seconds
)
}
private
func
showAlert
(
message
:
String
)
{
func
showAlert
(
message
:
String
)
{
let
alert
=
UIAlertController
(
title
:
"提示"
,
message
:
message
,
preferredStyle
:
.
alert
)
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHLivePlayerViewController.swift
View file @
6d7cc837
...
...
@@ -12,7 +12,12 @@ import UIKit
class
YHLivePlayerViewController
:
YHBasePlayerViewController
{
// MARK: - Properties
private
var
roomInfo
:
YHLiveRoomInfo
private
var
messageListView
:
YHLiveMessageListView
!
private
lazy
var
messageListView
:
YHLiveMessageListView
=
YHLiveMessageListView
()
private
lazy
var
bottomInputBar
:
YHInputBottomBar
=
{
let
view
=
YHInputBottomBar
()
return
view
}()
// MARK: - Initialization
init
(
roomInfo
:
YHLiveRoomInfo
)
{
...
...
@@ -27,20 +32,26 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
// MARK: - Lifecycle
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setup
MessageList
()
setup
UI
()
startLive
()
}
// MARK: - Setup
private
func
setupMessageList
()
{
messageListView
=
YHLiveMessageListView
()
view
.
addSubview
(
messageListView
)
messageListView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
view
.
safeAreaLayoutGuide
)
make
.
height
.
equalTo
(
view
.
snp
.
height
)
.
multipliedBy
(
0.3
)
private
func
setupUI
()
{
containerView
.
addSubview
(
bottomInputBar
)
// containerView.addSubview(messageListView)
bottomInputBar
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
top
.
equalTo
(
view
.
safeAreaLayoutGuide
.
snp
.
bottom
)
.
offset
(
-
YHInputBottomBar
.
inputActionHeight
)
}
// messageListView.snp.makeConstraints { make in
// make.left.right.equalToSuperview()
// make.bottom.equalTo(bottomInputBar.snp.top)
// make.height.equalTo(view.snp.height).multipliedBy(0.3)
// }
}
private
func
startLive
()
{
...
...
@@ -55,7 +66,7 @@ class YHLivePlayerViewController: YHBasePlayerViewController {
let
result
=
playerKit
.
open
(
with
:
mediaSource
)
if
result
!=
0
{
//
showAlert(message: "播放失败,错误码:\(result)")
showAlert
(
message
:
"播放失败,错误码:
\(
result
)
"
)
}
}
}
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHVODPlayerViewController.swift
View file @
6d7cc837
...
...
@@ -82,7 +82,7 @@ class YHVODPlayerViewController: YHBasePlayerViewController {
let
result
=
playerKit
.
open
(
with
:
mediaSource
)
if
result
!=
0
{
//
showAlert(message: "播放失败,错误码:\(result)")
showAlert
(
message
:
"播放失败,错误码:
\(
result
)
"
)
}
}
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHInputBottomBar.swift
0 → 100644
View file @
6d7cc837
//
// YHInputBottomBar.swift
// galaxy
//
// Created by alexzzw on 2024/11/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHInputBottomBar
:
UIView
{
static
let
inputActionHeight
:
CGFloat
=
54
private
let
inputViewHeight
:
CGFloat
=
38
var
giftButtonClickEvent
:
(()
->
Void
)?
var
textViewTappedEvent
:
(()
->
Void
)?
private
lazy
var
inputBarView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
.
black
.
withAlphaComponent
(
0.3
)
view
.
layer
.
cornerRadius
=
inputViewHeight
/
2.0
view
.
clipsToBounds
=
true
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
didTappedTextView
)
)
view
.
addGestureRecognizer
(
tap
)
return
view
}()
private
lazy
var
editTipsLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"说点什么..."
label
.
font
=
.
PFSC_R
(
ofSize
:
13
)
label
.
textColor
=
UIColor
.
white
.
withAlphaComponent
(
0.6
)
return
label
}()
private
lazy
var
giftButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setBackgroundImage
(
UIImage
(
named
:
"live_room_msg_gift"
),
for
:
.
normal
)
button
.
setTitle
(
"99+"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
.
PFSC_M
(
ofSize
:
10
)
button
.
addTarget
(
self
,
action
:
#selector(
giftButtonTapped
)
,
for
:
.
touchUpInside
)
button
.
titleEdgeInsets
=
UIEdgeInsets
(
top
:
5
,
left
:
0
,
bottom
:
-
5
,
right
:
0
)
return
button
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setupUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
private
func
setupUI
()
{
addSubview
(
inputBarView
)
addSubview
(
editTipsLabel
)
addSubview
(
giftButton
)
inputBarView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
8
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
height
.
equalTo
(
inputViewHeight
)
}
giftButton
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
inputBarView
.
snp
.
right
)
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
centerY
.
equalTo
(
inputBarView
)
make
.
width
.
height
.
equalTo
(
38
)
}
editTipsLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
inputBarView
.
snp
.
left
)
.
offset
(
16
)
make
.
centerY
.
equalTo
(
inputBarView
)
}
}
func
updateGiftCount
(
_
count
:
Int
)
{
guard
count
>
0
else
{
inputBarView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
8
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
height
.
equalTo
(
inputViewHeight
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
giftButton
.
snp
.
remakeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
centerY
.
equalTo
(
inputBarView
)
make
.
width
.
height
.
equalTo
(
38
)
}
giftButton
.
isHidden
=
true
return
}
giftButton
.
isHidden
=
false
inputBarView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
8
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
height
.
equalTo
(
inputViewHeight
)
}
giftButton
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
inputBarView
.
snp
.
right
)
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
centerY
.
equalTo
(
inputBarView
)
make
.
width
.
height
.
equalTo
(
38
)
}
if
count
>
99
{
giftButton
.
setTitle
(
"99+"
,
for
:
.
normal
)
}
else
{
giftButton
.
setTitle
(
"
\(
count
)
"
,
for
:
.
normal
)
}
}
}
extension
YHInputBottomBar
{
@objc
private
func
giftButtonTapped
()
{
giftButtonClickEvent
?()
}
@objc
private
func
didTappedTextView
()
{
textViewTappedEvent
?()
}
}
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHMessageInputView.swift
View file @
6d7cc837
...
...
@@ -12,11 +12,18 @@ protocol YHMessageInputViewDelegate: AnyObject {
func
messageInputView
(
_
inputView
:
YHMessageInputView
,
didSendMessage
text
:
String
)
}
enum
YHMessageInputViewState
{
case
normalWithGift
(
_
count
:
Int
)
case
inputState
}
class
YHMessageInputView
:
UIView
{
// MARK: - Properties
weak
var
delegate
:
YHMessageInputViewDelegate
?
// MARK: - UI Components
private
lazy
var
textField
:
UITextField
=
{
let
textField
=
UITextField
()
textField
.
placeholder
=
"说点什么..."
...
...
@@ -30,18 +37,40 @@ class YHMessageInputView: UIView {
return
textField
}()
private
lazy
var
giftButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setBackgroundImage
(
UIImage
(
named
:
"live_room_msg_gift"
),
for
:
.
normal
)
button
.
setTitle
(
"2"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
.
PFSC_M
(
ofSize
:
10
)
button
.
addTarget
(
self
,
action
:
#selector(
giftButtonTapped
)
,
for
:
.
touchUpInside
)
return
button
}()
private
lazy
var
sendButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
syste
m
)
let
button
=
UIButton
(
type
:
.
custo
m
)
button
.
setTitle
(
"发送"
,
for
:
.
normal
)
button
.
titleLabel
?
.
font
=
.
PFSC_M
(
ofSize
:
12
)
button
.
setTitleColor
(
.
white
,
for
:
.
normal
)
button
.
backgroundColor
=
.
brandMainColor
button
.
layer
.
cornerRadius
=
3
button
.
clipsToBounds
=
true
button
.
addTarget
(
self
,
action
:
#selector(
sendButtonTapped
)
,
for
:
.
touchUpInside
)
return
button
}()
var
state
:
YHMessageInputViewState
=
.
normalWithGift
(
2
)
{
didSet
{
updateState
(
state
)
}
}
// MARK: - Initialization
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setupUI
()
updateState
(
state
)
}
required
init
?(
coder
:
NSCoder
)
{
...
...
@@ -49,15 +78,18 @@ class YHMessageInputView: UIView {
}
private
func
setupUI
()
{
backgroundColor
=
UIColor
.
black
.
withAlphaComponent
(
0.4
)
addSubview
(
textField
)
addSubview
(
sendButton
)
setupConstraints
()
addSubview
(
giftButton
)
}
private
func
setupConstraints
()
{
private
func
updateState
(
_
state
:
YHMessageInputViewState
)
{
// switch state {
// case let .normalWithGift(count):
// <#code#>
// case .inputState:
// <#code#>
// }
textField
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
8
)
make
.
centerY
.
equalToSuperview
()
...
...
@@ -76,6 +108,10 @@ class YHMessageInputView: UIView {
sendMessage
()
}
@objc
private
func
giftButtonTapped
()
{
//
}
private
func
sendMessage
()
{
guard
let
text
=
textField
.
text
?
.
trimmingCharacters
(
in
:
.
whitespacesAndNewlines
),
!
text
.
isEmpty
else
{
...
...
@@ -88,6 +124,7 @@ class YHMessageInputView: UIView {
}
// MARK: - UITextFieldDelegate
extension
YHMessageInputView
:
UITextFieldDelegate
{
func
textFieldShouldReturn
(
_
textField
:
UITextField
)
->
Bool
{
sendMessage
()
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHPlayerTopBarView.swift
0 → 100644
View file @
6d7cc837
//
// YHPlayerTopBarView.swift
// galaxy
//
// Created by alexzzw on 2024/11/25.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHPlayerTopBarView
:
UIView
{
private
let
headerWidth
:
CGFloat
=
32
private
let
buttonWidth
:
CGFloat
=
32
var
shareButtonClickEvent
:
(()
->
Void
)?
var
zoomButtonClickEvent
:
(()
->
Void
)?
var
closeButtonClickEvent
:
(()
->
Void
)?
private
lazy
var
bottomVisualEffectView
:
UIVisualEffectView
=
{
let
effect
=
UIBlurEffect
(
style
:
.
dark
)
let
view
=
UIVisualEffectView
(
effect
:
effect
)
view
.
alpha
=
0.9
return
view
}()
private
lazy
var
headPortrait
:
UIImageView
=
{
let
view
=
UIImageView
()
view
.
layer
.
cornerRadius
=
headerWidth
/
2.0
view
.
clipsToBounds
=
true
view
.
backgroundColor
=
.
gray
return
view
}()
private
lazy
var
infoNameLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"优才E老师名字太长长况..."
label
.
textColor
=
.
white
label
.
font
=
.
PFSC_M
(
ofSize
:
14
)
return
label
}()
private
lazy
var
infoCountLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"865人来过"
label
.
textColor
=
.
white
.
withAlphaComponent
(
0.7
)
label
.
font
=
.
PFSC_R
(
ofSize
:
10
)
return
label
}()
private
lazy
var
shareButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setImage
(
UIImage
(
named
:
"live_room_share"
),
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
shareButtonClicked
)
,
for
:
.
touchUpInside
)
button
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
4
,
left
:
4
,
bottom
:
4
,
right
:
4
)
return
button
}()
private
lazy
var
zoomButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setImage
(
UIImage
(
named
:
"live_room_zoom"
),
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
zoomButtonClicked
)
,
for
:
.
touchUpInside
)
button
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
4
,
left
:
4
,
bottom
:
4
,
right
:
4
)
return
button
}()
private
lazy
var
closeButton
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setImage
(
UIImage
(
named
:
"live_room_close"
),
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
closeButtonClicked
)
,
for
:
.
touchUpInside
)
button
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
4
,
left
:
4
,
bottom
:
4
,
right
:
4
)
return
button
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setupUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
}
extension
YHPlayerTopBarView
{
@objc
private
func
shareButtonClicked
()
{
shareButtonClickEvent
?()
}
@objc
private
func
zoomButtonClicked
()
{
zoomButtonClickEvent
?()
}
@objc
private
func
closeButtonClicked
()
{
closeButtonClickEvent
?()
}
private
func
setupUI
()
{
addSubview
(
bottomVisualEffectView
)
addSubview
(
headPortrait
)
addSubview
(
infoNameLabel
)
addSubview
(
infoCountLabel
)
addSubview
(
shareButton
)
addSubview
(
zoomButton
)
addSubview
(
closeButton
)
bottomVisualEffectView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
bounds
.
size
.
width
,
height
:
bounds
.
size
.
height
)
bottomVisualEffectView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalToSuperview
()
}
// 渐变效果
let
gradinetLayer
=
CAGradientLayer
()
gradinetLayer
.
colors
=
[
UIColor
.
black
.
withAlphaComponent
(
0.16
)
.
cgColor
,
UIColor
.
black
.
withAlphaComponent
(
0.16
)
.
cgColor
,
UIColor
.
black
.
withAlphaComponent
(
0
)
.
cgColor
,
UIColor
.
black
.
withAlphaComponent
(
0
)
.
cgColor
]
gradinetLayer
.
startPoint
=
CGPoint
(
x
:
0.5
,
y
:
0
)
gradinetLayer
.
endPoint
=
CGPoint
(
x
:
0.5
,
y
:
1
)
gradinetLayer
.
frame
=
bottomVisualEffectView
.
bounds
bottomVisualEffectView
.
layer
.
mask
=
gradinetLayer
headPortrait
.
snp
.
makeConstraints
{
make
in
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
6
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
width
.
height
.
equalTo
(
headerWidth
)
}
infoNameLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
headPortrait
.
snp
.
top
)
make
.
left
.
equalTo
(
headPortrait
.
snp
.
right
)
.
offset
(
8
)
}
infoCountLabel
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
infoNameLabel
.
snp
.
bottom
)
make
.
left
.
equalTo
(
infoNameLabel
.
snp
.
left
)
}
closeButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
headPortrait
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
12
)
make
.
width
.
height
.
equalTo
(
buttonWidth
)
}
zoomButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
headPortrait
)
make
.
right
.
equalTo
(
closeButton
.
snp
.
left
)
.
offset
(
-
8
)
make
.
width
.
height
.
equalTo
(
buttonWidth
)
}
shareButton
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
(
headPortrait
)
make
.
right
.
equalTo
(
zoomButton
.
snp
.
left
)
.
offset
(
-
8
)
make
.
width
.
height
.
equalTo
(
buttonWidth
)
make
.
left
.
greaterThanOrEqualTo
(
infoNameLabel
.
snp
.
right
)
.
offset
(
36
)
make
.
left
.
greaterThanOrEqualTo
(
infoCountLabel
.
snp
.
right
)
.
offset
(
36
)
}
}
}
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/live_room_test_bg.png
0 → 100644
View file @
6d7cc837
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/Contents.json
0 → 100644
View file @
6d7cc837
{
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_close.imageset/Contents.json
0 → 100644
View file @
6d7cc837
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"live_room_close@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"live_room_close@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_close.imageset/live_room_close@2x.png
0 → 100644
View file @
6d7cc837
308 Bytes
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_close.imageset/live_room_close@3x.png
0 → 100644
View file @
6d7cc837
431 Bytes
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_msg_gift.imageset/Contents.json
0 → 100644
View file @
6d7cc837
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"live_room_msg_gift@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"live_room_msg_gift@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_msg_gift.imageset/live_room_msg_gift@2x.png
0 → 100644
View file @
6d7cc837
4.53 KB
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_msg_gift.imageset/live_room_msg_gift@3x.png
0 → 100644
View file @
6d7cc837
8.77 KB
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_share.imageset/Contents.json
0 → 100644
View file @
6d7cc837
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"live_room_share@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"live_room_share@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_share.imageset/live_room_share@2x.png
0 → 100644
View file @
6d7cc837
543 Bytes
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_share.imageset/live_room_share@3x.png
0 → 100644
View file @
6d7cc837
764 Bytes
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_zoom.imageset/Contents.json
0 → 100644
View file @
6d7cc837
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"live_room_zoom@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"live_room_zoom@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_zoom.imageset/live_room_zoom@2x.png
0 → 100644
View file @
6d7cc837
338 Bytes
galaxy/galaxy/Res/Assets.xcassets/YinHeLive/live_room_zoom.imageset/live_room_zoom@3x.png
0 → 100644
View file @
6d7cc837
413 Bytes
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