This commit is contained in:
2024-01-24 18:02:39 +08:00
parent e681d68c65
commit 2d7d3dc836
7 changed files with 161 additions and 50 deletions

View File

@@ -13,10 +13,10 @@ struct HomeView: View {
var body: some View {
ScrollView {
VStack(spacing: 12) {
Search
// Search
// Banner
// Navigation
// TodayKill
TodayKill
// Living
// Bestselling
// PartyReading
@@ -174,46 +174,68 @@ struct HomeView: View {
var TodayKill: some View {
VStack(alignment: .leading) {
HStack {
Text("今日秒杀")
Text("00:00:00")
}
HStack {
Image("Images/LaunchScreen")
.resizable(resizingMode: /*@START_MENU_TOKEN@*/ .stretch/*@END_MENU_TOKEN@*/)
.aspectRatio(contentMode: .fit)
.frame(maxWidth: 120)
VStack {
Text("石床垫:阿特伍德黑暗就故事(有的人说啥就是啥呢有的人说啥就是啥呢有的人说啥就是啥呢)")
.multilineTextAlignment(/*@START_MENU_TOKEN@*/ .leading/*@END_MENU_TOKEN@*/)
.lineLimit(/*@START_MENU_TOKEN@*/2/*@END_MENU_TOKEN@*/)
VStack(alignment: .leading) {
HStack {
Text("今日秒杀")
.foregroundColor(Color.white)
Text("¥19.99")
.foregroundColor(Color.red)
.padding(12)
.cornerRadius(12)
.background(Color.white)
HStack {
Text("抢购")
Image(systemName: "chevron.forward")
}
.foregroundColor(Color.white)
KillCountDown()
}
}
HStack {
ForEach(0 ..< 5) { _ in
.padding(8)
.background(LinearGradient(colors: [Color.yellow.opacity(0.3), Color.white.opacity(0.3)], startPoint: .leading, endPoint: .bottom))
HStack(spacing: 12) {
Image("Images/LaunchScreen")
.resizable(resizingMode: /*@START_MENU_TOKEN@*/ .stretch/*@END_MENU_TOKEN@*/)
.frame(maxWidth: 120, maxHeight: 150)
.overlay(alignment: .bottom) {
Text("剩余100")
.font(.system(size: 14))
.foregroundColor(Color.white)
.frame(maxWidth: .infinity)
.padding(.vertical, 4)
.background(Color.red.opacity(0.5))
}
.cornerRadius(8)
VStack {
Image("Images/LaunchScreen")
.resizable(resizingMode: /*@START_MENU_TOKEN@*/ .stretch/*@END_MENU_TOKEN@*/)
.aspectRatio(contentMode: .fit)
.frame(maxWidth: 120)
Text("是石床垫:阿特伍德黑暗就故事")
.lineLimit(1)
Text("石床垫:阿特伍德黑暗就故事(有的人说啥就是啥呢有的人说啥就是啥呢有的人说啥就是啥呢)")
.font(.title2)
.multilineTextAlignment(/*@START_MENU_TOKEN@*/ .leading/*@END_MENU_TOKEN@*/)
.lineLimit(/*@START_MENU_TOKEN@*/2/*@END_MENU_TOKEN@*/)
.foregroundColor(Color.white)
Text("¥19.99")
.foregroundColor(Color.red)
.padding(12)
.cornerRadius(12)
.background(Color.white)
HStack {
Text("抢购")
Image(systemName: "chevron.forward")
}
.foregroundColor(Color.white)
}
.frame(height: 150)
}
}
.padding(12)
VStack {
ScrollView(.horizontal) {
HStack {
ForEach(0 ..< 8) { _ in
VStack {
Image("Images/LaunchScreen")
.antialiased(true)
.resizable(resizingMode: .stretch)
.frame(maxWidth: 100, maxHeight: 130)
Text("是石床垫:阿特伍德黑暗就故事")
.font(.system(size: 14))
.lineLimit(1)
CamelPrice(amount: 19.99, size: 12)
}
.padding(4)
.frame(maxWidth: 110)
.background(Color.white)
.cornerRadius(4)
}
}
.frame(maxWidth: 110)
.background(Color.white)
}
}
.padding(12)