ɹ
ɹ
let receiptImage = try await Receipt {
if let src = receiptSetting.logoImageURL {
Image(src: src)
.maxHeight(96)
}
Title(“͝ར༻໌ࡉ")
Divider()
VStack(spacing: 2) {
for item in items {
if item.quantity >= 2 {
Text(item.name)
.truncated()
LabelText(label: "\(item.price) x \(item.quantity)",
content: item.totalPrice)
} else {
LabelText(label: item.name,
content: item.totalPrice)
.truncated()
}
}
}
}.image(width: 240)
var xml = ""
if let src = receiptSetting.logoImageURL?.absoluteString {
xml += "
\%22)
”
}
xml += """
͝ར༻໌ࡉ
"""
for item in items {
if item.quantity >= 2 {
let label = "(item.price) x \(item.quantity)"
xml += """
\(item.name)
\(item.totalPrice)
“""
} else {
xml += ""
xml += "\(item.totalPrice)"
xml += ""
}
}
// ~ লུ ~
xml += ""
return xml
After: resultBuilder利用