DFSingleStressHomeView.swift
1.48 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
//
// File.swift
// iwatch
//
// Created by 权海 on 2026/6/15.
//
import SwiftUI
struct DFSingleStressHomeView: View {
var kind: DFWatchStressKind = .overloaded
var value: String? = "38ms"
var sampleTime: String = "16:06"
private var valueDesc: String{
if let value{
return kind.title + "·" + value
}
return "等待数据"
}
var body: some View {
ZStack(alignment: .top) {
LinearGradient(
colors: [kind.color.opacity(0.3), kind.color.opacity(0)],
startPoint: .top,
endPoint: .bottom
)
.frame(width: .infinity, height: .infinity)
VStack(spacing: 8){
DFWatchFigmaHeader(subtitle: "HRV")
.padding(.top, 16)
HStack{}
.frame(width: 78, height: 78)
.background(Color(hex: "#FF0000"))
Text(valueDesc)
.font(.system(size: 16, weight: .semibold))
.foregroundStyle(value == nil ? Color(hex: "#B0B0B6") : kind.color)
DFWatchFigmaSegmentBar(selected: kind)
.frame(height: 14)
Text(sampleTime)
.font(.system(size: 12))
.foregroundStyle(.white)
}.padding(.horizontal, value == nil ? 30 : 22)
}
}
}