feat: 动画过渡
This commit is contained in:
parent
8f369867b2
commit
1e3ec86377
@ -262,6 +262,7 @@ struct BlindBoxView: View {
|
|||||||
// 检查状态是否为Unopened,如果是则停止轮询
|
// 检查状态是否为Unopened,如果是则停止轮询
|
||||||
if data.status == "Unopened" {
|
if data.status == "Unopened" {
|
||||||
print("✅ 盲盒已准备就绪,停止轮询")
|
print("✅ 盲盒已准备就绪,停止轮询")
|
||||||
|
self.animationPhase = .ready
|
||||||
stopPolling()
|
stopPolling()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -558,9 +559,9 @@ struct BlindBoxView: View {
|
|||||||
Button(action: {
|
Button(action: {
|
||||||
// 导航到BlindOutcomeView
|
// 导航到BlindOutcomeView
|
||||||
if mediaType == .video, !videoURL.isEmpty, let url = URL(string: videoURL) {
|
if mediaType == .video, !videoURL.isEmpty, let url = URL(string: videoURL) {
|
||||||
Router.shared.navigate(to: .blindOutcome(media: .video(url, nil), time: blindGenerate?.videoGenerateTime ?? "hhsdshjsjdhn", description:blindGenerate?.description ?? "informationinformationinformationinformationinformationinformation"))
|
Router.shared.navigate(to: .blindOutcome(media: .video(url, nil), time: blindGenerate?.name ?? "Your box", description:blindGenerate?.description ?? ""))
|
||||||
} else if mediaType == .image, let image = displayImage {
|
} else if mediaType == .image, let image = displayImage {
|
||||||
Router.shared.navigate(to: .blindOutcome(media: .image(image), time: blindGenerate?.videoGenerateTime ?? "hhsdshjsjdhn", description:blindGenerate?.description ?? "informationinformationinformationinformationinformationinformation"))
|
Router.shared.navigate(to: .blindOutcome(media: .image(image), time: blindGenerate?.name ?? "Your box", description:blindGenerate?.description ?? ""))
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
Image(systemName: "chevron.left")
|
Image(systemName: "chevron.left")
|
||||||
@ -656,10 +657,11 @@ struct BlindBoxView: View {
|
|||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.top, 20)
|
.padding(.top, 20)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 标题
|
// 标题
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
Text("Hi! Click And")
|
Text("Hi! Click And")
|
||||||
Text("Open Your First Box~")
|
Text("Open Your Box~")
|
||||||
}
|
}
|
||||||
.font(Typography.font(for: .smallLargeTitle))
|
.font(Typography.font(for: .smallLargeTitle))
|
||||||
.fontWeight(.bold)
|
.fontWeight(.bold)
|
||||||
@ -804,7 +806,8 @@ struct BlindBoxView: View {
|
|||||||
.animation(.easeOut(duration: 1.5), value: showScalingOverlay)
|
.animation(.easeOut(duration: 1.5), value: showScalingOverlay)
|
||||||
.offset(y: showScalingOverlay ? -100 : 0)
|
.offset(y: showScalingOverlay ? -100 : 0)
|
||||||
.animation(.easeInOut(duration: 1.5), value: showScalingOverlay)
|
.animation(.easeInOut(duration: 1.5), value: showScalingOverlay)
|
||||||
// 打开
|
|
||||||
|
// 打开 TODO 引导时,也要有按钮
|
||||||
if mediaType == .all {
|
if mediaType == .all {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
if animationPhase == .ready {
|
if animationPhase == .ready {
|
||||||
@ -856,6 +859,7 @@ struct BlindBoxView: View {
|
|||||||
.animation(.spring(response: 0.6, dampingFraction: 0.8), value: showModal)
|
.animation(.spring(response: 0.6, dampingFraction: 0.8), value: showModal)
|
||||||
.edgesIgnoringSafeArea(.all)
|
.edgesIgnoringSafeArea(.all)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户资料弹窗
|
// 用户资料弹窗
|
||||||
SlideInModal(
|
SlideInModal(
|
||||||
isPresented: $showModal,
|
isPresented: $showModal,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user