优化商品属性显示等

This commit is contained in:
pushuo 2023-01-12 16:19:00 +08:00
parent 13936b36c2
commit 0c74f77fcc
10 changed files with 63 additions and 68 deletions

View File

@ -20,7 +20,7 @@ class ProductController extends Controller
{ {
$relationIds = $product->relations->pluck('id')->toArray(); $relationIds = $product->relations->pluck('id')->toArray();
$product = ProductRepo::getProductDetail($product); $product = ProductRepo::getProductDetail($product);
dd((new ProductDetail($product))->jsonSerialize());
$data = [ $data = [
'product' => (new ProductDetail($product))->jsonSerialize(), 'product' => (new ProductDetail($product))->jsonSerialize(),
'relations' => ProductRepo::getProductsByIds($relationIds)->jsonSerialize(), 'relations' => ProductRepo::getProductsByIds($relationIds)->jsonSerialize(),

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
@extends('admin::layouts.master') @extends('admin::layouts.master')
@section('title', __('customer.customer_group')) @section('title', __('admin/common.customer_groups_index'))
@section('content') @section('content')
<div id="customer-app" class="card" v-cloak> <div id="customer-app" class="card" v-cloak>
@ -42,7 +42,7 @@
{{-- {{ $customer_groups->links('admin::vendor/pagination/bootstrap-4') }} --}} {{-- {{ $customer_groups->links('admin::vendor/pagination/bootstrap-4') }} --}}
</div> </div>
<el-dialog title="{{ __('customer.customer_group') }}" :visible.sync="dialog.show" width="670px" <el-dialog title="{{ __('admin/common.customer_groups_index') }}" :visible.sync="dialog.show" width="670px"
@close="closeCustomersDialog('form')" :close-on-click-modal="false"> @close="closeCustomersDialog('form')" :close-on-click-modal="false">
<el-form ref="form" :rules="rules" :model="dialog.form" label-width="155px"> <el-form ref="form" :rules="rules" :model="dialog.form" label-width="155px">

View File

@ -251,12 +251,6 @@ body.page-product {
width: 40%; width: 40%;
} }
} }
&:nth-child(2n+1) {
td {
background-color: rgba(249, 172, 17, .05);
}
}
} }
} }

View File

@ -59,7 +59,7 @@
text-align: left; text-align: left;
.product-name { .product-name {
font-size: 18px; font-size: 14px;
} }
} }
} }

View File

@ -12,7 +12,7 @@
return [ return [
'search' => 'Search', 'search' => 'Search',
'add_to_favorites' => 'Add To Favorites', 'add_to_favorites' => 'Add To Favorites',
'add_to_cart' => 'Add to Shopping Cart', 'add_to_cart' => 'Add To Cart',
'buy_now' => 'Buy Now', 'buy_now' => 'Buy Now',
'product_details' => 'Product Details', 'product_details' => 'Product Details',
'in_stock' => 'In Stock', 'in_stock' => 'In Stock',

View File

@ -13,5 +13,5 @@ return [
'name' => '姓名', 'name' => '姓名',
'email' => 'Email', 'email' => 'Email',
'from' => '注册来源', 'from' => '注册来源',
'customer_group' => '户组', 'customer_group' => '户组',
]; ];

View File

@ -42,11 +42,10 @@
@else @else
<x-shop-no-data /> <x-shop-no-data />
@endif @endif
{{ $products->links('shared/pagination/bootstrap-4') }}
</div> </div>
</div> </div>
{{ $products->links('shared/pagination/bootstrap-4') }}
</div> </div>
@endsection @endsection

View File

@ -153,14 +153,19 @@
</div> </div>
<div class="tab-pane fade" id="product-attributes" role="tabpanel"> <div class="tab-pane fade" id="product-attributes" role="tabpanel">
<table class="table table-bordered attribute-table"> <table class="table table-bordered attribute-table">
<tbody> @foreach ($product['attributes'] as $group)
@foreach ($product['attributes'] as $item) <thead class="table-light">
<tr> <tr><td colspan="2"><strong>{{ $group['attribute_group_name'] }}</strong></td></tr>
<td>{{ $item['attribute'] }}</td> </thead>
<td>{{ $item['attribute_value'] }}</td> <tbody>
</tr> @foreach ($group['attributes'] as $item)
@endforeach <tr>
</tbody> <td>{{ $item['attribute'] }}</td>
<td>{{ $item['attribute_value'] }}</td>
</tr>
@endforeach
</tbody>
@endforeach
</table> </table>
</div> </div>
</div> </div>

View File

@ -1,46 +1,43 @@
@if ($paginator->hasPages()) @if ($paginator->hasPages())
<nav> <nav class="d-flex justify-content-center">
<ul class="pagination"> <ul class="pagination">
{{-- Previous Page Link --}} {{-- Previous Page Link --}}
@if ($paginator->onFirstPage()) @if ($paginator->onFirstPage())
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
<span class="page-link" aria-hidden="true">&lsaquo;</span> <span class="page-link" aria-hidden="true">&lsaquo;</span>
</li> </li>
@else @else
<li class="page-item"> <li class="page-item">
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</a> <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</a>
</li> </li>
@endif @endif
{{-- Pagination Elements --}}
{{-- Pagination Elements --}} @foreach ($elements as $element)
@foreach ($elements as $element) {{-- "Three Dots" Separator --}}
{{-- "Three Dots" Separator --}} @if (is_string($element))
@if (is_string($element)) <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li> @endif
@endif {{-- Array Of Links --}}
@if (is_array($element))
{{-- Array Of Links --}} @foreach ($element as $page => $url)
@if (is_array($element)) @if ($page == $paginator->currentPage())
@foreach ($element as $page => $url) <li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>
@if ($page == $paginator->currentPage()) @else
<li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li> <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
@else @endif
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li> @endforeach
@endif @endif
@endforeach @endforeach
@endif {{-- Next Page Link --}}
@endforeach @if ($paginator->hasMorePages())
<li class="page-item">
{{-- Next Page Link --}} <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</a>
@if ($paginator->hasMorePages()) </li>
<li class="page-item"> @else
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</a> <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
</li> <span class="page-link" aria-hidden="true">&rsaquo;</span>
@else </li>
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> @endif
<span class="page-link" aria-hidden="true">&rsaquo;</span> </ul>
</li> </nav>
@endif
</ul>
</nav>
@endif @endif