From 7280c7e3c2ffb45afa159023a2defa154e47fe80 Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Mon, 1 Aug 2022 16:00:45 +0800 Subject: [PATCH] wip --- public/build/beike/admin/css/app.css | 87 +++- public/build/beike/admin/css/bootstrap.css | 14 +- public/build/beike/admin/js/app.js | 32 ++ .../beike/admin/css/_bootstrap-extra.scss | 20 +- resources/beike/admin/css/_global.scss | 14 + .../beike/admin/css/bootstrap/bootstrap.scss | 2 +- resources/beike/admin/js/app.js | 35 ++ .../admin/views/components/form/row.blade.php | 2 +- .../admin/views/layouts/master.blade.php | 1 + .../views/pages/admin_roles/index.blade.php | 18 +- .../views/pages/admin_users/index.blade.php | 107 ++--- .../views/pages/products/form/form.blade.php | 380 +++++++++--------- .../views/pages/products/index.blade.php | 2 +- 13 files changed, 419 insertions(+), 295 deletions(-) diff --git a/public/build/beike/admin/css/app.css b/public/build/beike/admin/css/app.css index a47220f7..deefadee 100644 --- a/public/build/beike/admin/css/app.css +++ b/public/build/beike/admin/css/app.css @@ -150,6 +150,86 @@ body { min-height: 1000px; } +.h-min-100 { + min-width: 100px; +} + +.h-min-200 { + min-width: 200px; +} + +.h-min-300 { + min-width: 300px; +} + +.h-min-400 { + min-width: 400px; +} + +.h-min-500 { + min-width: 500px; +} + +.h-min-600 { + min-width: 600px; +} + +.h-min-700 { + min-width: 700px; +} + +.h-min-800 { + min-width: 800px; +} + +.h-min-900 { + min-width: 900px; +} + +.h-min-1000 { + min-width: 1000px; +} + +.w-max-100 { + max-width: 100px; +} + +.w-max-200 { + max-width: 200px; +} + +.w-max-300 { + max-width: 300px; +} + +.w-max-400 { + max-width: 400px; +} + +.w-max-500 { + max-width: 500px; +} + +.w-max-600 { + max-width: 600px; +} + +.w-max-700 { + max-width: 700px; +} + +.w-max-800 { + max-width: 800px; +} + +.w-max-900 { + max-width: 900px; +} + +.w-max-1000 { + max-width: 1000px; +} + .hp-100 { height: 100px; } @@ -567,13 +647,14 @@ hr.horizontal.dark { .nav-tabs.nav-bordered .nav-item:last-child { margin-right: 0; } -.nav-tabs.nav-bordered .nav-item a { +.nav-tabs.nav-bordered .nav-item .nav-link { color: #6c757d; border: none; - padding: 0.7rem 0; + padding: 0 0.2rem 0.7rem; } -.nav-tabs.nav-bordered .nav-item a.active { +.nav-tabs.nav-bordered .nav-item .nav-link.active { color: #1a1a1a; + font-weight: bold; background-color: transparent; border-bottom: 2px solid #fd560f; } diff --git a/public/build/beike/admin/css/bootstrap.css b/public/build/beike/admin/css/bootstrap.css index 0e2d4bc4..9d620885 100644 --- a/public/build/beike/admin/css/bootstrap.css +++ b/public/build/beike/admin/css/bootstrap.css @@ -12296,7 +12296,7 @@ textarea.form-control-lg { align-items: center; justify-content: space-between; padding: 1rem 1rem; - border-bottom: 1px solid #e2e2e2; + border-bottom: 1px solid #f4f4f4; border-top-left-radius: calc(0.3rem - 1px); border-top-right-radius: calc(0.3rem - 1px); } @@ -12323,7 +12323,7 @@ textarea.form-control-lg { align-items: center; justify-content: flex-end; padding: 0.75rem; - border-top: 1px solid #e2e2e2; + border-top: 1px solid #f4f4f4; border-bottom-right-radius: calc(0.3rem - 1px); border-bottom-left-radius: calc(0.3rem - 1px); } @@ -13581,7 +13581,7 @@ textarea.form-control-lg { } .border { - border: 1px solid #e2e2e2 !important; + border: 1px solid #f4f4f4 !important; } .border-0 { @@ -13589,7 +13589,7 @@ textarea.form-control-lg { } .border-top { - border-top: 1px solid #e2e2e2 !important; + border-top: 1px solid #f4f4f4 !important; } .border-top-0 { @@ -13597,7 +13597,7 @@ textarea.form-control-lg { } .border-end { - border-right: 1px solid #e2e2e2 !important; + border-right: 1px solid #f4f4f4 !important; } .border-end-0 { @@ -13605,7 +13605,7 @@ textarea.form-control-lg { } .border-bottom { - border-bottom: 1px solid #e2e2e2 !important; + border-bottom: 1px solid #f4f4f4 !important; } .border-bottom-0 { @@ -13613,7 +13613,7 @@ textarea.form-control-lg { } .border-start { - border-left: 1px solid #e2e2e2 !important; + border-left: 1px solid #f4f4f4 !important; } .border-start-0 { diff --git a/public/build/beike/admin/js/app.js b/public/build/beike/admin/js/app.js index 6036edd2..eaaed5f3 100644 --- a/public/build/beike/admin/js/app.js +++ b/public/build/beike/admin/js/app.js @@ -2067,6 +2067,7 @@ __webpack_require__.r(__webpack_exports__); window.$http = _js_http__WEBPACK_IMPORTED_MODULE_0__["default"]; var base = document.querySelector('base').href; var asset = document.querySelector('meta[name="asset"]').content; +var editor_language = document.querySelector('meta[name="editor_language"]').content; $(document).on('click', '.open-file-manager', function (event) { var $this = $(this); layer.open({ @@ -2120,8 +2121,39 @@ $(document).ready(function ($) { } } }); + tinymceInit(); }); +function tinymceInit() { + if (typeof tinymce == 'undefined') { + return; + } + + tinymce.init({ + selector: '.tinymce', + language: editor_language, + branding: false, + height: 400, + plugins: "link lists fullscreen table hr wordcount image imagetools code", + menubar: "", + toolbar: "undo redo | toolbarImageButton | bold italic underline strikethrough | forecolor backcolor | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | formatpainter removeformat | charmap emoticons | preview | template link anchor table toolbarImageUrlButton | fullscreen code", + // contextmenu: "link image imagetools table", + toolbar_items_size: 'small', + image_caption: true, + // imagetools_toolbar: 'imageoptions', + toolbar_mode: 'wrap', + font_formats: "微软雅黑='Microsoft YaHei';黑体=黑体;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Georgia=georgia,palatino;Helvetica=helvetica;Times New Roman=times new roman,times;Verdana=verdana,geneva", + fontsize_formats: "10px 12px 14px 18px 24px 36px", + relative_urls: true, + setup: function setup(ed) {// ed.on('change', function(e) { + // if (e.target.targetElm.dataset.key) { + // app.form[e.target.targetElm.dataset.key] = ed.getContent() + // } + // }); + } + }); +} + /***/ }), /***/ "./resources/js/http.js": diff --git a/resources/beike/admin/css/_bootstrap-extra.scss b/resources/beike/admin/css/_bootstrap-extra.scss index af28bb63..7e98ecc9 100644 --- a/resources/beike/admin/css/_bootstrap-extra.scss +++ b/resources/beike/admin/css/_bootstrap-extra.scss @@ -36,19 +36,19 @@ hr.horizontal.dark { margin-right: 0; } - a { + .nav-link { color: #6c757d; border: none; - padding: 0.7rem 0; - } + padding: 0 .2rem 0.7rem; - a.active { - // color: $primary; - // color: #12263f; - color: #1a1a1a; - // font-weight: bold; - background-color: transparent; - border-bottom: 2px solid $primary; + &.active { + // color: $primary; + // color: #12263f; + color: #1a1a1a; + font-weight: bold; + background-color: transparent; + border-bottom: 2px solid $primary; + } } } } diff --git a/resources/beike/admin/css/_global.scss b/resources/beike/admin/css/_global.scss index 1c17cfa8..6e7f253f 100644 --- a/resources/beike/admin/css/_global.scss +++ b/resources/beike/admin/css/_global.scss @@ -43,6 +43,20 @@ body { } } +// 生成 100 200 300 ... 1000 的最小宽度 +@for $i from 1 through 10 { + .h-min-#{$i}00 { + min-width: #{$i}00px; + } +} + +// 生成 100 200 300 ... 1000 的最大宽度 +@for $i from 1 through 10 { + .w-max-#{$i}00 { + max-width: #{$i}00px; + } +} + // 生成 100 200 300 ... 1000 的高度 @for $i from 1 through 10 { .hp-#{$i}00 { diff --git a/resources/beike/admin/css/bootstrap/bootstrap.scss b/resources/beike/admin/css/bootstrap/bootstrap.scss index 91c05460..39d66eb6 100644 --- a/resources/beike/admin/css/bootstrap/bootstrap.scss +++ b/resources/beike/admin/css/bootstrap/bootstrap.scss @@ -21,7 +21,7 @@ $form-floating-padding-y: .9rem; $form-floating-height: 50px; $btn-focus-width: 0; $table-border-color: #e9ecef; -$border-color: #e2e2e2; +$border-color: #f4f4f4; $input-border-color: #e2e2e2; $badge-border-radius: 2px; $text-muted: #95aac9; diff --git a/resources/beike/admin/js/app.js b/resources/beike/admin/js/app.js index 0a39e8d6..e1ea3e98 100644 --- a/resources/beike/admin/js/app.js +++ b/resources/beike/admin/js/app.js @@ -2,6 +2,7 @@ import http from "../../../js/http"; window.$http = http; const base = document.querySelector('base').href; const asset = document.querySelector('meta[name="asset"]').content; +const editor_language = document.querySelector('meta[name="editor_language"]').content; $(document).on('click', '.open-file-manager', function(event) { const $this = $(this); @@ -48,4 +49,38 @@ $(document).ready(function ($) { } }, }); + + tinymceInit() }); + +function tinymceInit() { + if (typeof tinymce == 'undefined') { + return; + } + + tinymce.init({ + selector: '.tinymce', + language: editor_language, + branding: false, + height: 400, + plugins: "link lists fullscreen table hr wordcount image imagetools code", + menubar: "", + toolbar: "undo redo | toolbarImageButton | bold italic underline strikethrough | forecolor backcolor | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | formatpainter removeformat | charmap emoticons | preview | template link anchor table toolbarImageUrlButton | fullscreen code", + // contextmenu: "link image imagetools table", + toolbar_items_size: 'small', + image_caption: true, + // imagetools_toolbar: 'imageoptions', + toolbar_mode: 'wrap', + font_formats: + "微软雅黑='Microsoft YaHei';黑体=黑体;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Georgia=georgia,palatino;Helvetica=helvetica;Times New Roman=times new roman,times;Verdana=verdana,geneva", + fontsize_formats: "10px 12px 14px 18px 24px 36px", + relative_urls : true, + setup:function(ed) { + // ed.on('change', function(e) { + // if (e.target.targetElm.dataset.key) { + // app.form[e.target.targetElm.dataset.key] = ed.getContent() + // } + // }); + } + }); +} \ No newline at end of file diff --git a/resources/beike/admin/views/components/form/row.blade.php b/resources/beike/admin/views/components/form/row.blade.php index 75b46bde..3dd1c84d 100644 --- a/resources/beike/admin/views/components/form/row.blade.php +++ b/resources/beike/admin/views/components/form/row.blade.php @@ -1,6 +1,6 @@
-
+
{{ $slot }}
diff --git a/resources/beike/admin/views/layouts/master.blade.php b/resources/beike/admin/views/layouts/master.blade.php index 8a573b65..b68114f7 100644 --- a/resources/beike/admin/views/layouts/master.blade.php +++ b/resources/beike/admin/views/layouts/master.blade.php @@ -6,6 +6,7 @@ + diff --git a/resources/beike/admin/views/pages/admin_roles/index.blade.php b/resources/beike/admin/views/pages/admin_roles/index.blade.php index 5a1afac2..a496cf2d 100644 --- a/resources/beike/admin/views/pages/admin_roles/index.blade.php +++ b/resources/beike/admin/views/pages/admin_roles/index.blade.php @@ -29,7 +29,7 @@ - + @{{ tax.id }} @{{ tax.name }} @{{ tax.email }} @@ -43,7 +43,7 @@ - {{-- {{ $tax_classes->links('admin::vendor/pagination/bootstrap-4') }} --}} + {{-- {{ $admin_users->links('admin::vendor/pagination/bootstrap-4') }} --}}
{ if (!valid) { @@ -179,9 +179,9 @@ $http[type](url, this.dialog.form).then((res) => { this.$message.success(res.message); if (this.dialog.type == 'add') { - this.tax_classes.push(res.data) + this.admin_users.push(res.data) } else { - this.tax_classes[this.dialog.index] = res.data + this.admin_users[this.dialog.index] = res.data } this.dialog.show = false @@ -196,9 +196,9 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { - $http.delete('tax_classes/' + id).then((res) => { + $http.delete('admin_users/' + id).then((res) => { this.$message.success(res.message); - self.tax_classes.splice(index, 1) + self.admin_users.splice(index, 1) }) }).catch(()=>{}) }, diff --git a/resources/beike/admin/views/pages/admin_users/index.blade.php b/resources/beike/admin/views/pages/admin_users/index.blade.php index 73d32d7d..34c36ca6 100644 --- a/resources/beike/admin/views/pages/admin_users/index.blade.php +++ b/resources/beike/admin/views/pages/admin_users/index.blade.php @@ -15,21 +15,21 @@
- +
- - + + - + @@ -43,52 +43,27 @@
#名称描述账号名称邮箱 创建时间 修改时间 操作
@{{ tax.id }} @{{ tax.name }} @{{ tax.email }}
- {{-- {{ $tax_classes->links('admin::vendor/pagination/bootstrap-4') }} --}} + {{-- {{ $admin_users->links('admin::vendor/pagination/bootstrap-4') }} --}}
- - - + + - - + + - - - - - - - - - - - - - - - - - - -
税率基于优先级
- - - - - - - - - -
- 添加规则 + + + @{{roles.name}} + + 保存 取消 @@ -104,11 +79,11 @@ el: '#tax-classes-app', data: { - tax_classes: @json($admin_users ?? []), + admin_users: @json($admin_users ?? []), source: { all_tax_rates: @json($all_tax_rates ?? []), - bases: @json($bases ?? []), + roles: @json($admin_roles ?? []) }, dialog: { @@ -117,25 +92,19 @@ type: 'add', form: { id: null, - title: '', - description: '', - tax_rules: [], + name: '', + email: '', + roles: [], }, }, rules: { - title: [{required: true,message: '请输入税类名称',trigger: 'blur'}, ], - description: [{required: true,message: '请输入描述',trigger: 'blur'}, ], + name: [{required: true,message: '请输入账号名称',trigger: 'blur'}, ], + email: [{required: true,message: '请输入邮箱',trigger: 'blur'}, ], + roles: [{type: 'array', required: true, message: '请至少选择一个角色', trigger: 'change'}], } }, - beforeMount() { - // this.source.languages.forEach(e => { - // this.$set(this.dialog.form.name, e.code, '') - // this.$set(this.dialog.form.description, e.code, '') - // }) - }, - methods: { checkedCreate(type, index) { this.dialog.show = true @@ -143,32 +112,20 @@ this.dialog.index = index if (type == 'edit') { - let tax = this.tax_classes[index]; + let tax = this.admin_users[index]; this.dialog.form = { id: tax.id, title: tax.title, - description: tax.description, - tax_rules: tax.tax_rules, + email: tax.email, } } }, - addRates() { - const tax_rate_id = this.source.all_tax_rates[0]?.id || 0; - const based = this.source.bases[0] || ''; - - this.dialog.form.tax_rules.push({tax_rate_id, based, priority: ''}) - }, - - deleteRates(index) { - this.dialog.form.tax_rules.splice(index, 1) - }, - addFormSubmit(form) { const self = this; const type = this.dialog.type == 'add' ? 'post' : 'put'; - const url = this.dialog.type == 'add' ? 'tax_classes' : 'tax_classes/' + this.dialog.form.id; + const url = this.dialog.type == 'add' ? 'admin_users' : 'admin_users/' + this.dialog.form.id; this.$refs[form].validate((valid) => { if (!valid) { @@ -179,9 +136,9 @@ $http[type](url, this.dialog.form).then((res) => { this.$message.success(res.message); if (this.dialog.type == 'add') { - this.tax_classes.push(res.data) + this.admin_users.push(res.data) } else { - this.tax_classes[this.dialog.index] = res.data + this.admin_users[this.dialog.index] = res.data } this.dialog.show = false @@ -191,21 +148,21 @@ deleteCustomer(id, index) { const self = this; - this.$confirm('确定要删除税类码?', '提示', { + this.$confirm('确定要删除用户吗?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - $http.delete('tax_classes/' + id).then((res) => { + $http.delete('admin_users/' + id).then((res) => { this.$message.success(res.message); - self.tax_classes.splice(index, 1) + self.admin_users.splice(index, 1) }) }).catch(()=>{}) }, closeCustomersDialog(form) { Object.keys(this.dialog.form).forEach(key => this.dialog.form[key] = '') - this.dialog.form.tax_rules = [] + this.dialog.form.roles = []; this.dialog.show = false } } diff --git a/resources/beike/admin/views/pages/products/form/form.blade.php b/resources/beike/admin/views/pages/products/form/form.blade.php index 513191e0..090ad6dd 100644 --- a/resources/beike/admin/views/pages/products/form/form.blade.php +++ b/resources/beike/admin/views/pages/products/form/form.blade.php @@ -1,226 +1,230 @@ @extends('admin::layouts.master') +@section('title', '商品详情') + @section('body-class', 'page-product-form') @push('header') + @endpush @section('content') + + +
{{--
基础信息
--}}
-
基础信息
@csrf @method($product->id ? 'PUT' : 'POST') - @foreach (locales() as $index => $locale) - {{-- --}} - @endforeach - - - {{-- --}} - -
-
- - -
-
-
-
第一张图片将作为商品主图,支持同时上传多张图片,多张图片之间可随意调整位置;
-
开启多规格并且多规格配置了图片时,这里的图片将作为多规格的公用图片,展示在其后面
-
- - {{--
- @if ($product->image) -
- -
- @else - - @endif -
- - --}} - - - - - - @foreach ($source['categories'] as $_category) -
- id, $category_ids) ? 'checked' : '' }}> - -
- @endforeach -
- -
-
商品库存
- - - - - - - -
- -
-
-
- -
-
-
- @{{ variant.name[current_language_code] }} - 编辑 - 移除 -
-
- 添加规格图片 - Add value -
-
- -
- {{--
--}} - {{-- --}} - {{-- --}} - {{-- --}} - {{--
--}} - -
-
- -
-
- - -
-
- @{{ value.name[current_language_code] }} -
-
-
-
-
请添加 Value
-
-
-
- - Add variant +
+
+
数据
+ + +
+
+ +
+
+
+
第一张图片将作为商品主图,支持同时上传多张图片,多张图片之间可随意调整位置;
+
开启多规格并且多规格配置了图片时,这里的图片将作为多规格的公用图片,展示在其后面
+
+ + + -
- - - - - - - - - - - - - - - - - - - - - - - -
- @{{ variant.name[current_language_code] || 'No name' }} - imagemodelskupriceorgin pricecost pricequantity
-
-
- - -
-
-
+ + @foreach ($source['categories'] as $_category) +
+ id, $category_ids) ? 'checked' : '' }}> + +
+ @endforeach +
- {{--
+
+
商品库存
+ + + + + + + +
+ +
+
+
+ +
+
- + @{{ variant.name[current_language_code] }} + 编辑 + 移除 +
+
+ 添加规格图片 + Add value
- --}} + +
+ {{--
--}} + {{-- --}} + {{-- --}} + {{-- --}} + {{--
--}} - - -
- -
+
+
+ +
+
+ + +
+
+ @{{ value.name[current_language_code] }} +
+
+ +
+
请添加 Value
+
+
+ + + Add variant +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ @{{ variant.name[current_language_code] || 'No name' }} + imagemodelskupriceorgin pricecost pricequantity
+
+
+ + +
+
+
+ + +
+ +
+
+
+ +
+
+
商品详情
+ - + +
+ - + @{{ item.id }} -
+
@{{ item.name || '无名称' }} @{{ item.price_formatted }} @{{ item.created_at }}