拆分宣传页视图并扩充 Mock 数据,合作订单支持获客员备注名并修复线索图片网格尺寸。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -218,26 +218,37 @@ struct ReferralLeadImageGrid: View {
|
||||
} else {
|
||||
HStack(spacing: 8) {
|
||||
ForEach(0..<3, id: \.self) { index in
|
||||
if index < images.count, let url = URL(string: images[index]) {
|
||||
imageCell(at: index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 渲染单个网格位,先固定 1:1 容器再填充图片,避免 Kingfisher 按原图尺寸撑开导致格子大小不一。
|
||||
@ViewBuilder
|
||||
private func imageCell(at index: Int) -> some View {
|
||||
Group {
|
||||
if index < images.count, let url = URL(string: images[index]) {
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.fill(CooperationOrderColors.imagePlaceholderBg)
|
||||
.overlay {
|
||||
KFImage(url)
|
||||
.placeholder { CooperationOrderColors.imagePlaceholderBg }
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(maxWidth: .infinity)
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
onImageTap(images, index)
|
||||
}
|
||||
} else {
|
||||
Color.clear
|
||||
.frame(maxWidth: .infinity)
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(maxWidth: .infinity)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
guard index < images.count else { return }
|
||||
onImageTap(images, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,35 +301,46 @@ struct AcquisitionOrderCard: View {
|
||||
struct CooperativeSalerCard: View {
|
||||
let acquirer: CooperativeSaler
|
||||
let onDial: (String) -> Void
|
||||
let onEditRemark: () -> Void
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center, spacing: 0) {
|
||||
Image(systemName: "person.fill")
|
||||
.font(.system(size: 20))
|
||||
.foregroundStyle(CooperationOrderColors.primary)
|
||||
.padding(10)
|
||||
.background(CooperationOrderColors.primary.opacity(0.08), in: RoundedRectangle(cornerRadius: 8))
|
||||
ZStack(alignment: .topTrailing) {
|
||||
HStack(alignment: .center, spacing: 0) {
|
||||
Image(systemName: "person.fill")
|
||||
.font(.system(size: 20))
|
||||
.foregroundStyle(CooperationOrderColors.primary)
|
||||
.padding(10)
|
||||
.background(CooperationOrderColors.primary.opacity(0.08), in: RoundedRectangle(cornerRadius: 8))
|
||||
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
AcquirerInfoRow(
|
||||
label: "获客员名称",
|
||||
value: acquirer.displayName.isEmpty ? "—" : acquirer.displayName,
|
||||
emphasize: true
|
||||
)
|
||||
AcquirerPhoneInfoRow(phone: acquirer.displayPhone, onDial: onDial)
|
||||
AcquirerInfoRow(
|
||||
label: "绑定时间",
|
||||
value: acquirer.displayBindTime.isEmpty ? "—" : acquirer.displayBindTime
|
||||
)
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
AcquirerInfoRow(
|
||||
label: "获客员名称",
|
||||
value: acquirer.displayName.isEmpty ? "—" : acquirer.displayName,
|
||||
emphasize: true
|
||||
)
|
||||
AcquirerPhoneInfoRow(phone: acquirer.displayPhone, onDial: onDial)
|
||||
AcquirerInfoRow(
|
||||
label: "绑定时间",
|
||||
value: acquirer.displayBindTime.isEmpty ? "—" : acquirer.displayBindTime
|
||||
)
|
||||
}
|
||||
.padding(.leading, 12)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.padding(.leading, 12)
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.vertical, 16)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.background(.white, in: RoundedRectangle(cornerRadius: 10))
|
||||
.shadow(color: Color.black.opacity(0.06), radius: 1, x: 0, y: 1)
|
||||
|
||||
Button("修改备注") {
|
||||
onEditRemark()
|
||||
}
|
||||
.font(.system(size: 13))
|
||||
.foregroundStyle(CooperationOrderColors.primary)
|
||||
.padding(.top, 16)
|
||||
.padding(.trailing, 14)
|
||||
}
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.vertical, 16)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.background(.white, in: RoundedRectangle(cornerRadius: 10))
|
||||
.shadow(color: Color.black.opacity(0.06), radius: 1, x: 0, y: 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user