fix
This commit is contained in:
parent
c5b2cb3e83
commit
b067991c8b
@ -58,10 +58,8 @@ struct SettingsAccountView: View {
|
||||
}
|
||||
|
||||
// MARK: - 内部视图扩展
|
||||
extension SettingsAccountView {
|
||||
|
||||
// 统一的条目容器样式
|
||||
struct AccountRow: View {
|
||||
// 统一的条目容器样式
|
||||
private struct AccountRow: View {
|
||||
let icon: String
|
||||
let title: String
|
||||
let subtitle: String
|
||||
@ -95,9 +93,9 @@ extension SettingsAccountView {
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AccountCreditView: View {
|
||||
private struct AccountCreditView: View {
|
||||
@Environment(AppContext.self) var appContext: AppContext
|
||||
@Environment(\.openWindow) var openWindow
|
||||
@Environment(\.dismissWindow) var dismissWindow
|
||||
@ -107,10 +105,10 @@ extension SettingsAccountView {
|
||||
var body: some View {
|
||||
AccountRow(icon: "person.fill", title: "当前登录账号", subtitle: username, actions: AnyView(
|
||||
HStack(spacing: 12) {
|
||||
// Button("修改密码") {
|
||||
//
|
||||
// }
|
||||
// .buttonStyle(.link)
|
||||
// Button("修改密码") {
|
||||
//
|
||||
// }
|
||||
// .buttonStyle(.link)
|
||||
|
||||
Button("退出登录") {
|
||||
Task { @MainActor in
|
||||
@ -126,9 +124,9 @@ extension SettingsAccountView {
|
||||
))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TokenCreditView: View {
|
||||
private struct TokenCreditView: View {
|
||||
@Environment(AppContext.self) var appContext: AppContext
|
||||
@Environment(\.openWindow) var openWindow
|
||||
@Environment(\.dismissWindow) var dismissWindow
|
||||
@ -150,6 +148,4 @@ extension SettingsAccountView {
|
||||
.foregroundColor(.red)
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ struct SettingsDeviceView: View {
|
||||
}
|
||||
|
||||
// MARK: - 子组件:设备属性行
|
||||
struct DevicePropertyRow<Content: View>: View {
|
||||
private struct DevicePropertyRow<Content: View>: View {
|
||||
let title: String
|
||||
let value: String
|
||||
let trailingContent: () -> Content
|
||||
|
||||
@ -133,7 +133,7 @@ struct SettingsNetworkView: View {
|
||||
|
||||
}
|
||||
|
||||
struct StatusRow: View {
|
||||
private struct StatusRow: View {
|
||||
let title: String
|
||||
let value: String
|
||||
let valueColor: Color
|
||||
|
||||
@ -92,7 +92,7 @@ struct SettingsSystemView: View {
|
||||
}
|
||||
|
||||
// MARK: - 子组件:开关行
|
||||
struct ToggleRow: View {
|
||||
private struct ToggleRow: View {
|
||||
let icon: String
|
||||
let title: String
|
||||
@Binding var isOn: Bool
|
||||
|
||||
@ -122,7 +122,35 @@ struct SettingsUserIssueView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 提交逻辑
|
||||
// MARK: - 成功弹窗视图
|
||||
private var successPopup: some View {
|
||||
VStack(spacing: 16) {
|
||||
Image(systemName: "checkmark.seal.fill")
|
||||
.font(.system(size: 44))
|
||||
.foregroundStyle(.green.gradient)
|
||||
|
||||
Text("发送成功")
|
||||
.font(.headline)
|
||||
|
||||
Text("感谢您的支持!")
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.padding(40)
|
||||
.background(.ultraThinMaterial) // macOS 磨砂质感
|
||||
.cornerRadius(24)
|
||||
.shadow(color: .black.opacity(0.15), radius: 20)
|
||||
.transition(.asymmetric(
|
||||
insertion: .scale(scale: 0.8).combined(with: .opacity),
|
||||
removal: .opacity.combined(with: .scale(scale: 1.1))
|
||||
))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Actions 提交逻辑
|
||||
extension SettingsUserIssueView {
|
||||
|
||||
private func submitFeedback() async {
|
||||
withAnimation {
|
||||
isSubmitting = true
|
||||
@ -157,27 +185,4 @@ struct SettingsUserIssueView: View {
|
||||
self.isSubmitting = false
|
||||
}
|
||||
|
||||
// MARK: - 成功弹窗视图
|
||||
private var successPopup: some View {
|
||||
VStack(spacing: 16) {
|
||||
Image(systemName: "checkmark.seal.fill")
|
||||
.font(.system(size: 44))
|
||||
.foregroundStyle(.green.gradient)
|
||||
|
||||
Text("发送成功")
|
||||
.font(.headline)
|
||||
|
||||
Text("感谢您的支持!")
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.padding(40)
|
||||
.background(.ultraThinMaterial) // macOS 磨砂质感
|
||||
.cornerRadius(24)
|
||||
.shadow(color: .black.opacity(0.15), radius: 20)
|
||||
.transition(.asymmetric(
|
||||
insertion: .scale(scale: 0.8).combined(with: .opacity),
|
||||
removal: .opacity.combined(with: .scale(scale: 1.1))
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ struct SettingsView: View {
|
||||
}
|
||||
|
||||
// MARK: - 子组件:侧边栏按钮样式
|
||||
struct SidebarItem: View {
|
||||
private struct SidebarItem: View {
|
||||
let icon: String
|
||||
let title: String
|
||||
let isSelected: Bool
|
||||
|
||||
@ -43,7 +43,8 @@ class AppUpdateManager {
|
||||
}
|
||||
}
|
||||
|
||||
struct VersionComparator {
|
||||
private struct VersionComparator {
|
||||
|
||||
/// 比较版本号:如果 current < latest 返回 true (需要更新)
|
||||
static func isVersion(_ current: String, olderThan latest: String) -> Bool {
|
||||
let currentComponents = current.split(separator: ".").map { Int($0) ?? 0 }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user