update cart view

This commit is contained in:
pbao9
2025-07-29 08:53:41 +07:00
parent 5ea42105f9
commit 980c9468fc
18 changed files with 893 additions and 409 deletions
@@ -2,7 +2,7 @@
$basePrice = $product->price_sale ?: $product->price;
@endphp
<div x-data="cartHandler({{ json_encode($addons) }}, {{ $basePrice }}, {{ $months }})">
<div x-data="cartHandler({{ json_encode($addons) }}, {{ $basePrice }}, {{ $months }})" data-skeleton-id="addons-summary">
<div class="bg-white rounded-lg border border-gray-200 p-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">{{ __('Thời hạn') }}</h3>
<div class="relative">
@@ -62,10 +62,23 @@
<div class="bg-white rounded-lg border border-gray-200 p-6 mb-3">
<h3 class="text-lg font-semibold text-gray-800 mb-4">{{ __('Cấu hình tùy chọn') }}</h3>
<template x-if="loading">
<div class="space-y-4 animate-pulse">
<div class="h-20 bg-gray-200 rounded-lg"></div>
<div class="h-20 bg-gray-200 rounded-lg"></div>
<div class="h-20 bg-gray-200 rounded-lg"></div>
<div class="space-y-4">
@for ($i = 0; $i < 3; $i++)
<div class="p-4 bg-gray-50 rounded-lg animate-pulse">
<div class="flex justify-between items-center mb-2">
<div class="h-4 bg-gray-200 rounded w-24"></div>
<div class="h-4 bg-gray-200 rounded w-20"></div>
</div>
<div class="flex items-center gap-3">
<div class="flex items-center border border-gray-300 rounded-lg overflow-hidden bg-white">
<div class="w-10 h-10 bg-gray-200"></div>
<div class="w-16 h-10 bg-gray-200"></div>
<div class="w-10 h-10 bg-gray-200"></div>
</div>
<div class="h-4 bg-gray-200 rounded w-16"></div>
</div>
</div>
@endfor
</div>
</template>
<template x-if="!loading">
@@ -227,7 +240,7 @@
step: addon.step || 1,
}));
this.loading = false;
}, 500);
}, 1500); // Sync with other components
}
};
}