fix some bugs
This commit is contained in:
@@ -36,11 +36,6 @@
|
||||
<div v-else class="w-full h-[88px]">
|
||||
<GoldSkeleton class="w-full" />
|
||||
</div>
|
||||
<div v-if="limitedPrice !== undefined && userStore?.userInfo.trade_active !== 1"
|
||||
class="text-red text-xs flex gap-1 items-center justify-center my-2">
|
||||
<Icon icon="vuesax-linear:info-circle" size="16" />
|
||||
حداقل مبلغ اولیه برای ثبت سفارش {{ usePriceWithoutType(limitedPrice.value as number ?? 0) }} ریال می باشد.
|
||||
</div>
|
||||
</a-spin>
|
||||
<a-form :model="form" class="!mt-5" name="basic" @finish="okConfirm()">
|
||||
<div class="border-gray-200 border-1 rounded-xl p-5 h-58 relative">
|
||||
@@ -236,7 +231,7 @@ import { getLastPrices, getTradeBuyPrice, getTradeSellPrice, lastPrice } from '@
|
||||
import type { Product } from '@/models/products'
|
||||
import { useFundUserStore } from '@/store/fundStore'
|
||||
import {useConfigStore} from "@/store/configStore";
|
||||
import { calcFeeInGrams } from '@/utils/serviceFee'
|
||||
import { calcFeeInGrams, calcPayablePriceRial, calcSellGoldDebit, feeDeductFromGold, loadServiceFeeFromSettings } from '@/utils/serviceFee'
|
||||
import { formatCashWalletBalanceText, formatGoldWalletBalanceText } from '@/utils/productDealMethod'
|
||||
import { getCashWalletBalance } from '@/utils/productAssets'
|
||||
import { isStoreClosed, getStoreClosedMessage } from '@/utils/storeHours'
|
||||
@@ -315,8 +310,9 @@ const finalPrice = computed(() => {
|
||||
})
|
||||
|
||||
const payablePrice = computed(() =>
|
||||
isBuy.value ? finalPrice.value + feeInRial.value : finalPrice.value - feeInRial.value
|
||||
calcPayablePriceRial(finalPrice.value, feeInRial.value, isBuy.value)
|
||||
)
|
||||
const sellGoldDebit = computed(() => calcSellGoldDebit(form.value?.goldValue, feeInGrams.value))
|
||||
const feeInGrams = computed(() => calcFeeInGrams(form.value?.goldValue))
|
||||
const unitPrice = computed(() =>
|
||||
(props?.ProductItem?.price_profit ?? 0) + (props?.ProductItem?.price ?? 0)
|
||||
@@ -332,7 +328,8 @@ const disableTransaction = computed(() =>
|
||||
form.value?.goldCash === '' ||
|
||||
form.value?.goldCash === undefined ||
|
||||
(isBuy.value ? (form.value?.goldCash ?? 0) < 500000 : (form.value?.goldValue ?? 0) < 0.001) ||
|
||||
(!isBuy.value && form.value.goldValue > walletStore?.walletInfo?.gold) ||
|
||||
(!isBuy.value && sellGoldDebit.value > (walletStore?.walletInfo?.gold ?? 0)) ||
|
||||
(isBuy.value && payablePrice.value > cashWalletBalance.value) ||
|
||||
!lastPrice.value ||
|
||||
(isBuy.value ? getTradeBuyPrice(lastPrice.value) <= 0 : getTradeSellPrice(lastPrice.value) <= 0))
|
||||
|
||||
@@ -436,6 +433,7 @@ onMounted(async () => {
|
||||
break
|
||||
}
|
||||
await initPrice()
|
||||
await loadServiceFeeFromSettings()
|
||||
/* await initSellTable()
|
||||
await initBuyTable()*/
|
||||
})
|
||||
@@ -499,11 +497,6 @@ const unitCashCalculator = computed(() => {
|
||||
return cashWalletBalance.value / 100
|
||||
})
|
||||
|
||||
const limitedPrice = computed(() => {
|
||||
if (walletStore.limitedPrice)
|
||||
return walletStore?.limitedPrice[0]
|
||||
})
|
||||
|
||||
/*function calculateCash(val: number) {
|
||||
priceErrorVisible.value = false
|
||||
// console.log(val)
|
||||
|
||||
Reference in New Issue
Block a user