模块化 AppStore 并完善素材管理与个人空间设置。
将会话、权限、位置、收款与排队存储拆分为独立模块,同步更新各 ViewModel 与单元测试,并补充素材管理 UI 与个人空间设置交互。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -307,7 +307,7 @@ final class TaskAddViewController: BaseViewController {
|
||||
}
|
||||
|
||||
private func uploadPickedResults(_ results: [PHPickerResult], isImage: Bool) {
|
||||
let scenicId = AppStore.shared.currentScenicId
|
||||
let scenicId = AppStore.shared.session.currentScenicId
|
||||
guard scenicId > 0 else {
|
||||
showToast("请先选择景区")
|
||||
return
|
||||
@ -344,7 +344,7 @@ final class TaskAddViewController: BaseViewController {
|
||||
}
|
||||
|
||||
private func uploadCapturedPayload(_ payload: TaskMediaLoader.Payload, fileType: Int) {
|
||||
let scenicId = AppStore.shared.currentScenicId
|
||||
let scenicId = AppStore.shared.session.currentScenicId
|
||||
guard scenicId > 0 else {
|
||||
showToast("请先选择景区")
|
||||
return
|
||||
|
||||
@ -33,12 +33,23 @@ final class TaskOrderSelectViewController: BaseViewController {
|
||||
title = "订单列表"
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
ProfileNavigationStyle.apply(to: navigationController, showsDivider: false)
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
ProfileNavigationStyle.restore(navigationController)
|
||||
}
|
||||
|
||||
override func setupUI() {
|
||||
tableView.backgroundColor = AppColor.pageBackground
|
||||
tableView.separatorStyle = .none
|
||||
tableView.register(TaskOrderCell.self, forCellReuseIdentifier: TaskOrderCell.reuseIdentifier)
|
||||
tableView.dataSource = self
|
||||
tableView.delegate = self
|
||||
tableView.contentInset = UIEdgeInsets(top: 12, left: 0, bottom: 0, right: 0)
|
||||
|
||||
emptyLabel.text = "无有效订单"
|
||||
emptyLabel.font = .app(.body)
|
||||
@ -51,6 +62,7 @@ final class TaskOrderSelectViewController: BaseViewController {
|
||||
view.addSubview(emptyLabel)
|
||||
view.addSubview(bottomBar)
|
||||
bottomBar.addSubview(confirmButton)
|
||||
confirmButton.snp.updateConstraints { make in make.height.equalTo(48) }
|
||||
}
|
||||
|
||||
override func setupConstraints() {
|
||||
@ -58,7 +70,9 @@ final class TaskOrderSelectViewController: BaseViewController {
|
||||
make.leading.trailing.bottom.equalToSuperview()
|
||||
}
|
||||
confirmButton.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(AppSpacing.md)
|
||||
make.top.equalToSuperview().offset(16)
|
||||
make.leading.trailing.equalToSuperview().inset(16)
|
||||
make.bottom.equalTo(view.safeAreaLayoutGuide).inset(16)
|
||||
}
|
||||
tableView.snp.makeConstraints { make in
|
||||
make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide)
|
||||
@ -135,6 +149,8 @@ private final class TaskOrderCell: UITableViewCell {
|
||||
private let statusRow = TaskInfoRowView(label: "订单状态:")
|
||||
private let numberRow = TaskInfoRowView(label: "订单编号:")
|
||||
private let payTimeRow = TaskInfoRowView(label: "付款时间:")
|
||||
private let userIDRow = TaskInfoRowView(label: "用户 UID:")
|
||||
private let phoneRow = TaskInfoRowView(label: "用户手机号:")
|
||||
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
@ -152,6 +168,8 @@ private final class TaskOrderCell: UITableViewCell {
|
||||
cardView.addSubview(statusRow)
|
||||
cardView.addSubview(numberRow)
|
||||
cardView.addSubview(payTimeRow)
|
||||
cardView.addSubview(userIDRow)
|
||||
cardView.addSubview(phoneRow)
|
||||
|
||||
cardView.snp.makeConstraints { make in
|
||||
make.edges.equalToSuperview().inset(UIEdgeInsets(top: 0, left: AppSpacing.md, bottom: AppSpacing.sm, right: AppSpacing.md))
|
||||
@ -169,6 +187,14 @@ private final class TaskOrderCell: UITableViewCell {
|
||||
}
|
||||
payTimeRow.snp.makeConstraints { make in
|
||||
make.top.equalTo(numberRow.snp.bottom).offset(AppSpacing.xs)
|
||||
make.leading.trailing.equalTo(projectRow)
|
||||
}
|
||||
userIDRow.snp.makeConstraints { make in
|
||||
make.top.equalTo(payTimeRow.snp.bottom).offset(AppSpacing.xs)
|
||||
make.leading.trailing.equalTo(projectRow)
|
||||
}
|
||||
phoneRow.snp.makeConstraints { make in
|
||||
make.top.equalTo(userIDRow.snp.bottom).offset(AppSpacing.xs)
|
||||
make.leading.trailing.bottom.equalToSuperview().inset(AppSpacing.md)
|
||||
}
|
||||
}
|
||||
@ -183,8 +209,12 @@ private final class TaskOrderCell: UITableViewCell {
|
||||
statusRow.apply(value: order.orderStatusLabel.isEmpty ? "--" : order.orderStatusLabel)
|
||||
numberRow.apply(value: order.orderNumber)
|
||||
payTimeRow.apply(value: order.payTime.isEmpty ? "--" : order.payTime)
|
||||
cardView.layer.borderColor = isSelected ? AppColor.danger.cgColor : AppColor.border.cgColor
|
||||
userIDRow.apply(value: "U\(order.userId)")
|
||||
phoneRow.apply(value: order.userPhone)
|
||||
cardView.layer.borderColor = isSelected ? UIColor(hex: 0xFF0000).cgColor : AppColor.border.cgColor
|
||||
cardView.layer.borderWidth = isSelected ? 2 : 1
|
||||
accessibilityLabel = "订单\(order.orderNumber)"
|
||||
accessibilityTraits = isSelected ? [.button, .selected] : .button
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,17 +227,15 @@ private final class TaskInfoRowView: UIView {
|
||||
super.init(frame: .zero)
|
||||
labelView.text = label
|
||||
labelView.font = .app(.body)
|
||||
labelView.textColor = AppColor.textSecondary
|
||||
labelView.textColor = AppColor.textPrimary
|
||||
valueView.font = .app(.body)
|
||||
valueView.textColor = AppColor.textPrimary
|
||||
valueView.numberOfLines = 0
|
||||
|
||||
addSubview(labelView)
|
||||
addSubview(valueView)
|
||||
labelView.snp.makeConstraints { make in
|
||||
make.leading.top.bottom.equalToSuperview()
|
||||
make.width.equalTo(80)
|
||||
}
|
||||
labelView.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
labelView.snp.makeConstraints { make in make.leading.top.bottom.equalToSuperview() }
|
||||
valueView.snp.makeConstraints { make in
|
||||
make.leading.equalTo(labelView.snp.trailing).offset(AppSpacing.xs)
|
||||
make.trailing.top.bottom.equalToSuperview()
|
||||
|
||||
Reference in New Issue
Block a user