This commit is contained in:
2024-01-22 18:13:01 +08:00
parent b4f90a9019
commit 8c2daac591
23 changed files with 605 additions and 55 deletions

View File

@@ -8,17 +8,86 @@
import SwiftUI
struct UserView: View {
@State private var toLogin: Bool = false
var body: some View {
ScrollView {
VStack (alignment: .leading) {
UserCardComponent()
Text("item")
NavigationView {
ScrollView {
VStack (alignment: .leading, spacing: 12) {
Header
ToVip
//
// NavigationLink(destination: LoginView(), label: {
// Text("qu zhuce ")
// })
// Button(""){
// toLogin = true
// }
// .padding(.vertical, 12)
// .padding(.horizontal, 32)
// .foregroundColor(.white)
// .background(Color.blue)
// .cornerRadius(12)
// .fullScreenCover(isPresented: $toLogin, content: {
// LoginView()
// })
}
}
}
.background(Color.red)
}
var Header : some View {
HStack {
Image("Images/logo")
.resizable()
.frame(width: 64, height: 64)
.cornerRadius(32)
.overlay(
RoundedRectangle(cornerRadius: 32, style: .continuous)
.stroke(Color.red, lineWidth: 2)
)
VStack (alignment: .leading, spacing: 12, content: {
Text("用户名称")
.font(.title2)
.fontWeight(.regular)
Text("我的用户简介,超出部分需要隐藏,隐藏需要自动设置,这个文字长度也要有约束")
.font(.caption)
.foregroundColor(Color.gray)
.lineLimit(1)
})
Image(systemName: "gearshape")
.foregroundColor(Color.gray)
}
.padding(.horizontal, 16)
}
var ToVip: some View {
HStack(spacing: /*@START_MENU_TOKEN@*/nil/*@END_MENU_TOKEN@*/, content: {
Spacer()
Button("立即开通") {
}
.foregroundColor(Color.red)
.font(.subheadline)
.padding(.vertical, 8)
.padding(.horizontal, 16)
.background(Color.gray)
.cornerRadius(32)
})
.padding(16)
.frame(maxWidth: .infinity)
.frame( height: 64)
.background(Image("Images/banner3").resizable().cornerRadius(/*@START_MENU_TOKEN@*/12.0/*@END_MENU_TOKEN@*/))
.padding(.horizontal, 16)
}
}
#Preview {
UserView()
}