[Snow Team] frontend-fixer-2: auto-commit work

This commit is contained in:
yml
2026-06-09 17:04:40 +08:00
parent f5b38ff772
commit 42a54b474a
16 changed files with 376 additions and 130 deletions
@@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router'
import { CopyDocument, Search } from '@element-plus/icons-vue'
import { fetchOrders, type Order } from '@/features/orders'
import { formatMoney } from '@/shared/utils/money'
import { centToYuan, formatMoney } from '@/shared/utils/money'
import { useSessionStore } from '@/stores/session'
import { orderStatusLabel } from '@/utils/statusLabels'
import { formatDateTime } from '@/utils/time'
@@ -127,16 +127,22 @@ function amountLabel(order: Order) {
return isRenter(order) ? '支付租金' : '预计租金'
}
function amountYuan(cent: unknown, legacyYuan?: unknown) {
if (cent !== undefined && cent !== null) return centToYuan(Number(cent || 0))
return Number(legacyYuan || 0)
}
function orderRentAmount(order: Order) {
if (isOwner(order)) return Number(order.owner_rent_amount ?? order.display_amount ?? 0)
if (isRenter(order)) return Number(order.rent_amount ?? order.display_amount ?? 0)
return Number(order.display_amount ?? 0)
if (isOwner(order)) return amountYuan(order.owner_rent_amount_cent, order.owner_rent_amount ?? order.display_amount)
if (isRenter(order)) return amountYuan(order.rent_amount_cent, order.rent_amount ?? order.display_amount)
return amountYuan(order.display_amount_cent, order.display_amount)
}
function ownerActualIncome(order: Order) {
if (!isOwner(order)) return null
const value = order.checkout?.owner_income_amount
return typeof value === 'number' ? value : null
const value = order.checkout?.owner_income_amount_cent
if (typeof value === 'number') return centToYuan(value)
return typeof order.checkout?.owner_income_amount === 'number' ? order.checkout.owner_income_amount : null
}
function money(value: unknown) {
@@ -351,9 +357,9 @@ function getCountdownMinutes(order: Order) {
<div class="meta-row">
<span class="meta-label">押金</span>
<span class="meta-value">
¥{{ money(order.deposit_amount) }}
<em v-if="order.deposit_waived_amount > 0"
> ¥{{ money(order.deposit_waived_amount) }}</em
¥{{ money(amountYuan(order.deposit_amount_cent, order.deposit_amount)) }}
<em v-if="amountYuan(order.deposit_waived_amount_cent, order.deposit_waived_amount) > 0"
> ¥{{ money(amountYuan(order.deposit_waived_amount_cent, order.deposit_waived_amount)) }}</em
>
</span>
</div>