新增门店订单与核销管理列表,对齐 Android 订单能力并完善账号级缓存。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 14:46:10 +08:00
parent c4de3d17d0
commit 08492df6ce
51 changed files with 3668 additions and 102 deletions

View File

@ -46,6 +46,9 @@ struct DebugHomeMenuPreviewView: View {
appRouter.select(tab)
case .orders(let entry):
appRouter.selectOrders(entry: entry)
case .orderPush(let route):
appRouter.select(.orders)
appRouter.router(for: .orders).navigate(to: .orders(route))
case .destination(let homeRoute):
router.navigate(to: .home(homeRoute))
case .unsupported(_, let title, let reason):
@ -102,6 +105,8 @@ private struct DebugHomeMenuRow: View {
return "Tab"
case .orders:
return "订单"
case .orderPush:
return "订单页"
case .destination(let homeRoute):
if case .modulePlaceholder = homeRoute {
return "占位"
@ -119,7 +124,7 @@ private struct DebugHomeMenuRow: View {
switch route {
case .tab:
return "rectangle.grid.1x2"
case .orders:
case .orders, .orderPush:
return "doc.text"
case .destination(let homeRoute):
if case .modulePlaceholder = homeRoute {
@ -136,7 +141,7 @@ private struct DebugHomeMenuRow: View {
///
private var iconColor: Color {
switch route {
case .tab, .orders, .destination:
case .tab, .orders, .orderPush, .destination:
AppDesign.primary
case .unsupported:
.red

View File

@ -51,10 +51,11 @@ struct ProfileView: View {
.navigationTitle("个人信息")
.navigationBarTitleDisplayMode(.inline)
.task {
await reloadProfile(showToast: false)
viewModel.applyCachedProfile(accountContext.profile)
await reloadProfile()
}
.refreshable {
await reloadProfile(showToast: true)
await reloadProfile()
}
.sheet(isPresented: $showsPasswordSheet) {
PasswordUpdateSheet { password in
@ -517,9 +518,9 @@ struct ProfileView: View {
}
///
private func reloadProfile(showToast: Bool) async {
private func reloadProfile() async {
do {
try await globalLoading.withOptionalLoading(!showToast && viewModel.userInfo == nil, message: "加载中...") {
try await globalLoading.withOptionalLoading(viewModel.userInfo == nil, message: "加载中...") {
try await viewModel.reload(api: profileAPI)
}
if let userInfo = viewModel.userInfo {
@ -527,9 +528,6 @@ struct ProfileView: View {
} else {
accountContext.replaceProfile(viewModel.accountProfileFallback(accountContext.profile))
}
if showToast {
toastCenter.show("个人信息已刷新")
}
} catch is CancellationError {
return
} catch {