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
bcfaed22
Commit
bcfaed22
authored
Apr 10, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务首页接口添加
parent
7f5bfda3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
131 additions
and
21 deletions
+131
-21
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-0
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+5
-0
YHHomeClassifyModel.swift
...laxy/Classes/Modules/Home(首页)/M/YHHomeClassifyModel.swift
+25
-0
YHHomeListModel.swift
...y/galaxy/Classes/Modules/Home(首页)/M/YHHomeListModel.swift
+3
-0
YHHomePageViewModel.swift
...axy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
+50
-1
YHServiceListViewController.swift
...elligentService(服务中心)/C/YHServiceListViewController.swift
+22
-0
YHServiceBannerView.swift
...ules/IntelligentService(服务中心)/V/YHServiceBannerView.swift
+6
-4
YHServiceSectionView.swift
...les/IntelligentService(服务中心)/V/YHServiceSectionView.swift
+12
-15
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+4
-1
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
bcfaed22
...
...
@@ -240,6 +240,7 @@
049AC4C82BC513AB00F857F4
/* YHOrderListView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049AC4C72BC513AB00F857F4
/* YHOrderListView.swift */
;
};
049AC4CA2BC5141600F857F4
/* YHServerNoOrderView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049AC4C92BC5141600F857F4
/* YHServerNoOrderView.swift */
;
};
049AC4CC2BC6615500F857F4
/* YHHomeListModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049AC4CB2BC6615500F857F4
/* YHHomeListModel.swift */
;
};
049AC4CE2BC674A700F857F4
/* YHHomeClassifyModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049AC4CD2BC674A700F857F4
/* YHHomeClassifyModel.swift */
;
};
04A271232BABFF3200652B1B
/* YHCertificateUploadTypeCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A271222BABFF3200652B1B
/* YHCertificateUploadTypeCell.swift */
;
};
04A271252BAC33BB00652B1B
/* YHFilePreviewTool.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A271242BAC33BB00652B1B
/* YHFilePreviewTool.swift */
;
};
04A671592B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
;
};
...
...
@@ -674,6 +675,7 @@
049AC4C72BC513AB00F857F4
/* YHOrderListView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHOrderListView.swift
;
sourceTree
=
"<group>"
;
};
049AC4C92BC5141600F857F4
/* YHServerNoOrderView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServerNoOrderView.swift
;
sourceTree
=
"<group>"
;
};
049AC4CB2BC6615500F857F4
/* YHHomeListModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeListModel.swift
;
sourceTree
=
"<group>"
;
};
049AC4CD2BC674A700F857F4
/* YHHomeClassifyModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeClassifyModel.swift
;
sourceTree
=
"<group>"
;
};
04A271222BABFF3200652B1B
/* YHCertificateUploadTypeCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadTypeCell.swift
;
sourceTree
=
"<group>"
;
};
04A271242BAC33BB00652B1B
/* YHFilePreviewTool.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFilePreviewTool.swift
;
sourceTree
=
"<group>"
;
};
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadSheetView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -2145,6 +2147,7 @@
A5C5B2E92B4ECA4D00A7C5D1
/* YHDavidModel0.swift */
,
A53F42B82BC3DCA9009CAC70
/* YHHomeKingKongBlockModel.swift */
,
049AC4CB2BC6615500F857F4
/* YHHomeListModel.swift */
,
049AC4CD2BC674A700F857F4
/* YHHomeClassifyModel.swift */
,
);
path
=
M
;
sourceTree
=
"<group>"
;
...
...
@@ -2763,6 +2766,7 @@
044CF8D62BBA57DC00008CE8
/* YHFailPromptView.swift in Sources */
,
A5ACE9562B4564F7002C94D2
/* YHBouncesContentView.swift in Sources */
,
A554A5122B99715000EA5973
/* YHConstantArrayData.swift in Sources */
,
049AC4CE2BC674A700F857F4
/* YHHomeClassifyModel.swift in Sources */
,
045EEE962B9F171A0022A143
/* YHPreviewInfoCertificatePictureItemsView.swift in Sources */
,
A53D381E2BC23794006AE6F7
/* YHMsgViewController.swift in Sources */
,
A592FE912BA6CC010062FACA
/* YHCertificateEntryHeadView.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
bcfaed22
...
...
@@ -90,6 +90,11 @@ class YHHomePageViewController: YHBaseViewController {
guard
let
self
=
self
else
{
return
}
self
.
homeHeaderView
.
homeBannerView
.
dataArr
=
self
.
viewModel
.
banners
??
[]
}
viewModel
.
getHomeClassify
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/M/YHHomeClassifyModel.swift
0 → 100644
View file @
bcfaed22
//
// YHHomeClassifyModel.swift
// galaxy
//
// Created by EDY on 2024/4/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHHomeClassifyModel
:
YHBaseModel
{
var
id
:
Int
=
0
var
name
:
String
=
""
var
pid
:
Int
=
0
var
type
:
Int
=
0
var
children
:
[
YHClassifyModel
]
=
[]
}
class
YHClassifyModel
:
YHBaseModel
{
var
children
:
[
String
]
=
[]
var
id
:
Int
=
0
var
name
:
String
=
""
var
pid
:
Int
=
0
var
type
:
Int
=
0
}
galaxy/galaxy/Classes/Modules/Home(首页)/M/YHHomeListModel.swift
View file @
bcfaed22
...
...
@@ -15,4 +15,7 @@ class YHHomeListModel: YHBaseModel {
var
content
:
String
=
""
var
view_count
:
Int
=
0
var
img_url
:
String
=
""
var
type
:
Int
=
0
var
img_width
:
Int
=
0
var
img_height
:
Int
=
0
}
galaxy/galaxy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
View file @
bcfaed22
...
...
@@ -13,6 +13,7 @@ class YHHomePageViewModel : YHBaseViewModel {
var
configModel
:
YHHomeCofigMode
?
var
lists
:
[
YHHomeListModel
]?
var
banners
:
[
YHBannerModel
]?
var
classify
:
[
YHHomeClassifyModel
]?
}
//接口
...
...
@@ -66,7 +67,7 @@ extension YHHomePageViewModel {
func
getHomeBanner
(
_
type
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"type"
:
type
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
banner
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
{
...
...
@@ -85,4 +86,52 @@ extension YHHomePageViewModel {
callBackBlock
(
false
,
err
)
}
}
func
getHomeClassify
(
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
classify
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
//1. json字符串 转 对象
if
json
.
code
==
200
{
let
dic
=
json
.
data
guard
let
result
=
[
YHHomeClassifyModel
]
.
deserialize
(
from
:
dic
as?
[
Any
])
else
{
callBackBlock
(
false
,
nil
)
return
}
self
.
classify
=
result
as?
[
YHHomeClassifyModel
]
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
func
getList
(
_
classifyID
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:
[
String
:
Any
]
=
[
"page"
:
1
,
"page_size"
:
10
,
"classify_id"
:
classifyID
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
article
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
//1. json字符串 转 对象
if
json
.
code
==
200
{
let
dic
=
json
.
data
// guard let result = [YHHomeListModel].deserialize(from: dic as? [Any]) else {
// callBackBlock(false,nil)
// return
// }
// self.lists = result as? [YHHomeListModel]
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceListViewController.swift
View file @
bcfaed22
...
...
@@ -12,6 +12,7 @@ import JXSegmentedView
class
YHServiceListViewController
:
YHBaseViewController
{
private
let
serviceCenterMainReqVM
:
YHServiceCenterMainViewModel
=
YHServiceCenterMainViewModel
()
let
homeViewModel
:
YHHomePageViewModel
=
YHHomePageViewModel
()
var
orderListView
:
YHOrderListView
!
var
normalView
:
YHServerNoOrderView
!
...
...
@@ -32,6 +33,27 @@ class YHServiceListViewController: YHBaseViewController {
extension
YHServiceListViewController
{
func
loadData
()
{
homeViewModel
.
getHomeBanner
(
1
){[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
normalView
.
tableHeadView
.
bannarView
.
dataArr
=
self
.
homeViewModel
.
banners
??
[]
}
homeViewModel
.
getHomeClassify
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
,
let
classify
=
self
.
homeViewModel
.
classify
else
{
return
}
for
item
in
classify
{
let
model
=
item
as
YHHomeClassifyModel
if
model
.
id
==
1
{
self
.
normalView
.
sectionView
.
items
=
model
.
children
let
classifyID
=
model
.
children
.
first
?
.
id
??
0
self
.
homeViewModel
.
getList
(
classifyID
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
}
}
}
}
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
self
.
handleRightUI
()
return
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServiceBannerView.swift
View file @
bcfaed22
...
...
@@ -12,7 +12,12 @@ import FSPagerView
class
YHServiceBannerView
:
UIView
{
// 位置、大小、图片、文本
fileprivate
var
dataArr
:
[
YHBannerModel
]
=
[
YHBannerModel
(),
YHBannerModel
(),
YHBannerModel
(),
YHBannerModel
(),
YHBannerModel
()]
var
dataArr
:
[
YHBannerModel
]
=
[]
{
didSet
{
self
.
pageControl
.
numberOfPages
=
self
.
dataArr
.
count
bannerView
.
reloadData
()
}
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
...
...
@@ -89,12 +94,9 @@ extension YHServiceBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
if
let
url
=
URL
(
string
:
model
.
img_url
)
{
cell
.
imageView
?
.
kf
.
setImage
(
with
:
url
)
}
cell
.
textLabel
?
.
text
=
model
.
name
}
cell
.
imageView
?
.
contentMode
=
.
scaleAspectFill
cell
.
backgroundColor
=
.
contentBkgColor
cell
.
contentView
.
layer
.
shadowColor
=
UIColor
.
clear
.
cgColor
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServiceSectionView.swift
View file @
bcfaed22
...
...
@@ -10,7 +10,13 @@ import UIKit
class
YHServiceSectionView
:
UIView
{
var
items
:
[
String
]
=
[]
var
items
:
[
YHClassifyModel
]
=
[]
{
didSet
{
self
.
myCollectView
.
reloadData
()
}
}
var
selectIndex
=
0
lazy
var
myCollectView
=
{
// 设置布局方向
...
...
@@ -32,19 +38,13 @@ class YHServiceSectionView: UIView {
collectinoView
.
alwaysBounceVertical
=
true
return
collectinoView
}()
var
dataSource
:
YHScemeHeadModel
?
{
didSet
{
updateAllViews
()
}
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
.
white
setUpView
()
self
.
items
=
[
"优才"
,
"高才"
,
"留学"
,
"专才"
]
self
.
myCollectView
.
reloadData
()
//
self.items = ["优才","高才","留学","专才"]
//
self.myCollectView.reloadData()
}
required
init
?(
coder
:
NSCoder
)
{
...
...
@@ -62,10 +62,6 @@ class YHServiceSectionView: UIView {
// }
}
func
updateAllViews
()
{
guard
let
model
=
dataSource
else
{
return
}
}
}
extension
YHServiceSectionView
:
UICollectionViewDelegate
,
UICollectionViewDataSource
{
...
...
@@ -89,6 +85,7 @@ extension YHServiceSectionView: UICollectionViewDelegate, UICollectionViewDataSo
private
func
collectionView
(
collectionView
:
UICollectionView
,
didSelectItemAtIndexPath
indexPath
:
NSIndexPath
)
{
selectIndex
=
indexPath
.
row
collectionView
.
reloadData
()
print
(
"index is
\(
indexPath
.
row
)
"
)
}
}
...
...
@@ -121,7 +118,7 @@ class YHServiceSectionCollectionViewCell: UICollectionViewCell {
descripeLable
.
textColor
=
UIColor
(
hex
:
0x94a3bb
)
}
var
dataSource
:
String
?
{
var
dataSource
:
YHClassifyModel
?
{
didSet
{
updataAllSubViews
()
}
...
...
@@ -159,6 +156,6 @@ class YHServiceSectionCollectionViewCell: UICollectionViewCell {
func
updataAllSubViews
()
{
guard
let
dataSource
=
dataSource
else
{
return
}
descripeLable
.
text
=
dataSource
descripeLable
.
text
=
dataSource
.
name
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
bcfaed22
...
...
@@ -18,7 +18,10 @@ class YHAllApiName {
static
let
consult
=
"infoflow/home/consult"
//获取首页展示的banner
static
let
banner
=
"infoflow/banner/list"
//获取栏目
static
let
classify
=
"infoflow/classify/list"
//获取资讯
static
let
article
=
"infoflow/article/list"
}
//order 模块
...
...
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