完善首页权限申请流程与队列播报体验。

对齐 Android 无权限强制弹窗、角色下拉与申请页交互,补充 UIButton configuration 适配,并增强景区排队 TTS 与相关单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-14 13:46:45 +08:00
parent c083f1d4b3
commit efb3925257
50 changed files with 2585 additions and 455 deletions

View File

@ -5,6 +5,35 @@
import Foundation
///
enum PermissionApplyDestination: Equatable {
case apply
case status(applyCode: String)
}
///
enum PermissionDeletionTarget: Equatable {
case role(name: String)
case scenic(id: Int, name: String)
/// Android
var dialogTitle: String {
switch self {
case .role: "是否删除该角色"
case .scenic: "是否删除该景区"
}
}
/// Android
var dialogMessage: String {
switch self {
case .role(let name): "您确定要删除\(name)角色吗?"
case .scenic(_, let name): "您确定要删除\(name)吗?"
}
}
}
///
struct RoleApplyPendingResponse: Decodable, Equatable {
let code: String
let roleId: Int
@ -45,11 +74,13 @@ struct RoleApplyPendingResponse: Decodable, Equatable {
}
}
///
struct RoleApplyScenicItem: Decodable, Equatable {
let id: Int
let name: String
}
///
struct ScenicListAllResponse: Decodable, Equatable {
let total: Int
let list: [ScenicListItem]
@ -60,11 +91,13 @@ struct ScenicListAllResponse: Decodable, Equatable {
}
}
///
struct ScenicListItem: Decodable, Equatable {
let id: Int
let name: String
}
///
struct RoleApplySubmitRequest: Encodable {
let scenicId: [Int]
let roleId: Int
@ -75,6 +108,7 @@ struct RoleApplySubmitRequest: Encodable {
}
}
///
struct RoleOption: Equatable, Hashable {
let id: Int
let name: String
@ -82,26 +116,10 @@ struct RoleOption: Equatable, Hashable {
var isSelected: Bool
}
///
struct ScenicOption: Equatable, Hashable {
let id: Int
let name: String
var isSelected: Bool
var isDisabled: Bool
}
struct RoleApplySubmitResult: Decodable, Equatable {
let code: String
init(code: String = "") {
self.code = code
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
code = try container.decodeIfPresent(String.self, forKey: .code) ?? ""
}
private enum CodingKeys: String, CodingKey {
case code
}
}