Files
kangkang/康康/Security/LockScreenView.swift
link2026 77a4ee1c37 缺少代码差异信息,无法生成具体的commit message。请提供code differences内容以便分析并生成符合Angular规范的提交信息。
当您提供代码差异后,我将按照以下格式生成:

```
<type>(<scope>): <subject>

<body>
```

其中type会根据更改类型选择(feat、fix、docs、style、refactor等),scope表示影响范围,subject简要描述变更内容,body详细说明修改内容。
2026-06-07 14:17:18 +08:00

95 lines
2.9 KiB
Swift

import SwiftUI
/// :,onAppear ;/,
struct LockScreenView: View {
@State private var appLock = AppLock.shared
/// /
private var glyph: String {
switch appLock.biometryLabel {
case "Face ID": return "faceid"
case "Touch ID": return "touchid"
default: return "lock.fill"
}
}
var body: some View {
ZStack {
Tj.Palette.sand.ignoresSafeArea()
VStack(spacing: 18) {
Spacer()
ZStack {
Circle()
.fill(Tj.Palette.paper)
.overlay(Circle().strokeBorder(Tj.Palette.line, lineWidth: 1))
Image(systemName: "lock.fill")
.font(.tjScaled( 34))
.foregroundStyle(Tj.Palette.ink)
}
.frame(width: 92, height: 92)
.shadow(color: Tj.Palette.ink.opacity(0.06), radius: 12, y: 4)
VStack(spacing: 6) {
Text("康康 已锁定")
.font(.tjH2())
.foregroundStyle(Tj.Palette.text)
Text("你的健康档案已加密保护")
.font(.tjScaled( 13))
.foregroundStyle(Tj.Palette.text3)
}
Spacer()
Button {
Task { await appLock.authenticate() }
} label: {
Label("\(appLock.biometryLabel) 解锁", systemImage: glyph)
.frame(maxWidth: .infinity)
}
.buttonStyle(TjPrimaryButton(height: 52, fontSize: 16))
.padding(.horizontal, 40)
.padding(.bottom, 48)
}
}
.onAppear {
Task { await appLock.authenticate() }
}
}
}
/// : / ,
/// ,
struct PrivacyCoverView: View {
var body: some View {
ZStack {
Tj.Palette.sand.ignoresSafeArea()
VStack(spacing: 14) {
ZStack {
Circle()
.fill(Tj.Palette.paper)
.overlay(Circle().strokeBorder(Tj.Palette.line, lineWidth: 1))
Image(systemName: "heart.text.square.fill")
.font(.tjScaled( 30))
.foregroundStyle(Tj.Palette.ink)
}
.frame(width: 80, height: 80)
Text("康康")
.font(.tjH2())
.foregroundStyle(Tj.Palette.text)
}
}
}
}
#Preview("锁屏") {
LockScreenView()
}
#Preview("隐私遮罩") {
PrivacyCoverView()
}