新增门店订单与核销管理列表,对齐 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

@ -20,9 +20,13 @@ final class ProfileViewModel: ObservableObject {
@Published private(set) var pendingAvatarData: Data?
@Published private(set) var pendingAvatarFileName: String?
@Published private(set) var avatarUploadProgress: Int?
/// 使 AccountContext / AccountSnapshot
private var cachedProfile: AccountProfile?
var displayNickname: String {
nonEmpty(userInfo?.nickname) ?? "未设置昵称"
nonEmpty(userInfo?.nickname)
?? nonEmpty(cachedProfile?.displayName)
?? "未设置昵称"
}
var displayRealName: String {
@ -30,11 +34,11 @@ final class ProfileViewModel: ObservableObject {
}
var displayPhone: String {
nonEmpty(userInfo?.phone) ?? "--"
nonEmpty(userInfo?.phone) ?? nonEmpty(cachedProfile?.phone) ?? "--"
}
var displayAvatarURL: String {
nonEmpty(userInfo?.avatar) ?? ""
nonEmpty(userInfo?.avatar) ?? nonEmpty(cachedProfile?.avatarURL) ?? ""
}
var accountStatusText: String {
@ -53,6 +57,12 @@ final class ProfileViewModel: ObservableObject {
}
}
///
func applyCachedProfile(_ profile: AccountProfile?) {
guard userInfo == nil else { return }
cachedProfile = profile
}
///
func reload(api: ProfileAPI) async throws {
guard !isLoading else { return }