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
fa3e1fde
Commit
fa3e1fde
authored
Apr 11, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
四大金刚区跳转
parent
5a4ffdcc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
YHHomeKingKongBlockView.swift
.../Classes/Modules/Home(首页)/V/YHHomeKingKongBlockView.swift
+28
-5
YHHomePageViewModel.swift
...axy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
+8
-3
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeKingKongBlockView.swift
View file @
fa3e1fde
...
...
@@ -22,10 +22,10 @@ class YHHomeKingKongBlockView: UIView {
}
var
arrData
:
[
YHHomeKingKongBlockModel
]
=
[
YHHomeKingKongBlockModel
(
type
:
"
1
"
,
iconName
:
"kingkong_sffl"
,
title
:
"身份福利"
),
YHHomeKingKongBlockModel
(
type
:
"
2
"
,
iconName
:
"kingkong_blgl"
,
title
:
"办理攻略"
),
YHHomeKingKongBlockModel
(
type
:
"
3
"
,
iconName
:
"kingkong_khxs"
,
title
:
"客户心声"
),
YHHomeKingKongBlockModel
(
type
:
"
4
"
,
iconName
:
"kingkong_xgbs"
,
title
:
"香港办事"
),
YHHomeKingKongBlockModel
(
type
:
"
3
"
,
iconName
:
"kingkong_sffl"
,
title
:
"身份福利"
),
YHHomeKingKongBlockModel
(
type
:
"
4
"
,
iconName
:
"kingkong_blgl"
,
title
:
"办理攻略"
),
YHHomeKingKongBlockModel
(
type
:
"
5
"
,
iconName
:
"kingkong_khxs"
,
title
:
"客户心声"
),
YHHomeKingKongBlockModel
(
type
:
"
6
"
,
iconName
:
"kingkong_xgbs"
,
title
:
"香港办事"
),
]
}
...
...
@@ -33,7 +33,7 @@ private extension YHHomeKingKongBlockView {
func
initView
()
{
let
gap
:
CGFloat
=
16.0
var
offsetX
:
CGFloat
=
0.0
for
(
_
,
item
)
in
arrData
.
enumerated
()
{
for
(
index
,
item
)
in
arrData
.
enumerated
()
{
let
view
=
YHHomeKingKongBlockItem
()
view
.
dataModel
=
item
addSubview
(
view
)
...
...
@@ -44,6 +44,29 @@ private extension YHHomeKingKongBlockView {
}
offsetX
=
offsetX
+
YHHomeKingKongBlockView
.
viewH
+
gap
view
.
tag
=
index
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
tapView(gestureRecognizer:)
)
)
view
.
addGestureRecognizer
(
tap
)
}
}
@objc
func
tapView
(
gestureRecognizer
:
UITapGestureRecognizer
)
{
if
let
tag
=
gestureRecognizer
.
view
?
.
tag
{
switch
tag
{
case
0
:
printLog
(
"跳转 身份福利"
)
case
1
:
printLog
(
"跳转 办理攻略"
)
case
2
:
printLog
(
"跳转 客户心声"
)
case
3
:
printLog
(
"跳转 香港办事"
)
default
:
break
}
}
}
}
galaxy/galaxy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
View file @
fa3e1fde
...
...
@@ -15,6 +15,11 @@ class YHHomePageViewModel : YHBaseViewModel {
var
arrHomeNewsData
:
[
YHHomeListModel
?]
=
[]
var
banners
:
[
YHBannerModel
]?
var
classify
:
[
YHHomeClassifyModel
]?
//首页相关参数
private
var
curPageIndex
:
Int
=
1
private
var
page_Size
:
Int
=
10
private
var
hasMoreForHomeNews
:
Bool
=
true
}
//接口
...
...
@@ -40,10 +45,10 @@ extension YHHomePageViewModel {
}
func
getHomeNewsList
(
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"page"
:
1
,
"page_size"
:
10
]
let
params
:
[
String
:
Any
]
=
[
"page"
:
curPageIndex
,
"page_size"
:
page_Size
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
consult
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
//1. json字符串 转 对象
if
json
.
code
==
200
{
...
...
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