-
{{ parseFloat(((form.goldValue ?? 0) * 0.01).toFixed(4)) }}
-
+
{{ parseFloat(((form.goldValue ?? 0) * (Number(feeAmount))).toFixed(4)) }}
گرم
@@ -170,7 +167,7 @@
کارمزد:
-
{{ parseFloat(((form.goldValue ?? 0) * 0.01).toFixed(4)) }}
+
{{ parseFloat(((form.goldValue ?? 0) * (Number(feeAmount))).toFixed(4)) }}
گرم
@@ -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
([])
const priceErrorVisible = ref(false)
const buyTableOutput = ref | null>(null)
const sellTableOutput = ref | null>(null)
+const feeAmount = ref(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()*/
})