
- 修改Package.swift以支持iOS 15和macOS 12。 - 更新swift-tca-architecture-guidelines.mdc中的alwaysApply设置为false。 - 注释掉AppDelegate中的NIMSDK导入,移除不再使用的NIMConfigurationManager和NIMSessionManager文件。 - 添加新的API相关文件,包括EMailLoginFeature、IDLoginFeature和相关视图,增强登录功能。 - 更新APIConstants和APIEndpoints以反映新的API路径。 - 添加本地化支持文件,包含英文和中文简体的本地化字符串。 - 新增字体管理和安全工具类,支持AES和DES加密。 - 更新Xcode项目配置,调整版本号和启动画面设置。
59 lines
1.5 KiB
Swift
59 lines
1.5 KiB
Swift
import SwiftUI
|
|
|
|
// MARK: - Login Button Component
|
|
struct LoginButton: View {
|
|
let iconName: String
|
|
let iconColor: Color
|
|
let title: String
|
|
let action: () -> Void
|
|
|
|
var body: some View {
|
|
Button(action: action) {
|
|
ZStack {
|
|
// 背景
|
|
Color.white
|
|
.cornerRadius(28)
|
|
|
|
// 居中的文本
|
|
Text(title)
|
|
.font(.system(size: 18, weight: .semibold))
|
|
.frame(alignment: .center)
|
|
.foregroundColor(Color(hex: 0x313131))
|
|
|
|
// 左侧图标
|
|
HStack {
|
|
Image(systemName: iconName)
|
|
.foregroundColor(iconColor)
|
|
.font(.system(size: 30))
|
|
.padding(.leading, 33)
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
.frame(height: 56)
|
|
.padding(.horizontal, 29)
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
VStack(spacing: 20) {
|
|
LoginButton(
|
|
iconName: "person.circle.fill",
|
|
iconColor: .green,
|
|
title: "ID Login"
|
|
) {
|
|
// Preview action
|
|
}
|
|
|
|
LoginButton(
|
|
iconName: "envelope.fill",
|
|
iconColor: .blue,
|
|
title: "Email Login"
|
|
) {
|
|
// Preview action
|
|
}
|
|
}
|
|
.padding()
|
|
.background(Color.gray.opacity(0.2))
|
|
} |