@extends('frontend.layouts.main-profile') @section('title', $seo['title'] ?? '' ) @section('keywords', $seo['keywords']??'') @section('description', $seo['description']??'') @section('abstract', $seo['abstract']??'') @section('image', $seo['image']??'') @section('css') @endsection @section('content')
⭐
{{$user->rank->name}}
Tổng chi tiêu hiện tại
{{number_format($user->point)}}đ
@if($nextRank)
🏆 Lên {{$nextRank->name}}
Còn {{number_format($nextRank->total - $user->point)}}đ
@else
🎉 Bạn đã đạt hạng cao nhất
@endif @php $progress = $nextRank ? round(($user->point / $nextRank->total) * 100, 2) : 100; @endphp
@if($nextRank)
0₫ {{number_format($nextRank->total)}}đ
@else
{{number_format($currentRank->total)}}đ ∞
@endif
@if($nextRank)
🏆 Quyền lợi {{$nextRank->name}}
{!!$nextRank->description!!}
@else
🏅 Bạn đã đạt hạng cao nhất!
Tận hưởng toàn bộ ưu đãi đặc biệt dành cho bạn.
🏆 Quyền lợi hiện tại
{!!$currentRank->description!!}
@endif
@php $currentRankIndex = null; foreach ($ranks as $index => $item) { if ($user->rank_id == $item->id) { $currentRankIndex = $index; break; } } @endphp @foreach($ranks as $index => $item) @php if ($index === $currentRankIndex) { $class = 'current'; } elseif ($index < $currentRankIndex) { $class='completed' ; } else { $class='upcoming' ; } // Gán thêm logic: nếu point user>= 90% của rank kế tiếp thì vẫn xem như "current" if ($index === $currentRankIndex + 1 && $user->point >= ($item->total * 0.9)) { $class = 'current'; } @endphp
🏆
{{ $item->name }}
{{ number_format($item->total) }}đ
@endforeach
@endsection @section('js') @endsection