MainPagingView.swift
869 Bytes
//
// MainPagingView.swift
// hippo-watch Watch App
//
// Created by shihao on 2025/6/6.
//
import SwiftUI
struct MainPagingView: View {
@State private var showPKView = false
@State private var currentPage = 0
@EnvironmentObject var router: WatchNotificationRouter
var body: some View {
NavigationView {
ZStack {
DFDefaultWatchHomeView()
}
.navigationBarHidden(true)
}
.fullScreenCover(isPresented: $showPKView, content: {
DFCoupleStressHomeView()
})
.onAppear {
router.consumeCachedPayloadIfNeeded()
}
.onChange(of: router.pendingNotification?.id) { _, id in
guard let id else { return }
// TODO: 根据 id 跳转详情页
print("跳转通知详情:", id)
}
}
}