import SwiftUI /// 单张优惠券卡片,对齐安卓 FeedCard:图 + 券名 + 门店 + 到手价/原价 + 「抢」。 struct CouponCardView: View { let card: CouponCard let onTap: () -> Void var body: some View { HStack(spacing: 12) { AsyncImage(url: URL(string: card.headImageUrl)) { phase in switch phase { case .success(let image): image.resizable().aspectRatio(contentMode: .fill) default: AppColors.gray100 } } .frame(width: 84, height: 84) .clipShape(RoundedRectangle(cornerRadius: 10)) VStack(alignment: .leading, spacing: 4) { Text(card.name) .font(.subheadline) .lineLimit(2) if let poi = card.poiName, !poi.isEmpty { Text(poi) .font(.caption) .foregroundStyle(.secondary) .lineLimit(1) } HStack(alignment: .firstTextBaseline, spacing: 6) { Text("¥\(card.sellPrice)") .font(.headline) .foregroundStyle(AppColors.hot) Text("¥\(card.originalPrice)") .font(.caption) .strikethrough() .foregroundStyle(.secondary) if let dist = card.distanceText, !dist.isEmpty { Spacer(minLength: 0) Text(dist).font(.caption2).foregroundStyle(.secondary) } } } Button(action: onTap) { Text("抢") .font(.subheadline.bold()) .padding(.horizontal, 18) .padding(.vertical, 8) .background(AppColors.primary) .foregroundStyle(.black) .clipShape(Capsule()) } .buttonStyle(.plain) } .padding(.vertical, 6) } }