修复离线路径误弹位置上报超时窗,并优化提醒设置与定位 Loading 展示。
离线或倒计时未进入提醒窗口时不再弹出超时提醒;全局 Loading 支持按需展示定位文案,提前提醒选项抽成共用组件。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -80,6 +80,9 @@ struct SourcePersonRow: View {
|
||||
}
|
||||
|
||||
struct SourceLeadContent: View {
|
||||
/// 带客单缩略图固定三列等宽网格。
|
||||
private static let leadImageColumns = Array(repeating: GridItem(.flexible()), count: 3)
|
||||
|
||||
let lead: OrderSourceLead
|
||||
var compact = false
|
||||
var enablePhoneCall = true
|
||||
@ -123,14 +126,15 @@ struct SourceLeadContent: View {
|
||||
.background(OrderSourceColors.imageEmptyBg, in: RoundedRectangle(cornerRadius: 6))
|
||||
}
|
||||
} else {
|
||||
HStack(spacing: 8) {
|
||||
ForEach(Array(lead.images.prefix(3).enumerated()), id: \.offset) { index, imageUrl in
|
||||
leadThumbnail(imageUrl: imageUrl, index: index)
|
||||
}
|
||||
ForEach(0..<max(0, 3 - min(lead.images.count, 3)), id: \.self) { _ in
|
||||
Color.clear
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(maxWidth: .infinity)
|
||||
LazyVGrid(columns: Self.leadImageColumns, spacing: 8) {
|
||||
ForEach(0..<3, id: \.self) { index in
|
||||
if index < min(lead.images.count, 3) {
|
||||
leadThumbnail(imageUrl: lead.images[index], index: index)
|
||||
} else {
|
||||
Color.clear
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -138,21 +142,28 @@ struct SourceLeadContent: View {
|
||||
}
|
||||
|
||||
private func leadThumbnail(imageUrl: String, index: Int) -> some View {
|
||||
Group {
|
||||
if let url = URL(string: imageUrl), !imageUrl.isEmpty {
|
||||
KFImage(url)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
} else {
|
||||
OrderSourceColors.imageEmptyBg
|
||||
Color.clear
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(maxWidth: .infinity)
|
||||
.overlay {
|
||||
leadThumbnailImage(imageUrl: imageUrl)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
onImageTap(lead.images, index)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
onImageTap(lead.images, index)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func leadThumbnailImage(imageUrl: String) -> some View {
|
||||
if let url = URL(string: imageUrl), !imageUrl.isEmpty {
|
||||
KFImage(url)
|
||||
.placeholder { OrderSourceColors.imageEmptyBg }
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
} else {
|
||||
OrderSourceColors.imageEmptyBg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user