This commit is contained in:
anlicheng 2025-03-31 17:33:54 +08:00
parent 283c3ae78a
commit 7255bb3c5a

View File

@ -57,7 +57,7 @@ final class IndexModel {
var follow_num: String = "0"
// group_name
var fixedGroupName: String = ""
var fixedDramaGroup: UpdateDramaGroup? = nil
@ObservationIgnored
private var isLoaded = false
@ -78,6 +78,7 @@ final class IndexModel {
print("index load data get error_code: \(code), message: \(message)")
case .result(let result):
self.updateDramaGroups = result.update_dramas
self.fixedDramaGroup = result.update_dramas.first
self.follow_num = result.follow_num >= 100 ? "99+" : "\(result.follow_num)"
}
self.isLoaded = true
@ -381,11 +382,15 @@ extension IndexView {
HStack {
Text("🔍")
Spacer()
Text(indexModel.fixedGroupName)
if let fixedDramaGroup = indexModel.fixedDramaGroup {
Text(fixedDramaGroup.group_name)
.font(.system(size: 18))
.fontWeight(.regular)
.onTapGesture {
print("call me here")
selectGroupId = fixedDramaGroup.group_id
indexModel.selectedDate = fixedDramaGroup.group_id
showDateNavPopover = true
}
}
}
.padding(8)
@ -431,7 +436,7 @@ extension IndexView {
geometry in
Color.clear.onChange(of: geometry.frame(in: .named("indexScrollView")).minY) {_, y in
if abs(y) <= 5 {
model.fixedGroupName = group.group_name
model.fixedDramaGroup = group
}
}
})