1404/11/19-change rule in input buy product

This commit is contained in:
2026-02-08 13:37:10 +03:30
parent c6c7635041
commit 71312d809d
4 changed files with 59 additions and 15 deletions
+5 -5
View File
@@ -34,7 +34,7 @@
>
<div class="flex gap-4">
<!-- Product Image -->
<div class="bg-gray-100 rounded-lg flex justify-center items-center p-3 min-w-[80px] h-[80px]">
<div class="bg-gray-100 rounded-lg flex justify-center items-center p-1 min-w-[80px] h-[80px]">
<img
:src="getProductImage(item.product)"
class="max-w-full max-h-full object-contain"
@@ -152,7 +152,7 @@ watch(lastPrice, () => {
// Update item price and total price
item.price = newPrice + (product.cash_fee_buy ?? 0)
item.totalPrice = item.price * item.quantity
item.totalPrice = parseInt(item.price * item.quantity)
})
// Save updated prices to storage
@@ -162,7 +162,7 @@ watch(lastPrice, () => {
// Computed total price that updates with price changes
const totalPrice = computed(() => {
return cartStore.cartItems.reduce((sum, item) => sum + item.totalPrice, 0)
return parseInt(cartStore.cartItems.reduce((sum, item) => sum + item.totalPrice, 0))
})
function getProductImage(product: any) {
@@ -255,7 +255,7 @@ async function handleCheckout() {
// Check wallet balance for cash method items (without gateway)
const cashItemsTotal = cartStore.cartItems
.filter(item => item.method === 'cash' && !item.gateway)
.reduce((sum, item) => sum + item.totalPrice, 0)
.reduce((sum, item) => parseInt(sum + item.totalPrice), 0)
if (cashItemsTotal > 0) {
// Ensure wallet info is loaded
@@ -374,7 +374,7 @@ async function initPrice() {
// Update item price and total price
item.price = newPrice + (product.cash_fee_buy ?? 0)
item.totalPrice = item.price * item.quantity
item.totalPrice =parseInt(item.price * item.quantity)
})
// Save updated prices to storage