1404/11/14-round price
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user