fix: align photo unit prices and update purchase labels
This commit is contained in:
@@ -149,16 +149,26 @@ fun FaceRecognitionResultScreen(
|
||||
colors = CardDefaults.cardColors(containerColor = Color(0xFFF4F4F4))
|
||||
) {
|
||||
Column(Modifier.fillMaxWidth().padding(24.dp)) {
|
||||
Text("已选择 ${selectedCount} 张", fontSize = 24.sp, fontWeight = FontWeight.Bold)
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text("已选择 ${selectedCount} 张", fontSize = 24.sp, fontWeight = FontWeight.Bold)
|
||||
Spacer(Modifier.weight(1f))
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(20.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text("打印版 ${formatPriceDisplay(pricePerPhoto)}元/张", fontSize = 21.sp)
|
||||
Text("电子版 ${formatPriceDisplay(electronicPrice)}元/张", fontSize = 21.sp)
|
||||
}
|
||||
}
|
||||
Spacer(Modifier.height(16.dp))
|
||||
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
PurchaseMode.entries.forEach { mode ->
|
||||
val isPrint = mode == PurchaseMode.PRINT
|
||||
val unit = if (isPrint) pricePerPhoto else electronicPrice
|
||||
val total = if (isPrint) totalPrice else electronicTotal
|
||||
Column(Modifier.weight(1f)) {
|
||||
Text("${mode.label} ${formatPriceDisplay(unit)}元/张", fontSize = 21.sp)
|
||||
Spacer(Modifier.height(12.dp))
|
||||
Button(
|
||||
onClick = { viewModel.getPayUrl(mode) { showPayDialog = true } },
|
||||
enabled = selectedCount > 0 && total != "--" && !creatingOrder && !quoteLoading,
|
||||
@@ -171,7 +181,7 @@ fun FaceRecognitionResultScreen(
|
||||
) {
|
||||
Text(
|
||||
text = if (!isPrint && total == "--" && !quoteLoading)
|
||||
"电子版暂不可购买" else "支付${mode.label}\n${formatPriceDisplay(total)}元",
|
||||
"电子版暂不可购买" else "${if (isPrint) "购买打印照片" else "购买电子照片"}\n${formatPriceDisplay(total)}元",
|
||||
textAlign = TextAlign.Center,
|
||||
fontSize = 24.sp,
|
||||
lineHeight = 32.sp,
|
||||
|
||||
Reference in New Issue
Block a user