dynamic fee
This commit is contained in:
@@ -125,13 +125,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<div class=" w-full bottom-18 px-6 rounded-xl py-1 border-1 bg-white">
|
<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 class="flex justify-between items-center">
|
||||||
<div>کارمزد:</div>
|
<div>کارمزد:</div>
|
||||||
<div class="flex gap-2 items-center">
|
<div class="flex gap-2 items-center">
|
||||||
<div class="">{{ parseFloat(((form.goldValue ?? 0) * 0.01).toFixed(4)) }}</div>
|
<div class="">{{ parseFloat(((form.goldValue ?? 0) * (Number(feeAmount))).toFixed(4)) }}</div>
|
||||||
<!-- <div class="font-bold text-2xl">{{ 0 }}</div>-->
|
|
||||||
<div>
|
<div>
|
||||||
گرم
|
گرم
|
||||||
</div>
|
</div>
|
||||||
@@ -170,7 +167,7 @@
|
|||||||
<div class="flex justify-between mt-3">
|
<div class="flex justify-between mt-3">
|
||||||
<div>کارمزد:</div>
|
<div>کارمزد:</div>
|
||||||
<div class="flex items-center gap-2">
|
<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 class="text-xs mr-1">گرم</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -234,6 +231,7 @@ import { getLastPrices, getUpPrice, lastPrice, setIntervalGetAllPrice, stopPrice
|
|||||||
import type { Product } from '@/models/products'
|
import type { Product } from '@/models/products'
|
||||||
import { useFundUserStore } from '@/store/fundStore'
|
import { useFundUserStore } from '@/store/fundStore'
|
||||||
import {useConfigStore} from "@/store/configStore";
|
import {useConfigStore} from "@/store/configStore";
|
||||||
|
import { getSettings } from '@/api/configuration'
|
||||||
// import Bg_main from "@/components/bg_main.vue";
|
// import Bg_main from "@/components/bg_main.vue";
|
||||||
|
|
||||||
const infoVisible = ref(false)
|
const infoVisible = ref(false)
|
||||||
@@ -247,6 +245,7 @@ const sellItems = ref<Transaction[]>([])
|
|||||||
const priceErrorVisible = ref<boolean>(false)
|
const priceErrorVisible = ref<boolean>(false)
|
||||||
const buyTableOutput = ref<TableOutput<Transaction> | null>(null)
|
const buyTableOutput = ref<TableOutput<Transaction> | null>(null)
|
||||||
const sellTableOutput = ref<TableOutput<Transaction> | null>(null)
|
const sellTableOutput = ref<TableOutput<Transaction> | null>(null)
|
||||||
|
const feeAmount = ref<number>(0.01)
|
||||||
const el = ref()
|
const el = ref()
|
||||||
|
|
||||||
interface Prop {
|
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) {
|
// if (!userStore.isSingle) {
|
||||||
/*useInfiniteScroll(
|
/*useInfiniteScroll(
|
||||||
el,
|
el,
|
||||||
@@ -390,6 +399,7 @@ onMounted(async () => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
await initPrice()
|
await initPrice()
|
||||||
|
await getFeePercentage()
|
||||||
/* await initSellTable()
|
/* await initSellTable()
|
||||||
await initBuyTable()*/
|
await initBuyTable()*/
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user