Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
AoleiSports
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b4ff7130
由
ilCode
编写于
2024-06-24 14:28:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
情报优化
1 个父辈
5ea859e5
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
77 行增加
和
30 行删除
AoleiSports.xcodeproj/project.pbxproj
AoleiSports/Src/Information/InfoController.swift
AoleiSports/Src/Information/InfoDetailController.swift
AoleiSports/Src/Information/JcInfoDetailHeaderView.swift
AoleiSports/Src/Information/MatchInfoCell.swift
AoleiSports/Src/Information/MatchInfoDetailCell.swift
AoleiSports.xcodeproj/project.pbxproj
查看文件 @
b4ff713
...
...
@@ -74,6 +74,7 @@
5EA9FDCB2C25690100654E93 /* MatchInfoDetailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EA9FDCA2C25690100654E93 /* MatchInfoDetailCell.swift */; };
5EA9FDCD2C256C4A00654E93 /* JcInfoDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EA9FDCC2C256C4A00654E93 /* JcInfoDetailModel.swift */; };
5EAA223F2C17F87800404739 /* UIView+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EAA223E2C17F87800404739 /* UIView+Ext.swift */; };
5EB268732C2915AE0044BA0C /* JcInfoDetailHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EB268722C2915AE0044BA0C /* JcInfoDetailHeaderView.swift */; };
5EB4F8B22C23D1B300A3667D /* DateTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EB4F8B12C23D1B300A3667D /* DateTools.swift */; };
5EC03E4A2C1155530068A5CB /* NetworkTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EC03E492C1155530068A5CB /* NetworkTools.swift */; };
5EC03E4E2C1155720068A5CB /* CacheTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EC03E4D2C1155720068A5CB /* CacheTools.swift */; };
...
...
@@ -157,6 +158,7 @@
5EA9FDCA2C25690100654E93 /* MatchInfoDetailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatchInfoDetailCell.swift; sourceTree = "<group>"; };
5EA9FDCC2C256C4A00654E93 /* JcInfoDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JcInfoDetailModel.swift; sourceTree = "<group>"; };
5EAA223E2C17F87800404739 /* UIView+Ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Ext.swift"; sourceTree = "<group>"; };
5EB268722C2915AE0044BA0C /* JcInfoDetailHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JcInfoDetailHeaderView.swift; sourceTree = "<group>"; };
5EB4F8B12C23D1B300A3667D /* DateTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTools.swift; sourceTree = "<group>"; };
5EC03E492C1155530068A5CB /* NetworkTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkTools.swift; sourceTree = "<group>"; };
5EC03E4D2C1155720068A5CB /* CacheTools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CacheTools.swift; sourceTree = "<group>"; };
...
...
@@ -216,6 +218,7 @@
5E47C9742C1FD35E002EA39E /* InfoProvider.swift */,
5E47C9762C1FD7F6002EA39E /* InfoModel.swift */,
5EA9FDCA2C25690100654E93 /* MatchInfoDetailCell.swift */,
5EB268722C2915AE0044BA0C /* JcInfoDetailHeaderView.swift */,
5EA9FDCC2C256C4A00654E93 /* JcInfoDetailModel.swift */,
);
path = Information;
...
...
@@ -560,6 +563,7 @@
5E9A1A2B2C0EF51600321AC5 /* GKNavigationBarSwift.swift in Sources */,
5E9A1A2C2C0EF51600321AC5 /* GKNavigationInteractiveTransition.swift in Sources */,
5E9A1A3E2C0F043100321AC5 /* RootController.swift in Sources */,
5EB268732C2915AE0044BA0C /* JcInfoDetailHeaderView.swift in Sources */,
5E9A1A332C0EF51600321AC5 /* UINavigationItem+GKExtension.swift in Sources */,
5E65F8952C22C5310082D374 /* UserManager.swift in Sources */,
5E9A1A4A2C0F13BF00321AC5 /* UIColor+Ext.swift in Sources */,
...
...
AoleiSports/Src/Information/InfoController.swift
查看文件 @
b4ff713
...
...
@@ -9,8 +9,6 @@ import UIKit
// 赛事情报页面
class
InfoController
:
BaseController
{
private
let
MatchInfoCellId
=
"MatchInfoCell"
var
provider
:
InfoProvider
<
InfoTarget
>
?
private
lazy
var
infoListView
:
UITableView
=
{
...
...
@@ -18,7 +16,7 @@ class InfoController: BaseController {
tv
.
delegate
=
self
tv
.
dataSource
=
self
tv
.
backgroundColor
=
kMainBgColor
tv
.
register
(
MatchInfoCell
.
self
,
forCellReuseIdentifier
:
MatchInfoCell
Id
)
tv
.
register
(
MatchInfoCell
.
self
,
forCellReuseIdentifier
:
MatchInfoCell
.
reuseIdentifier
)
tv
.
es
.
addPullToRefresh
(
animator
:
RefreshHeaderAnimator
(
frame
:
.
zero
))
{
[
weak
self
]
in
self
?
.
handleRefresh
()
}
...
...
@@ -96,7 +94,7 @@ extension InfoController: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
model
=
provider
?
.
infoDataList
.
value
[
indexPath
.
row
]
model
?
.
isLast
=
indexPath
.
row
==
(
provider
?
.
infoDataList
.
value
.
count
??
0
)
-
1
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
MatchInfoCell
Id
,
for
:
indexPath
)
as!
MatchInfoCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
MatchInfoCell
.
reuseIdentifier
,
for
:
indexPath
)
as!
MatchInfoCell
cell
.
model
=
model
return
cell
}
...
...
AoleiSports/Src/Information/InfoDetailController.swift
查看文件 @
b4ff713
...
...
@@ -12,8 +12,6 @@ class InfoDetailController: BaseController {
var
model
:
InfoModel
?
var
groupDatas
:
[
JcInfoDetailGroupModel
]
=
[]
private
let
MatchInfoDetailCellId
=
"MatchInfoDetailCellId"
private
lazy
var
topTitleLab
:
UILabel
=
{
let
lab
=
UILabel
()
lab
.
text
=
model
?
.
getTopTitle
()
...
...
@@ -49,13 +47,19 @@ class InfoDetailController: BaseController {
}()
private
lazy
var
infoDetailView
:
UITableView
=
{
let
tv
=
UITableView
(
frame
:
CGRect
(
x
:
0
,
y
:
kNavBarH
,
width
:
kScreenW
,
height
:
kScreenH
-
kNavBarH
),
style
:
.
grouped
)
let
tv
=
UITableView
(
frame
:
CGRect
(
x
:
0
,
y
:
kNavBarH
,
width
:
kScreenW
,
height
:
kScreenH
-
kNavBarH
),
style
:
.
plain
)
tv
.
dataSource
=
self
tv
.
delegate
=
self
tv
.
tableHeaderView
=
header
tv
.
backgroundColor
=
kMainBgColor
tv
.
showsVerticalScrollIndicator
=
false
tv
.
register
(
MatchInfoDetailCell
.
self
,
forCellReuseIdentifier
:
MatchInfoDetailCellId
)
tv
.
sectionHeaderHeight
=
0
tv
.
sectionFooterHeight
=
0
if
#available(iOS 15.0, *)
{
tv
.
sectionHeaderTopPadding
=
CGFloat
.
leastNormalMagnitude
}
tv
.
register
(
MatchInfoDetailCell
.
self
,
forCellReuseIdentifier
:
MatchInfoDetailCell
.
reuseIdentifier
)
tv
.
register
(
JcInfoDetailHeaderView
.
self
,
forHeaderFooterViewReuseIdentifier
:
JcInfoDetailHeaderView
.
reuseIdentifier
)
return
tv
}()
...
...
@@ -84,32 +88,27 @@ extension InfoDetailController: UITableViewDataSource, UITableViewDelegate {
let
groupModel
=
groupDatas
[
indexPath
.
section
]
let
info
=
groupModel
.
infos
?[
indexPath
.
row
]
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
MatchInfoDetailCell
Id
,
for
:
indexPath
)
as!
MatchInfoDetailCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
MatchInfoDetailCell
.
reuseIdentifier
,
for
:
indexPath
)
as!
MatchInfoDetailCell
cell
.
info
=
info
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
groupModel
=
groupDatas
[
section
]
var
headerH
=
0.001
if
let
groupTitle
=
groupModel
.
title
,
!
groupTitle
.
isEmpty
{
headerH
=
30
}
let
headSecView
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
kScreenW
,
height
:
headerH
))
headSecView
.
backgroundColor
=
kWhite
let
header
=
tableView
.
dequeueReusableHeaderFooterView
(
withIdentifier
:
JcInfoDetailHeaderView
.
reuseIdentifier
)
as?
JcInfoDetailHeaderView
let
groupTitleLab
=
UILabel
(
frame
:
CGRect
(
x
:
30
,
y
:
0
,
width
:
kScreenW
-
60
,
height
:
headerH
))
groupTitleLab
.
text
=
groupModel
.
t
itle
groupTitleLab
.
textColor
=
kMainTitleColor
groupTitleLab
.
font
=
kBoldFontSize
(
18
)
headSecView
.
addSubview
(
groupTitleLab
)
return
head
SecView
if
let
groupTitle
=
groupModel
.
title
,
!
groupTitle
.
isEmpty
{
header
?
.
titleLabel
.
text
=
groupT
itle
}
else
{
header
?
.
titleLabel
.
text
=
nil
}
return
head
er
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
10
,
height
:
0.001
))
return
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
10
,
height
:
CGFloat
.
leastNormalMagnitude
))
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
...
...
@@ -117,10 +116,10 @@ extension InfoDetailController: UITableViewDataSource, UITableViewDelegate {
if
let
title
=
groupModel
.
title
,
!
title
.
isEmpty
{
return
30
}
return
0.001
return
CGFloat
.
leastNormalMagnitude
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
0.001
return
CGFloat
.
leastNormalMagnitude
}
}
AoleiSports/Src/Information/JcInfoDetailHeaderView.swift
0 → 100644
查看文件 @
b4ff713
//
// JcInfoDetailHeaderView.swift
// AoleiSports
//
// Created by ilCode on 2024/6/24.
//
import
UIKit
class
JcInfoDetailHeaderView
:
UITableViewHeaderFooterView
{
static
let
reuseIdentifier
=
"JcInfoDetailHeaderView"
let
titleLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
kMainTitleColor
label
.
font
=
kBoldFontSize
(
18
)
label
.
translatesAutoresizingMaskIntoConstraints
=
false
return
label
}()
override
init
(
reuseIdentifier
:
String
?)
{
super
.
init
(
reuseIdentifier
:
reuseIdentifier
)
contentView
.
backgroundColor
=
kWhite
contentView
.
addSubview
(
titleLabel
)
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
30
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
30
)
make
.
top
.
bottom
.
equalToSuperview
()
}
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
}
AoleiSports/Src/Information/MatchInfoCell.swift
查看文件 @
b4ff713
...
...
@@ -8,6 +8,8 @@
import
UIKit
class
MatchInfoCell
:
BaseTableViewCell
{
static
let
reuseIdentifier
=
"MatchInfoCell"
private
lazy
var
cornerBgView
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
kWhite
...
...
@@ -222,7 +224,7 @@ class MatchInfoCell: BaseTableViewCell {
infoCountLab
.
text
=
detailModel
?
.
getTotalInfoCountStr
()
cornerBgView
.
snp
.
makeConstraints
{
make
in
cornerBgView
.
snp
.
re
makeConstraints
{
make
in
make
.
left
.
top
.
equalToSuperview
()
.
offset
(
8
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
8
)
make
.
bottom
.
equalToSuperview
()
.
offset
((
model
?
.
isLast
??
false
)
?
-
8
:
0
)
...
...
AoleiSports/Src/Information/MatchInfoDetailCell.swift
查看文件 @
b4ff713
...
...
@@ -8,15 +8,17 @@
import
UIKit
class
MatchInfoDetailCell
:
BaseTableViewCell
{
static
let
reuseIdentifier
=
"MatchInfoDetailCellId"
private
lazy
var
dotView
:
UIView
=
{
let
view
=
UIView
()
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
.
colorWith
(
hexString
:
"FFBEC1"
)
view
.
corners
(
radius
:
5
)
return
view
}()
private
lazy
var
infoLab
:
UILabel
=
{
let
lab
=
UILabel
()
let
lab
=
UILabel
()
lab
.
textColor
=
kMainTitleColor
lab
.
numberOfLines
=
0
lab
.
font
=
kFontSize
(
14
)
...
...
@@ -30,9 +32,9 @@ class MatchInfoDetailCell: BaseTableViewCell {
contentView
.
addSubview
(
dotView
)
contentView
.
addSubview
(
infoLab
)
dotView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
1
2
)
make
.
top
.
equalToSuperview
()
.
offset
(
1
4
)
make
.
left
.
equalToSuperview
()
.
offset
(
10
)
make
.
size
.
equalTo
(
CGSize
(
width
:
10
,
height
:
10
))
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论