init
This commit is contained in:
39
demo/Components/GoodsCard.swift
Normal file
39
demo/Components/GoodsCard.swift
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// GoodsCard.swift
|
||||
// demo
|
||||
//
|
||||
// Created by Jason on 2024/1/23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct GoodsCard: View {
|
||||
func getHeight() -> CGFloat {
|
||||
(UIScreen.main.bounds.width - 24 - 12) / 2 * 1.2
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image("Images/LaunchScreen")
|
||||
.resizable()
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(maxHeight: getHeight())
|
||||
VStack(spacing: 4) {
|
||||
Text("苏东坡专辑,谁谁会注解的内容哦")
|
||||
.font(.subheadline)
|
||||
.lineLimit(1)
|
||||
HStack(alignment: .bottom) {
|
||||
CamelPrice(amount: 125.9229, size: 16)
|
||||
Spacer()
|
||||
Text("100+付款")
|
||||
.foregroundColor(Color.gray)
|
||||
.font(.caption)
|
||||
.baselineOffset(2)
|
||||
}
|
||||
}
|
||||
.padding(4)
|
||||
}
|
||||
.background(Color.white)
|
||||
.cornerRadius(8)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user