This commit is contained in:
anlicheng 2025-03-03 23:00:57 +08:00
parent 085ed309d9
commit e1cc10c399
2 changed files with 64 additions and 64 deletions

View File

@ -305,7 +305,12 @@ extension DetailView {
HStack { HStack {
Text(episode.num_name) Text(episode.num_name)
.font(.system(size: 12)) .font(.system(size: 12))
.foregroundColor(Color(hex: "#333333")) .foregroundColor(.white)
.padding([.leading, .trailing], 5)
.background(
Color.black.opacity(0.5)
.cornerRadius(5)
)
Spacer() Spacer()
} }
Spacer() Spacer()

View File

@ -85,84 +85,79 @@ struct ListView: View {
.font(.system(size: 28)) .font(.system(size: 28))
.foregroundColor(Color(hex: "#333333")) .foregroundColor(Color(hex: "#333333"))
.fontWeight(.medium) .fontWeight(.medium)
Text("返回")
.font(.system(size: 13))
.foregroundColor(Color(hex: "#333333"))
.onTapGesture {
self.presentationMode.wrappedValue.dismiss()
}
} }
Spacer() Spacer()
} }
.padding([.leading, .top, .bottom], 10) .padding([.leading, .top, .bottom], 10)
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.bottom]) .background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: [.top])
//
HStack(alignment: .center, spacing: 15) {
ForEach(Array(detailModel.channels.enumerated()), id: \.offset) { idx, channel in
Text(channel.name)
.font(.system(size: 13))
.foregroundColor(idx == detailModel.selectedChannelIdx ? Color(hex: "#169BD5") : Color(hex: "#666666"))
.onTapGesture {
detailModel.toggleChannel(channelIdx: idx)
}
}
Spacer()
}
// VStack {
ScrollView(.vertical, showsIndicators: false) { //
LazyVStack(alignment: .center, spacing: 15) { HStack(alignment: .center, spacing: 15) {
ForEach(detailModel.selectedEpisodes) { episode in ForEach(Array(detailModel.channels.enumerated()), id: \.offset) { idx, channel in
HStack(alignment: .center) { Text(channel.name)
AsyncImage(url: URL(string: episode.thumb)) { image in .font(.system(size: 13))
image.resizable() .foregroundColor(idx == detailModel.selectedChannelIdx ? Color(hex: "#169BD5") : Color(hex: "#666666"))
} placeholder: { .onTapGesture {
ProgressView() detailModel.toggleChannel(channelIdx: idx)
} }
.frame(width: 90, height: 60) }
Spacer()
VStack(alignment: .leading, spacing: 20) { }
Text(episode.num_name)
.font(.system(size: 12)) //
.foregroundColor(Color(hex: "#333333")) ScrollView(.vertical, showsIndicators: false) {
LazyVStack(alignment: .center, spacing: 15) {
ForEach(detailModel.selectedEpisodes) { episode in
HStack(alignment: .center) {
AsyncImage(url: URL(string: episode.thumb)) { image in
image.resizable()
} placeholder: {
ProgressView()
}
.frame(width: 90, height: 60)
Text(episode.name) VStack(alignment: .leading, spacing: 20) {
.font(.system(size: 12)) Text(episode.num_name)
.foregroundColor(Color(hex: "#333333")) .font(.system(size: 12))
.lineLimit(1) .foregroundColor(Color(hex: "#333333"))
Text(episode.name)
.font(.system(size: 12))
.foregroundColor(Color(hex: "#333333"))
.lineLimit(1)
}
Spacer()
} }
Spacer() .onTapGesture {
} if let playUrl = URL(string: episode.play) {
.onTapGesture { UIApplication.shared.open(playUrl)
if let playUrl = URL(string: episode.play) { }
UIApplication.shared.open(playUrl)
} }
} }
} }
} }
}
HStack(alignment: .center) {
HStack(alignment: .center) { Button {
Button { self.presentationMode.wrappedValue.dismiss()
self.presentationMode.wrappedValue.dismiss() } label: {
} label: { Rectangle()
Rectangle() .frame(width: 200, height: 25)
.frame(width: 200, height: 25) .foregroundColor(Color(hex: "#F2F2F2"))
.foregroundColor(Color(hex: "#F2F2F2")) .overlay {
.overlay { Text("收起剧集")
Text("收起剧集") .font(.system(size: 13))
.font(.system(size: 13)) .foregroundColor(Color(hex: "#999999"))
.foregroundColor(Color(hex: "#999999")) }
} }
} }
Spacer()
} }
.frame(width: 370, alignment: .center)
Spacer()
} }
.frame(width: 370, alignment: .center)
.task { .task {
await detailModel.loadData(userId: self.userId, id: self.id) await detailModel.loadData(userId: self.userId, id: self.id)
} }