金额使用整数, 不再扣押金, 价格每个人看到自己的-1
This commit is contained in:
@@ -16,10 +16,12 @@ export interface Order {
|
||||
login_platform: string
|
||||
rented_at?: string
|
||||
estimated_duration_hours: number
|
||||
rent_amount: number
|
||||
owner_rent_amount: number
|
||||
price_role?: 'renter' | 'owner' | 'admin' | string
|
||||
display_amount: number
|
||||
rent_amount?: number
|
||||
owner_rent_amount?: number
|
||||
deposit_amount: number
|
||||
platform_fee: number
|
||||
platform_fee?: number
|
||||
account_snapshot?: Record<string, unknown>
|
||||
status: OrderStatus
|
||||
handoff_status: HandoffStatus
|
||||
@@ -34,16 +36,18 @@ export interface Checkout {
|
||||
order_id: number
|
||||
initiated_by: number
|
||||
status: SettlementStatus
|
||||
rent_amount: number
|
||||
owner_rent_amount: number
|
||||
platform_fee: number
|
||||
price_role?: 'renter' | 'owner' | 'admin' | string
|
||||
display_amount: number
|
||||
rent_amount?: number
|
||||
owner_rent_amount?: number
|
||||
platform_fee?: number
|
||||
deposit_amount: number
|
||||
consumable_amount: number
|
||||
coin_consumed_m: number
|
||||
other_amount: number
|
||||
deposit_deduct_amount: number
|
||||
renter_refund_amount: number
|
||||
owner_income_amount: number
|
||||
renter_refund_amount?: number
|
||||
owner_income_amount?: number
|
||||
content: string
|
||||
evidence_urls: string[]
|
||||
owner_adjustment_reason: string
|
||||
|
||||
@@ -13,7 +13,7 @@ export const dailyLossOptions = [10, 20, 30, 40, 50]
|
||||
export const commonOnlineTimes = ['00:00', '08:00', '10:00', '12:00', '14:00', '18:00', '20:00', '22:00', '23:59']
|
||||
|
||||
export function roundMoney(value: number) {
|
||||
return Math.round(value * 100) / 100
|
||||
return Math.round(value)
|
||||
}
|
||||
|
||||
export function roundRatio(value: number) {
|
||||
|
||||
@@ -64,6 +64,7 @@ const disputeEvidenceText = ref('')
|
||||
|
||||
const isOwner = computed(() => order.value?.owner_id === session.userId)
|
||||
const isRenter = computed(() => order.value?.renter_id === session.userId)
|
||||
const orderAmountLabel = computed(() => (isOwner.value ? '我的租金' : '订单金额'))
|
||||
const canOpenDispute = computed(() => {
|
||||
if (!order.value || (!isOwner.value && !isRenter.value)) return false
|
||||
return !['completed', 'cancelled', 'closed', 'disputing', 'checkout_disputing', 'abnormal'].includes(order.value.status)
|
||||
@@ -86,10 +87,10 @@ const resourceChargeAmount = computed(() => {
|
||||
})
|
||||
const snapshotHafCoinM = computed(() => {
|
||||
const snapshot = readSnapshot()
|
||||
return roundMoney(readNumber(snapshot?.haf_coin_amount) / 1000000)
|
||||
return roundQuantity(readNumber(snapshot?.haf_coin_amount) / 1000000)
|
||||
})
|
||||
const remainingHafCoinM = computed(() => {
|
||||
return roundMoney(Math.max(snapshotHafCoinM.value - Number(checkoutForm.value.coin_consumed_m || 0), 0))
|
||||
return roundQuantity(Math.max(snapshotHafCoinM.value - Number(checkoutForm.value.coin_consumed_m || 0), 0))
|
||||
})
|
||||
|
||||
onMounted(loadOrder)
|
||||
@@ -387,12 +388,12 @@ function checkoutContentWithSummary() {
|
||||
if (usedResources.length) {
|
||||
lines.push(
|
||||
`额外消耗品:${usedResources
|
||||
.map((item) => `${item.label} ${readResourceUsage(item.key)}/${item.quantity}${isChargedResource(item) ? `,扣款¥${resourceLineAmount(item).toFixed(2)}` : ',赠送不扣款'}`)
|
||||
.map((item) => `${item.label} ${readResourceUsage(item.key)}/${item.quantity}${isChargedResource(item) ? `,金额¥${money(resourceLineAmount(item))}` : ',赠送不扣款'}`)
|
||||
.join(';')}`,
|
||||
)
|
||||
}
|
||||
if (Number(checkoutForm.value.coin_consumed_m || 0) > 0) {
|
||||
lines.push(`哈夫币消耗:${Number(checkoutForm.value.coin_consumed_m).toFixed(2)}M,预计剩余${remainingHafCoinM.value.toFixed(2)}M`)
|
||||
lines.push(`哈夫币消耗:${quantity(Number(checkoutForm.value.coin_consumed_m))}M,预计剩余${quantity(remainingHafCoinM.value)}M`)
|
||||
}
|
||||
if (lines.length === 0) {
|
||||
lines.push('租客发起结账。')
|
||||
@@ -415,9 +416,22 @@ function readUnitPrice(priceText: string) {
|
||||
}
|
||||
|
||||
function roundMoney(value: number) {
|
||||
return Math.round(value)
|
||||
}
|
||||
|
||||
function roundQuantity(value: number) {
|
||||
return Math.round(value * 100) / 100
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return `${roundMoney(readNumber(value))}`
|
||||
}
|
||||
|
||||
function quantity(value: unknown) {
|
||||
const rounded = roundQuantity(readNumber(value))
|
||||
return Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(2)
|
||||
}
|
||||
|
||||
function readNumber(value: unknown) {
|
||||
const number = Number(value || 0)
|
||||
return Number.isFinite(number) ? number : 0
|
||||
@@ -462,16 +476,12 @@ function linesToList(value: string) {
|
||||
<strong>{{ handoffStatusLabel(order.handoff_status) }}</strong>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span>订单金额</span>
|
||||
<strong>¥{{ order.rent_amount }}</strong>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span>平台费用</span>
|
||||
<strong>¥{{ order.platform_fee }}</strong>
|
||||
<span>{{ orderAmountLabel }}</span>
|
||||
<strong>¥{{ money(order.display_amount) }}</strong>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span>押金</span>
|
||||
<strong>¥{{ order.deposit_amount }}</strong>
|
||||
<strong>¥{{ money(order.deposit_amount) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -518,7 +528,7 @@ function linesToList(value: string) {
|
||||
<div class="checkout-resource-panel panel-action">
|
||||
<div class="checkout-resource-head">
|
||||
<strong>额外消耗品</strong>
|
||||
<span>扣款合计:¥{{ resourceChargeAmount.toFixed(2) }}</span>
|
||||
<span>金额合计:¥{{ money(resourceChargeAmount) }}</span>
|
||||
</div>
|
||||
<el-empty v-if="checkoutResources.length === 0" description="订单快照中暂无额外消耗品" />
|
||||
<div v-for="item in checkoutResources" v-else :key="item.key" class="checkout-resource-row">
|
||||
@@ -533,16 +543,16 @@ function linesToList(value: string) {
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
/>
|
||||
<span class="checkout-resource-amount">¥{{ resourceLineAmount(item).toFixed(2) }}</span>
|
||||
<span class="checkout-resource-amount">¥{{ money(resourceLineAmount(item)) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-form class="form-grid panel-action" label-position="top">
|
||||
<el-form-item label="消耗哈夫币(M)">
|
||||
<el-input-number v-model="checkoutForm.coin_consumed_m" class="full-control" :min="0" :max="snapshotHafCoinM" :precision="2" controls-position="right" />
|
||||
<span class="field-hint">订单快照 {{ snapshotHafCoinM.toFixed(2) }}M,预计剩余 {{ remainingHafCoinM.toFixed(2) }}M</span>
|
||||
<span class="field-hint">订单快照 {{ quantity(snapshotHafCoinM) }}M,预计剩余 {{ quantity(remainingHafCoinM) }}M</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="其他扣款(元)">
|
||||
<el-input-number v-model="checkoutForm.other_amount" class="full-control" :min="0" :precision="2" controls-position="right" />
|
||||
<el-input-number v-model="checkoutForm.other_amount" class="full-control" :min="0" :precision="0" controls-position="right" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-input
|
||||
@@ -557,9 +567,10 @@ function linesToList(value: string) {
|
||||
|
||||
<div v-if="order && order.checkout && ['pending_checkout_confirm', 'pending_checkout_accept'].includes(order.status)" class="order-panel">
|
||||
<h2>结账明细</h2>
|
||||
<p>买家租金:¥{{ order.checkout.rent_amount }},号主租金:¥{{ order.checkout.owner_rent_amount }},平台费用:¥{{ order.checkout.platform_fee }}</p>
|
||||
<p>押金:¥{{ order.checkout.deposit_amount }}</p>
|
||||
<p>扣除:¥{{ order.checkout.deposit_deduct_amount }},退还租客:¥{{ order.checkout.renter_refund_amount }},号主收入:¥{{ order.checkout.owner_income_amount }}</p>
|
||||
<p>{{ orderAmountLabel }}:¥{{ money(order.checkout.display_amount) }},押金:¥{{ money(order.checkout.deposit_amount) }}</p>
|
||||
<p>额外消耗品金额:¥{{ money(order.checkout.consumable_amount) }},押金扣除:¥{{ money(order.checkout.deposit_deduct_amount) }}</p>
|
||||
<p v-if="isRenter">退还租客:¥{{ money(order.checkout.renter_refund_amount) }}</p>
|
||||
<p v-if="isOwner">号主收入:¥{{ money(order.checkout.owner_income_amount) }}</p>
|
||||
<p v-if="order.checkout.content">说明:{{ order.checkout.content }}</p>
|
||||
<p v-if="order.checkout.owner_adjustment_reason">修正原因:{{ order.checkout.owner_adjustment_reason }}</p>
|
||||
</div>
|
||||
@@ -571,17 +582,17 @@ function linesToList(value: string) {
|
||||
|
||||
<h2 class="panel-action">修改结账</h2>
|
||||
<el-form class="form-grid" label-position="top">
|
||||
<el-form-item label="消耗扣款(元)">
|
||||
<el-input-number v-model="counterForm.consumable_amount" class="full-control" :min="0" :precision="2" controls-position="right" />
|
||||
<el-form-item label="额外消耗品金额(已含租金)">
|
||||
<el-input-number v-model="counterForm.consumable_amount" class="full-control" :min="0" :precision="0" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item label="消耗哈夫币(M)">
|
||||
<el-input-number v-model="counterForm.coin_consumed_m" class="full-control" :min="0" :precision="2" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item label="其他扣款(元)">
|
||||
<el-input-number v-model="counterForm.other_amount" class="full-control" :min="0" :precision="2" controls-position="right" />
|
||||
<el-input-number v-model="counterForm.other_amount" class="full-control" :min="0" :precision="0" controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item label="押金扣除(元)">
|
||||
<el-input-number v-model="counterForm.deposit_deduct_amount" class="full-control" :min="0" :max="order.deposit_amount" :precision="2" controls-position="right" />
|
||||
<el-input-number v-model="counterForm.deposit_deduct_amount" class="full-control" :min="0" :max="order.deposit_amount" :precision="0" controls-position="right" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-input v-model="counterForm.reason" class="panel-action" type="textarea" :rows="3" placeholder="填写修改原因" />
|
||||
|
||||
@@ -48,6 +48,10 @@ function orderRole(order: Order) {
|
||||
if (order.owner_id === session.userId) return '号主'
|
||||
return '-'
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return Math.round(Number(value || 0))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -61,8 +65,12 @@ function orderRole(order: Order) {
|
||||
<el-table v-loading="loading" class="table-panel" :data="orders">
|
||||
<el-table-column prop="order_no" label="订单号" min-width="210" />
|
||||
<el-table-column prop="title" label="账号" min-width="180" />
|
||||
<el-table-column prop="rent_amount" label="订单金额" width="100" />
|
||||
<el-table-column prop="deposit_amount" label="押金" width="100" />
|
||||
<el-table-column label="我的金额" width="100">
|
||||
<template #default="{ row }">¥{{ money(row.display_amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="押金" width="100">
|
||||
<template #default="{ row }">¥{{ money(row.deposit_amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份" width="80">
|
||||
<template #default="{ row }">{{ orderRole(row) }}</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -85,7 +85,7 @@ function readError(error: unknown, fallback: string) {
|
||||
|
||||
<div class="table-panel recharge-panel">
|
||||
<h2>开发充值</h2>
|
||||
<el-input-number v-model="rechargeAmount" :min="0.01" :precision="2" controls-position="right" />
|
||||
<el-input-number v-model="rechargeAmount" :min="1" :precision="0" controls-position="right" />
|
||||
<el-button type="primary" :loading="recharging" @click="handleRecharge">充值</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ async function loadDashboard() {
|
||||
}
|
||||
|
||||
function money(value?: number) {
|
||||
return `¥${Number(value || 0).toFixed(2)}`
|
||||
return `¥${Math.round(Number(value || 0))}`
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ function readError(error: unknown, fallback: string) {
|
||||
v-model="amount"
|
||||
class="full-control panel-action"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:precision="0"
|
||||
:step="10"
|
||||
placeholder="裁决金额"
|
||||
/>
|
||||
|
||||
@@ -54,7 +54,7 @@ async function submitAction() {
|
||||
}
|
||||
|
||||
function money(value: number) {
|
||||
return `¥${Number(value || 0).toFixed(2)}`
|
||||
return `¥${Math.round(Number(value || 0))}`
|
||||
}
|
||||
|
||||
function listingPrice(row: Listing) {
|
||||
|
||||
@@ -63,7 +63,7 @@ function openEvidence(row: Listing) {
|
||||
}
|
||||
|
||||
function listingPrice(row: Listing) {
|
||||
return `¥${Number(row.price || 0).toFixed(2)}`
|
||||
return `¥${Math.round(Number(row.price || 0))}`
|
||||
}
|
||||
|
||||
function extractObjectKey(url: string) {
|
||||
|
||||
@@ -39,7 +39,7 @@ function resetFilters() {
|
||||
}
|
||||
|
||||
function money(value: number) {
|
||||
return `¥${Number(value || 0).toFixed(2)}`
|
||||
return `¥${Math.round(Number(value || 0))}`
|
||||
}
|
||||
|
||||
function listingPrice(row: Listing) {
|
||||
|
||||
@@ -75,6 +75,10 @@ function orderEstimatedEndAt() {
|
||||
if (!rentedAt || durationHours <= 0) return undefined
|
||||
return new Date(new Date(rentedAt).getTime() + durationHours * 60 * 60 * 1000).toISOString()
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return Math.round(Number(value || 0))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -105,15 +109,15 @@ function orderEstimatedEndAt() {
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span>订单金额</span>
|
||||
<strong>¥{{ order.rent_amount }}</strong>
|
||||
<strong>¥{{ money(order.rent_amount) }}</strong>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span>平台费用</span>
|
||||
<strong>¥{{ order.platform_fee }}</strong>
|
||||
<strong>¥{{ money(order.platform_fee) }}</strong>
|
||||
</div>
|
||||
<div class="metric-card">
|
||||
<span>押金</span>
|
||||
<strong>¥{{ order.deposit_amount }}</strong>
|
||||
<strong>¥{{ money(order.deposit_amount) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ function handleSizeChange() {
|
||||
}
|
||||
|
||||
function money(value: number) {
|
||||
return `¥${value.toFixed(2)}`
|
||||
return `¥${Math.round(Number(value || 0))}`
|
||||
}
|
||||
|
||||
function directionType(direction: string) {
|
||||
|
||||
@@ -42,8 +42,8 @@ onMounted(async () => {
|
||||
});
|
||||
|
||||
const orderTotal = computed(() => {
|
||||
if (!listing.value) return "0.00";
|
||||
return getListingDisplayPrice(listing.value).toFixed(2);
|
||||
if (!listing.value) return "0";
|
||||
return `${Math.round(getListingDisplayPrice(listing.value))}`;
|
||||
});
|
||||
|
||||
const detailMetrics = computed(() => {
|
||||
|
||||
@@ -72,6 +72,7 @@ const showRejectPopup = ref(false);
|
||||
|
||||
const isOwner = computed(() => order.value?.owner_id === session.userId);
|
||||
const isRenter = computed(() => order.value?.renter_id === session.userId);
|
||||
const orderAmountLabel = computed(() => (isOwner.value ? "我的租金" : "订单金额"));
|
||||
const canOpenDispute = computed(() => {
|
||||
if (!order.value || (!isOwner.value && !isRenter.value)) return false;
|
||||
return !["completed", "cancelled", "closed", "disputing", "checkout_disputing", "abnormal"].includes(order.value.status);
|
||||
@@ -94,10 +95,10 @@ const resourceChargeAmount = computed(() => {
|
||||
});
|
||||
const snapshotHafCoinM = computed(() => {
|
||||
const snapshot = readSnapshot();
|
||||
return roundMoney(readNumber(snapshot?.haf_coin_amount) / 1000000);
|
||||
return roundQuantity(readNumber(snapshot?.haf_coin_amount) / 1000000);
|
||||
});
|
||||
const remainingHafCoinM = computed(() => {
|
||||
return roundMoney(Math.max(snapshotHafCoinM.value - Number(checkoutForm.value.coin_consumed_m || 0), 0));
|
||||
return roundQuantity(Math.max(snapshotHafCoinM.value - Number(checkoutForm.value.coin_consumed_m || 0), 0));
|
||||
});
|
||||
|
||||
onMounted(loadOrder);
|
||||
@@ -450,14 +451,14 @@ function checkoutContentWithSummary() {
|
||||
.map(
|
||||
(item) =>
|
||||
`${item.label} ${readResourceUsage(item.key)}/${item.quantity}${
|
||||
isChargedResource(item) ? `,扣款¥${resourceLineAmount(item).toFixed(2)}` : ",赠送不扣款"
|
||||
isChargedResource(item) ? `,金额¥${money(resourceLineAmount(item))}` : ",赠送不扣款"
|
||||
}`
|
||||
)
|
||||
.join(";")}`
|
||||
);
|
||||
}
|
||||
if (Number(checkoutForm.value.coin_consumed_m || 0) > 0) {
|
||||
lines.push(`哈夫币消耗:${Number(checkoutForm.value.coin_consumed_m).toFixed(2)}M,预计剩余${remainingHafCoinM.value.toFixed(2)}M`);
|
||||
lines.push(`哈夫币消耗:${quantity(Number(checkoutForm.value.coin_consumed_m))}M,预计剩余${quantity(remainingHafCoinM.value)}M`);
|
||||
}
|
||||
if (lines.length === 0) {
|
||||
lines.push("租客发起结账。");
|
||||
@@ -480,9 +481,22 @@ function readUnitPrice(priceText: string) {
|
||||
}
|
||||
|
||||
function roundMoney(value: number) {
|
||||
return Math.round(value);
|
||||
}
|
||||
|
||||
function roundQuantity(value: number) {
|
||||
return Math.round(value * 100) / 100;
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return `${roundMoney(readNumber(value))}`;
|
||||
}
|
||||
|
||||
function quantity(value: unknown) {
|
||||
const rounded = roundQuantity(readNumber(value));
|
||||
return Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(2);
|
||||
}
|
||||
|
||||
function readNumber(value: unknown) {
|
||||
const number = Number(value || 0);
|
||||
return Number.isFinite(number) ? number : 0;
|
||||
@@ -560,12 +574,12 @@ function getStatusTagType(status: string) {
|
||||
<h2 class="order-title">{{ order.title }}</h2>
|
||||
<div class="order-meta-grid">
|
||||
<div class="meta-item">
|
||||
<span class="meta-label">订单金额</span>
|
||||
<strong class="meta-value accent">¥{{ order.rent_amount }}</strong>
|
||||
<span class="meta-label">{{ orderAmountLabel }}</span>
|
||||
<strong class="meta-value accent">¥{{ money(order.display_amount) }}</strong>
|
||||
</div>
|
||||
<div class="meta-item">
|
||||
<span class="meta-label">押金</span>
|
||||
<strong class="meta-value">¥{{ order.deposit_amount }}</strong>
|
||||
<strong class="meta-value">¥{{ money(order.deposit_amount) }}</strong>
|
||||
</div>
|
||||
<div class="meta-item">
|
||||
<span class="meta-label">交接状态</span>
|
||||
@@ -711,12 +725,12 @@ function getStatusTagType(status: string) {
|
||||
min="0"
|
||||
:max="item.quantity"
|
||||
/>
|
||||
<span class="resource-line-amount">¥{{ resourceLineAmount(item).toFixed(2) }}</span>
|
||||
<span class="resource-line-amount">¥{{ money(resourceLineAmount(item)) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="resource-panel-footer">
|
||||
<span>物资费用扣款合计:</span>
|
||||
<strong>¥{{ resourceChargeAmount.toFixed(2) }}</strong>
|
||||
<span>物资金额合计:</span>
|
||||
<strong>¥{{ money(resourceChargeAmount) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -735,7 +749,7 @@ function getStatusTagType(status: string) {
|
||||
</template>
|
||||
</van-field>
|
||||
<div class="coin-hint">
|
||||
订单快照 {{ snapshotHafCoinM.toFixed(2) }}M,预计剩余 {{ remainingHafCoinM.toFixed(2) }}M
|
||||
订单快照 {{ quantity(snapshotHafCoinM) }}M,预计剩余 {{ quantity(remainingHafCoinM) }}M
|
||||
</div>
|
||||
<van-field label="其他费用" label-width="100px">
|
||||
<template #input>
|
||||
@@ -778,13 +792,12 @@ function getStatusTagType(status: string) {
|
||||
<section v-if="order.checkout && ['pending_checkout_confirm', 'pending_checkout_accept'].includes(order.status)" class="card-section">
|
||||
<h3 class="section-title">结账结算账单</h3>
|
||||
<van-cell-group inset :border="false">
|
||||
<van-cell title="买家租金" :value="`¥${order.checkout.rent_amount}`" />
|
||||
<van-cell title="号主实收租金" :value="`¥${order.checkout.owner_rent_amount}`" />
|
||||
<van-cell title="平台服务费" :value="`¥${order.checkout.platform_fee}`" />
|
||||
<van-cell title="押金总额" :value="`¥${order.checkout.deposit_amount}`" />
|
||||
<van-cell title="扣款总计" :value="`¥${order.checkout.deposit_deduct_amount}`" value-class="red-text" />
|
||||
<van-cell title="退还租客押金" :value="`¥${order.checkout.renter_refund_amount}`" value-class="green-text" />
|
||||
<van-cell title="号主最终收益" :value="`¥${order.checkout.owner_income_amount}`" value-class="green-text" />
|
||||
<van-cell :title="orderAmountLabel" :value="`¥${money(order.checkout.display_amount)}`" />
|
||||
<van-cell title="押金总额" :value="`¥${money(order.checkout.deposit_amount)}`" />
|
||||
<van-cell title="额外消耗品金额" :value="`¥${money(order.checkout.consumable_amount)}`" />
|
||||
<van-cell title="押金扣除" :value="`¥${money(order.checkout.deposit_deduct_amount)}`" value-class="red-text" />
|
||||
<van-cell v-if="isRenter" title="退还租客押金" :value="`¥${money(order.checkout.renter_refund_amount)}`" value-class="green-text" />
|
||||
<van-cell v-if="isOwner" title="号主最终收益" :value="`¥${money(order.checkout.owner_income_amount)}`" value-class="green-text" />
|
||||
<van-cell v-if="order.checkout.content" title="结账备注" :label="order.checkout.content" />
|
||||
<van-cell v-if="order.checkout.owner_adjustment_reason" title="号主修正原因" :label="order.checkout.owner_adjustment_reason" />
|
||||
</van-cell-group>
|
||||
|
||||
@@ -93,6 +93,10 @@ function readError(error: unknown, fallback: string) {
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return Math.round(Number(value || 0));
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -164,12 +168,12 @@ function readError(error: unknown, fallback: string) {
|
||||
|
||||
<div class="price-row">
|
||||
<div class="price-item">
|
||||
<span class="price-label">买家实付租金</span>
|
||||
<span class="price-val">¥{{ order.rent_amount }}</span>
|
||||
<span class="price-label">我的金额</span>
|
||||
<span class="price-val">¥{{ money(order.display_amount) }}</span>
|
||||
</div>
|
||||
<div class="price-item">
|
||||
<span class="price-label">押金金额</span>
|
||||
<span class="price-val deposit">¥{{ order.deposit_amount }}</span>
|
||||
<span class="price-val deposit">¥{{ money(order.deposit_amount) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -276,7 +276,7 @@ function resolveAvatarURL(url: string | undefined | null) {
|
||||
<div class="balance-row">
|
||||
<div class="balance-info">
|
||||
<span class="balance-label">账户可用余额(元)</span>
|
||||
<strong class="balance-value">¥{{ balance.toFixed(2) }}</strong>
|
||||
<strong class="balance-value">¥{{ Math.round(Number(balance || 0)) }}</strong>
|
||||
</div>
|
||||
<button class="withdraw-btn" @click="handleWithdraw">提现</button>
|
||||
</div>
|
||||
@@ -375,7 +375,7 @@ function resolveAvatarURL(url: string | undefined | null) {
|
||||
<span class="ledger-time">{{ formatDateMinute(item.created_at) }}</span>
|
||||
</div>
|
||||
<div class="ledger-right" :class="item.direction === 'in' ? 'in-color' : 'out-color'">
|
||||
{{ item.direction === 'in' ? '+' : '-' }}¥{{ item.amount.toFixed(2) }}
|
||||
{{ item.direction === 'in' ? '+' : '-' }}¥{{ Math.round(Number(item.amount || 0)) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -129,7 +129,7 @@ function getStatusText(item: Listing) {
|
||||
}
|
||||
|
||||
function listingPrice(item: Listing) {
|
||||
return getListingSellerPrice(item).toFixed(2)
|
||||
return `${Math.round(getListingSellerPrice(item))}`
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
@@ -197,7 +197,7 @@ function goBack() {
|
||||
|
||||
<div class="price-row">
|
||||
<span class="price-val">¥{{ listingPrice(item) }}</span>
|
||||
<span class="deposit-val">押金: ¥{{ item.deposit_amount.toFixed(2) }}</span>
|
||||
<span class="deposit-val">押金: ¥{{ Math.round(Number(item.deposit_amount || 0)) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@ function readError(error: unknown, fallback: string) {
|
||||
}
|
||||
|
||||
function listingPrice(item: Listing) {
|
||||
return Number(item.price || 0).toFixed(2);
|
||||
return `${Math.round(Number(item.price || 0))}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -59,6 +59,10 @@ function actionText(order: Order) {
|
||||
if (['overdue', 'checkout_disputing', 'disputing', 'abnormal'].includes(order.status)) return '查看处理'
|
||||
return '详情'
|
||||
}
|
||||
|
||||
function money(value: unknown) {
|
||||
return Math.round(Number(value || 0))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -103,7 +107,7 @@ function actionText(order: Order) {
|
||||
<el-table-column prop="order_no" label="订单号" min-width="220" />
|
||||
<el-table-column prop="title" label="账号" min-width="180" />
|
||||
<el-table-column label="金额" width="120">
|
||||
<template #default="{ row }">¥{{ row.rent_amount }}</template>
|
||||
<template #default="{ row }">¥{{ money(row.display_amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单状态" width="150">
|
||||
<template #default="{ row }">{{ orderStatusLabel(row.status) }}</template>
|
||||
|
||||
@@ -37,7 +37,7 @@ async function offline(id: number) {
|
||||
}
|
||||
|
||||
function listingPrice(row: Listing) {
|
||||
return `¥${getListingSellerPrice(row).toFixed(2)}`
|
||||
return `¥${Math.round(getListingSellerPrice(row))}`
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user