feat: 暂提
This commit is contained in:
parent
d90ed0a171
commit
5080b104a4
@ -10,6 +10,7 @@ enum AppRoute: Hashable {
|
|||||||
case blindBox(mediaType: BlindBoxView.BlindBoxMediaType)
|
case blindBox(mediaType: BlindBoxView.BlindBoxMediaType)
|
||||||
case blindOutcome(media: MediaType)
|
case blindOutcome(media: MediaType)
|
||||||
case memories
|
case memories
|
||||||
|
case subscribe
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
var view: some View {
|
var view: some View {
|
||||||
@ -30,6 +31,8 @@ enum AppRoute: Hashable {
|
|||||||
BlindOutcomeView(media: media)
|
BlindOutcomeView(media: media)
|
||||||
case .memories:
|
case .memories:
|
||||||
MemoriesView()
|
MemoriesView()
|
||||||
|
case .subscribe:
|
||||||
|
SubscribeView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,22 @@ struct UserProfile: Codable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct MemberProfile: Codable {
|
||||||
|
let userId: String
|
||||||
|
let nickname: String
|
||||||
|
let avatarUrl: String?
|
||||||
|
let account: String
|
||||||
|
let email: String
|
||||||
|
|
||||||
|
enum CodingKeys: String, CodingKey {
|
||||||
|
case userId = "user_id"
|
||||||
|
case nickname
|
||||||
|
case avatarUrl = "avatar_file_url"
|
||||||
|
case account
|
||||||
|
case email
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// API Response wrapper
|
// API Response wrapper
|
||||||
struct APIResponse<T: Codable>: Codable {
|
struct APIResponse<T: Codable>: Codable {
|
||||||
let code: Int
|
let code: Int
|
||||||
@ -126,39 +142,43 @@ struct UserProfileModal: View {
|
|||||||
)
|
)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
|
||||||
|
Button(action: {
|
||||||
|
Router.shared.navigate(to: .subscribe)
|
||||||
|
}) {
|
||||||
ZStack(alignment: .center) {
|
ZStack(alignment: .center) {
|
||||||
// SVG背景 - 确保铺满整个区域
|
// SVG背景 - 确保铺满整个区域
|
||||||
SVGImage(svgName: "Pioneer")
|
SVGImage(svgName: "Pioneer")
|
||||||
.scaledToFill()
|
.scaledToFill()
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
|
|
||||||
// 内容区域
|
// 内容区域
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
Text("Pioneer")
|
Text("Pioneer")
|
||||||
.font(Typography.font(for: .title3))
|
.font(Typography.font(for: .title3))
|
||||||
.fontWeight(.bold)
|
.fontWeight(.bold)
|
||||||
.foregroundColor(.themeTextMessageMain)
|
.foregroundColor(.themeTextMessageMain)
|
||||||
.padding(.top, 6)
|
.padding(.top, 6)
|
||||||
|
|
||||||
Text("Expires on :")
|
Text("Expires on :")
|
||||||
.font(.system(size: 12))
|
.font(.system(size: 12))
|
||||||
.foregroundColor(.themeTextMessageMain)
|
.foregroundColor(.themeTextMessageMain)
|
||||||
.padding(.top, 2)
|
.padding(.top, 2)
|
||||||
|
|
||||||
Text("March 15, 2025")
|
Text("March 15, 2025")
|
||||||
.font(.system(size: 12))
|
.font(.system(size: 12))
|
||||||
.fontWeight(.bold)
|
.fontWeight(.bold)
|
||||||
.foregroundColor(.themeTextMessageMain)
|
.foregroundColor(.themeTextMessageMain)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.padding(.leading, 32)
|
.padding(.leading, 32)
|
||||||
// 可以添加内边距使内容不紧贴边缘
|
// 可以添加内边距使内容不紧贴边缘
|
||||||
.padding(.vertical, 12)
|
.padding(.vertical, 12)
|
||||||
|
}
|
||||||
|
.frame(height: 112)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.cornerRadius(16)
|
||||||
|
.clipped() // 确保内容不会超出边界
|
||||||
}
|
}
|
||||||
.frame(height: 112)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.cornerRadius(16)
|
|
||||||
.clipped() // 确保内容不会超出边界
|
|
||||||
|
|
||||||
VStack(spacing: 12) {
|
VStack(spacing: 12) {
|
||||||
// upload
|
// upload
|
||||||
@ -281,6 +301,24 @@ struct UserProfileModal: View {
|
|||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
isLoading = false
|
isLoading = false
|
||||||
|
|
||||||
|
switch result {
|
||||||
|
case .success(let response):
|
||||||
|
self.userProfile = response.data
|
||||||
|
print("✅ Successfully fetched user info:", response.data)
|
||||||
|
case .failure(let error):
|
||||||
|
self.errorMessage = error.localizedDescription
|
||||||
|
print("❌ Failed to fetch user info:", error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 会员信息
|
||||||
|
NetworkService.shared.get(
|
||||||
|
path: "/membership/personal-center-info",
|
||||||
|
parameters: nil
|
||||||
|
) { (result: Result<APIResponse<UserProfile>, NetworkError>) in
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
isLoading = false
|
||||||
|
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let response):
|
case .success(let response):
|
||||||
self.userProfile = response.data
|
self.userProfile = response.data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user