feat: update wallet punch point and report success
This commit is contained in:
@ -976,8 +976,10 @@ private final class WildReportSuccessCheckmarkView: UIView {
|
||||
|
||||
/// 举报成功页横向处理进度卡片。
|
||||
private final class WildReportSuccessProgressView: UIView {
|
||||
private let contentView = UIView()
|
||||
private let stack = UIStackView()
|
||||
private let steps: [String]
|
||||
private var itemViews: [WildReportSuccessProgressItemView] = []
|
||||
|
||||
init(steps: [String]) {
|
||||
self.steps = steps
|
||||
@ -999,27 +1001,38 @@ private final class WildReportSuccessProgressView: UIView {
|
||||
|
||||
stack.axis = .horizontal
|
||||
stack.alignment = .top
|
||||
stack.distribution = .fillEqually
|
||||
stack.spacing = 0
|
||||
|
||||
addSubview(stack)
|
||||
addSubview(contentView)
|
||||
contentView.addSubview(stack)
|
||||
for (index, step) in steps.enumerated() {
|
||||
let item = WildReportSuccessProgressItemView(title: step, isCompleted: index == 0)
|
||||
itemViews.append(item)
|
||||
stack.addArrangedSubview(item)
|
||||
item.snp.makeConstraints { make in
|
||||
make.width.equalTo(74)
|
||||
}
|
||||
}
|
||||
|
||||
for index in steps.indices.dropLast() {
|
||||
if index < steps.count - 1 {
|
||||
let connector = WildReportSuccessProgressConnectorView(isCompleted: index == 0)
|
||||
stack.addArrangedSubview(connector)
|
||||
contentView.insertSubview(connector, belowSubview: stack)
|
||||
connector.snp.makeConstraints { make in
|
||||
make.leading.equalTo(itemViews[index].connectorAnchorView.snp.centerX).offset(12)
|
||||
make.trailing.equalTo(itemViews[index + 1].connectorAnchorView.snp.centerX).offset(-12)
|
||||
make.centerY.equalTo(itemViews[index].connectorAnchorView)
|
||||
make.height.equalTo(24)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func setupConstraints() {
|
||||
stack.snp.makeConstraints { make in
|
||||
contentView.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 16, left: 12, bottom: 16, right: 12))
|
||||
}
|
||||
stack.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1028,6 +1041,8 @@ private final class WildReportSuccessProgressItemView: UIView {
|
||||
private let nodeView: WildReportSuccessProgressNodeView
|
||||
private let titleLabel = UILabel()
|
||||
|
||||
var connectorAnchorView: UIView { nodeView }
|
||||
|
||||
init(title: String, isCompleted: Bool) {
|
||||
self.nodeView = WildReportSuccessProgressNodeView(isCompleted: isCompleted)
|
||||
super.init(frame: .zero)
|
||||
|
||||
Reference in New Issue
Block a user