后台订单列表

This commit is contained in:
pushuo 2022-07-06 15:04:32 +08:00
parent cff07400da
commit c1c9f1ec5b
6 changed files with 67 additions and 9 deletions

View File

@ -16,7 +16,7 @@ class Header extends Component
public function __construct()
{
$this->addLink('管理首页', admin_route('home.index'), equal_route('admin.home.index'));
$this->addLink('订单管理', admin_route('home.index'), equal_route('admin.orders.index'));
$this->addLink('订单管理', admin_route('orders.index'), equal_route('admin.orders.index'));
$this->addLink('商品管理', admin_route('products.index'), equal_route('admin.products.index'));
$this->addLink('会员管理', admin_route('customers.index'), equal_route('admin.customers.index'));
$this->addLink('营销管理', admin_route('home.index'), equal_route('admin.promotions.index'));

View File

@ -39,6 +39,10 @@ class Sidebar extends Component
$this->addLink('用户组', admin_route('customer_groups.index'), 'fa fa-tachometer-alt', false);
}
if (Str::startsWith($routeName, ['admin.orders.'])) {
$this->addLink('订单列表', admin_route('orders.index'), 'fa fa-tachometer-alt', false);
}
return view('admin::components.sidebar');
}

View File

@ -47,6 +47,7 @@ body {
.main-content > #content {
flex: 1;
padding: 1rem 1rem 4rem;
margin-top: 42px;
overflow-y: auto;
}
@media screen and (max-width: 991px) {
@ -55,10 +56,23 @@ body {
}
}
.page-title-box {
position: fixed;
top: 60px;
left: 190px;
z-index: 9;
right: 0;
height: 43px;
line-height: 43px;
padding: 0 28px;
background-color: #fff;
border-bottom: 1px solid #f1f1f1;
display: flex;
align-items: center;
}
.page-title-box .page-title {
font-size: 15px;
margin: 0;
margin-bottom: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

View File

@ -45,6 +45,7 @@ body {
> #content {
flex: 1;
padding: 1rem 1rem 4rem;
margin-top: 42px;
overflow-y: auto;
@media screen and (max-width: 991px) {
@ -54,11 +55,23 @@ body {
}
.page-title-box {
position: fixed;
top: 60px;
left: 190px;
z-index: 9;
right: 0;
height: 43px;
line-height: 43px;
padding: 0 28px;
background-color: #fff;
border-bottom: 1px solid #f1f1f1;
display: flex;
align-items: center;
.page-title {
font-size: 15px;
margin: 0;
// line-height: 35px;
margin-bottom: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

View File

@ -30,9 +30,9 @@
<aside class="sidebar navbar-expand-xs border-radius-xl">
<x-admin-sidebar />
</aside>
<div class="page-title-box"><h4 class="page-title">@yield('title')</h4></div>
<div id="content">
<div class="container-fluid p-0">
<div class="page-title-box"><h4 class="page-title">@yield('title')</h4></div>
@yield('content')
</div>
</div>

View File

@ -3,13 +3,40 @@
@section('title', '订单列表')
@section('content')
<div id="customer-app" class="card" v-cloak>
<div id="customer-app" class="card">
<div class="card-body">
<div class="d-flex justify-content-between mb-4">
<button type="button" class="btn btn-primary" @click="checkedCustomersCreate">创建顾客</button>
</div>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>订单号</th>
<th>客户姓名</th>
<th>支付方式</th>
<th>状态</th>
<th>总计</th>
<th>生成日期</th>
<th>修改日期</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@foreach ($orders as $order)
<tr>
<td>{{ $order->id }}</td>
<td>{{ $order->number }}</td>
<td>{{ $order->customer_name }}</td>
<td>{{ $order->payment_method_name }}</td>
<td>{{ $order->status }}</td>
<td>{{ $order->total }}</td>
<td>{{ $order->created_at }}</td>
<td>{{ $order->updated_at }}</td>
<td><a href="{{ admin_route('orders.show', [$order->id]) }}" class="btn btn-outline-secondary btn-sm">查看</a></td>
</tr>
@endforeach
</tbody>
</table>
{{-- {{ $customers->links('admin::vendor/pagination/bootstrap-4') }} --}}
{{ $orders->links('admin::vendor/pagination/bootstrap-4') }}
</div>
</div>
@endsection