62 lines
1.9 KiB
Swift
62 lines
1.9 KiB
Swift
//
|
|
// SPConsumptionRecordsViewController.swift
|
|
// MoviaBox
|
|
//
|
|
// Created by 佳尔 on 2025/4/29.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
///消费记录
|
|
class SPConsumptionRecordsViewController: SPViewController {
|
|
|
|
//MARK: UI属性
|
|
private lazy var tableView: SPTableView = {
|
|
let tableView = SPTableView(frame: .zero, style: .plain)
|
|
tableView.delegate = self
|
|
tableView.dataSource = self
|
|
tableView.rowHeight = 72
|
|
tableView.separatorInset = .init(top: 0, left: 32, bottom: 0, right: 32)
|
|
SPConsumptionRecordsCell.registerCell(tableView: tableView)
|
|
return tableView
|
|
}()
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
self.title = "Consumption Records".localized
|
|
self.edgesForExtendedLayout = .top
|
|
|
|
_setupUI()
|
|
}
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
self.navigationController?.setNavigationBarHidden(false, animated: true)
|
|
setNavigationNormalStyle(backgroundColor: .clear, isTranslucent: true)
|
|
|
|
}
|
|
}
|
|
|
|
extension SPConsumptionRecordsViewController {
|
|
private func _setupUI() {
|
|
view.addSubview(tableView)
|
|
|
|
tableView.snp.makeConstraints { make in
|
|
make.left.right.bottom.equalToSuperview()
|
|
make.top.equalToSuperview().offset(kSPNavBarHeight)
|
|
}
|
|
}
|
|
}
|
|
|
|
//MARK: -------------- UITableViewDelegate & UITableViewDataSource --------------
|
|
extension SPConsumptionRecordsViewController: UITableViewDelegate, UITableViewDataSource {
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
|
let cell = SPConsumptionRecordsCell.dequeueReusableCell(tableView: tableView, indexPath: indexPath)
|
|
return cell
|
|
}
|
|
|
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
|
return 10
|
|
}
|
|
}
|