fix index
This commit is contained in:
parent
f1bda5455f
commit
a0f9ea9c5b
@ -50,7 +50,6 @@ struct IndexMainView: View {
|
||||
.contentShape(Rectangle())
|
||||
.highPriorityGesture(
|
||||
TapGesture().onEnded {
|
||||
print("call me tap")
|
||||
appNavigation.append(dest: .followList)
|
||||
}
|
||||
)
|
||||
@ -77,22 +76,29 @@ struct IndexMainView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// // 上滑刷新
|
||||
// RefreshFooter(refreshing: $footerRefreshing, action: {
|
||||
// guard !self.showDateNavPopover else {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// Task {
|
||||
// self.footerRefreshing = true
|
||||
// await self.indexModel.loadMoreUpdateDramas(userId: self.userId, mode: .next)
|
||||
// self.footerRefreshing = false
|
||||
// }
|
||||
// }) {
|
||||
// ProgressView()
|
||||
// }
|
||||
// .noMore(noMore)
|
||||
// .preload(offset: 50)
|
||||
Rectangle()
|
||||
.frame(height: 0)
|
||||
.background(GeometryReader {
|
||||
geometry in
|
||||
Color.clear.onChange(of: geometry.frame(in: .global).minY) {_, offset in
|
||||
|
||||
let frame = geometry.frame(in: .global)
|
||||
let screenBounds = UIScreen.main.bounds
|
||||
let contextFrame = geometry.frame(in: .named("indexScrollView"))
|
||||
|
||||
if screenBounds.height - frame.minY > 50 && contextFrame.minY > 0 && !footerRefreshing {
|
||||
Task {
|
||||
self.footerRefreshing = true
|
||||
await self.indexModel.loadMoreUpdateDramas(userId: self.userId, mode: .next)
|
||||
self.footerRefreshing = false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if self.footerRefreshing {
|
||||
ProgressView()
|
||||
}
|
||||
}
|
||||
.frame(width: 370)
|
||||
.coordinateSpace(name: "indexScrollView")
|
||||
@ -155,9 +161,6 @@ struct IndexMainView: View {
|
||||
self.visibleIndices = Set(offsets.compactMap { (id: Int, offset: CGFloat) in
|
||||
return offset >= 0 ? id : nil
|
||||
})
|
||||
|
||||
print("visible indx: \(self.visibleIndices)")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user