fix index view

This commit is contained in:
anlicheng 2025-02-24 15:38:21 +08:00
parent 3713d30daa
commit 5ff82b10bb

View File

@ -13,11 +13,16 @@ import Observation
final class IndexModel { final class IndexModel {
struct DramaItem: Codable { struct DramaItem: Codable {
struct Episode: Codable { struct Episode: Codable, Identifiable {
let id: Int32 let id = UUID().uuidString
let name: String let name: String
let thumb: String let thumb: String
let num_name: String let num_name: String
let play: String
enum CodingKeys: String, CodingKey {
case name, thumb, num_name, play
}
} }
let id: Int32 let id: Int32
@ -260,7 +265,7 @@ extension IndexView {
ScrollView(.horizontal, showsIndicators: false) { ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .center, spacing: 5) { HStack(alignment: .center, spacing: 5) {
ForEach(dramaItem.episodes, id: \.id) { item in ForEach(dramaItem.episodes) { item in
VStack(alignment: .center) { VStack(alignment: .center) {
GeometryReader { geometry in GeometryReader { geometry in
AsyncImage(url: URL(string: item.thumb)) { image in AsyncImage(url: URL(string: item.thumb)) { image in