DFCoupleStressHomeView.swift 2.14 KB
//
//  DFCoupleStressHomeView.swift
//  iwatch
//
//  Created by 权海 on 2026/6/15.
//

import SwiftUI

struct DFCoupleStressHomeView: View {
    var hasData: Bool = true

    var body: some View {
            VStack {
                DFWatchFigmaHeader(subtitle: hasData ? "我们的状态·HRV" : "我们的状态·实时")
                Spacer().frame(height: 9)
                HStack(spacing: 4){
                    DFCouplePersonCard(
                        kind:.overloaded,
                        name: "男朋友",
                        value: hasData ? "30ms" : "-%",
                    ).frame(maxWidth: .infinity)
                    DFCouplePersonCard(
                        kind: .excellent,
                        name: "我",
                        value: hasData ? "80ms" : "-%",
                    ).frame(maxWidth: .infinity)
                }
                Spacer().frame(height: 5)
                HStack{
                    DFWatchHeartBeatCircle(progress: 0, value: nil)
                        .frame(width: 45, height: 44)
                    Spacer()
                    DFWatchCloseCircle(outerProgress: 0, middleProgress: 0, innerProgress: 0)
                        .frame(width: 44, height: 44)
                    Spacer()
                    DFWatchStepCountCircle(progress: 0, value: 0)
                        .frame(width: 44, height: 44)
                }
            }.padding(.all, 16)
    }
}

private struct DFCouplePersonCard: View {
    let kind: DFWatchStressKind?
    let name: String
    let value: String?

    var body: some View {
        VStack(spacing: 4) {
            HStack{}
                .frame(width: 55, height: 55)
                .background(Color(hex: "#FF0000"))
            Text(kind?.title ?? "等待数据")
                .font(.system(size: 12, weight: .semibold))
                .foregroundColor(kind?.color ?? Color(hex: "#B0B0B6"))
            Text(name)
                .font(.system(size: 10, weight: .medium))
                .foregroundColor(.white)
            Text(value ?? "--ms")
                .font(.system(size: 8, weight: .light))
                .foregroundColor(.white)
        }
    }
}