This commit is contained in:
anlicheng 2025-03-04 18:11:35 +08:00
parent 7ba146abf9
commit a497280270
9 changed files with 132 additions and 31 deletions

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ph_img_big.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ph_img_medium.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ph_img_small.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -291,14 +291,24 @@ extension DetailView {
var body: some View {
VStack(alignment: .center) {
AsyncImage(url: URL(string: episode.thumb)) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 90, height: 70)
.clipped()
} placeholder: {
ProgressView()
AsyncImage(url: URL(string: episode.thumb)) { phase in
switch phase {
case .empty:
ProgressView()
case .success(let image):
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 90, height: 70)
.clipped()
default:
Image("ph_img_small")
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
}
}
.frame(width: 90, height: 70)
.overlay(alignment: .topLeading) {

View File

@ -397,13 +397,22 @@ extension IndexView {
ForEach(dramaItem.episodes) { item in
VStack(alignment: .center) {
GeometryReader { geometry in
AsyncImage(url: URL(string: item.thumb)) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
} placeholder: {
ProgressView()
AsyncImage(url: URL(string: item.thumb)) { phase in
switch phase {
case .empty:
ProgressView()
case .success(let image):
image
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
default:
Image("ph_img_medium")
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
}
}
.frame(width: geometry.frame(in: .local).width, height: 80)
.overlay(alignment: .topLeading) {
@ -463,14 +472,23 @@ extension IndexView {
ForEach(group.items, id: \.id) { item in
NavigationLink(destination: DetailView(id: item.id)) {
AsyncImage(url: URL(string: item.thumb)) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 370, height: 180)
.clipped()
} placeholder: {
ProgressView()
AsyncImage(url: URL(string: item.thumb)) { phase in
switch phase {
case .empty:
ProgressView()
case .success(let image):
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 370, height: 180)
.clipped()
default:
Image("ph_img_big")
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
}
}
.frame(width: 370, height: 180)
.overlay(alignment: .topLeading) {

View File

@ -148,14 +148,24 @@ extension ListView {
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()
AsyncImage(url: URL(string: episode.thumb)) { phase in
switch phase {
case .empty:
ProgressView()
case .success(let image):
image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 90, height: 60)
.clipped()
default:
Image("ph_img_medium")
.resizable()
.aspectRatio(contentMode: .fill)
.clipped()
}
}
.frame(width: 90, height: 60)