dynamic fee

This commit is contained in:
2026-05-14 16:28:08 +03:30
parent e3b4182f6c
commit f5ea583836
+15 -5
View File
@@ -125,13 +125,10 @@
</div>
</a-form-item>
<div class=" w-full bottom-18 px-6 rounded-xl py-1 border-1 bg-white">
<!-- <BasicInfoItem is-line title="کارمزد" :value="parseFloat(((form.goldValue?? 0)*0.005).toFixed(3))" />-->
<!-- <BasicInfoItem is-line title="کارمزد" :value="parseFloat(((form.goldValue?? 0)*0.005).toFixed(3))" />-->
<div class="flex justify-between items-center">
<div>کارمزد:</div>
<div class="flex gap-2 items-center">
<div class="">{{ parseFloat(((form.goldValue ?? 0) * 0.01).toFixed(4)) }}</div>
<!-- <div class="font-bold text-2xl">{{ 0 }}</div>-->
<div class="">{{ parseFloat(((form.goldValue ?? 0) * (Number(feeAmount))).toFixed(4)) }}</div>
<div>
گرم
</div>
@@ -170,7 +167,7 @@
<div class="flex justify-between mt-3">
<div>کارمزد:</div>
<div class="flex items-center gap-2">
<div class="font-bold text-xl">{{ parseFloat(((form.goldValue ?? 0) * 0.01).toFixed(4)) }}</div>
<div class="font-bold text-xl">{{ parseFloat(((form.goldValue ?? 0) * (Number(feeAmount))).toFixed(4)) }}</div>
<div class="text-xs mr-1">گرم</div>
</div>
</div>
@@ -234,6 +231,7 @@ import { getLastPrices, getUpPrice, lastPrice, setIntervalGetAllPrice, stopPrice
import type { Product } from '@/models/products'
import { useFundUserStore } from '@/store/fundStore'
import {useConfigStore} from "@/store/configStore";
import { getSettings } from '@/api/configuration'
// import Bg_main from "@/components/bg_main.vue";
const infoVisible = ref(false)
@@ -247,6 +245,7 @@ const sellItems = ref<Transaction[]>([])
const priceErrorVisible = ref<boolean>(false)
const buyTableOutput = ref<TableOutput<Transaction> | null>(null)
const sellTableOutput = ref<TableOutput<Transaction> | null>(null)
const feeAmount = ref<number>(0.01)
const el = ref()
interface Prop {
@@ -344,6 +343,16 @@ async function initSellTable() {
}
}
async function getFeePercentage() {
const settings = await getSettings()
if (settings && Array.isArray(settings)) {
const feeSetting = settings.find(s => s?.key === 'fee_service_charge_percentage' && s?.is_active === true)
if(feeSetting && feeSetting.value !== undefined && feeSetting.value !== null) {
feeAmount.value = feeSetting.value
}
}
}
// if (!userStore.isSingle) {
/*useInfiniteScroll(
el,
@@ -390,6 +399,7 @@ onMounted(async () => {
break
}
await initPrice()
await getFeePercentage()
/* await initSellTable()
await initBuyTable()*/
})