dimensionhub/dimensionhub/Views/Search/SearchDramaGroupView.swift
2025-04-08 17:22:04 +08:00

65 lines
2.1 KiB
Swift

//
// SearchDramaGroupView.swift
// dimensionhub
//
// Created by on 2025/4/8.
//
import SwiftUI
//
struct SearchDramaGroupView: View {
let group: SearchModel.DramaGroup
var body: some View {
VStack(alignment: .center, spacing: 10) {
ForEach(group.items, id: \.id) { item in
NavigationLink(destination: DetailView(id: item.id)) {
AsyncImage(url: URL(string: item.thumb)) { phase in
switch phase {
case .empty:
ProgressView()
case .success(let image):
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(height: 180)
.clipped()
default:
Image("ph_img_big")
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
}
}
.frame(width: 370, height: 180)
.overlay(alignment: .topLeading) {
VStack(alignment: .leading, spacing: 8) {
Text(item.name)
.font(.system(size: 16))
.foregroundColor(.white)
.lineLimit(1)
Text(item.status)
.font(.system(size: 12))
.foregroundColor(.white)
.lineLimit(1)
}
.padding(5)
.background(
Color.black.opacity(0.6)
)
.cornerRadius(5)
.padding(8)
}
}
}
}
}
}
//#Preview {
// SearchDramaGroupView()
//}