[Snow Team] frontend-fixer-2: auto-commit work
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
type Order,
|
||||
type PaymentOrder,
|
||||
} from '@/features/orders/api/orders'
|
||||
import { formatMoney } from '@/shared/utils/money'
|
||||
import { centToYuan, formatMoney } from '@/shared/utils/money'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { formatDateMinute } from '@/utils/time'
|
||||
import { formatListingNo } from '@/utils/listingDisplay'
|
||||
@@ -131,15 +131,21 @@ function amountLabel(order: Order) {
|
||||
return isOwner(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)
|
||||
return Number(order.rent_amount ?? order.display_amount ?? 0)
|
||||
if (isOwner(order)) return amountYuan(order.owner_rent_amount_cent, order.owner_rent_amount ?? order.display_amount)
|
||||
return amountYuan(order.rent_amount_cent, order.rent_amount ?? 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 formatListingCode(order: Order) {
|
||||
@@ -232,9 +238,9 @@ async function copyListingCode(order: Order) {
|
||||
<div class="price-item">
|
||||
<span class="price-label">押金金额</span>
|
||||
<span class="price-val deposit">
|
||||
¥{{ 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>
|
||||
|
||||
Reference in New Issue
Block a user