1404/11/14-round price
This commit is contained in:
@@ -144,8 +144,8 @@ watch(lastPrice, async () => {
|
||||
val.price = lastPrice.value?.price_last
|
||||
val.sellPrice = lastPrice.value?.sell
|
||||
} else {
|
||||
val.price = val.amount * lastPrice.value?.price_last
|
||||
val.sellPrice = val.amount * lastPrice.value?.sell
|
||||
val.price = parseInt(val.amount * lastPrice.value?.price_last)
|
||||
val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
|
||||
|
||||
// console.log(lastPrice.value?.price_last + "*" + val.amount + ' ' + val.price)
|
||||
}
|
||||
@@ -154,11 +154,11 @@ watch(lastPrice, async () => {
|
||||
if (firstItems.value) {
|
||||
firstItems.value.forEach((val) => {
|
||||
if (val.group_type == 'آبشده') {
|
||||
val.price = lastPrice.value?.price_last
|
||||
val.sellPrice = lastPrice.value?.sell
|
||||
val.price = parseInt(lastPrice.value?.price_last)
|
||||
val.sellPrice = parseInt(lastPrice.value?.sell)
|
||||
} else {
|
||||
val.price = val.amount * lastPrice.value?.price_last
|
||||
val.sellPrice = val.amount * lastPrice.value?.sell
|
||||
val.price = parseInt(val.amount * lastPrice.value?.price_last)
|
||||
val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -177,22 +177,22 @@ async function initPrice() {
|
||||
if (lastPrice.value && items.value) {
|
||||
items.value.forEach((val) => {
|
||||
if (val.group_type == 'آبشده') {
|
||||
val.price = lastPrice.value?.price_last
|
||||
val.sellPrice = lastPrice.value?.sell
|
||||
val.price = parseInt(lastPrice.value?.price_last)
|
||||
val.sellPrice = parseInt(lastPrice.value?.sell)
|
||||
} else {
|
||||
val.price = val.amount * lastPrice.value?.price_last
|
||||
val.sellPrice = val.amount * lastPrice.value?.sell
|
||||
val.price = parseInt(val.amount * lastPrice.value?.price_last)
|
||||
val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
|
||||
}
|
||||
})
|
||||
// Update firstItems as well
|
||||
if (firstItems.value) {
|
||||
firstItems.value.forEach((val) => {
|
||||
if (val.group_type == 'آبشده') {
|
||||
val.price = lastPrice.value?.price_last
|
||||
val.sellPrice = lastPrice.value?.sell
|
||||
val.price = parseInt(lastPrice.value?.price_last)
|
||||
val.sellPrice =parseInt( lastPrice.value?.sell)
|
||||
} else {
|
||||
val.price = val.amount * lastPrice.value?.price_last
|
||||
val.sellPrice = val.amount * lastPrice.value?.sell
|
||||
val.price = parseInt(val.amount * lastPrice.value?.price_last)
|
||||
val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -179,11 +179,11 @@ async function initPrice() {
|
||||
loading.value = true
|
||||
if (lastPrice.value && product.value) {
|
||||
if (product.value.group_type == 'آبشده') {
|
||||
product.value.price = lastPrice.value?.price_last
|
||||
product.value.sellPrice = lastPrice.value?.sell
|
||||
product.value.price = parseInt(lastPrice.value?.price_last)
|
||||
product.value.sellPrice = parseInt(lastPrice.value?.sell)
|
||||
} else {
|
||||
product.value.price = product.value.amount * lastPrice.value?.price_last
|
||||
product.value.sellPrice = product.value.amount * lastPrice.value?.sell
|
||||
product.value.price = parseInt(product.value.amount * lastPrice.value?.price_last)
|
||||
product.value.sellPrice = parseInt(product.value.amount * lastPrice.value?.sell)
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
|
||||
Reference in New Issue
Block a user