fix some bug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user