fix some bug

This commit is contained in:
2026-06-06 15:48:27 +03:30
parent f82a0c3873
commit 4c707849ef
5 changed files with 29 additions and 27 deletions
+8 -3
View File
@@ -227,6 +227,7 @@ import type { Transaction } from '@/models/transaction'
import type { TableEngineInput, TableOutput } from '@/models/table'
import { useInfiniteScroll } from '@vueuse/core'
import { getTransactionTable } from '@/api/transaction'
import { getProductBuyPrice, getProductSellPrice } from '@/utils/productPrice'
import { getLastPrices, getTradeBuyPrice, getTradeSellPrice, lastPrice, setIntervalGetAllPrice, stopPriceInterval } from '@/utils/price'
import type { Product } from '@/models/products'
import { useFundUserStore } from '@/store/fundStore'
@@ -277,9 +278,13 @@ const sellPagination = ref<TableEngineInput>({
}], limit: 6, page: 0
})
const unitPrice = computed(() =>
isBuy.value ? getTradeBuyPrice(lastPrice.value) : getTradeSellPrice(lastPrice.value)
)
const unitPrice = computed(() => {
const product = props.ProductItem
if (product?.group_type === 'آبشده') {
return isBuy.value ? getProductBuyPrice(product) : getProductSellPrice(product)
}
return isBuy.value ? getTradeBuyPrice(lastPrice.value) : getTradeSellPrice(lastPrice.value)
})
const feeInGrams = computed(() => calcFeeInGrams(form.value?.goldValue))
const finalPrice = computed(() => (form.value?.goldValue ?? 0) * unitPrice.value)
const feeInRial = computed(() => unitPrice.value * feeInGrams.value)