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
3ead8fff
Commit
3ead8fff
authored
Apr 15, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS
into develop
parents
4b03ddaf
5aea376c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
18 deletions
+89
-18
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+3
-3
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+4
-1
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+40
-2
YHHomeWebViewController.swift
.../Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
+28
-6
YHStartPageViewController.swift
...lasses/Modules/Home(首页)/C/YHStartPageViewController.swift
+4
-2
YHHomeListModel.swift
...y/galaxy/Classes/Modules/Home(首页)/M/YHHomeListModel.swift
+2
-2
YHServerHKLifeViewController.swift
...lligentService(服务中心)/C/YHServerHKLifeViewController.swift
+3
-0
YHServiceListViewController.swift
...elligentService(服务中心)/C/YHServiceListViewController.swift
+3
-0
YHHomeCollectionViewCell.swift
...IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
+2
-2
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
3ead8fff
...
...
@@ -2944,7 +2944,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
0
;
CURRENT_PROJECT_VERSION
=
2
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
@@ -3145,7 +3145,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
0
;
CURRENT_PROJECT_VERSION
=
2
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
@@ -3187,7 +3187,7 @@
CODE_SIGN_IDENTITY
=
"Apple Development"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Manual
;
CURRENT_PROJECT_VERSION
=
0
;
CURRENT_PROJECT_VERSION
=
2
;
DEVELOPMENT_TEAM
=
""
;
"DEVELOPMENT_TEAM[sdk=iphoneos*]"
=
RXHYW88XR7
;
ENABLE_USER_SCRIPT_SANDBOXING
=
NO
;
...
...
galaxy/galaxy/AppDelegate.swift
View file @
3ead8fff
...
...
@@ -124,7 +124,10 @@ extension AppDelegate {
//1.设置主窗口
private
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
v0
=
YHNavigationController
(
rootVC
:
YHHomePageViewController
())
let
homeVC
=
YHHomePageViewController
()
tabBarController
.
delegate
=
homeVC
let
v0
=
YHNavigationController
(
rootVC
:
homeVC
)
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
3ead8fff
...
...
@@ -41,7 +41,6 @@ class YHHomePageViewController: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
loadFirstData
()
}
lazy
var
searchView
:
YHHomeSearchView
=
{
...
...
@@ -55,6 +54,10 @@ class YHHomePageViewController: YHBaseViewController {
let
view
=
YHHomeHeadView
()
return
view
}()
var
tapTimestamp
:
CFAbsoluteTime
=
-
10.0
}
private
extension
YHHomePageViewController
{
...
...
@@ -97,6 +100,11 @@ private extension YHHomePageViewController {
}
self
.
homeCollectView
.
reloadData
()
// DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute:{
// printLog(YHHomeHeadView.viewH)
// printLog(self.homeCollectView.contentOffset)
// })
}
}
...
...
@@ -104,7 +112,7 @@ private extension YHHomePageViewController {
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
.
white
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
homepageRefresh
)
,
name
:
YhConstant
.
YhNotification
.
refreshHomePageNotifiction
,
object
:
nil
)
//
NotificationCenter.default.addObserver(self, selector: #selector(homepageRefresh), name:YhConstant.YhNotification.refreshHomePageNotifiction, object: nil)
view
.
addSubview
(
searchView
)
searchView
.
snp
.
makeConstraints
{
make
in
...
...
@@ -160,6 +168,18 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
let
vc
=
YHHomeWebViewController
()
vc
.
url
=
YHConfigManager
.
shared
.
h5Url
+
"?id=
\(
model
.
id
)
"
vc
.
id
=
model
.
id
vc
.
block
=
{
item
in
if
let
arr
=
self
.
viewModel
.
arrHomeNewsData
{
for
(
index
,
targetItem
)
in
arr
.
enumerated
()
{
if
targetItem
.
id
==
item
.
id
{
targetItem
.
is_like
=
item
.
is_like
targetItem
.
like_count
=
item
.
like_count
self
.
homeCollectView
.
reloadItems
(
at
:
[
IndexPath
(
index
:
index
)])
}
}
}
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
model
.
type
==
1
{
printLog
(
"直接播放视频"
)
...
...
@@ -173,3 +193,21 @@ extension YHHomePageViewController : CollectionViewWaterfallLayoutDelegate {
return
CGSize
(
width
:
model
.
img_width_cell
,
height
:
model
.
img_height_cell
)
}
}
extension
YHHomePageViewController
:
UITabBarControllerDelegate
{
func
tabBarController
(
_
tabBarController
:
UITabBarController
,
didSelect
viewController
:
UIViewController
)
{
let
doubleTapInterval
:
CGFloat
=
0.3
if
tabBarController
.
selectedIndex
==
0
{
let
timestamp
=
CFAbsoluteTimeGetCurrent
()
printLog
(
timestamp
-
self
.
tapTimestamp
)
if
timestamp
-
self
.
tapTimestamp
<
doubleTapInterval
{
UIView
.
animate
(
withDuration
:
0.25
)
{
self
.
homeCollectView
.
contentOffset
=
CGPoint
(
x
:
0
,
y
:
-
YHHomeHeadView
.
viewH
)
//置顶功能
}
}
self
.
tapTimestamp
=
timestamp
}
}
}
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
View file @
3ead8fff
...
...
@@ -10,8 +10,14 @@ import UIKit
import
WebKit
class
YHHomeWebViewController
:
YHBaseViewController
,
WKUIDelegate
,
WKNavigationDelegate
{
var
operationFlag
:
Bool
=
false
typealias
Block
=
(
YHWebModel
)
->
()
var
block
:
Block
?
var
viewModel
:
YHHomeWebViewModel
!
var
webview
=
WKWebView
()
var
progBar
=
UIProgressView
()
var
bottomView
:
YHHomeWebBottomView
!
...
...
@@ -60,16 +66,22 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
self
.
viewModel
.
getLike
(
self
.
id
,
1
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
operationFlag
=
true
YHHUD
.
flash
(
message
:
"已点赞"
)
self
.
getData
()
}
else
{
operationFlag
=
false
}
}
}
else
{
self
.
viewModel
.
getLike
(
self
.
id
,
0
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
operationFlag
=
true
YHHUD
.
flash
(
message
:
"已取消点赞"
)
self
.
getData
()
}
else
{
operationFlag
=
false
}
}
}
...
...
@@ -87,16 +99,22 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
self
.
viewModel
.
getStar
(
self
.
id
,
1
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
operationFlag
=
true
YHHUD
.
flash
(
message
:
"已收藏"
)
self
.
getData
()
}
else
{
operationFlag
=
false
}
}
}
else
{
self
.
viewModel
.
getStar
(
self
.
id
,
0
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
operationFlag
=
true
YHHUD
.
flash
(
message
:
"已取消收藏"
)
self
.
getData
()
}
else
{
operationFlag
=
false
}
}
}
...
...
@@ -132,11 +150,15 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
func
getData
()
{
viewModel
.
getWebDetail
(
self
.
id
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
model
=
self
.
viewModel
.
mainModel
else
{
return
}
bottomView
.
likeCount
=
model
.
like_count
bottomView
.
starCount
=
model
.
collect_count
bottomView
.
isStar
=
model
.
is_collect
bottomView
.
isLike
=
model
.
is_like
if
success
{
guard
let
model
=
self
.
viewModel
.
mainModel
else
{
return
}
bottomView
.
likeCount
=
model
.
like_count
bottomView
.
starCount
=
model
.
collect_count
bottomView
.
isStar
=
model
.
is_collect
bottomView
.
isLike
=
model
.
is_like
self
.
block
?(
model
)
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHStartPageViewController.swift
View file @
3ead8fff
...
...
@@ -26,7 +26,7 @@ class YHStartPageViewController: UIViewController {
lazy
var
closeBtn
:
UIButton
=
{
let
button
=
UIButton
(
type
:
.
custom
)
button
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
button
.
setTitle
(
"跳过
5
"
,
for
:
.
normal
)
button
.
setTitle
(
"跳过
3
"
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
(
hex
:
0xffffff
),
for
:
.
normal
)
button
.
setBackgroundColor
(
color
:
UIColor
(
red
:
0.071
,
green
:
0.102
,
blue
:
0.149
,
alpha
:
0.3
),
forState
:
.
normal
)
return
button
...
...
@@ -98,7 +98,9 @@ private extension YHStartPageViewController {
//1.设置主窗口
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
v0
=
YHNavigationController
(
rootVC
:
YHHomePageViewController
())
let
homeVC
=
YHHomePageViewController
()
tabBarController
.
delegate
=
homeVC
let
v0
=
YHNavigationController
(
rootVC
:
homeVC
)
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/M/YHHomeListModel.swift
View file @
3ead8fff
...
...
@@ -18,12 +18,12 @@ class YHHomeListModel: YHBaseModel {
var
id
:
Int
=
0
var
title
:
String
=
""
var
content
:
String
=
""
var
view_count
:
Int
=
0
var
view_count
:
Int
=
0
//浏览数量
var
img_url
:
String
=
""
var
type
:
Int
=
0
//文章类型 '文章类型 1视频 2图文 3图片',
var
is_like
:
Bool
=
false
var
media_url
:
String
=
""
var
like_count
:
Int
=
0
var
like_count
:
Int
=
0
//点赞梳理
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServerHKLifeViewController.swift
View file @
3ead8fff
...
...
@@ -60,6 +60,9 @@ extension YHServerHKLifeViewController {
let
model
=
item
as
YHHomeClassifyModel
if
model
.
id
==
2
{
self
.
sectionView
.
items
=
model
.
children
if
self
.
classId
==
0
{
return
}
let
classifyID
=
model
.
children
.
first
?
.
id
??
0
self
.
classId
=
classifyID
self
.
homeViewModel
.
getList
(
true
,
classifyID
)
{[
weak
self
]
success
,
error
in
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceListViewController.swift
View file @
3ead8fff
...
...
@@ -44,6 +44,9 @@ extension YHServiceListViewController {
let
model
=
item
as
YHHomeClassifyModel
if
model
.
id
==
1
{
self
.
normalView
.
sectionView
.
items
=
model
.
children
if
self
.
classId
==
0
{
return
}
let
classifyID
=
model
.
children
.
first
?
.
id
??
0
self
.
classId
=
classifyID
self
.
homeViewModel
.
getList
(
true
,
classifyID
)
{[
weak
self
]
success
,
error
in
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
View file @
3ead8fff
...
...
@@ -200,6 +200,7 @@ extension YHHomeCollectionViewCell {
if
success
{
YHHUD
.
flash
(
message
:
"已点赞"
)
listModel
.
is_like
=
true
listModel
.
like_count
=
listModel
.
like_count
+
1
updataSubViews
()
}
}
...
...
@@ -209,12 +210,11 @@ extension YHHomeCollectionViewCell {
if
success
{
YHHUD
.
flash
(
message
:
"已取消点赞"
)
listModel
.
is_like
=
false
listModel
.
like_count
=
listModel
.
like_count
-
1
updataSubViews
()
}
}
}
NotificationCenter
.
default
.
post
(
name
:
YhConstant
.
YhNotification
.
refreshHomePageNotifiction
,
object
:
nil
)
}
else
{
let
vc
=
UINavigationController
(
rootVC
:
YHPhoneLoginViewController
())
vc
.
modalPresentationStyle
=
.
custom
...
...
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