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

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

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-14 13:46:45 +08:00
co-authored by Cursor
parent c083f1d4b3
commit efb3925257
50 changed files with 2584 additions and 454 deletions
@@ -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
}
}