diff --git a/resources/beike/admin/views/pages/products/index.blade.php b/resources/beike/admin/views/pages/products/index.blade.php
index 4cbbe47b..7217ec80 100644
--- a/resources/beike/admin/views/pages/products/index.blade.php
+++ b/resources/beike/admin/views/pages/products/index.blade.php
@@ -8,9 +8,9 @@
@section('content')
- @if ($errors->has('error'))
-
| + | ID | 图片 | 商品名称 | @@ -107,37 +109,37 @@操作 | ||||
|---|---|---|---|---|---|---|---|---|
| - - | -@{{ item.id }} | -
- |
- @{{ item.name || '无名称' }} | -@{{ item.price_formatted }} | -@{{ item.created_at }} | -@{{ item.position }} | - @if ($type != 'trashed') -@{{ item.active ? '上架' : '下架' }} | - @endif -- - 编辑 - 删除 - - - 恢复 - - | -
| + | @{{ item.id }} | +
+ |
+ @{{ item.name || '无名称' }} | +@{{ item.price_formatted }} | +@{{ item.created_at }} | +@{{ item.position }} | + @if ($type != 'trashed') +@{{ item.active ? '上架' : '下架' }} | + @endif ++ + 编辑 + 删除 + + + 恢复 + + | +
无商品
@@ -196,6 +198,15 @@ } return url; + }, + + allSelected: { + get() { + return this.selected.length == this.product.data.length; + }, + set(val) { + return this.selected = val ? this.product.data.map(e => e.id) : []; + } } }, @@ -220,18 +231,23 @@ this.$confirm('确认要批量删除选中的商品吗?', '删除商品', { type: 'warning' }).then(() => { - $http.delete('products/delete', {ids: this.selected}).then((res) => { + $http.delete('products/delete', { + ids: this.selected + }).then((res) => { layer.msg(res.message) location.reload(); }) }); }, - batchActive (type) { + batchActive(type) { this.$confirm('确认要批量修改选中的商品的状态吗?', '修改状态', { type: 'warning' }).then(() => { - $http.post('products/status', {ids: this.selected, status: type}).then((res) => { + $http.post('products/status', { + ids: this.selected, + status: type + }).then((res) => { layer.msg(res.message) location.reload(); }) @@ -266,7 +282,9 @@ this.$confirm('确认要恢复选中的商品吗?', '恢复商品', { type: 'warning' }).then(() => { - $http.put('products/restore', {id: product.id}).then((res) => { + $http.put('products/restore', { + id: product.id + }).then((res) => { location.reload(); }) });