fix product price
This commit is contained in:
@@ -306,6 +306,7 @@ import {
|
||||
shouldShowProductDealMethodSelect,
|
||||
resolveProductTradeBuyUnitPrice,
|
||||
resolveProductTradeSellUnitPrice,
|
||||
productPriceAmountFactor,
|
||||
formatProductWeightAmount,
|
||||
getProductQuantityUnit,
|
||||
getProductTotalWeightLabel,
|
||||
@@ -409,9 +410,7 @@ const buyTotalPrice = computed(() => {
|
||||
if (!item) return 0
|
||||
const basePrice = (item.price ?? 0) + (item.cash_fee_buy ?? 0)
|
||||
|
||||
return item.direct_price === 0
|
||||
? basePrice * (item.amount ?? 0)
|
||||
: basePrice
|
||||
return basePrice * productPriceAmountFactor(item)
|
||||
})
|
||||
|
||||
const sellTotalPrice = computed(() => {
|
||||
@@ -420,9 +419,7 @@ const sellTotalPrice = computed(() => {
|
||||
|
||||
const basePrice = (item.price ?? 0) - (item.cash_fee_sell ?? 0)
|
||||
|
||||
return item.direct_price === 0
|
||||
? basePrice * (item.amount ?? 0)
|
||||
: basePrice
|
||||
return basePrice * productPriceAmountFactor(item)
|
||||
})
|
||||
const buyFee = computed(() => ((props?.ProductItem?.amount * (props?.ProductItem?.percent_fee_buy ?? 0) * (props?.ProductItem?.price ?? 0)).toFixed(0)))
|
||||
const sellFee = computed(() => ((props?.ProductItem?.amount * (props?.ProductItem?.percent_fee_sell ?? 0) * (props?.ProductItem?.sellPrice ?? 0)).toFixed(0)))
|
||||
@@ -758,12 +755,8 @@ function calculateCash(val: number) {
|
||||
// form.value.goldVazn = parseFloat((val * (( props?.ProductItem?.price) + (props?.ProductItem?.cash_fee_buy)))/lastPrice.value?.buy).toFixed(2)
|
||||
if (isBuy.value) {
|
||||
if (val){
|
||||
if(props?.ProductItem?.direct_price === 0){
|
||||
form.value.goldCash = parseFloat(val * props?.ProductItem?.amount * (props?.ProductItem?.price + props?.ProductItem?.cash_fee_buy)).toFixed(0)
|
||||
}
|
||||
else {
|
||||
form.value.goldCash = parseFloat(val * (props?.ProductItem?.price + props?.ProductItem?.cash_fee_buy)).toFixed(0)
|
||||
}
|
||||
const unitPrice = (props?.ProductItem?.price ?? 0) + (props?.ProductItem?.cash_fee_buy ?? 0)
|
||||
form.value.goldCash = parseFloat(String(val * unitPrice * productPriceAmountFactor(props?.ProductItem))).toFixed(0)
|
||||
}
|
||||
else {
|
||||
form.value.goldCash = 0
|
||||
@@ -772,13 +765,8 @@ function calculateCash(val: number) {
|
||||
}
|
||||
else {
|
||||
if (val){
|
||||
if(props?.ProductItem?.direct_price === 0){
|
||||
form.value.goldCash = parseFloat(val * props?.ProductItem?.amount * (props?.ProductItem?.price - props?.ProductItem?.cash_fee_sell)).toFixed(0)
|
||||
}
|
||||
else{
|
||||
form.value.goldCash = parseFloat(val * (props?.ProductItem?.price - props?.ProductItem?.cash_fee_sell)).toFixed(0)
|
||||
|
||||
}
|
||||
const unitPrice = (props?.ProductItem?.price ?? 0) - (props?.ProductItem?.cash_fee_sell ?? 0)
|
||||
form.value.goldCash = parseFloat(String(val * unitPrice * productPriceAmountFactor(props?.ProductItem))).toFixed(0)
|
||||
}
|
||||
else{
|
||||
form.value.goldCash = 0
|
||||
|
||||
Reference in New Issue
Block a user