From 316085e4e2b68b0eee2620ac9d3f9e1ba5a6a0bf Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Thu, 28 Jul 2022 16:48:33 +0800 Subject: [PATCH] wip --- .../Admin/Providers/AdminServiceProvider.php | 2 + beike/Admin/View/Components/Form/Image.php | 24 +++ beike/Admin/View/Components/Sidebar.php | 3 +- public/build/beike/admin/css/app.css | 1 + resources/beike/admin/css/_global.scss | 1 + .../views/components/form/image.blade.php | 10 ++ .../admin/views/pages/brands/index.blade.php | 157 ++++++++++++++++-- .../pages/customer_groups/index.blade.php | 7 +- .../admin/views/shared/vue-image.blade.php | 55 ++++++ 9 files changed, 242 insertions(+), 18 deletions(-) create mode 100644 beike/Admin/View/Components/Form/Image.php create mode 100644 resources/beike/admin/views/components/form/image.blade.php create mode 100644 resources/beike/admin/views/shared/vue-image.blade.php diff --git a/beike/Admin/Providers/AdminServiceProvider.php b/beike/Admin/Providers/AdminServiceProvider.php index 6da9e1a6..5ec9f1ed 100644 --- a/beike/Admin/Providers/AdminServiceProvider.php +++ b/beike/Admin/Providers/AdminServiceProvider.php @@ -10,6 +10,7 @@ use Illuminate\Support\ServiceProvider; use Beike\Admin\View\Components\Filter; use Beike\Admin\View\Components\Header; use Beike\Admin\View\Components\Sidebar; +use Beike\Admin\View\Components\Form\Image; use Beike\Admin\View\Components\Form\Input; use Beike\Console\Commands\MakeRootAdminUser; use Beike\Admin\View\Components\Form\InputLocale; @@ -45,6 +46,7 @@ class AdminServiceProvider extends ServiceProvider 'form-input-locale' => InputLocale::class, 'form-switch' => SwitchRadio::class, 'form-input' => Input::class, + 'form-image' => Image::class, ]); $this->registerGuard(); diff --git a/beike/Admin/View/Components/Form/Image.php b/beike/Admin/View/Components/Form/Image.php new file mode 100644 index 00000000..122a4eda --- /dev/null +++ b/beike/Admin/View/Components/Form/Image.php @@ -0,0 +1,24 @@ +name = $name; + $this->image = $image ?? ''; + $this->value = $value ?? ''; + } + + public function render() + { + return view('admin::components.form.image'); + } +} diff --git a/beike/Admin/View/Components/Sidebar.php b/beike/Admin/View/Components/Sidebar.php index 0a8c0866..898395f7 100644 --- a/beike/Admin/View/Components/Sidebar.php +++ b/beike/Admin/View/Components/Sidebar.php @@ -33,9 +33,10 @@ class Sidebar extends Component $routeNameWithPrefix = request()->route()->getName(); $routeName = str_replace($adminName . '.', '', $routeNameWithPrefix); - if (Str::startsWith($routeName, ['products.', 'categories.'])) { + if (Str::startsWith($routeName, ['products.', 'categories.', 'brands.'])) { $this->addLink('商品分类', admin_route('categories.index'), 'fa fa-tachometer-alt', $this->equalRoute('categories.index')); $this->addLink('商品列表', admin_route('products.index'), 'fa fa-tachometer-alt', $this->equalRoute('products.index')); + $this->addLink('品牌管理', admin_route('brands.index'), 'fa fa-tachometer-alt', $this->equalRoute('brands.index')); $this->addLink('回收站', admin_route('products.index', ['trashed' => 1]), 'fa fa-tachometer-alt', false); } diff --git a/public/build/beike/admin/css/app.css b/public/build/beike/admin/css/app.css index 8cd27124..f5ea2af3 100644 --- a/public/build/beike/admin/css/app.css +++ b/public/build/beike/admin/css/app.css @@ -272,6 +272,7 @@ body { background-color: #f8f8f8; border: 1px dashed #e2e2e2; display: flex; + cursor: pointer; align-items: center; justify-content: center; transition: all 0.2s ease; diff --git a/resources/beike/admin/css/_global.scss b/resources/beike/admin/css/_global.scss index 171a0163..9a05955e 100644 --- a/resources/beike/admin/css/_global.scss +++ b/resources/beike/admin/css/_global.scss @@ -93,6 +93,7 @@ body { background-color: #f8f8f8; border: 1px dashed #e2e2e2; display: flex; + cursor: pointer; align-items: center; // flex-start | center justify-content: center; // flex-end | center | space-between transition: all .2s ease; diff --git a/resources/beike/admin/views/components/form/image.blade.php b/resources/beike/admin/views/components/form/image.blade.php new file mode 100644 index 00000000..db9921ca --- /dev/null +++ b/resources/beike/admin/views/components/form/image.blade.php @@ -0,0 +1,10 @@ +
| {{ $brand['id'] }} | -{{ $brand['name'] }} | -{{ $brand['logo'] }} | -{{ $brand['sort_order'] }} | -{{ $brand['status'] }} | -- 编辑 - | -
| @{{ brand.id }} | +@{{ brand.name }} | +@{{ brand.logo }} | +@{{ brand.sort_order }} | +@{{ brand.status }} | ++ + + | +