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
87a72744
Commit
87a72744
authored
Dec 09, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播bug修复
parent
a33a1f25
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
17 deletions
+99
-17
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+20
-2
YHFloatingWindow.swift
...es/Modules/LivestreamSales(直播销售)/V/YHFloatingWindow.swift
+35
-9
YHGradientView.swift
...sses/Modules/LivestreamSales(直播销售)/V/YHGradientView.swift
+42
-5
YHShareAlertView.swift
...es/Modules/LivestreamSales(直播销售)/V/YHShareAlertView.swift
+2
-1
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
87a72744
...
...
@@ -80,6 +80,9 @@ class YHHomePageViewController: YHBaseViewController {
guard
YHPlayerManager
.
shared
.
isConfigFloating
!=
false
else
{
return
}
guard
let
configModel
=
YHConfigManager
.
shared
.
reqVM
.
configModel
,
configModel
.
is_integral_open
else
{
return
}
viewModel
.
getHomeFloatingLive
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
...
...
@@ -218,7 +221,14 @@ private extension YHHomePageViewController {
}
func
addDefaultData
()
{
homeHeaderView
.
homeBannerView
.
dataArr
=
getCacheDataForBanner
()
if
let
configModel
=
YHConfigManager
.
shared
.
reqVM
.
configModel
,
configModel
.
is_integral_open
{
homeHeaderView
.
homeBannerView
.
dataArr
=
getCacheDataForBanner
()
}
else
{
homeHeaderView
.
homeBannerView
.
dataArr
=
getCacheDataForBanner
()
.
filter
{
(
$0
.
skip_type
!=
100
)
&&
(
$0
.
skip_type
!=
101
)
&&
(
$0
.
skip_type
!=
102
)
}
}
getCacheDataForHomeNewsData
()
}
...
...
@@ -276,7 +286,15 @@ private extension YHHomePageViewController {
self
.
viewModel
.
getHomeBanner
(
0
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
DispatchQueue
.
main
.
async
{
self
.
homeHeaderView
.
homeBannerView
.
dataArr
=
self
.
viewModel
.
banners
??
self
.
getCacheDataForBanner
()
if
let
configModel
=
YHConfigManager
.
shared
.
reqVM
.
configModel
,
configModel
.
is_integral_open
{
self
.
homeHeaderView
.
homeBannerView
.
dataArr
=
self
.
viewModel
.
banners
??
self
.
getCacheDataForBanner
()
}
else
{
self
.
homeHeaderView
.
homeBannerView
.
dataArr
=
(
self
.
viewModel
.
banners
??
self
.
getCacheDataForBanner
())
.
filter
{
(
$0
.
skip_type
!=
100
)
&&
(
$0
.
skip_type
!=
101
)
&&
(
$0
.
skip_type
!=
102
)
}
}
if
let
arrB
=
self
.
viewModel
.
banners
,
arrB
.
count
>
0
{
let
arrString
=
arrB
.
toJSONString
()
UserDefaults
.
standard
.
set
(
arrString
,
forKey
:
"homeBannerData"
)
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHFloatingWindow.swift
View file @
87a72744
...
...
@@ -30,7 +30,17 @@ class YHFloatingWindow: NSObject {
var
source
:
Source
=
.
userAction
weak
var
delegate
:
YHFloatingWindowDelegate
?
var
playbackInfo
:
YHPlayerManager
.
PlaybackInfo
?
var
playbackInfo
:
YHPlayerManager
.
PlaybackInfo
?
{
didSet
{
if
playbackInfo
?
.
isLive
==
true
{
bottomView
.
isHidden
=
false
bottomView
.
play
(
true
)
}
else
{
bottomView
.
isHidden
=
true
bottomView
.
play
(
false
)
}
}
}
// 视频方向
enum
VideoOrientation
{
...
...
@@ -52,13 +62,13 @@ class YHFloatingWindow: NSObject {
static
let
minHeight
:
CGFloat
=
67.5
// 16:9
static
let
maxHeight
:
CGFloat
=
UIScreen
.
main
.
bounds
.
height
static
let
defaultWidth
:
CGFloat
=
150
static
let
defaultHeight
:
CGFloat
=
84.375
// 16:9
static
let
defaultWidth
:
CGFloat
=
72
//
150
static
let
defaultHeight
:
CGFloat
=
128
//
84.375 // 16:9
}
private(set)
var
contentView
:
UIView
private
var
containerView
:
UIView
private
var
videoOrientation
:
VideoOrientation
=
.
landscape
private
var
videoOrientation
:
VideoOrientation
=
.
portrait
//.
landscape
// 手势相关
private
var
initialFrame
:
CGRect
=
.
zero
...
...
@@ -101,6 +111,13 @@ class YHFloatingWindow: NSObject {
closeButton
.
center
=
CGPoint
(
x
:
container
.
bounds
.
width
/
2
,
y
:
container
.
bounds
.
height
/
2
)
return
container
}()
private
lazy
var
bottomView
:
YHGradientView
=
{
let
view
=
YHGradientView
()
view
.
isHidden
=
true
view
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
Size
.
defaultWidth
,
height
:
20
)
return
view
}()
// MARK: - Initialization
...
...
@@ -144,16 +161,25 @@ class YHFloatingWindow: NSObject {
closeButtonContainer
.
widthAnchor
.
constraint
(
equalToConstant
:
30
),
closeButtonContainer
.
heightAnchor
.
constraint
(
equalToConstant
:
30
),
])
containerView
.
addSubview
(
bottomView
)
bottomView
.
translatesAutoresizingMaskIntoConstraints
=
false
NSLayoutConstraint
.
activate
([
bottomView
.
bottomAnchor
.
constraint
(
equalTo
:
containerView
.
bottomAnchor
),
bottomView
.
trailingAnchor
.
constraint
(
equalTo
:
containerView
.
trailingAnchor
),
bottomView
.
leadingAnchor
.
constraint
(
equalTo
:
containerView
.
leadingAnchor
),
bottomView
.
heightAnchor
.
constraint
(
equalToConstant
:
20
),
])
}
private
func
setupGestures
()
{
let
panGesture
=
UIPanGestureRecognizer
(
target
:
self
,
action
:
#selector(
handlePan(_:)
)
)
let
pinchGesture
=
UIPinchGestureRecognizer
(
target
:
self
,
action
:
#selector(
handlePinch(_:)
)
)
//
let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(handlePinch(_:)))
let
tapGesture
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
handleTap(_:)
)
)
tapGesture
.
delegate
=
self
containerView
.
addGestureRecognizer
(
panGesture
)
containerView
.
addGestureRecognizer
(
pinchGesture
)
//
containerView.addGestureRecognizer(pinchGesture)
containerView
.
addGestureRecognizer
(
tapGesture
)
}
...
...
@@ -524,9 +550,9 @@ extension YHFloatingWindow: YHPlayerDelegate {
//
}
func
player
(
_
player
:
YHPlayer
,
didReceiveVideoSize
size
:
CGSize
)
{
DispatchQueue
.
main
.
async
{
self
.
setVideoSize
(
size
)
}
//
DispatchQueue.main.async {
//
self.setVideoSize(size)
//
}
}
func
player
(
_
player
:
YHPlayer
,
didChangedTo
positionMs
:
Int
,
atTimestamp
timestampMs
:
TimeInterval
)
{
//
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHGradientView.swift
View file @
87a72744
...
...
@@ -7,9 +7,24 @@
//
import
UIKit
import
Lottie
class
YHGradientView
:
UIView
{
private
lazy
var
liveAnimationView
:
LottieAnimationView
=
{
let
view
=
LottieAnimationView
(
name
:
"live"
)
view
.
backgroundColor
=
UIColor
.
clear
view
.
loopMode
=
.
loop
return
view
}()
private
lazy
var
infoTitleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
.
white
label
.
text
=
"直播中"
label
.
font
=
.
PFSC_R
(
ofSize
:
11
)
return
label
}()
override
class
var
layerClass
:
AnyClass
{
return
CAGradientLayer
.
self
}
...
...
@@ -29,10 +44,32 @@ class YHGradientView: UIView {
return
}
gradientLayer
.
colors
=
[
UIColor
(
white
:
1
,
alpha
:
1
)
.
cgColor
,
// 顶部 100% 不透明
UIColor
(
white
:
1
,
alpha
:
0
)
.
cgColor
// 底部 0% 完全透明
(
UIColor
(
hexString
:
"#AFCEFF"
)
??
UIColor
())
.
cgColor
,
(
UIColor
(
hexString
:
"#0046B4"
)
??
UIColor
())
.
cgColor
,
(
UIColor
(
hexString
:
"#0046B4"
)
??
UIColor
())
.
cgColor
,
(
UIColor
(
hexString
:
"#AFCEFF"
)
??
UIColor
())
.
cgColor
]
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0.5
,
y
:
0
)
// 上边中点
gradientLayer
.
endPoint
=
CGPoint
(
x
:
0.5
,
y
:
1
)
// 下边中点
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0
,
y
:
0.5
)
// 上边中点
gradientLayer
.
endPoint
=
CGPoint
(
x
:
1
,
y
:
0.5
)
// 下边中点
addSubview
(
liveAnimationView
)
addSubview
(
infoTitleLabel
)
liveAnimationView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
8
)
make
.
centerY
.
equalToSuperview
()
make
.
width
.
height
.
equalTo
(
18
)
}
infoTitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
liveAnimationView
.
snp
.
right
)
make
.
centerY
.
equalToSuperview
()
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
12
)
}
}
func
play
(
_
needPlay
:
Bool
)
{
if
needPlay
{
liveAnimationView
.
play
()
}
else
{
liveAnimationView
.
stop
()
}
}
}
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHShareAlertView.swift
View file @
87a72744
...
...
@@ -296,7 +296,8 @@ class YHShareAlertView: UIView {
@objc
func
wxClick
()
{
if
fromAiSale
{
YHShareManager
.
shared
.
sendLinkContent
(
subMessage
,
""
,
mainImageView
.
image
??
UIImage
(),
link
:
linkUrl
)
let
content
=
isLive
?
"
\(
title
)
正在直播中,快来围观吧~"
:
"点击查看详情讲解~"
YHShareManager
.
shared
.
sendLinkContent
(
subMessage
,
content
,
mainImageView
.
image
??
UIImage
(),
link
:
linkUrl
)
}
else
{
YHShareManager
.
shared
.
sendLinkContent
(
title
,
subMessage
,
mainImageView
.
image
??
UIImage
(),
link
:
linkUrl
)
}
...
...
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