新增线下收款记录和 ai 修图优化
This commit is contained in:
@@ -14,6 +14,12 @@ final class SettingViewController: BaseViewController {
|
||||
private let contentView = UIView()
|
||||
private let cardView = UIView()
|
||||
private let rowsStack = UIStackView()
|
||||
private let dangerCardView = UIView()
|
||||
private let accountDeletionRow = SettingMenuRow(
|
||||
title: "注销账号",
|
||||
titleColor: AppColor.danger,
|
||||
showsDivider: false
|
||||
)
|
||||
private let versionRow = SettingMenuRow(title: "系统版本", showsChevron: false)
|
||||
private let copyrightLabel = UILabel()
|
||||
|
||||
@@ -41,12 +47,18 @@ final class SettingViewController: BaseViewController {
|
||||
view.addSubview(contentView)
|
||||
contentView.addSubview(cardView)
|
||||
cardView.addSubview(rowsStack)
|
||||
contentView.addSubview(dangerCardView)
|
||||
dangerCardView.addSubview(accountDeletionRow)
|
||||
contentView.addSubview(copyrightLabel)
|
||||
|
||||
cardView.backgroundColor = .white
|
||||
cardView.layer.cornerRadius = 12
|
||||
cardView.clipsToBounds = true
|
||||
|
||||
dangerCardView.backgroundColor = .white
|
||||
dangerCardView.layer.cornerRadius = 12
|
||||
dangerCardView.clipsToBounds = true
|
||||
|
||||
rowsStack.axis = .vertical
|
||||
|
||||
copyrightLabel.text = "Copyright © 2025 All Rights Reserved\n苏ICP备2025157647号"
|
||||
@@ -68,6 +80,7 @@ final class SettingViewController: BaseViewController {
|
||||
rows[2].addTarget(self, action: #selector(copyDownloadTapped), for: .touchUpInside)
|
||||
rows[3].addTarget(self, action: #selector(userAgreementTapped), for: .touchUpInside)
|
||||
rows[4].addTarget(self, action: #selector(privacyTapped), for: .touchUpInside)
|
||||
accountDeletionRow.addTarget(self, action: #selector(accountDeletionTapped), for: .touchUpInside)
|
||||
}
|
||||
|
||||
override func setupConstraints() {
|
||||
@@ -80,6 +93,13 @@ final class SettingViewController: BaseViewController {
|
||||
rowsStack.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16))
|
||||
}
|
||||
dangerCardView.snp.makeConstraints { make in
|
||||
make.top.equalTo(cardView.snp.bottom).offset(16)
|
||||
make.leading.trailing.equalToSuperview()
|
||||
}
|
||||
accountDeletionRow.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16))
|
||||
}
|
||||
copyrightLabel.snp.makeConstraints { make in
|
||||
make.leading.trailing.equalToSuperview()
|
||||
make.bottom.equalToSuperview().offset(-16)
|
||||
@@ -119,6 +139,10 @@ final class SettingViewController: BaseViewController {
|
||||
openAgreement(.privacyPolicy)
|
||||
}
|
||||
|
||||
@objc private func accountDeletionTapped() {
|
||||
navigationController?.pushViewController(AccountDeletionViewController(), animated: true)
|
||||
}
|
||||
|
||||
private func openAgreement(_ kind: SettingAgreementKind) {
|
||||
let destination = viewModel.agreementDestination(for: kind)
|
||||
navigationController?.pushViewController(
|
||||
@@ -141,6 +165,7 @@ final class SettingMenuRow: UIControl {
|
||||
init(
|
||||
title: String,
|
||||
value: String? = nil,
|
||||
titleColor: UIColor = UIColor(hex: 0x4B5563),
|
||||
valueColor: UIColor = AppColor.textPrimary,
|
||||
showsChevron: Bool = true,
|
||||
showsDivider: Bool = true
|
||||
@@ -150,6 +175,7 @@ final class SettingMenuRow: UIControl {
|
||||
setupUI()
|
||||
setupConstraints()
|
||||
titleLabel.text = title
|
||||
titleLabel.textColor = titleColor
|
||||
valueLabel.text = value
|
||||
valueLabel.textColor = valueColor
|
||||
chevronImageView.isHidden = !showsChevron
|
||||
@@ -175,7 +201,6 @@ final class SettingMenuRow: UIControl {
|
||||
|
||||
private func setupUI() {
|
||||
titleLabel.font = .systemFont(ofSize: 14)
|
||||
titleLabel.textColor = UIColor(hex: 0x4B5563)
|
||||
|
||||
valueLabel.font = .systemFont(ofSize: 14)
|
||||
valueLabel.textColor = AppColor.textPrimary
|
||||
|
||||
Reference in New Issue
Block a user