319 lines
18 KiB
PHP
319 lines
18 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Mijn Account | Jouwdriedee.nl')
|
|
|
|
@section('content')
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 sm:py-12 space-y-6" x-data="{ tab: 'orders' }">
|
|
|
|
<!-- Account Welcome Banner -->
|
|
<div class="p-6 sm:p-7 rounded-2xl bg-white border border-slate-200/80 shadow-xs flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4">
|
|
<div class="flex items-center space-x-3.5">
|
|
<div class="w-12 h-12 rounded-xl bg-slate-900 text-white flex items-center justify-center font-bold text-base shadow-xs">
|
|
{{ strtoupper(substr($user->name, 0, 1)) }}
|
|
</div>
|
|
<div>
|
|
<div class="flex items-center space-x-2">
|
|
<h1 class="text-xl font-bold text-slate-900">
|
|
{{ $user->name }}
|
|
</h1>
|
|
@if($user->isAdmin())
|
|
<span class="px-2 py-0.5 rounded-full bg-slate-100 text-slate-700 text-[10px] font-semibold border border-slate-200">
|
|
Beheerder
|
|
</span>
|
|
@endif
|
|
</div>
|
|
<p class="text-xs text-slate-500 mt-0.5">
|
|
{{ $user->email }} • Lid sinds {{ $user->created_at->format('d-m-Y') }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-2 self-stretch sm:self-auto justify-end">
|
|
@if($user->isAdmin())
|
|
<a href="{{ route('admin.content.index') }}" class="px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white font-medium text-xs transition flex items-center space-x-1.5 shadow-xs">
|
|
<i data-lucide="shield" class="w-3.5 h-3.5"></i>
|
|
<span>Admin Dashboard</span>
|
|
</a>
|
|
@endif
|
|
|
|
<form action="{{ route('logout') }}" method="POST">
|
|
@csrf
|
|
<button type="submit" class="px-3.5 py-2 rounded-xl bg-white hover:bg-slate-50 text-slate-600 hover:text-slate-900 border border-slate-200 text-xs font-medium transition flex items-center space-x-1.5 cursor-pointer">
|
|
<i data-lucide="log-out" class="w-3.5 h-3.5"></i>
|
|
<span>Uitloggen</span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Navigation Tabs -->
|
|
<div class="flex items-center space-x-1.5 p-1 bg-slate-100/80 rounded-xl max-w-max text-xs font-medium">
|
|
<button
|
|
type="button"
|
|
@click="tab = 'orders'"
|
|
:class="tab === 'orders' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900'"
|
|
class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer"
|
|
>
|
|
<i data-lucide="package" class="w-3.5 h-3.5"></i>
|
|
<span>Mijn Bestellingen</span>
|
|
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-slate-200/60 text-slate-700">
|
|
{{ $orders->count() }}
|
|
</span>
|
|
</button>
|
|
|
|
<button
|
|
type="button"
|
|
@click="tab = 'messages'"
|
|
:class="tab === 'messages' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900'"
|
|
class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer"
|
|
>
|
|
<i data-lucide="message-square" class="w-3.5 h-3.5"></i>
|
|
<span>Mijn Vragen</span>
|
|
<span class="px-1.5 py-0.2 rounded-md text-[10px] bg-slate-200/60 text-slate-700">
|
|
{{ $communications->count() }}
|
|
</span>
|
|
</button>
|
|
|
|
<button
|
|
type="button"
|
|
@click="tab = 'profile'"
|
|
:class="tab === 'profile' ? 'bg-white text-slate-900 font-semibold shadow-2xs' : 'text-slate-600 hover:text-slate-900'"
|
|
class="px-3 py-1.5 rounded-lg transition flex items-center space-x-1.5 cursor-pointer"
|
|
>
|
|
<i data-lucide="user-cog" class="w-3.5 h-3.5"></i>
|
|
<span>Profiel & Beveiliging</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- TAB 1: BESTELLINGEN -->
|
|
<div x-show="tab === 'orders'" class="space-y-3">
|
|
@if($orders->isEmpty())
|
|
<div class="p-10 text-center rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-2.5">
|
|
<div class="w-10 h-10 rounded-xl bg-slate-100 text-slate-400 flex items-center justify-center mx-auto">
|
|
<i data-lucide="shopping-bag" class="w-5 h-5"></i>
|
|
</div>
|
|
<h3 class="text-sm font-semibold text-slate-900">Nog geen bestellingen</h3>
|
|
<p class="text-xs text-slate-500 max-w-xs mx-auto">
|
|
Je hebt nog geen 3D prints besteld. Bekijk onze studio collectie!
|
|
</p>
|
|
<div class="pt-2">
|
|
<a href="{{ route('catalog') }}" class="inline-flex items-center space-x-1.5 px-4 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition shadow-xs">
|
|
<span>Collectie bekijken</span>
|
|
<i data-lucide="arrow-right" class="w-3 h-3"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="space-y-3">
|
|
@foreach($orders as $order)
|
|
<div class="p-5 rounded-2xl bg-white border border-slate-200/80 shadow-2xs space-y-3">
|
|
|
|
<!-- Header regel -->
|
|
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-3 border-b border-slate-100 gap-2">
|
|
<div>
|
|
<span class="font-mono font-bold text-xs text-slate-900">#{{ $order->order_number }}</span>
|
|
<span class="text-xs text-slate-400 ml-2">• {{ $order->created_at->format('d-m-Y H:i') }}</span>
|
|
</div>
|
|
|
|
<div class="flex items-center space-x-3">
|
|
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold
|
|
@if($order->status === 'completed' || $order->status === 'shipped') bg-emerald-50 text-emerald-700 border border-emerald-200/60
|
|
@elseif($order->status === 'printed' || $order->status === 'processing') bg-sky-50 text-sky-700 border border-sky-200/60
|
|
@elseif($order->status === 'cancelled') bg-rose-50 text-rose-700 border border-rose-200/60
|
|
@else bg-amber-50 text-amber-700 border border-amber-200/60 @endif
|
|
">
|
|
{{ $order->status_label }}
|
|
</span>
|
|
|
|
<span class="font-bold text-slate-900 text-xs">
|
|
{{ $order->formatted_total }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Items -->
|
|
<div class="divide-y divide-slate-100">
|
|
@foreach($order->items as $item)
|
|
<div class="py-2 flex items-start justify-between text-xs">
|
|
<div>
|
|
<div class="font-medium text-slate-900">{{ $item->product_name }}</div>
|
|
<div class="text-[11px] text-slate-500 mt-0.5">
|
|
@if($item->material) {{ strtoupper($item->material) }} • @endif
|
|
@if($item->color) {{ $item->color }} • @endif
|
|
{{ $item->scale ?? '100%' }}
|
|
</div>
|
|
</div>
|
|
<div class="text-right">
|
|
<span class="text-slate-500">{{ $item->quantity }}x</span>
|
|
<span class="font-semibold text-slate-900 ml-1">€ {{ number_format($item->total_price, 2, ',', '.') }}</span>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<!-- Bezorging adres -->
|
|
<div class="pt-2.5 border-t border-slate-100 flex items-center justify-between text-[11px] text-slate-500">
|
|
<span>Bezorgadres: {{ $order->shipping_street }} {{ $order->shipping_number }}, {{ $order->shipping_postal_code }} {{ $order->shipping_city }}</span>
|
|
<span class="font-medium text-slate-700 flex items-center space-x-1">
|
|
<i data-lucide="truck" class="w-3.5 h-3.5 text-slate-400"></i>
|
|
<span>PostNL</span>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<!-- TAB: MIJN VRAGEN & COMMUNICATIE -->
|
|
<div x-show="tab === 'messages'" class="space-y-4">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<h2 class="text-sm font-bold text-slate-900">Jouw gestelde vragen aan Jouwdriedee.nl</h2>
|
|
<p class="text-xs text-slate-500">Volg hier jouw berichten en antwoorden van onze printstudio.</p>
|
|
</div>
|
|
<a href="{{ route('contact.index') }}" class="px-3.5 py-1.5 rounded-xl bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition flex items-center space-x-1.5 shadow-xs">
|
|
<i data-lucide="plus" class="w-3.5 h-3.5"></i>
|
|
<span>Nieuwe vraag stellen</span>
|
|
</a>
|
|
</div>
|
|
|
|
@if($communications->isEmpty())
|
|
<div class="p-10 text-center rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-2.5">
|
|
<div class="w-10 h-10 rounded-xl bg-slate-100 text-slate-400 flex items-center justify-center mx-auto">
|
|
<i data-lucide="message-square" class="w-5 h-5"></i>
|
|
</div>
|
|
<h3 class="text-sm font-semibold text-slate-900">Nog geen vragen gesteld</h3>
|
|
<p class="text-xs text-slate-500 max-w-xs mx-auto">
|
|
Heb je een vraag over een model, levering of materiaal? Stel hem gerust!
|
|
</p>
|
|
<div class="pt-2">
|
|
<a href="{{ route('contact.index') }}" class="inline-flex items-center space-x-1.5 px-4 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white text-xs font-medium transition shadow-xs">
|
|
<i data-lucide="message-square" class="w-3.5 h-3.5"></i>
|
|
<span>Vraag stellen aan de shop</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="space-y-3">
|
|
@foreach($communications as $comm)
|
|
<div class="p-5 rounded-2xl bg-white border border-slate-200/80 shadow-2xs space-y-3">
|
|
<div class="flex flex-col sm:flex-row sm:items-center justify-between pb-2.5 border-b border-slate-100 gap-2">
|
|
<div>
|
|
<span class="font-mono text-xs text-slate-400">#{{ $comm->id }}</span>
|
|
<h3 class="font-bold text-slate-900 text-xs sm:text-sm inline ml-1">{{ $comm->subject }}</h3>
|
|
<span class="text-xs text-slate-400 ml-2">• {{ $comm->created_at->format('d-m-Y om H:i') }}</span>
|
|
</div>
|
|
|
|
<span class="px-2 py-0.5 rounded-full text-[10px] font-semibold self-start sm:self-auto
|
|
@if($comm->status === 'new') bg-sky-50 text-sky-700 border border-sky-200/60
|
|
@elseif($comm->status === 'in_progress') bg-amber-50 text-amber-700 border border-amber-200/60
|
|
@elseif($comm->status === 'resolved') bg-emerald-50 text-emerald-700 border border-emerald-200/60
|
|
@else bg-slate-100 text-slate-600 border border-slate-200/60 @endif">
|
|
{{ $comm->status_label }}
|
|
</span>
|
|
</div>
|
|
|
|
<!-- Oorspronkelijke vraag -->
|
|
<div class="text-xs text-slate-700 leading-relaxed bg-slate-50 p-3 rounded-xl border border-slate-100">
|
|
<span class="font-semibold text-slate-900 block text-[11px] mb-1">Jouw vraag:</span>
|
|
{{ $comm->message }}
|
|
</div>
|
|
|
|
<!-- Eventuele antwoorden van de shop -->
|
|
@if($comm->replies->isNotEmpty())
|
|
<div class="space-y-2 pt-1">
|
|
<span class="text-[11px] font-semibold text-emerald-700 block">Antwoord van Jouwdriedee.nl:</span>
|
|
@foreach($comm->replies as $reply)
|
|
<div class="p-3 rounded-xl bg-emerald-50/60 border border-emerald-200/70 text-xs text-slate-800 space-y-1">
|
|
<div class="flex items-center justify-between text-[10px] text-emerald-700 font-medium">
|
|
<span>Studio Specialist</span>
|
|
<span>{{ $reply->created_at->format('d-m-Y H:i') }}</span>
|
|
</div>
|
|
<div class="whitespace-pre-wrap">{{ $reply->message }}</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@else
|
|
<div class="text-[11px] text-slate-400 italic">
|
|
We hebben jouw vraag in behandeling. Je ontvangt zo snel mogelijk antwoord via e-mail.
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<!-- TAB 2: PROFIEL & BEVEILIGING -->
|
|
<div x-show="tab === 'profile'" class="grid grid-cols-1 md:grid-cols-2 gap-5">
|
|
|
|
<!-- Profielgegevens -->
|
|
<div class="p-6 rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-3.5">
|
|
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider flex items-center space-x-1.5">
|
|
<i data-lucide="user" class="w-3.5 h-3.5 text-slate-500"></i>
|
|
<span>Persoonlijke gegevens</span>
|
|
</h3>
|
|
|
|
<form action="{{ route('account.profile') }}" method="POST" class="space-y-3 pt-1">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<div class="space-y-1">
|
|
<label class="block text-xs font-medium text-slate-700">Naam</label>
|
|
<input type="text" name="name" value="{{ old('name', $user->name) }}" required class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="block text-xs font-medium text-slate-700">E-mailadres</label>
|
|
<input type="email" name="email" value="{{ old('email', $user->email) }}" required class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">
|
|
</div>
|
|
|
|
<div class="pt-1">
|
|
<button type="submit" class="px-4 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white font-medium text-xs transition shadow-xs cursor-pointer">
|
|
Gegevens Opslaan
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Wachtwoord Wijzigen -->
|
|
<div class="p-6 rounded-2xl bg-white border border-slate-200/80 shadow-xs space-y-3.5">
|
|
<h3 class="text-xs font-bold text-slate-900 uppercase tracking-wider flex items-center space-x-1.5">
|
|
<i data-lucide="lock" class="w-3.5 h-3.5 text-slate-500"></i>
|
|
<span>Wachtwoord wijzigen</span>
|
|
</h3>
|
|
|
|
<form action="{{ route('account.password') }}" method="POST" class="space-y-3 pt-1">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<div class="space-y-1">
|
|
<label class="block text-xs font-medium text-slate-700">Huidig wachtwoord</label>
|
|
<input type="password" name="current_password" required placeholder="••••••••" class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="block text-xs font-medium text-slate-700">Nieuw wachtwoord (min. 8 tekens)</label>
|
|
<input type="password" name="password" required placeholder="••••••••" class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<label class="block text-xs font-medium text-slate-700">Bevestig nieuw wachtwoord</label>
|
|
<input type="password" name="password_confirmation" required placeholder="••••••••" class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900 focus:bg-white focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900">
|
|
</div>
|
|
|
|
<div class="pt-1">
|
|
<button type="submit" class="px-4 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 text-white font-medium text-xs transition shadow-xs cursor-pointer">
|
|
Wachtwoord Wijzigen
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
@endsection
|