fix(ios): 全局去掉图标彩色背景块,图标直接显色

- ZXSettingRow / ZXSettingToggleRow 移除 background+clipShape
- ProfileView 通知/设置图标去掉毛玻璃背景
- 全局清理 .background(xxxBG(0.xx)).clipShape() 图案

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-05-30 09:33:59 +08:00
parent cb5e49de12
commit a09853ffa9
5 changed files with 31 additions and 24 deletions

View File

@ -48,7 +48,8 @@ struct AnalysisHomeView: View {
ForEach(viewModel.recommendations.prefix(3)) { rec in
HStack(spacing: 10) {
Image(systemName: rec.type == "review" ? "arrow.triangle.2.circlepath" : "lightbulb.fill")
.font(.system(size: 14)).foregroundColor(Color.zxAccent).frame(width: 32, height: 32).background(Color.zxAccent.opacity(0.1)).clipShape(RoundedRectangle(cornerRadius: 8))
.font(.system(size: 14)).foregroundColor(Color.zxAccent).frame(width: 32, height: 32)
VStack(alignment: .leading, spacing: 2) { Text(rec.title ?? "").font(.system(size: 13, weight: .semibold)).foregroundColor(Color.zxF0); if let desc = rec.description { Text(desc).font(.system(size: 11)).foregroundColor(Color.zxF04).lineLimit(1) } }
Spacer()
if let p = rec.priority { Text(p).font(.system(size: 10, weight: .bold)).foregroundColor(p == "high" ? Color.zxCoral : Color.zxAmber).padding(.horizontal, 6).padding(.vertical, 2).background((p == "high" ? Color.zxCoral : Color.zxAmber).opacity(0.1)).clipShape(Capsule()) }

View File

@ -208,7 +208,8 @@ struct LibraryDetailPage: View {
HStack(spacing: 12) {
Image(systemName: src.type == "file" ? "doc.fill" : "link")
.font(.system(size: 18)).foregroundColor(Color.zxPurple)
.frame(width: 40, height: 40).background(Color.zxPurpleBG(0.12)).clipShape(RoundedRectangle(cornerRadius: 10))
.frame(width: 40, height: 40)
VStack(alignment: .leading, spacing: 2) {
Text(src.title ?? src.originalFilename ?? "未命名").font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0).lineLimit(1)
HStack(spacing: 6) {
@ -664,7 +665,8 @@ struct ImportPage: View {
ScrollView { VStack(spacing: 12) {
if let error = importError {
HStack(spacing: 8) { Image(systemName: "exclamationmark.triangle.fill").foregroundColor(.red); Text(error).font(.system(size: 13)).foregroundColor(.red) }
.padding(12).background(Color.red.opacity(0.1)).clipShape(RoundedRectangle(cornerRadius: 12))
.padding(12)
}
if !statusMessage.isEmpty {
HStack(spacing: 8) { ProgressView(); Text(statusMessage).font(.system(size: 13)).foregroundColor(Color.zxF04) }
@ -756,7 +758,8 @@ struct ImportPage: View {
}
struct ZXImportRow: View { let icon: String; let title: String; let desc: String
var body: some View { HStack(spacing: 14) { Image(systemName: icon).font(.system(size: 22)).foregroundColor(Color.zxPurple).frame(width: 48, height: 48).background(Color.zxPurpleBG(0.1)).clipShape(RoundedRectangle(cornerRadius: 14)); VStack(alignment: .leading, spacing: 2) { Text(title).font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF0); Text(desc).font(.system(size: 12)).foregroundColor(Color.zxF04) }; Spacer(); Image(systemName: "chevron.right").font(.system(size: 12)).foregroundColor(Color.zxF03) }.padding(16).background(Color.zxFill003).clipShape(RoundedRectangle(cornerRadius: 16)).overlay(RoundedRectangle(cornerRadius: 16).stroke(Color.zxBorder006, lineWidth: 1)) }
var body: some View { HStack(spacing: 14) { Image(systemName: icon).font(.system(size: 22)).foregroundColor(Color.zxPurple).frame(width: 48, height: 48)
; VStack(alignment: .leading, spacing: 2) { Text(title).font(.system(size: 15, weight: .semibold)).foregroundColor(Color.zxF0); Text(desc).font(.system(size: 12)).foregroundColor(Color.zxF04) }; Spacer(); Image(systemName: "chevron.right").font(.system(size: 12)).foregroundColor(Color.zxF03) }.padding(16).background(Color.zxFill003).clipShape(RoundedRectangle(cornerRadius: 16)).overlay(RoundedRectangle(cornerRadius: 16).stroke(Color.zxBorder006, lineWidth: 1)) }
}
// MARK: - Import Review
@ -826,14 +829,16 @@ struct ImportReviewPage: View {
} label: {
Label("拒绝", systemImage: "xmark").font(.system(size: 13, weight: .medium))
.foregroundColor(Color.zxCoral).frame(maxWidth: .infinity).frame(height: 40)
.background(Color.zxCoral.opacity(0.1)).clipShape(RoundedRectangle(cornerRadius: 10))
}
Button {
Task { await acceptCandidate(c) }
} label: {
Label("接受", systemImage: "checkmark").font(.system(size: 13, weight: .medium))
.foregroundColor(Color.zxGreen).frame(maxWidth: .infinity).frame(height: 40)
.background(Color.zxGreen.opacity(0.1)).clipShape(RoundedRectangle(cornerRadius: 10))
}
}
.padding(.horizontal, 12).padding(.top, 8)

View File

@ -12,17 +12,11 @@ struct ProfileView: View {
Text("我的").font(.system(size: 22, weight: .heavy)).foregroundColor(Color.zxF0).tracking(-0.5)
Spacer()
NavigationLink(value: Route.notificationList) {
Image("icon-notifications").resizable().scaledToFit().frame(width: 18, height: 18).foregroundColor(Color.zxF05)
.frame(width: 36, height: 36).background(Color(hex:"#FFFFFF",opacity:0.05))
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.zxBorder008, lineWidth: 1))
Image("icon-notifications").resizable().scaledToFit().frame(width: 22, height: 22).foregroundColor(Color.zxF05)
}
.accessibilityLabel("通知中心")
NavigationLink(value: Route.settings) {
Image("icon-settings").resizable().scaledToFit().frame(width: 18, height: 18).foregroundColor(Color.zxF05)
.frame(width: 36, height: 36).background(Color(hex:"#FFFFFF",opacity:0.05))
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.zxBorder008, lineWidth: 1))
Image("icon-settings").resizable().scaledToFit().frame(width: 22, height: 22).foregroundColor(Color.zxF05)
}
.accessibilityLabel("设置")
}.padding(.horizontal, 20).padding(.top, 8).padding(.bottom, 4)
@ -100,7 +94,8 @@ struct ProfileView: View {
VStack(spacing: 0) {
NavigationLink(value: Route.libraryCreate) {
HStack {
Image(systemName: "books.vertical.fill").font(.system(size: 18)).foregroundColor(Color.zxPurple).frame(width: 36, height: 36).background(Color.zxPurpleBG(0.12)).clipShape(RoundedRectangle(cornerRadius: 10))
Image(systemName: "books.vertical.fill").font(.system(size: 18)).foregroundColor(Color.zxPurple).frame(width: 36, height: 36)
Text("学习资产").font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0)
Spacer()
Text("\(viewModel.kbCount)\(viewModel.itemCount)\(viewModel.cardCount)").font(.system(size: 12)).foregroundColor(Color.zxF04)
@ -110,14 +105,16 @@ struct ProfileView: View {
ZXProfileDivider()
NavigationLink(value: Route.notificationList) {
HStack {
Image(systemName: "bell.fill").font(.system(size: 18)).foregroundColor(Color.zxOrange).frame(width: 36, height: 36).background(Color.zxOrange.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 10))
Image(systemName: "bell.fill").font(.system(size: 18)).foregroundColor(Color.zxOrange).frame(width: 36, height: 36)
Text("消息中心").font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0)
Spacer(); Image(systemName: "chevron.right").font(.system(size: 12)).foregroundColor(Color.zxF03)
}.padding(.horizontal, 16).padding(.vertical, 14)
}.foregroundColor(.primary)
ZXProfileDivider()
HStack {
Image(systemName: "externaldrive.fill").font(.system(size: 18)).foregroundColor(Color.zxTeal).frame(width: 36, height: 36).background(Color.zxTeal.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 10))
Image(systemName: "externaldrive.fill").font(.system(size: 18)).foregroundColor(Color.zxTeal).frame(width: 36, height: 36)
VStack(alignment: .leading, spacing: 2) {
Text("存储空间").font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0)
Text(viewModel.formattedStorage).font(.system(size: 11)).foregroundColor(Color.zxF04)

View File

@ -82,7 +82,8 @@ struct SettingsView: View {
showLogoutAlert = true
} label: {
HStack(spacing: 12) {
Image(systemName: "rectangle.portrait.and.arrow.right").font(.system(size: 16)).foregroundColor(.red).frame(width: 32, height: 32).background(Color.red.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 8))
Image(systemName: "rectangle.portrait.and.arrow.right").font(.system(size: 16)).foregroundColor(.red).frame(width: 32, height: 32)
Text("退出登录").font(.system(size: 14, weight: .semibold)).foregroundColor(.red)
Spacer()
}.padding(.horizontal, 16).padding(.vertical, 14)
@ -159,8 +160,8 @@ struct ZXSettingRow: View {
let title: String; let value: String; let icon: String; let color: Color; var isCustom: Bool = false
var body: some View {
HStack(spacing: 12) {
if isCustom { Image(icon).resizable().scaledToFit().frame(width: 16, height: 16).foregroundColor(color).frame(width: 32, height: 32).background(color.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 8)) }
else { Image(systemName: icon).font(.system(size: 16)).foregroundColor(color).frame(width: 32, height: 32).background(color.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 8)) }
if isCustom { Image(icon).resizable().scaledToFit().frame(width: 20, height: 20).foregroundColor(color) }
else { Image(systemName: icon).font(.system(size: 18)).foregroundColor(color) }
Text(title).font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0)
Spacer()
if !value.isEmpty { Text(value).font(.system(size: 13)).foregroundColor(Color.zxF03) }
@ -173,7 +174,7 @@ struct ZXSettingToggleRow: View {
let title: String; let icon: String; let color: Color; @Binding var isOn: Bool
var body: some View {
HStack(spacing: 12) {
Image(systemName: icon).font(.system(size: 16)).foregroundColor(color).frame(width: 32, height: 32).background(color.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 8))
Image(systemName: icon).font(.system(size: 18)).foregroundColor(color)
Text(title).font(.system(size: 14, weight: .semibold)).foregroundColor(Color.zxF0)
Spacer()
Toggle("", isOn: $isOn).labelsHidden().tint(Color.zxPurple)

View File

@ -55,19 +55,22 @@ struct StudyHomeView: View {
HStack(spacing: 12) {
NavigationLink(value: Route.aiChat) {
VStack(spacing: 6) {
Image(systemName: "sparkles").font(.system(size: 18)).foregroundColor(Color.zxPurple).frame(width: 44, height: 44).background(Color.zxPurpleBG(0.12)).clipShape(RoundedRectangle(cornerRadius: 12))
Image(systemName: "sparkles").font(.system(size: 18)).foregroundColor(Color.zxPurple).frame(width: 44, height: 44)
Text("AI 问答").font(.system(size: 11)).foregroundColor(Color.zxF04)
}.frame(maxWidth: .infinity)
}.foregroundColor(.primary)
NavigationLink(value: Route.activeRecall) {
VStack(spacing: 6) {
Image(systemName: "brain.head.profile").font(.system(size: 18)).foregroundColor(Color.zxOrange).frame(width: 44, height: 44).background(Color.zxOrangeBG(0.12)).clipShape(RoundedRectangle(cornerRadius: 12))
Image(systemName: "brain.head.profile").font(.system(size: 18)).foregroundColor(Color.zxOrange).frame(width: 44, height: 44)
Text("自测").font(.system(size: 11)).foregroundColor(Color.zxF04)
}.frame(maxWidth: .infinity)
}.foregroundColor(.primary)
NavigationLink(value: Route.reviewCard) {
VStack(spacing: 6) {
Image(systemName: "arrow.triangle.2.circlepath").font(.system(size: 18)).foregroundColor(Color.zxTeal).frame(width: 44, height: 44).background(Color.zxTeal.opacity(0.12)).clipShape(RoundedRectangle(cornerRadius: 12))
Image(systemName: "arrow.triangle.2.circlepath").font(.system(size: 18)).foregroundColor(Color.zxTeal).frame(width: 44, height: 44)
Text("复习").font(.system(size: 11)).foregroundColor(Color.zxF04)
}.frame(maxWidth: .infinity)
}.foregroundColor(.primary)