Fableon/Fableon/Class/Store/C/FAConsumptionRecordsViewController.swift
2025-10-23 15:53:39 +08:00

67 lines
2.0 KiB
Swift

//
// FAConsumptionRecordsViewController.swift
// Fableon
//
// Created by 鸿 on 2025/10/23.
//
import UIKit
class FAConsumptionRecordsViewController: FAViewController {
private lazy var tableView: FATableView = {
let tableView = FATableView(frame: .zero, style: .plain)
tableView.delegate = self
tableView.dataSource = self
tableView.rowHeight = 71
tableView.separatorColor = .FFFFFF.withAlphaComponent(0.1)
tableView.separatorInset = .init(top: 0, left: 34, bottom: 0, right: 34)
tableView.contentInset = .init(top: 10, left: 0, bottom: UIScreen.safeBottom + 10, right: 0)
tableView.register(UINib(nibName: "FAConsumptionRecordsCell", bundle: nil), forCellReuseIdentifier: "cell")
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Consumption Records".localized
fa_setupLayout()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(false, animated: true)
fa_setNavigationStyle()
}
}
extension FAConsumptionRecordsViewController {
private func fa_setupLayout() {
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(UIScreen.navBarHeight)
}
}
}
//MARK: UITableViewDelegate UITableViewDataSource
extension FAConsumptionRecordsViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! FAConsumptionRecordsCell
return cell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 20
}
}