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
5bc88467
Commit
5bc88467
authored
Apr 11, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频播放功能
parent
591a900a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
5 deletions
+63
-5
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+0
-5
YHHomeCollectionViewCell.swift
...IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
+41
-0
Contents.json
...Assets.xcassets/Home/home_play_btn.imageset/Contents.json
+22
-0
编组-21@2x.png
.../Assets.xcassets/Home/home_play_btn.imageset/编组-21@2x.png
+0
-0
编组-21@3x.png
.../Assets.xcassets/Home/home_play_btn.imageset/编组-21@3x.png
+0
-0
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
5bc88467
...
...
@@ -16,10 +16,6 @@ class YHHomePageViewController: YHBaseViewController {
return
viewModel
}()
lazy
var
items
=
{
return
[
AboutAdvantageItem
(
iconName
:
"about_match"
,
title
:
"精准匹配"
,
detail
:
"大数据精准匹配,专属方案获批率更高"
,
url
:
""
)]
}()
lazy
var
homeCollectView
=
{
// 设置布局方向
let
flowLayout
=
YHHomeCollectionLayout
()
...
...
@@ -32,7 +28,6 @@ class YHHomePageViewController: YHBaseViewController {
collectinoView
.
register
(
YHHomeCollectionViewCell
.
self
,
forCellWithReuseIdentifier
:
YHHomeCollectionViewCell
.
cellReuseIdentifier
)
collectinoView
.
delegate
=
self
collectinoView
.
dataSource
=
self
// collectinoView.bounces = false
collectinoView
.
translatesAutoresizingMaskIntoConstraints
=
false
collectinoView
.
alwaysBounceVertical
=
true
return
collectinoView
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
View file @
5bc88467
...
...
@@ -8,6 +8,8 @@
import
UIKit
import
Kingfisher
import
AVFoundation
import
AVKit
class
YHHomeCollectionViewCell
:
UICollectionViewCell
{
static
let
cellReuseIdentifier
=
"YHHomeCollectionViewCell"
...
...
@@ -73,6 +75,33 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
setupUI
()
}
lazy
var
playButton
:
UIButton
=
{
let
btn
=
UIButton
(
type
:
.
custom
)
btn
.
setImage
(
UIImage
(
named
:
"home_play_btn"
),
for
:
.
normal
)
// btn.isHidden = true
return
btn
}()
lazy
var
playerViewController
:
AVPlayerViewController
=
{
let
vc
=
AVPlayerViewController
()
return
vc
}()
}
extension
YHHomeCollectionViewCell
{
@objc
func
clickPlayButton
()
{
if
let
url
=
URL
(
string
:
"https://upload.cdn.galaxy-immi.com/sell/production/video/1638527500518.mp4"
)
{
let
player
=
AVPlayer
(
url
:
url
)
playerViewController
.
player
=
player
self
.
parentViewController
?
.
present
(
playerViewController
,
animated
:
true
)
{
self
.
playerViewController
.
player
!.
play
()
// 开始播放视频
}
}
}
private
func
setupUI
()
{
contentView
.
clipsToBounds
=
true
contentView
.
addSubview
(
titleImageView
)
...
...
@@ -115,6 +144,16 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
heartImageViewBtn
.
addTarget
(
self
,
action
:
#selector(
clickHeart
)
,
for
:
.
touchUpInside
)
heartImageViewBtn
.
YH_clickEdgeInsets
=
UIEdgeInsets
(
top
:
15
,
left
:
15
,
bottom
:
15
,
right
:
15
)
contentView
.
addSubview
(
playButton
)
playButton
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
8
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
8
)
make
.
width
.
height
.
equalTo
(
20
)
}
playButton
.
addTarget
(
self
,
action
:
#selector(
clickPlayButton
)
,
for
:
.
touchUpInside
)
}
func
updataSubViews
()
{
...
...
@@ -139,6 +178,8 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
heartImageViewBtn
.
isSelected
=
listModel
.
is_like
}
@objc
func
clickHeart
()
{
guard
let
listModel
=
listModel
else
{
return
}
...
...
galaxy/galaxy/Res/Assets.xcassets/Home/home_play_btn.imageset/Contents.json
0 → 100644
View file @
5bc88467
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"编组-21@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"编组-21@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Home/home_play_btn.imageset/编组-21@2x.png
0 → 100644
View file @
5bc88467
1.1 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_play_btn.imageset/编组-21@3x.png
0 → 100644
View file @
5bc88467
1.67 KB
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