Advance UIKit rewrite with AMap integration and core UI modules.
Integrate高德 SDK with simulator-safe build flags, add map views for operating area and punch points, refactor main tabs and key feature screens to UIKit with Diffable lists, and document Swift concurrency defaults in AGENTS.md. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -104,6 +104,7 @@ final class LiveManagementViewModel {
|
||||
await reload(api: api, scenicId: scenicId, showLoading: false)
|
||||
}
|
||||
|
||||
/// 加载Page数据。
|
||||
private func loadPage(api: any LiveServing, scenicId: Int, page: Int) async throws {
|
||||
let response = try await api.liveList(scenicId: scenicId, page: page, pageSize: pageSize)
|
||||
if page == 1 {
|
||||
@ -118,6 +119,7 @@ final class LiveManagementViewModel {
|
||||
hasMore = items.count < total
|
||||
}
|
||||
|
||||
/// 重置状态。
|
||||
private func reset() {
|
||||
clearListAndDetail()
|
||||
loading = false
|
||||
@ -125,6 +127,7 @@ final class LiveManagementViewModel {
|
||||
errorMessage = nil
|
||||
}
|
||||
|
||||
/// 清空列表并详情。
|
||||
private func clearListAndDetail() {
|
||||
items = []
|
||||
detail = nil
|
||||
@ -143,6 +146,7 @@ final class LiveDetailViewModel {
|
||||
var actionInFlight = false { didSet { onChange?() } }
|
||||
var errorMessage: String? { didSet { onChange?() } }
|
||||
|
||||
/// 初始化实例。
|
||||
init(detail: LiveEntity) {
|
||||
self.detail = detail
|
||||
}
|
||||
@ -265,6 +269,7 @@ final class LiveAlbumViewModel {
|
||||
await reload(api: api, scenicId: scenicId, showLoading: false)
|
||||
}
|
||||
|
||||
/// 加载Page数据。
|
||||
private func loadPage(api: any LiveServing, scenicId: Int, page: Int) async throws {
|
||||
let response = try await api.liveAlbumList(
|
||||
scenicId: scenicId,
|
||||
@ -284,6 +289,7 @@ final class LiveAlbumViewModel {
|
||||
hasMore = folders.count < total
|
||||
}
|
||||
|
||||
/// 重置状态。
|
||||
private func reset() {
|
||||
clearFolders()
|
||||
loading = false
|
||||
@ -291,6 +297,7 @@ final class LiveAlbumViewModel {
|
||||
errorMessage = nil
|
||||
}
|
||||
|
||||
/// 清空Folders。
|
||||
private func clearFolders() {
|
||||
folders = []
|
||||
page = 1
|
||||
@ -377,6 +384,7 @@ final class LiveAlbumPreviewViewModel {
|
||||
var loading = false { didSet { onChange?() } }
|
||||
var errorMessage: String? { didSet { onChange?() } }
|
||||
|
||||
/// 初始化实例。
|
||||
init(folderId: Int, startIndex: Int = 0, summary: LiveAlbumFolderItem? = nil) {
|
||||
self.folderId = folderId
|
||||
currentIndex = max(startIndex, 0)
|
||||
|
||||
Reference in New Issue
Block a user