This commit is contained in:
anlicheng 2025-03-04 12:54:56 +08:00
parent ba775af7b9
commit eeb82d7152
3 changed files with 35 additions and 33 deletions

View File

@ -87,6 +87,7 @@ struct DateNavView: View {
} }
} }
} }
.padding([.leading, .trailing], 1)
} }
} }
} }

View File

@ -300,22 +300,27 @@ extension DetailView {
} placeholder: { } placeholder: {
ProgressView() ProgressView()
} }
.frame(width: 90, height: 70)
.overlay { .overlay {
VStack { if !episode.num_name.isEmpty {
HStack { VStack {
Text(episode.num_name) HStack {
.font(.system(size: 12)) Text(episode.num_name)
.foregroundColor(.white) .font(.system(size: 12))
.padding([.leading, .trailing], 5) .foregroundColor(.white)
.background( .padding([.leading, .trailing], 5)
Color.black.opacity(0.5) .background(
.cornerRadius(5) Color.black.opacity(0.5)
) .cornerRadius(5)
)
Spacer()
}
Spacer() Spacer()
} }
Spacer() .padding([.top, .leading], 8)
} else {
EmptyView()
} }
.padding([.top, .leading], 8)
} }
Text(episode.name) Text(episode.name)

View File

@ -299,19 +299,20 @@ extension IndexView {
.background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: .top) .background(Color(hex: "#F2F2F2"), ignoresSafeAreaEdges: .top)
VStack(alignment: .center) { VStack(alignment: .center) {
HStack(alignment: .center) {
Spacer()
Text("番剧补完计划")
.font(.system(size: 24))
.foregroundColor(Color(hex: "#999999"))
}
ForEach(indexModel.dramas, id: \.id) { drama in
DramaCellView(dramaItem: drama)
}
//
ScrollView(.vertical, showsIndicators: false) { ScrollView(.vertical, showsIndicators: false) {
HStack(alignment: .center) {
Spacer()
Text("番剧补完计划")
.font(.system(size: 24))
.foregroundColor(Color(hex: "#999999"))
}
ForEach(indexModel.dramas, id: \.id) { drama in
DramaCellView(dramaItem: drama)
}
//
VStack(alignment: .center, spacing: 10) { VStack(alignment: .center, spacing: 10) {
ForEach(indexModel.updateDramaGroups, id: \.group_id) { group in ForEach(indexModel.updateDramaGroups, id: \.group_id) { group in
DramaGroupView(group: group) { DramaGroupView(group: group) {
@ -330,7 +331,7 @@ extension IndexView {
let frame = geometry.frame(in: .global) let frame = geometry.frame(in: .global)
let screenBounds = UIScreen.main.bounds let screenBounds = UIScreen.main.bounds
let contextFrame = geometry.frame(in: .named("scrollView")) let contextFrame = geometry.frame(in: .named("indexScrollView"))
if screenBounds.height - frame.minY > 50 && contextFrame.minY > 0 && !isMoreLoading { if screenBounds.height - frame.minY > 50 && contextFrame.minY > 0 && !isMoreLoading {
Task { Task {
@ -346,7 +347,7 @@ extension IndexView {
ProgressView() ProgressView()
} }
} }
.coordinateSpace(name: "scrollView") .coordinateSpace(name: "indexScrollView")
.refreshable { .refreshable {
guard !self.isPrevLoading && !self.showDateNavPopover else { guard !self.isPrevLoading && !self.showDateNavPopover else {
return return
@ -372,13 +373,8 @@ extension IndexView {
.alert(isPresented: $showPrompt) { .alert(isPresented: $showPrompt) {
Alert(title: Text("提示"), message: Text(self.promptMessage), dismissButton: .default(Text("OK"))) Alert(title: Text("提示"), message: Text(self.promptMessage), dismissButton: .default(Text("OK")))
} }
.onAppear { .task {
Task { await self.indexModel.loadData(userId: self.userId)
await self.indexModel.loadData(userId: self.userId)
}
withUnsafePointer(to: indexModel) { pointer in
print(pointer)
}
} }
} }
} }
@ -397,7 +393,7 @@ extension IndexView {
} }
ScrollView(.horizontal, showsIndicators: false) { ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .center, spacing: 5) { LazyHStack(alignment: .center, spacing: 5) {
ForEach(dramaItem.episodes) { item in ForEach(dramaItem.episodes) { item in
VStack(alignment: .center) { VStack(alignment: .center) {
GeometryReader { geometry in GeometryReader { geometry in