92 lines
4.7 KiB
PHP
92 lines
4.7 KiB
PHP
@extends('layout.master')
|
||
|
||
@section('body-class', 'page-account-order-list')
|
||
|
||
@section('content')
|
||
<x-shop-breadcrumb type="static" value="account.order.index" />
|
||
|
||
<div class="container">
|
||
<div class="row">
|
||
<x-shop-sidebar />
|
||
|
||
<div class="col-12 col-md-9">
|
||
<div class="card mb-4 account-card order-wrap h-min-600">
|
||
<div class="card-header d-flex justify-content-between align-items-center">
|
||
<h5 class="card-title">{{ __('shop/account.order.index') }}</h5>
|
||
</div>
|
||
<div class="card-body">
|
||
<div class="table-responsive">
|
||
<table class="table ">
|
||
<thead>
|
||
<tr>
|
||
<th>{{ __('shop/account.order.order_details') }}</th>
|
||
<th width="160px">{{ __('shop/account.order.amount') }}</th>
|
||
<th width="100px">{{ __('shop/account.order.state') }}</th>
|
||
<th width="100px" class="text-end">{{ __('common.action') }}</th>
|
||
</tr>
|
||
</thead>
|
||
@if (count($orders))
|
||
@foreach ($orders as $order)
|
||
<tbody>
|
||
<tr class="sep-row">
|
||
<td colspan="4"></td>
|
||
</tr>
|
||
<tr class="head-tr">
|
||
<td colspan="4">
|
||
<span class="order-created me-4">{{ $order->created_at }}</span>
|
||
<span class="order-number me-4">{{ __('shop/account.order.order_number') }}:{{ $order->number }}</span>
|
||
{{--物流信息--}}
|
||
@if ($order->orderShipments->count() > 0)
|
||
<span class="order-created me-4">{{ __('order.express_company') }}:{{ $order->orderShipments[0]->express_company }}</span>
|
||
<span class="order-number me-4">{{ __('order.express_number') }}:{{ $order->orderShipments[0]->express_number }}</span>
|
||
@if($order->logistics)
|
||
@php
|
||
$created_at = strtotime($order->orderShipments[0]->created_at);
|
||
$day_min = $order->logistics->day_min;
|
||
$day_max = $order->logistics->day_max;
|
||
$startTime = date('Y-m-d',strtotime("+{$day_min} day", $created_at));
|
||
$endTime = date('Y-m-d',strtotime("+{$day_max} day", $created_at));
|
||
@endphp
|
||
<span class="order-number">{{ __('order.expected_arrival',['start_time'=>$startTime,'end_time'=>$endTime]) }}</span>
|
||
@endif
|
||
@endif
|
||
</td>
|
||
</tr>
|
||
@foreach ($order->orderProducts as $product)
|
||
<tr class="{{ $loop->first ? 'first-tr' : '' }}">
|
||
<td>
|
||
<div class="product-info">
|
||
<div class="img border d-flex justify-content-center align-items-center wh-60"><img src="{{ $product->image }}" class="img-fluid"></div>
|
||
<div class="name">
|
||
<a class="text-dark" href="{{ shop_route('products.show', ['product' => $product->product_id]) }}">{{ $product->name }}</a>
|
||
<div class="quantity mt-1 text-secondary">x {{ $product->quantity }}</div>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
@if ($loop->first)
|
||
<td rowspan="{{ $loop->count }}">
|
||
{{ currency_format($order->total, $order->currency_code, $order->currency_value) }}</td>
|
||
<td rowspan="{{ $loop->count }}">{{$order->status_format}}</td>
|
||
<td rowspan="{{ $loop->count }}" class="text-end">
|
||
<a href="{{ shop_route('account.order.show', ['number' => $order->number]) }}"
|
||
class="btn btn-outline-secondary btn-sm">{{ __('shop/account.order.check') }}</a>
|
||
</td>
|
||
@endif
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
@endforeach
|
||
@else
|
||
<tbody>
|
||
<tr><td colspan="4" class="border-0"><x-shop-no-data /></td></tr>
|
||
</tbody>
|
||
@endif
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@endsection
|