chore: 完成部分svg资源替换
This commit is contained in:
parent
b036f3d18e
commit
17dc5bbe5e
File diff suppressed because one or more lines are too long
@ -315,8 +315,9 @@ struct BlindBoxView: View {
|
||||
HStack {
|
||||
// 设置按钮
|
||||
Button(action: showUserProfile) {
|
||||
SVGImage(svgName: "User")
|
||||
.frame(width: 24, height: 24)
|
||||
Image(systemName: "line.3.horizontal")
|
||||
.font(.system(size: 20, weight: .regular))
|
||||
.foregroundColor(.primary)
|
||||
.padding(13) // Increases tap area while keeping visual size
|
||||
.contentShape(Rectangle()) // Makes the padded area tappable
|
||||
}
|
||||
@ -392,15 +393,7 @@ struct BlindBoxView: View {
|
||||
.animation(.easeOut(duration: 1.5), value: showScalingOverlay)
|
||||
}
|
||||
if mediaType == .all && !showScalingOverlay {
|
||||
ZStack {
|
||||
SVGImage(svgName: "BlindCount")
|
||||
.frame(width: 100, height: 60)
|
||||
|
||||
Text("\(viewModel.blindCount?.availableQuantity ?? 0) Boxes")
|
||||
.font(Typography.font(for: .body, family: .quicksandBold))
|
||||
.foregroundColor(.white)
|
||||
.offset(x: 6, y: -18)
|
||||
}
|
||||
BlindCountBadge(text: "\(viewModel.blindCount?.availableQuantity ?? 0) Boxes")
|
||||
.position(x: UIScreen.main.bounds.width * 0.7,
|
||||
y: UIScreen.main.bounds.height * 0.18)
|
||||
.opacity(showScalingOverlay ? 0 : 1)
|
||||
@ -655,6 +648,24 @@ struct BlindBoxView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 盲盒数量徽标(SwiftUI 重绘)
|
||||
private struct BlindCountBadge: View {
|
||||
let text: String
|
||||
|
||||
var body: some View {
|
||||
Text(text)
|
||||
.font(Typography.font(for: .body, family: .quicksandBold))
|
||||
.foregroundColor(.white)
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 8)
|
||||
.background(
|
||||
Capsule()
|
||||
.fill(Color.black)
|
||||
.shadow(color: Color.black.opacity(0.15), radius: 4, x: 0, y: 2)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// 隐藏设置页面
|
||||
private func hideSettings() {
|
||||
withAnimation(.spring(response: 0.6, dampingFraction: 0.8)) {
|
||||
|
||||
@ -93,8 +93,9 @@ struct AvatarUploader: View {
|
||||
Color.gray.opacity(0.1)
|
||||
.frame(width: size, height: size)
|
||||
.overlay(
|
||||
SVGImage(svgName: "Avatar")
|
||||
.frame(width: size * 0.8, height: size * 0.8)
|
||||
Image(systemName: "person.crop.circle")
|
||||
.font(.system(size: size * 0.5))
|
||||
.foregroundColor(.gray)
|
||||
)
|
||||
.clipShape(RoundedRectangle(cornerRadius: size * 0.1))
|
||||
.overlay(
|
||||
|
||||
@ -157,9 +157,9 @@ struct UserProfileModal: View {
|
||||
Router.shared.navigate(to: .mediaUpload)
|
||||
}) {
|
||||
HStack(spacing: 16) {
|
||||
SVGImage(svgName: "Upload")
|
||||
Image(systemName: "tray.and.arrow.up")
|
||||
.font(.system(size: 20, weight: .regular))
|
||||
.foregroundColor(.orange)
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Text("Upload Resources")
|
||||
.font(Typography.font(for: .body))
|
||||
@ -179,9 +179,9 @@ struct UserProfileModal: View {
|
||||
Router.shared.navigate(to: .memories)
|
||||
}) {
|
||||
HStack(spacing: 16) {
|
||||
SVGImage(svgName: "Memory")
|
||||
Image(systemName: "photo.on.rectangle")
|
||||
.font(.system(size: 20, weight: .regular))
|
||||
.foregroundColor(.orange)
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Text("My Memories")
|
||||
.font(Typography.font(for: .body))
|
||||
@ -225,9 +225,9 @@ struct UserProfileModal: View {
|
||||
}
|
||||
}) {
|
||||
HStack(spacing: 16) {
|
||||
SVGImage(svgName: "Set")
|
||||
Image(systemName: "gearshape")
|
||||
.font(.system(size: 20, weight: .regular))
|
||||
.foregroundColor(.orange)
|
||||
.frame(width: 20, height: 20)
|
||||
|
||||
Text("Setting")
|
||||
.font(Typography.font(for: .body))
|
||||
|
||||
@ -125,8 +125,9 @@ struct MediaUploadView: View {
|
||||
/// 上传提示视图
|
||||
private var uploadHintView: some View {
|
||||
HStack (spacing: 6) {
|
||||
SVGImage(svgName: "Tips")
|
||||
.frame(width: 16, height: 16)
|
||||
Image(systemName: "lightbulb")
|
||||
.font(.system(size: 16, weight: .regular))
|
||||
.foregroundColor(.themeTextMessageMain)
|
||||
.padding(.leading,6)
|
||||
Text("The upload process will take approximately 2 minutes. Thank you for your patience.")
|
||||
.font(.caption)
|
||||
@ -601,9 +602,11 @@ struct UploadPromptView: View {
|
||||
|
||||
var body: some View {
|
||||
Button(action: { showMediaPicker = true }) {
|
||||
// 上传图标
|
||||
SVGImageHtml(svgName: "IP")
|
||||
ZStack {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.fill(Color.white)
|
||||
.frame(width: 225, height: 225)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.overlay(
|
||||
ZStack {
|
||||
|
||||
@ -85,8 +85,9 @@ struct UserInfo: View {
|
||||
.zIndex(1) // 确保导航栏在最上层
|
||||
// Dynamic text that changes based on keyboard state
|
||||
HStack(spacing: 6) {
|
||||
SVGImage(svgName: "Tips")
|
||||
.frame(width: 16, height: 16)
|
||||
Image(systemName: "lightbulb")
|
||||
.font(.system(size: 16, weight: .regular))
|
||||
.foregroundColor(.themeTextMessageMain)
|
||||
.padding(.leading,6)
|
||||
Text("Choose a photo as your avatar, and we'll generate a video mystery box for you.")
|
||||
.font(Typography.font(for: .caption))
|
||||
|
||||
@ -109,7 +109,9 @@ struct SettingsView: View {
|
||||
Button(action: action) {
|
||||
HStack {
|
||||
// 左侧图标
|
||||
SVGImage(svgName: icon)
|
||||
Image(systemName: systemSymbol(for: icon))
|
||||
.font(.system(size: 18, weight: .regular))
|
||||
.foregroundColor(.primary)
|
||||
.frame(width: 22, height: 22)
|
||||
|
||||
// 标题
|
||||
@ -130,9 +132,26 @@ struct SettingsView: View {
|
||||
.listRowBackground(Color.white)
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
|
||||
// 将现有 SVG 名称映射为系统符号名称
|
||||
private func systemSymbol(for icon: String) -> String {
|
||||
switch icon {
|
||||
case "Account":
|
||||
return "person.circle"
|
||||
case "Permission":
|
||||
return "lock.rectangle"
|
||||
case "Suport":
|
||||
return "headphones"
|
||||
case "AboutUs":
|
||||
return "info.circle"
|
||||
default:
|
||||
return "questionmark.circle"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 预览
|
||||
#Preview {
|
||||
SettingsView(isPresented: .constant(true))
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,8 @@ struct SubscriptionStatusBar: View {
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
// Background SVG - First layer
|
||||
SVGImage(svgName: status.backgroundImageName)
|
||||
// SwiftUI 绘制的背景
|
||||
SubscriptionBackground(status: status)
|
||||
.frame(maxWidth: .infinity, minHeight: 120)
|
||||
.clipped()
|
||||
|
||||
@ -107,6 +107,42 @@ struct SubscriptionStatusBar: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 背景绘制
|
||||
private struct SubscriptionBackground: View {
|
||||
let status: SubscriptionStatus
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .topTrailing) {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.fill(background)
|
||||
.shadow(color: Color.black.opacity(0.06), radius: 10, x: 0, y: 6)
|
||||
|
||||
// 装饰元素(右上角)
|
||||
if case .pioneer = status {
|
||||
Circle()
|
||||
.fill(Color.black.opacity(0.08))
|
||||
.frame(width: 90, height: 90)
|
||||
.offset(x: 12, y: -12)
|
||||
} else {
|
||||
Circle()
|
||||
.fill(Color.black.opacity(0.04))
|
||||
.frame(width: 70, height: 70)
|
||||
.offset(x: 12, y: -12)
|
||||
}
|
||||
}
|
||||
.clipShape(RoundedRectangle(cornerRadius: 20))
|
||||
}
|
||||
|
||||
private var background: some ShapeStyle {
|
||||
switch status {
|
||||
case .free:
|
||||
return LinearGradient(colors: [Color.white, Color.white.opacity(0.96)], startPoint: .topLeading, endPoint: .bottomTrailing)
|
||||
case .pioneer:
|
||||
return LinearGradient(colors: [Color.themePrimary.opacity(0.85), Color.orange.opacity(0.6)], startPoint: .topLeading, endPoint: .bottomTrailing)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - 预览
|
||||
#Preview {
|
||||
VStack(spacing: 20) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user