Add custom main tab bar with global scan-to-verify flow.

Introduce configurable custom TabBar with order badge, central scanner routing to verification orders, and update the migration checklist for recently completed modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-23 10:52:45 +08:00
parent 3a11583729
commit 1d1eb46ed8
25 changed files with 740 additions and 34 deletions

View File

@ -0,0 +1,31 @@
//
// MainTabBadgeViewModel.swift
// suixinkan
//
// Created by Codex on 2026/6/23.
//
import Foundation
import Observation
@MainActor
@Observable
/// Tab ViewModel Tab
final class MainTabBadgeViewModel {
private(set) var pendingWriteOffCount: Int?
///
func refreshPendingWriteOffCount(api: OrderServing, scenicId: Int?, storeId: Int?) async {
guard let scenicId, scenicId > 0 else {
pendingWriteOffCount = nil
return
}
do {
let result = try await api.writeOffList(scenicId: scenicId, storeId: storeId, page: 1, pageSize: 1)
pendingWriteOffCount = min(result.total, 99)
} catch {
pendingWriteOffCount = nil
}
}
}