新增门店订单与核销管理列表,对齐 Android 订单能力并完善账号级缓存。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
71
suixinkan/Features/Orders/Views/OrderListHeaderView.swift
Normal file
71
suixinkan/Features/Orders/Views/OrderListHeaderView.swift
Normal file
@ -0,0 +1,71 @@
|
||||
//
|
||||
// OrderListHeaderView.swift
|
||||
// suixinkan
|
||||
//
|
||||
// Created by Codex on 2026/6/29.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
/// 订单列表筛选头部,展示状态与时间筛选;手机号搜索由页面级 `.searchable` 提供。
|
||||
struct OrderListHeaderView: View {
|
||||
let filterTitle: String
|
||||
let timeFilterTitle: String
|
||||
let statusFilters: [OrderStatusFilter]
|
||||
let selectedStatus: Int
|
||||
let onStatusSelected: (Int) -> Void
|
||||
let onTimeFilterTap: () -> Void
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 8) {
|
||||
Menu {
|
||||
ForEach(statusFilters) { filter in
|
||||
Button(filter.title) {
|
||||
onStatusSelected(filter.id)
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
OrderListFilterPill(title: filterTitle, showsChevron: true)
|
||||
}
|
||||
|
||||
Button(action: onTimeFilterTap) {
|
||||
OrderListFilterPill(title: timeFilterTitle, showsCalendar: true)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.padding(16)
|
||||
.background(.white)
|
||||
}
|
||||
}
|
||||
|
||||
/// 订单列表筛选 pill 按钮样式。
|
||||
private struct OrderListFilterPill: View {
|
||||
let title: String
|
||||
var showsChevron = false
|
||||
var showsCalendar = false
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 4) {
|
||||
Text(title)
|
||||
.font(.system(size: 14))
|
||||
.foregroundStyle(AppDesign.orderLabelColor)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.75)
|
||||
Spacer(minLength: 4)
|
||||
if showsChevron {
|
||||
Image(systemName: "chevron.down")
|
||||
.font(.system(size: 12, weight: .semibold))
|
||||
.foregroundStyle(AppDesign.orderLabelColor)
|
||||
}
|
||||
if showsCalendar {
|
||||
Image(systemName: "calendar")
|
||||
.font(.system(size: 15))
|
||||
.foregroundStyle(AppDesign.orderLabelColor)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 35)
|
||||
.background(AppDesign.orderInputBackground, in: RoundedRectangle(cornerRadius: 4))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user