@extends('user.layouts.app') @section('css') @endsection @section('title') تفاصيل طلب الشحن @endsection @section('content')
@php $styles = config('credit_request_filters.status_type_styles', []); $status = $creditRequest->status ?? 'pending'; $style = $styles[$status] ?? null; $badgeIconParts = explode(' ', $style['iconClass'] ?? 'banknote'); $badgeIconName = $badgeIconParts[0]; $badgeIconExtraClass = implode(' ', array_slice($badgeIconParts, 1)); $amountClass = $style['amountClass'] ?? ''; $itemCardClass = $style['itemCardClass'] ?? ''; $createdAt = optional($creditRequest->created_at)->format('Y/m/d H:i:s'); // Build attachment name map from method attachments (active first, then all if available) $attachmentsCollection = optional($creditRequest->method)->activeAttachments ?? (optional($creditRequest->method)->attachments ?? collect()); $attachmentNames = []; try { foreach ($attachmentsCollection ?? [] as $att) { $attachmentNames[$att->id] = $att->name; } } catch (\Throwable $e) { } // Normalize attachments array (support JSON string or array) $attachments = $creditRequest->attachment_values; if (is_string($attachments)) { $decoded = json_decode($attachments, true); if (json_last_error() === JSON_ERROR_NONE) { $attachments = $decoded; } } if (!is_array($attachments)) { $attachments = (array) ($attachments ?? []); } @endphp
#{{ $creditRequest->id }}
{{ $createdAt }}
@svg('lucide-' . $badgeIconName, ['class' => $badgeIconExtraClass, 'width' => '16', 'height' => '16']) {{ config('credit_request_filters.status_types.' . $status . '.label', $status) }}
المبلغ المطلوب:
{{ $creditRequest->amount }} {{ $creditRequest->currency->name ?? '' }}
@if (!is_null($creditRequest->final_amount) && (float) $creditRequest->final_amount !== (float) $creditRequest->amount)
المبلغ النهائي:
{{ $creditRequest->final_amount }} {{ $creditRequest->currency->name ?? '' }}
@endif
طريقة الدفع:
{{ $creditRequest->method->name ?? '-' }}
العملة:
{{ $creditRequest->currency->name ?? '-' }}
@if (!empty($creditRequest->operation_number))
رقم العملية:
{{ $creditRequest->operation_number }}
@endif @if (!empty($creditRequest->payment_id))
معرف الدفع:
{{ $creditRequest->payment_id }}
@endif @if (!empty($creditRequest->note) && trim($creditRequest->note) !== '_')
ملاحظة:
{{ $creditRequest->note }}
@endif @if (!empty($creditRequest->image))
صورة:
attachment image
@endif
@if (!empty($attachments))
المرفقات
@foreach ($attachments as $key => $value) @php $label = $attachmentNames[$key] ?? 'المرفق #' . $key; $isFile = is_string($value) && \Illuminate\Support\Str::startsWith($value, 'file__'); $fileName = $isFile ? substr($value, 6) : null; $url = null; if ($isFile) { // If looks like absolute URL if ( is_string($fileName) && (\Illuminate\Support\Str::startsWith($fileName, 'http://') || \Illuminate\Support\Str::startsWith($fileName, 'https://')) ) { $url = $fileName; } else { $url = route('media.credit-request.attachment', [ 'creditRequest' => $creditRequest->id, 'field' => $key, ]); } } @endphp
{{ $label }} @if ($isFile && $url) {{ $label }} @else
{{ is_array($value) ? json_encode($value, JSON_UNESCAPED_UNICODE) : (string) $value }}
@endif
@endforeach
@endif @php $createdTs = optional($creditRequest->created_at)->timestamp ?? now()->timestamp; $expiresAtTs = $createdTs + 15 * 60; $walletAddress = $creditRequest->wallet_address ?? ($walletAddress ?? null); $walletNetwork = $creditRequest->wallet_network ?? ($walletNetwork ?? null); $walletTag = $creditRequest->wallet_tag ?? ($walletTag ?? null); $payAmount = (float) ($creditRequest->final_amount ?: $creditRequest->amount); $payCurrency = $creditRequest->currency->name ?? 'USDT'; @endphp
معلومات المحفظة والدفع
المبلغ المطلوب تحويله:
{{ number_format($payAmount, 6, '.', ',') }} {{ $payCurrency }}
الشبكة:
{{ $walletNetwork ?? '—' }}
عنوان المحفظة:
{{ $walletAddress ?? '—' }}
@if (!empty($walletTag))
Memo/Tag إن وجد:
{{ $walletTag }}
@endif
الوقت المتبقي للدفع
15:00
سيتم تحديث الصفحة تلقائياً كل 40 ثانية للتحقق من وصول الدفعة.
@endsection @push('scripts') @endpush