DFCoupleStressHomeView.swift
2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// 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)
}
}
}