支持结账多轮协商与按实际消耗双比例结算
允许双方最多 6 轮修改结账方案;哈夫币按实际消耗与 buyer/seller 比例计价,打超从押金扣,押金不足禁止自动完结并引导人工争议。同步收紧结账明细展示密度。
This commit is contained in:
@@ -35,9 +35,10 @@ export function useOrderCheckoutSnapshot(options: {
|
||||
calculateResourceChargeAmount(checkoutResources.value, options.resourceUsage.value)
|
||||
)
|
||||
const snapshotHafCoinM = computed(() => getSnapshotHafCoinM(options.order.value))
|
||||
// 允许为负:表示打超(实际消耗 > 发布量)
|
||||
const remainingHafCoinM = computed(() =>
|
||||
roundQuantity(
|
||||
Math.max(snapshotHafCoinM.value - Number(options.checkoutForm.value.coin_consumed_m || 0), 0)
|
||||
snapshotHafCoinM.value - Number(options.checkoutForm.value.coin_consumed_m || 0)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -167,11 +168,14 @@ export function buildCheckoutContentWithSummary(options: {
|
||||
)
|
||||
}
|
||||
if (Number(options.coinConsumedM || 0) > 0) {
|
||||
lines.push(
|
||||
`哈夫币消耗:${quantity(options.coinConsumedM)}M,预计剩余${quantity(
|
||||
options.remainingHafCoinM
|
||||
)}M`
|
||||
)
|
||||
const remain = Number(options.remainingHafCoinM || 0)
|
||||
if (remain >= 0) {
|
||||
lines.push(`哈夫币实际消耗:${quantity(options.coinConsumedM)}M,预计剩余${quantity(remain)}M`)
|
||||
} else {
|
||||
lines.push(
|
||||
`哈夫币实际消耗:${quantity(options.coinConsumedM)}M,打超${quantity(-remain)}M(超额按比例从押金结算)`
|
||||
)
|
||||
}
|
||||
}
|
||||
if (lines.length === 0) {
|
||||
lines.push('租客发起结账。')
|
||||
|
||||
Reference in New Issue
Block a user