Commit b4ff7130 ilCode

情报优化

1 个父辈 5ea859e5
......@@ -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 */,
......
......@@ -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: MatchInfoCellId)
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: MatchInfoCellId, for: indexPath) as! MatchInfoCell
let cell = tableView.dequeueReusableCell(withIdentifier: MatchInfoCell.reuseIdentifier, for: indexPath) as! MatchInfoCell
cell.model = model
return cell
}
......
......@@ -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: MatchInfoDetailCellId, 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.title
groupTitleLab.textColor = kMainTitleColor
groupTitleLab.font = kBoldFontSize(18)
headSecView.addSubview(groupTitleLab)
return headSecView
if let groupTitle = groupModel.title, !groupTitle.isEmpty {
header?.titleLabel.text = groupTitle
} else {
header?.titleLabel.text = nil
}
return header
}
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
}
}
//
// 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")
}
}
......@@ -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.remakeConstraints { make in
make.left.top.equalToSuperview().offset(8)
make.right.equalToSuperview().offset(-8)
make.bottom.equalToSuperview().offset((model?.isLast ?? false) ? -8 : 0)
......
......@@ -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(12)
make.top.equalToSuperview().offset(14)
make.left.equalToSuperview().offset(10)
make.size.equalTo(CGSize(width: 10, height: 10))
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!