Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
AoleiSports
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 76c5c151
由
ilCode
编写于
2024-06-27 17:19:38 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
完成大数据研究列表页面
1 个父辈
fd27edb4
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
166 行增加
和
21 行删除
AoleiSports.xcodeproj/project.pbxproj
AoleiSports/Src/Discover/HadoopController.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopController.swift
AoleiSports/Src/Discover/HadoopDetailController.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopDetailController.swift
AoleiSports/Src/Discover/HadoopHeaderView.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopHeaderView.swift
AoleiSports/Src/Discover/HadoopMatchFilterGroupModel.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopMatchFilterGroupModel.swift
AoleiSports/Src/Discover/HadoopMatchFilterView.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopMatchFilterView.swift
AoleiSports/Src/Discover/HadoopProvider.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopProvider.swift
AoleiSports/Src/Discover/HadoopRequestModel.swift → AoleiSports/Src/Discover/BigDataResearch/HadoopRequestModel.swift
AoleiSports/Src/Discover/HustleScoreCell.swift → AoleiSports/Src/Discover/BigDataResearch/HustleScoreCell.swift
AoleiSports/Src/Discover/MatchFilterHeaderView.swift → AoleiSports/Src/Discover/BigDataResearch/MatchFilterHeaderView.swift
AoleiSports/Src/Discover/RaceTypeModel.swift → AoleiSports/Src/Discover/BigDataResearch/RaceTypeModel.swift
AoleiSports/Src/Information/InfoController.swift
AoleiSports/Src/Utils/NetworkTools.swift
AoleiSports.xcodeproj/project.pbxproj
查看文件 @
76c5c15
...
...
@@ -417,18 +417,26 @@
isa = PBXGroup;
children = (
5EB268752C2957550044BA0C /* DiscoverController.swift */,
5EC3AD942C2D4F0500DCFB26 /* BigDataResearch */,
);
path = Discover;
sourceTree = "<group>";
};
5EC3AD942C2D4F0500DCFB26 /* BigDataResearch */ = {
isa = PBXGroup;
children = (
5EB268772C295DA80044BA0C /* HadoopController.swift */,
5E5A69D62C2AB0560063B726 /* HadoopDetailController.swift */,
5EB268792C2974B40044BA0C /* HustleScoreCell.swift */,
5EB2687B2C29764B0044BA0C /* MatchFilterHeaderView.swift */,
5E5A69D42C2A5F7F0063B726 /* HadoopHeaderView.swift */,
5EB2687B2C29764B0044BA0C /* MatchFilterHeaderView.swift */,
5E5A69D82C2ACA9B0063B726 /* HadoopMatchFilterView.swift */,
5EB268792C2974B40044BA0C /* HustleScoreCell.swift */,
5E720D052C2B9D7500D30A16 /* HadoopProvider.swift */,
5E720D072C2B9FBE00D30A16 /* HadoopRequestModel.swift */,
5E720D0B2C2C200700D30A16 /* HadoopMatchFilterGroupModel.swift */,
5EC3AD922C2CEB7200DCFB26 /* RaceTypeModel.swift */,
);
path =
Discover
;
path =
BigDataResearch
;
sourceTree = "<group>";
};
5EC6E6492C211735006F778C /* Refresh */ = {
...
...
AoleiSports/Src/Discover/HadoopController.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopController.swift
查看文件 @
76c5c15
...
...
@@ -124,6 +124,8 @@ extension HadoopController {
self
.
header
.
update
(
predictData
:
tmpPredictData
)
})
.
disposed
(
by
:
disposeBag
)
header
.
setProvider
(
provider
)
}
private
func
emptyStateDeal
(
isShow
:
Bool
=
true
)
{
...
...
@@ -148,12 +150,12 @@ extension HadoopController: UITableViewDataSource, UITableViewDelegate {
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
h
eader
=
tableView
.
dequeueReusableHeaderFooterView
(
withIdentifier
:
MatchFilterHeaderView
.
reuseIdentifier
)
as?
MatchFilterHeaderView
h
eader
?
.
setProvider
(
provider
)
h
eader
?
.
rightBtn
.
rx
.
tap
.
subscribe
(
onNext
:
{
let
groupH
eader
=
tableView
.
dequeueReusableHeaderFooterView
(
withIdentifier
:
MatchFilterHeaderView
.
reuseIdentifier
)
as?
MatchFilterHeaderView
groupH
eader
?
.
setProvider
(
provider
)
groupH
eader
?
.
rightBtn
.
rx
.
tap
.
subscribe
(
onNext
:
{
self
.
filterView
.
showInView
(
self
.
view
)
})
.
disposed
(
by
:
disposeBag
)
return
h
eader
return
groupH
eader
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
...
...
AoleiSports/Src/Discover/HadoopDetailController.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopDetailController.swift
查看文件 @
76c5c15
文件被删除
AoleiSports/Src/Discover/HadoopHeaderView.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopHeaderView.swift
查看文件 @
76c5c15
...
...
@@ -9,6 +9,8 @@ import UIKit
class
HadoopHeaderView
:
UIView
{
let
disposeBag
=
DisposeBag
()
let
leftRightMagin
=
15.0
var
provider
:
HadoopProvider
<
HadoopTarget
>
?
private
lazy
var
bigIcon
:
UIImageView
=
{
let
icon
=
UIImageView
.
init
(
image
:
R
.
image
.
dsj
())
...
...
@@ -49,6 +51,15 @@ class HadoopHeaderView: UIView {
return
btn
}()
private
lazy
var
preCollectionView
:
PredictTopRateView
=
{
let
layout
=
UICollectionViewFlowLayout
()
layout
.
itemSize
=
CGSize
(
width
:
(
kScreenW
-
2*
leftRightMagin
-
20
)
/
3.0
,
height
:
50
)
layout
.
minimumInteritemSpacing
=
8
layout
.
sectionInset
=
UIEdgeInsets
(
top
:
0
,
left
:
leftRightMagin
,
bottom
:
0
,
right
:
leftRightMagin
)
let
collectionView
=
PredictTopRateView
(
frame
:
.
zero
,
collectionViewLayout
:
layout
)
return
collectionView
}()
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
kScreenW
,
height
:
0
))
...
...
@@ -58,6 +69,7 @@ class HadoopHeaderView: UIView {
addSubview
(
titleLab
)
addSubview
(
detailLab
)
addSubview
(
yesPreBtn
)
addSubview
(
preCollectionView
)
bigIcon
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
...
...
@@ -69,15 +81,20 @@ class HadoopHeaderView: UIView {
make
.
top
.
equalTo
(
bigIcon
.
snp
.
bottom
)
.
offset
(
15
)
}
detailLab
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
left
.
equalToSuperview
()
.
offset
(
leftRightMagin
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
leftRightMagin
)
make
.
top
.
equalTo
(
titleLab
.
snp
.
bottom
)
.
offset
(
15
)
}
yesPreBtn
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
detailLab
)
make
.
top
.
equalTo
(
detailLab
.
snp
.
bottom
)
.
offset
(
15
)
make
.
height
.
equalTo
(
26
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
15
)
.
priority
(
.
high
)
}
preCollectionView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
yesPreBtn
.
snp
.
bottom
)
.
offset
(
15
)
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
50
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
10
)
.
priority
(
.
high
)
}
// 获取动态高度
...
...
@@ -86,12 +103,21 @@ class HadoopHeaderView: UIView {
self
.
height
=
systemLayoutSizeFitting
(
UIView
.
layoutFittingCompressedSize
)
.
height
}
func
setProvider
(
_
provider
:
HadoopProvider
<
HadoopTarget
>
?)
{
self
.
provider
=
provider
self
.
provider
?
.
predictTopList
.
asObservable
()
.
subscribe
(
onNext
:
{
tmpList
in
self
.
preCollectionView
.
update
(
topList
:
tmpList
)
})
.
disposed
(
by
:
disposeBag
)
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
}
extension
HadoopHeaderView
{
func
update
(
predictData
:
(
Int
,
String
)
=
(
0
,
""
))
{
let
totalCount
=
predictData
.
0
let
rate
=
predictData
.
1
...
...
@@ -99,3 +125,97 @@ extension HadoopHeaderView {
yesPreBtn
.
isEnabled
=
totalCount
>
0
}
}
class
PredictTopRateView
:
UICollectionView
,
UICollectionViewDataSource
,
UICollectionViewDelegateFlowLayout
{
private
var
predictTopList
:
[
PredictTopModel
]
=
[]
override
init
(
frame
:
CGRect
,
collectionViewLayout
layout
:
UICollectionViewLayout
)
{
super
.
init
(
frame
:
frame
,
collectionViewLayout
:
layout
)
backgroundColor
=
.
clear
dataSource
=
self
delegate
=
self
showsVerticalScrollIndicator
=
false
showsHorizontalScrollIndicator
=
false
register
(
PredictTopRateCell
.
self
,
forCellWithReuseIdentifier
:
PredictTopRateCell
.
reuseIdentifier
)
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
return
predictTopList
.
count
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
guard
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
PredictTopRateCell
.
reuseIdentifier
,
for
:
indexPath
)
as?
PredictTopRateCell
else
{
return
PredictTopRateCell
()
}
cell
.
model
=
predictTopList
[
indexPath
.
row
]
return
cell
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
}
func
update
(
topList
:
[
PredictTopModel
])
{
predictTopList
=
topList
reloadData
()
}
}
class
PredictTopRateCell
:
UICollectionViewCell
{
static
let
reuseIdentifier
=
"PredictTopRateCell"
private
let
titleLab
:
UILabel
=
{
let
lab
=
UILabel
()
lab
.
textColor
=
UIColor
.
colorWith
(
hexString
:
"B6BBE5"
)
lab
.
font
=
kFontSize
(
13
)
lab
.
textAlignment
=
.
center
return
lab
}()
private
let
dataLab
:
UILabel
=
{
let
lab
=
UILabel
()
lab
.
textColor
=
UIColor
.
colorWith
(
hexString
:
"C8B15D"
)
lab
.
font
=
kFontSize
(
13
)
lab
.
textAlignment
=
.
center
return
lab
}()
private
lazy
var
preStackView
:
UIStackView
=
{
let
stackView
=
UIStackView
(
arrangedSubviews
:
[
titleLab
,
dataLab
])
stackView
.
axis
=
.
vertical
stackView
.
alignment
=
.
center
return
stackView
}()
var
model
:
PredictTopModel
?
{
didSet
{
titleLab
.
text
=
model
?
.
comName
let
recentCount
=
model
?
.
recentCount
??
0
let
count
=
model
?
.
count
??
0
dataLab
.
text
=
(
recentCount
>
0
&&
count
>
0
)
?
"近
\(
recentCount
)
红
\(
count
)
>"
:
""
}
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
UIColor
.
colorWith
(
hexString
:
"273479"
)
corners
(
radius
:
5
)
contentView
.
addSubview
(
preStackView
)
preStackView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
2
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
2
)
make
.
top
.
equalToSuperview
()
.
offset
(
4
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
4
)
}
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
}
AoleiSports/Src/Discover/HadoopMatchFilterGroupModel.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopMatchFilterGroupModel.swift
查看文件 @
76c5c15
文件被删除
AoleiSports/Src/Discover/HadoopMatchFilterView.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopMatchFilterView.swift
查看文件 @
76c5c15
文件被删除
AoleiSports/Src/Discover/HadoopProvider.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopProvider.swift
查看文件 @
76c5c15
...
...
@@ -21,12 +21,13 @@ enum HadoopTarget: TargetType {
}
class
HadoopProvider
<
Target
:
TargetType
>
:
BaseMoyaProvider
<
Target
>
{
var
predictTopList
=
BehaviorRelay
<
[
PredictTopModel
]
>
(
value
:
[])
var
oriMatchList
=
BehaviorRelay
<
[
HadoopMatchModel
]
>
(
value
:
[])
var
predictData
=
BehaviorRelay
<
(
Int
,
String
)
>
(
value
:
(
0
,
"0"
))
var
matchTotalCount
=
BehaviorRelay
<
Int
>
(
value
:
0
)
var
comList
=
BehaviorRelay
<
[
HadoopComModel
]
>
(
value
:
[])
var
matchList
=
BehaviorRelay
<
[
HadoopMatchModel
]
>
(
value
:
[])
func
bigDataListRequest
(
completion
:
@escaping
(
Result
<
Bool
,
AsError
>
)
->
Void
)
{
moyaPost
(
api
:
APIs
.
kBigDataList
,
target
:
HadoopTarget
.
bigDataList
)
{
midResult
in
// DDLogInfo("大数据研究列表接口数据:\(midResult)")
...
...
@@ -35,11 +36,6 @@ class HadoopProvider<Target: TargetType>: BaseMoyaProvider<Target> {
case
let
.
success
(
midSuccessResult
):
let
requestModel
=
HadoopRequestModel
(
JSON
:
midSuccessResult
)
if
let
tmpReult
=
requestModel
?
.
result
,
!
tmpReult
.
isEmpty
{
self
.
oriMatchList
.
accept
(
tmpReult
)
self
.
matchList
.
accept
(
tmpReult
)
}
if
let
predictData
=
requestModel
?
.
predictData
,
let
predictResult
=
predictData
.
predictResult
,
let
totalCount
=
predictResult
[
"total_count"
]
as?
Int
,
...
...
@@ -48,6 +44,22 @@ class HadoopProvider<Target: TargetType>: BaseMoyaProvider<Target> {
self
.
predictData
.
accept
((
totalCount
,
rate
))
}
if
let
predictTopList
=
requestModel
?
.
predictData
?
.
predictTopList
,
!
predictTopList
.
isEmpty
,
let
recentCount
=
requestModel
?
.
predictData
?
.
recentCount
{
let
tmpTopList
=
predictTopList
.
prefix
(
3
)
.
map
{
tmpModel
in
var
newModel
=
tmpModel
newModel
.
recentCount
=
recentCount
return
newModel
}
self
.
predictTopList
.
accept
(
tmpTopList
)
}
if
let
tmpReult
=
requestModel
?
.
result
,
!
tmpReult
.
isEmpty
{
self
.
oriMatchList
.
accept
(
tmpReult
)
self
.
matchList
.
accept
(
tmpReult
)
}
if
let
total
=
requestModel
?
.
total
{
self
.
matchTotalCount
.
accept
(
total
)
}
...
...
AoleiSports/Src/Discover/HadoopRequestModel.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HadoopRequestModel.swift
查看文件 @
76c5c15
...
...
@@ -44,6 +44,7 @@ struct PredictTopModel: Mappable {
var
title
:
String
?
var
comId
:
Int
?
var
comName
:
String
?
var
recentCount
:
Int
?
init
?(
map
:
ObjectMapper
.
Map
)
{
}
...
...
AoleiSports/Src/Discover/HustleScoreCell.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
HustleScoreCell.swift
查看文件 @
76c5c15
文件被删除
AoleiSports/Src/Discover/MatchFilterHeaderView.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
MatchFilterHeaderView.swift
查看文件 @
76c5c15
文件被删除
AoleiSports/Src/Discover/RaceTypeModel.swift
→
AoleiSports/Src/Discover/
BigDataResearch/
RaceTypeModel.swift
查看文件 @
76c5c15
文件被删除
AoleiSports/Src/Information/InfoController.swift
查看文件 @
76c5c15
...
...
@@ -42,7 +42,9 @@ class InfoController: BaseController {
provider
?
.
infoDataList
.
asObservable
()
.
subscribe
(
onNext
:
{
infoModels
in
.
subscribe
(
onNext
:
{
[
weak
self
]
infoModels
in
guard
let
self
=
self
else
{
return
}
self
.
infoListView
.
reloadData
()
if
infoModels
.
isEmpty
{
...
...
AoleiSports/Src/Utils/NetworkTools.swift
查看文件 @
76c5c15
...
...
@@ -74,7 +74,7 @@ extension TargetType {
//MARK: - 自定义Plugin
final
class
BaseMoyaPlugin
:
PluginType
{
var
vc
:
UIViewController
?
weak
var
vc
:
UIViewController
?
private
var
spinner
:
NVActivityIndicatorView
!
var
initLoading
:
Bool
=
true
var
showErr
:
Bool
=
true
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论