fix
This commit is contained in:
parent
e1cc10c399
commit
efe9de8b5e
@ -294,7 +294,7 @@ extension DetailView {
|
|||||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
AsyncImage(url: URL(string: episode.thumb)) { image in
|
||||||
image
|
image
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fit)
|
.aspectRatio(contentMode: .fill)
|
||||||
.frame(width: 90, height: 70)
|
.frame(width: 90, height: 70)
|
||||||
.clipped()
|
.clipped()
|
||||||
} placeholder: {
|
} placeholder: {
|
||||||
|
|||||||
@ -390,8 +390,7 @@ extension IndexView {
|
|||||||
AsyncImage(url: URL(string: item.thumb)) { image in
|
AsyncImage(url: URL(string: item.thumb)) { image in
|
||||||
image
|
image
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(contentMode: .fit)
|
.aspectRatio(contentMode: .fill)
|
||||||
.frame(width: geometry.frame(in: .local).width, height: 80)
|
|
||||||
.clipped()
|
.clipped()
|
||||||
} placeholder: {
|
} placeholder: {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
@ -450,23 +449,34 @@ extension IndexView {
|
|||||||
ForEach(group.items, id: \.id) { item in
|
ForEach(group.items, id: \.id) { item in
|
||||||
NavigationLink(destination: DetailView(id: item.id)) {
|
NavigationLink(destination: DetailView(id: item.id)) {
|
||||||
AsyncImage(url: URL(string: item.thumb)) { image in
|
AsyncImage(url: URL(string: item.thumb)) { image in
|
||||||
image.resizable()
|
image
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.frame(width: 370, height: 180)
|
||||||
|
.clipped()
|
||||||
} placeholder: {
|
} placeholder: {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
}
|
}
|
||||||
.frame(width: 370, height: 180)
|
.frame(width: 370, height: 180)
|
||||||
.overlay {
|
.overlay {
|
||||||
HStack {
|
HStack {
|
||||||
|
VStack {
|
||||||
VStack(alignment: .leading, spacing: 8) {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text(item.name)
|
Text(item.name)
|
||||||
.font(.system(size: 16))
|
.font(.system(size: 16))
|
||||||
.foregroundColor(Color(hex: "#333333"))
|
.foregroundColor(.white)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
|
|
||||||
Text(item.status)
|
Text(item.status)
|
||||||
.font(.system(size: 12))
|
.font(.system(size: 12))
|
||||||
.foregroundColor(Color(hex: "#333333"))
|
.foregroundColor(.white)
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
|
}
|
||||||
|
.padding(5)
|
||||||
|
.background(
|
||||||
|
Color.black.opacity(0.6)
|
||||||
|
)
|
||||||
|
.cornerRadius(5)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,31 +109,7 @@ struct ListView: View {
|
|||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
LazyVStack(alignment: .center, spacing: 15) {
|
LazyVStack(alignment: .center, spacing: 15) {
|
||||||
ForEach(detailModel.selectedEpisodes) { episode in
|
ForEach(detailModel.selectedEpisodes) { episode in
|
||||||
HStack(alignment: .center) {
|
EpisodeView(episode: episode)
|
||||||
AsyncImage(url: URL(string: episode.thumb)) { image in
|
|
||||||
image.resizable()
|
|
||||||
} placeholder: {
|
|
||||||
ProgressView()
|
|
||||||
}
|
|
||||||
.frame(width: 90, height: 60)
|
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 20) {
|
|
||||||
Text(episode.num_name)
|
|
||||||
.font(.system(size: 12))
|
|
||||||
.foregroundColor(Color(hex: "#333333"))
|
|
||||||
|
|
||||||
Text(episode.name)
|
|
||||||
.font(.system(size: 12))
|
|
||||||
.foregroundColor(Color(hex: "#333333"))
|
|
||||||
.lineLimit(1)
|
|
||||||
}
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
.onTapGesture {
|
|
||||||
if let playUrl = URL(string: episode.play) {
|
|
||||||
UIApplication.shared.open(playUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,6 +141,46 @@ struct ListView: View {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension ListView {
|
||||||
|
|
||||||
|
struct EpisodeView: View {
|
||||||
|
let episode: ListModel.Episode
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
HStack(alignment: .center) {
|
||||||
|
AsyncImage(url: URL(string: episode.thumb)) { image in
|
||||||
|
image
|
||||||
|
.resizable()
|
||||||
|
.aspectRatio(contentMode: .fill)
|
||||||
|
.frame(width: 90, height: 60)
|
||||||
|
.clipped()
|
||||||
|
} placeholder: {
|
||||||
|
ProgressView()
|
||||||
|
}
|
||||||
|
.frame(width: 90, height: 60)
|
||||||
|
|
||||||
|
VStack(alignment: .leading, spacing: 20) {
|
||||||
|
Text(episode.num_name)
|
||||||
|
.font(.system(size: 12))
|
||||||
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
|
|
||||||
|
Text(episode.name)
|
||||||
|
.font(.system(size: 12))
|
||||||
|
.foregroundColor(Color(hex: "#333333"))
|
||||||
|
.lineLimit(1)
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.onTapGesture {
|
||||||
|
if let playUrl = URL(string: episode.play) {
|
||||||
|
UIApplication.shared.open(playUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
ListView(id: 19625)
|
ListView(id: 19625)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user