copinism-ios/copinism/Views/Shopping/ShoppingView.swift
2024-06-04 09:41:01 +08:00

79 lines
2.8 KiB
Swift

//
//
import SwiftUI
struct ShoppingView: View {
@State var searchText = "" //
var body: some View {
NavigationView {
VStack {
//
HStack {
Image(systemName: "magnifyingglass")
TextField("二手手机和电脑", text: $searchText)
Spacer()
Button {} label: {
Image(systemName: "mappin.circle.fill")
}
Button {} label: {
Image(systemName: "map")
}
Button {} label: {
Image(systemName: "list.bullet")
}
}
.padding(.horizontal, 12)
.foregroundStyle(.black)
//
ScrollView {
//
LazyVGrid(columns: [
GridItem(.fixed(90)),
GridItem(.fixed(90)),
GridItem(.fixed(90)),
GridItem(.fixed(90))
]) {
ForEach(0 ..< 8) { index in
VStack {
Image("image-4")
.resizable()
.frame(width: 50, height: 50)
.aspectRatio(contentMode: .fit)
Text("列表\(index)")
}
}
}
.padding(.top, 20)
//
HStack(alignment: .top, spacing: 4) {
VStack {
// CardView(banner: "image-1", title: "", avatar: "avatar", userName: "")
// CardView(banner: "image-3", title: "", avatar: "avatar", userName: "")
// CardView(banner: "image-4", title: "", avatar: "avatar", userName: "")
}
VStack {
// CardView(banner: "image-2", title: "", avatar: "avatar", userName: "")
// CardView(banner: "image-1", title: "", avatar: "avatar", userName: "")
// CardView(banner: "image-3", title: "", avatar: "avatar", userName: "")
}
}
.background(.gray.opacity(0.1))
}
}
}
.toolbar(.hidden)
}
}
#Preview {
ShoppingView()
}