feat(trade): separate gross price, fee and net payable into three colored rows

This commit is contained in:
2026-10-11 22:44:10 +03:30
parent 751d9a34e3
commit d7a743ba09
+30 -8
View File
@@ -147,15 +147,33 @@
موجودی کیف پول ناکافی می باشد.
</div>
</a-form-item>
<div class="w-full px-4 rounded-2xl py-2 border-1 bg-white gold-fee-box">
<div class="flex justify-between items-center">
<div>کارمزد ({{ feeDeductsFromGold ? `از طلا` : `از ریال` }}):</div>
<div class="flex gap-2 items-center font-bold">
<div>{{ feeDisplayText }}</div>
</div>
<div class="w-full px-4 rounded-2xl py-3 border-1 bg-white gold-fee-box flex flex-col gap-2 mt-2">
<!-- سطر اول: مبلغ اصل معامله (رنگ مشکی/پایه) -->
<div class="flex justify-between items-center text-xs sm:text-sm">
<span class="text-gray-600 font-medium">مبلغ اصل معامله:</span>
<strong class="font-bold text-gray-800 number-ltr" dir="ltr">
{{ usePriceWithoutType(Math.round(finalPrice ?? 0)) }} ریال
</strong>
</div>
<div class="text-xs text-gray-600 mt-1">
{{ feeFormHint }}
<!-- سطر دوم: کارمزد معامله (رنگ قرمز) -->
<div class="flex justify-between items-center text-xs sm:text-sm">
<span class="text-red-500 font-medium">
{{ isBuy ? `کارمزد خرید (${feePercentLabel}):` : `کسر ${feePercentLabel} کارمزد از فروش:` }}
</span>
<strong class="font-bold text-red-600 number-ltr" dir="ltr">
{{ isBuy ? `+ ${feeDisplayText}` : `− ${feeDisplayText}` }}
</strong>
</div>
<!-- سطر سوم: مبلغ نهایی قابل پرداخت / قابل واریز (رنگ سبز برجسته) -->
<div class="flex justify-between items-center text-xs sm:text-sm pt-2 border-t border-gray-100">
<span class="text-green-700 font-bold">
{{ isBuy ? 'مبلغ قابل پرداخت:' : 'مبلغ قابل واریز (دریافتی):' }}
</span>
<strong class="font-bold text-green-600 text-sm sm:text-base number-ltr" dir="ltr">
{{ usePriceWithoutType(Math.round(payablePrice ?? 0)) }} ریال
</strong>
</div>
</div>
</a-form>
@@ -491,6 +509,10 @@ const feeDisplayText = computed(() =>
: `${usePriceWithoutType(Math.round(feeInRial.value))} ریال`
)
const feePercentLabel = computed(() =>
feeInGrams.value > 0 ? `${formatFixed(serviceFeePercentage.value * 100, 2)}%` : 'رایگان'
)
const displayTradeGoldAmount = computed(() =>
formatTradeGramDisplay(orderGoldAmount.value)
)