This commit is contained in:
anlicheng 2025-03-03 22:20:59 +08:00
parent 466ff8e387
commit 085ed309d9
2 changed files with 98 additions and 83 deletions

View File

@ -160,6 +160,7 @@ struct DetailView: View {
.foregroundColor(Color(hex: "#333333"))
Spacer()
}
if showAllSummary {
Text(detailModel.summary)
.lineLimit(nil)
@ -183,9 +184,10 @@ struct DetailView: View {
}
}
}
.padding([.top, .leading], 10)
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.bottom])
.padding(10)
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.top])
VStack(alignment: .center) {
HStack(alignment: .center, spacing: 10) {
Spacer()
ForEach(detailModel.statuses, id: \.status) { status in
@ -220,41 +222,12 @@ struct DetailView: View {
//
ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .center) {
LazyHStack(alignment: .center) {
ForEach(detailModel.selectedEpisodes) { episode in
VStack(alignment: .center) {
AsyncImage(url: URL(string: episode.thumb)) { image in
image.resizable()
} placeholder: {
ProgressView()
}
.frame(width: 90, height: 70)
.overlay {
VStack {
HStack {
Text(episode.num_name)
.font(.system(size: 12))
.foregroundColor(Color(hex: "#333333"))
Spacer()
}
Spacer()
}
.padding([.top, .leading], 8)
}
Text(episode.name)
.font(.system(size: 12))
.foregroundColor(Color(hex: "#333333"))
.lineLimit(1)
}
.frame(width: 90, height: 120)
.onTapGesture {
if let playUrl = URL(string: episode.play) {
UIApplication.shared.open(playUrl)
}
}
EpisodeView(episode: episode)
}
}
.frame(height: 100)
}
if detailModel.selectedEpisodes.count >= 5 {
@ -276,6 +249,7 @@ struct DetailView: View {
Spacer()
}
.frame(width: 370, alignment: .center)
}
.alert(isPresented: $showAlert) {
Alert(title: Text(self.errorInfo.0), message: Text(self.errorInfo.1), dismissButton: .default(Text("OK")))
}
@ -312,6 +286,47 @@ extension DetailView {
}
}
struct EpisodeView: View {
let episode: DetailModel.Episode
var body: some View {
VStack(alignment: .center) {
AsyncImage(url: URL(string: episode.thumb)) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 90, height: 70)
.clipped()
} placeholder: {
ProgressView()
}
.overlay {
VStack {
HStack {
Text(episode.num_name)
.font(.system(size: 12))
.foregroundColor(Color(hex: "#333333"))
Spacer()
}
Spacer()
}
.padding([.top, .leading], 8)
}
Text(episode.name)
.font(.system(size: 12))
.foregroundColor(Color(hex: "#333333"))
.lineLimit(1)
}
.frame(width: 90)
.onTapGesture {
if let playUrl = URL(string: episode.play) {
UIApplication.shared.open(playUrl)
}
}
}
}
}
#Preview {

View File

@ -276,7 +276,7 @@ extension IndexView {
@State private var showDateNavPopover: Bool = false
var body: some View {
VStack {
VStack(alignment: .center) {
HStack(alignment: .center) {
Color.clear