完善首页权限申请流程与队列播报体验。
对齐 Android 无权限强制弹窗、角色下拉与申请页交互,补充 UIButton configuration 适配,并增强景区排队 TTS 与相关单元测试。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -11,6 +11,9 @@ final class PermissionApplyStatusViewModel {
|
||||
private(set) var pendingData: RoleApplyPendingResponse?
|
||||
private(set) var isLoading = false
|
||||
private(set) var rolePermissionList: [RolePermissionResponse] = []
|
||||
private(set) var showScenicListDialog = false
|
||||
private(set) var dialogRoleName = ""
|
||||
private(set) var dialogScenicList: [ScenicInfo] = []
|
||||
|
||||
var onStateChange: (() -> Void)?
|
||||
var onNavigateToEdit: ((RoleApplyPendingResponse) -> Void)?
|
||||
@ -29,7 +32,11 @@ final class PermissionApplyStatusViewModel {
|
||||
notifyStateChange()
|
||||
do {
|
||||
let pendingList = try await api.roleApplyPending()
|
||||
pendingData = pendingList.first { $0.code == applyCode }
|
||||
pendingData = pendingList.first {
|
||||
$0.code == applyCode
|
||||
&& ($0.status == PermissionApplyPendingStatus.reviewing
|
||||
|| $0.status == PermissionApplyPendingStatus.rejected)
|
||||
}
|
||||
} catch {
|
||||
pendingData = nil
|
||||
}
|
||||
@ -42,6 +49,22 @@ final class PermissionApplyStatusViewModel {
|
||||
onNavigateToEdit?(pendingData)
|
||||
}
|
||||
|
||||
/// 展示某个已有角色的全部景区。
|
||||
func showScenicList(roleName: String, scenics: [ScenicInfo]) {
|
||||
dialogRoleName = roleName
|
||||
dialogScenicList = scenics
|
||||
showScenicListDialog = true
|
||||
notifyStateChange()
|
||||
}
|
||||
|
||||
/// 关闭已有景区列表弹窗。
|
||||
func hideScenicList() {
|
||||
dialogRoleName = ""
|
||||
dialogScenicList = []
|
||||
showScenicListDialog = false
|
||||
notifyStateChange()
|
||||
}
|
||||
|
||||
private func notifyStateChange() {
|
||||
onStateChange?()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user