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
394c9674
Commit
394c9674
authored
May 19, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录注册页 视频播放
parent
08a31016
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
11 deletions
+87
-11
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+22
-0
YHPhoneLiginWithVideoBkgViewController.swift
.../Login(登录)/C/YHPhoneLiginWithVideoBkgViewController.swift
+40
-8
YHLoginPrivacyView.swift
...laxy/Classes/Modules/Login(登录)/V/YHLoginPrivacyView.swift
+3
-3
Contents.json
...ts/Login/login_privacy_agree_white.imageset/Contents.json
+22
-0
Group 3040@2x.png
...ogin/login_privacy_agree_white.imageset/Group 3040@2x.png
+0
-0
Group 3040@3x.png
...ogin/login_privacy_agree_white.imageset/Group 3040@3x.png
+0
-0
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
394c9674
...
...
@@ -11,6 +11,7 @@ import IQKeyboardManagerSwift
import
SmartCodable
import
GKNavigationBarSwift
import
DeviceKit
import
AVFoundation
@main
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
,
WXApiDelegate
{
...
...
@@ -32,6 +33,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
//4.本地用户信息加载
YHLoginManager
.
shared
.
loadLocalUserInfoData
()
YHConfigManager
.
shared
.
loadConfigData
()
//5.预加载
preloadOP
()
//微信注册app
WXApi
.
registerApp
(
"wx06b21f3c7a5ba594"
,
universalLink
:
"https://www.galaxy-immi.com/app1/"
)
WXApi
.
startLog
(
by
:
.
detail
)
{
string
in
...
...
@@ -119,6 +124,23 @@ extension AppDelegate {
window
?
.
rootViewController
=
nav
window
?
.
makeKeyAndVisible
()
}
private
func
preloadOP
()
{
DispatchQueue
.
global
()
.
async
{
guard
let
videoURL
=
Bundle
.
main
.
url
(
forResource
:
"loginBkg"
,
withExtension
:
"mov"
)
else
{
return
}
let
player
:
AVPlayer
?
=
AVPlayer
(
url
:
videoURL
)
player
?
.
actionAtItemEnd
=
.
none
let
playerLayer
:
AVPlayerLayer
?
=
AVPlayerLayer
(
player
:
player
)
playerLayer
?
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
)
playerLayer
?
.
videoGravity
=
.
resizeAspectFill
player
?
.
play
()
player
?
.
pause
()
}
}
}
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHPhoneLiginWithVideoBkgViewController.swift
View file @
394c9674
...
...
@@ -33,6 +33,7 @@ class YHPhoneLiginWithVideoBkgViewController: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
YHAnalytics
.
timeStrat
(
"loginTime"
)
IQKeyboardManager
.
shared
.
enable
=
false
}
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
...
...
@@ -60,13 +61,42 @@ class YHPhoneLiginWithVideoBkgViewController: YHBaseViewController {
lazy
var
contentHoldView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
clear
// view.backgroundColor = .red //for test hjl
return
view
}()
// 视图控制器被销毁前,移除所有观察者
deinit
{
NotificationCenter
.
default
.
removeObserver
(
self
,
name
:
UIResponder
.
keyboardWillShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
removeObserver
(
self
,
name
:
UIResponder
.
keyboardWillHideNotification
,
object
:
nil
)
}
}
extension
YHPhoneLiginWithVideoBkgViewController
{
@objc
func
keyboardWillShow
(
notification
:
NSNotification
)
{
if
((
notification
.
userInfo
?[
UIResponder
.
keyboardFrameEndUserInfoKey
]
as?
NSValue
)?
.
cgRectValue
)
!=
nil
{
contentHoldView
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
loginSubTitleLabel
.
snp
.
bottom
)
.
offset
(
72
)
make
.
left
.
right
.
equalToSuperview
()
}
}
}
// 键盘将要隐藏时的处理函数
@objc
func
keyboardWillHide
(
notification
:
NSNotification
)
{
contentHoldView
.
snp
.
remakeConstraints
{
make
in
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
40
)
make
.
left
.
right
.
equalToSuperview
()
}
}
func
setView
()
{
view
.
backgroundColor
=
.
white
...
...
@@ -76,6 +106,12 @@ extension YHPhoneLiginWithVideoBkgViewController {
viewModel
=
YHLoginViewModel
()
// 添加键盘显示的观察者
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardWillShow
)
,
name
:
UIResponder
.
keyboardWillShowNotification
,
object
:
nil
)
// 添加键盘隐藏的观察者
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardWillHide
)
,
name
:
UIResponder
.
keyboardWillHideNotification
,
object
:
nil
)
setupBackgroundVideo
()
setupFrontUI
()
...
...
@@ -169,9 +205,6 @@ extension YHPhoneLiginWithVideoBkgViewController {
phoneMessageView
=
{
let
view
=
YHPhoneMessageView
()
view
.
backgroundColor
=
.
clear
//UIColor.contentBkgColor
// view.layer.cornerRadius = kCornerRadius6
// view.layer.borderWidth = 1
// view.layer.borderColor = UIColor(hex:0xebeef4).cgColor
view
.
phoneBlock
=
{[
weak
self
]
count
in
guard
let
self
=
self
else
{
return
}
if
count
==
0
{
...
...
@@ -227,9 +260,6 @@ extension YHPhoneLiginWithVideoBkgViewController {
}
@objc
func
getCode
()
{
IQKeyboardManager
.
shared
.
resignFirstResponder
()
let
phoneNumer
=
phoneMessageView
.
phoneTextField
.
text
??
""
guard
phoneNumer
.
isMobile
()
==
true
else
{
YHHUD
.
flash
(
message
:
"请输入正确的手机号"
)
...
...
@@ -279,7 +309,8 @@ extension YHPhoneLiginWithVideoBkgViewController {
@objc
func
close
()
{
YHLoginManager
.
shared
.
loginSuccessActionBlock
=
nil
self
.
dismiss
(
animated
:
true
)
IQKeyboardManager
.
shared
.
enable
=
true
dismiss
(
animated
:
true
)
}
}
...
...
@@ -294,6 +325,7 @@ extension YHPhoneLiginWithVideoBkgViewController {
playerLayer
?
.
videoGravity
=
.
resizeAspectFill
view
.
layer
.
insertSublayer
(
playerLayer
!
,
at
:
0
)
player
?
.
play
()
player
?
.
seek
(
to
:
.
zero
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
playerItemDidPlayToEndTimeNotification
)
,
name
:
AVPlayerItem
.
didPlayToEndTimeNotification
,
object
:
nil
)
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/V/YHLoginPrivacyView.swift
View file @
394c9674
...
...
@@ -29,7 +29,7 @@ class YHLoginPrivacyView: UIView {
agreeButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
setBackgroundImage
(
UIImage
(
named
:
"login_privacy_disagree"
),
for
:
.
normal
)
button
.
setBackgroundImage
(
UIImage
(
named
:
"login_privacy_agree"
),
for
:
.
selected
)
button
.
setBackgroundImage
(
UIImage
(
named
:
"login_privacy_agree
_white
"
),
for
:
.
selected
)
button
.
addTarget
(
self
,
action
:
#selector(
agreeClick
)
,
for
:
.
touchUpInside
)
return
button
}()
...
...
@@ -61,7 +61,7 @@ class YHLoginPrivacyView: UIView {
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
12
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"《隐私协议》"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
firstUrlClick
)
,
for
:
.
touchUpInside
)
return
button
}()
...
...
@@ -91,7 +91,7 @@ class YHLoginPrivacyView: UIView {
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
12
)
button
.
contentHorizontalAlignment
=
.
center
button
.
setTitle
(
"《用户条款》"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
white
,
for
:
.
normal
)
button
.
addTarget
(
self
,
action
:
#selector(
secondUrlClick
)
,
for
:
.
touchUpInside
)
return
button
}()
...
...
galaxy/galaxy/Res/Assets.xcassets/Login/login_privacy_agree_white.imageset/Contents.json
0 → 100644
View file @
394c9674
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Group 3040@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Group 3040@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Login/login_privacy_agree_white.imageset/Group 3040@2x.png
0 → 100644
View file @
394c9674
343 Bytes
galaxy/galaxy/Res/Assets.xcassets/Login/login_privacy_agree_white.imageset/Group 3040@3x.png
0 → 100644
View file @
394c9674
479 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