1404/11/14-round price

This commit is contained in:
2026-02-03 16:58:17 +03:30
parent 19a8584fa0
commit f18d196e30
2 changed files with 18 additions and 18 deletions
+14 -14
View File
@@ -144,8 +144,8 @@ watch(lastPrice, async () => {
val.price = lastPrice.value?.price_last val.price = lastPrice.value?.price_last
val.sellPrice = lastPrice.value?.sell val.sellPrice = lastPrice.value?.sell
} else { } else {
val.price = val.amount * lastPrice.value?.price_last val.price = parseInt(val.amount * lastPrice.value?.price_last)
val.sellPrice = val.amount * lastPrice.value?.sell val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
// console.log(lastPrice.value?.price_last + "*" + val.amount + ' ' + val.price) // console.log(lastPrice.value?.price_last + "*" + val.amount + ' ' + val.price)
} }
@@ -154,11 +154,11 @@ watch(lastPrice, async () => {
if (firstItems.value) { if (firstItems.value) {
firstItems.value.forEach((val) => { firstItems.value.forEach((val) => {
if (val.group_type == 'آبشده') { if (val.group_type == 'آبشده') {
val.price = lastPrice.value?.price_last val.price = parseInt(lastPrice.value?.price_last)
val.sellPrice = lastPrice.value?.sell val.sellPrice = parseInt(lastPrice.value?.sell)
} else { } else {
val.price = val.amount * lastPrice.value?.price_last val.price = parseInt(val.amount * lastPrice.value?.price_last)
val.sellPrice = val.amount * lastPrice.value?.sell val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
} }
}) })
} }
@@ -177,22 +177,22 @@ async function initPrice() {
if (lastPrice.value && items.value) { if (lastPrice.value && items.value) {
items.value.forEach((val) => { items.value.forEach((val) => {
if (val.group_type == 'آبشده') { if (val.group_type == 'آبشده') {
val.price = lastPrice.value?.price_last val.price = parseInt(lastPrice.value?.price_last)
val.sellPrice = lastPrice.value?.sell val.sellPrice = parseInt(lastPrice.value?.sell)
} else { } else {
val.price = val.amount * lastPrice.value?.price_last val.price = parseInt(val.amount * lastPrice.value?.price_last)
val.sellPrice = val.amount * lastPrice.value?.sell val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
} }
}) })
// Update firstItems as well // Update firstItems as well
if (firstItems.value) { if (firstItems.value) {
firstItems.value.forEach((val) => { firstItems.value.forEach((val) => {
if (val.group_type == 'آبشده') { if (val.group_type == 'آبشده') {
val.price = lastPrice.value?.price_last val.price = parseInt(lastPrice.value?.price_last)
val.sellPrice = lastPrice.value?.sell val.sellPrice =parseInt( lastPrice.value?.sell)
} else { } else {
val.price = val.amount * lastPrice.value?.price_last val.price = parseInt(val.amount * lastPrice.value?.price_last)
val.sellPrice = val.amount * lastPrice.value?.sell val.sellPrice = parseInt(val.amount * lastPrice.value?.sell)
} }
}) })
} }
+4 -4
View File
@@ -179,11 +179,11 @@ async function initPrice() {
loading.value = true loading.value = true
if (lastPrice.value && product.value) { if (lastPrice.value && product.value) {
if (product.value.group_type == 'آبشده') { if (product.value.group_type == 'آبشده') {
product.value.price = lastPrice.value?.price_last product.value.price = parseInt(lastPrice.value?.price_last)
product.value.sellPrice = lastPrice.value?.sell product.value.sellPrice = parseInt(lastPrice.value?.sell)
} else { } else {
product.value.price = product.value.amount * lastPrice.value?.price_last product.value.price = parseInt(product.value.amount * lastPrice.value?.price_last)
product.value.sellPrice = product.value.amount * lastPrice.value?.sell product.value.sellPrice = parseInt(product.value.amount * lastPrice.value?.sell)
} }
} }
} catch (e: any) { } catch (e: any) {