test
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct UserView: View {
|
||||
@State private var showDetail = false
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
Header
|
||||
@@ -21,9 +23,8 @@ struct UserView: View {
|
||||
tj
|
||||
}
|
||||
.padding(16)
|
||||
.background(LinearGradient(colors: [Color.orange, Color.gray], startPoint: .top, endPoint: UnitPoint(x: 0, y: 0.5)))
|
||||
.background(Color.gray.opacity(0.2))
|
||||
.cornerRadius(12)
|
||||
.offset(y: -76)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,11 +52,17 @@ struct UserView: View {
|
||||
Image(systemName: "gearshape")
|
||||
.foregroundColor(Color.gray)
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.horizontal, 24)
|
||||
}
|
||||
|
||||
var ToVip: some View {
|
||||
HStack(spacing: /*@START_MENU_TOKEN@*/nil/*@END_MENU_TOKEN@*/, content: {
|
||||
Text("VIP de yixie 简介部分")
|
||||
Button(action: {
|
||||
self.showDetail.toggle()
|
||||
}, label: {
|
||||
Text("详情")
|
||||
})
|
||||
Spacer()
|
||||
Button("立即开通") {}
|
||||
.foregroundColor(Color.red)
|
||||
@@ -68,6 +75,8 @@ struct UserView: View {
|
||||
.padding(16)
|
||||
.padding(.bottom, 64)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: showDetail ? 100 : 200)
|
||||
.animation(.default, value: showDetail)
|
||||
.background(
|
||||
Image("Images/banner3").resizable(resizingMode: .tile)
|
||||
// .overlay(
|
||||
@@ -82,17 +91,7 @@ struct UserView: View {
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: 16) {
|
||||
ForEach(/*@START_MENU_TOKEN@*/0 ..< 5/*@END_MENU_TOKEN@*/) { _ in
|
||||
VStack {
|
||||
HStack {
|
||||
Image(systemName: "star")
|
||||
Text("我的积分")
|
||||
}
|
||||
Text("共8888分")
|
||||
.font(.caption)
|
||||
}
|
||||
.padding(12)
|
||||
.background(Color.white)
|
||||
.cornerRadius(8)
|
||||
UserAccountCard(model: UserAccountCardModel(title: "我的积分", icon: "star", info: "共30001分"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user