From df96ffafa52e5c31df4121faae962415267509fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=89=AF=E8=BE=B0?= Date: Fri, 14 Jul 2023 03:31:03 +0000 Subject: [PATCH] =?UTF-8?q?!151=20=E5=90=8E=E5=8F=B0=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0model=E5=92=8Cquantity=20=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=9B=B4=E6=8E=A5=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=9E=B6=E7=8A=B6=E6=80=81=20*=20cursor-pointer=20*=20admin=20?= =?UTF-8?q?products-list=20add=20switch=20to=20edit=20status=20*=20Product?= =?UTF-8?q?Resource=20add=20model=20and=20quantity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Admin/Http/Resources/ProductResource.php | 2 ++ .../admin/views/pages/products/index.blade.php | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/beike/Admin/Http/Resources/ProductResource.php b/beike/Admin/Http/Resources/ProductResource.php index b75a0cab..7e03794a 100644 --- a/beike/Admin/Http/Resources/ProductResource.php +++ b/beike/Admin/Http/Resources/ProductResource.php @@ -24,6 +24,8 @@ class ProductResource extends JsonResource return image_resize($image); }, $this->images ?? []), 'name' => $this->description->name ?? '', + 'model' => $masterSku->model, + 'quantity' => $masterSku->quantity, 'price_formatted' => currency_format($masterSku->price), 'active' => $this->active, 'position' => $this->position, diff --git a/resources/beike/admin/views/pages/products/index.blade.php b/resources/beike/admin/views/pages/products/index.blade.php index be35503d..472b618a 100644 --- a/resources/beike/admin/views/pages/products/index.blade.php +++ b/resources/beike/admin/views/pages/products/index.blade.php @@ -135,9 +135,9 @@ {{ $product['position'] }} @if ($type != 'trashed') - - {{ $product['active'] ? __('common.enable') : __('common.disable') }} - +
+ +
@endif @hook('admin.product.list.column_value') @@ -203,6 +203,17 @@ }, methods: { + turnOnOff() { + let id = event.currentTarget.getAttribute("data-id"); + let checked = event.currentTarget.getAttribute("data-active"); + let type = true; + if (checked) type = false; + $http.post('products/status', {ids: [id], status: type}).then((res) => { + layer.msg(res.message) + location.reload(); + }) + }, + batchDelete() { this.$confirm('{{ __('admin/product.confirm_batch_product') }}', '{{ __('common.text_hint') }}', { confirmButtonText: '{{ __('common.confirm') }}',