完善账号切换展示、首页菜单图标与有线传输设置 chip。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-15 14:59:31 +08:00
parent 5eef31b8da
commit ce6de76055
18 changed files with 321 additions and 130 deletions

View File

@ -1187,7 +1187,7 @@ final class WildPhotographerReportDetailViewController: BaseViewController {
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.titleLabel?.minimumScaleFactor = 0.82
button.setConfigurationContentInsets(
NSDirectionalEdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10)
NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)
)
button.configuration?.imagePlacement = .leading
button.configuration?.imagePadding = 4

View File

@ -328,14 +328,7 @@ final class WildReportRiskMapViewController: BaseViewController {
}
private func makeRadarHeader(clue: WildReportRadarActiveClue) -> UIView {
let container = UIStackView()
container.axis = .vertical
container.spacing = 6
let row = UIStackView()
row.axis = .horizontal
row.alignment = .top
row.spacing = 12
let container = UIView()
let iconWrap = UIView()
iconWrap.backgroundColor = headerIconColor(for: clue)
@ -348,17 +341,15 @@ final class WildReportRiskMapViewController: BaseViewController {
make.center.equalToSuperview()
make.size.equalTo(20)
}
iconWrap.snp.makeConstraints { make in
make.size.equalTo(44)
}
let textStack = UIStackView()
textStack.axis = .vertical
textStack.spacing = 6
var reportMetaText: String?
let badge = WildReportRiskStatusBadge(text: clue.statusText, color: statusColor(for: clue))
badge.setContentHuggingPriority(.required, for: .horizontal)
badge.setContentCompressionResistancePriority(.required, for: .horizontal)
let title: UILabel
var metaText: String?
if isReportClue(clue) {
let title = WildReportUI.label("线索 ID\(clue.id)", font: .systemFont(ofSize: 16, weight: .bold), color: AppColor.textPrimary, lines: 2)
textStack.addArrangedSubview(title)
title = WildReportUI.label("线索 ID\(clue.id)", font: .systemFont(ofSize: 14, weight: .bold), color: AppColor.textPrimary, lines: 1)
var metaParts: [String] = []
if let distance = clue.distanceText ?? clue.distance {
metaParts.append("距离:距离您\(distance)")
@ -366,41 +357,58 @@ final class WildReportRiskMapViewController: BaseViewController {
if let updatedAt = clue.updatedAt {
metaParts.append("时间:\(updatedAt)")
}
reportMetaText = metaParts.isEmpty ? nil : metaParts.joined(separator: " ")
metaText = metaParts.isEmpty ? nil : metaParts.joined(separator: " ")
} else {
let title = WildReportUI.label(clue.displayTitle, font: .systemFont(ofSize: 16, weight: .bold), color: AppColor.textPrimary, lines: 2)
textStack.addArrangedSubview(title)
title = WildReportUI.label(clue.displayTitle, font: .systemFont(ofSize: 16, weight: .bold), color: AppColor.textPrimary, lines: 2)
if clue.type == .green {
let metaText = [clue.distance.map { "距蓝点 \($0)" }, clue.direction, clue.updatedAt].compactMap { $0 }.joined(separator: " ")
if !metaText.isEmpty {
textStack.addArrangedSubview(WildReportUI.label(metaText, font: .systemFont(ofSize: 12), color: AppColor.textSecondary))
let text = [clue.distance.map { "距蓝点 \($0)" }, clue.direction, clue.updatedAt].compactMap { $0 }.joined(separator: " ")
metaText = text.isEmpty ? nil : text
}
}
container.addSubview(iconWrap)
container.addSubview(badge)
container.addSubview(title)
iconWrap.snp.makeConstraints { make in
make.top.leading.equalToSuperview()
make.size.equalTo(44)
}
badge.snp.makeConstraints { make in
make.top.trailing.equalToSuperview()
}
title.snp.makeConstraints { make in
make.top.equalToSuperview()
make.leading.equalTo(iconWrap.snp.trailing).offset(12)
make.trailing.lessThanOrEqualTo(badge.snp.leading).offset(-12)
}
if let metaText {
let metaLabel = WildReportUI.label(metaText, font: .systemFont(ofSize: 12), color: AppColor.textSecondary, lines: 0)
container.addSubview(metaLabel)
metaLabel.snp.makeConstraints { make in
make.top.equalTo(title.snp.bottom).offset(6)
make.leading.equalTo(title)
make.trailing.equalToSuperview()
make.bottom.equalToSuperview()
}
iconWrap.snp.makeConstraints { make in
make.bottom.lessThanOrEqualToSuperview()
}
} else {
[iconWrap, title, badge].forEach { view in
view.snp.makeConstraints { make in
make.bottom.lessThanOrEqualToSuperview()
}
}
}
let badge = WildReportRiskStatusBadge(text: clue.statusText, color: statusColor(for: clue))
row.addArrangedSubview(iconWrap)
row.addArrangedSubview(textStack)
row.addArrangedSubview(badge)
textStack.setContentHuggingPriority(.defaultLow, for: .horizontal)
badge.setContentHuggingPriority(.required, for: .horizontal)
container.addArrangedSubview(row)
if let reportMetaText {
let metaRow = UIStackView()
metaRow.axis = .horizontal
metaRow.spacing = 0
let spacer = UIView()
spacer.snp.makeConstraints { make in
make.width.equalTo(56)
iconWrap.snp.makeConstraints { make in
make.bottom.equalToSuperview().priority(.high)
}
title.snp.makeConstraints { make in
make.bottom.equalToSuperview().priority(.high)
}
let metaLabel = WildReportUI.label(reportMetaText, font: .systemFont(ofSize: 12), color: AppColor.textSecondary)
metaLabel.textAlignment = .right
metaLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
metaRow.addArrangedSubview(spacer)
metaRow.addArrangedSubview(metaLabel)
container.addArrangedSubview(metaRow)
}
return container
}