From 060f10e5ac43d9b56703232f883905f555f6d5b2 Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Fri, 12 Aug 2022 11:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=BA=9B=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E9=85=8D=E7=BD=AE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/CustomerController.php | 4 + beike/Admin/View/Components/Form/Image.php | 6 +- public/build/beike/admin/js/app.js | 22 ++-- public/build/beike/shop/default/css/app.css | 16 ++- public/catalog/favicon.png | Bin 0 -> 2309 bytes resources/beike/admin/js/app.js | 13 ++- resources/beike/admin/js/common.js | 7 +- .../views/components/form/image.blade.php | 17 ++- .../views/pages/customers/index.blade.php | 25 +++- .../builder/component/link_selector.blade.php | 4 + .../component/rich_text_i18n.blade.php | 2 +- .../pages/design/builder/index.blade.php | 4 +- .../beike/admin/views/pages/setting.blade.php | 110 +++++++++++------- resources/beike/shop/default/css/footer.scss | 9 +- resources/beike/shop/default/css/global.scss | 6 + resources/beike/shop/default/css/header.scss | 4 +- resources/lang/en/shop/account.php | 8 ++ resources/lang/zh_cn/shop/account.php | 11 +- resources/lang/zh_cn/shop/brands.php | 14 +++ themes/default/layout/footer.blade.php | 12 +- themes/default/layout/header.blade.php | 5 +- themes/default/layout/master.blade.php | 2 +- themes/default/pages/detail.blade.php | 2 +- 23 files changed, 197 insertions(+), 106 deletions(-) create mode 100644 public/catalog/favicon.png create mode 100644 resources/lang/zh_cn/shop/brands.php diff --git a/beike/Admin/Http/Controllers/CustomerController.php b/beike/Admin/Http/Controllers/CustomerController.php index d1434f86..c93a4dbd 100644 --- a/beike/Admin/Http/Controllers/CustomerController.php +++ b/beike/Admin/Http/Controllers/CustomerController.php @@ -35,6 +35,10 @@ class CustomerController extends Controller 'customer_groups' => CustomerGroupDetail::collection(CustomerGroupRepo::list())->jsonSerialize(), ]; + if ($request->expectsJson()) { + return json_success('成功', $data); + } + return view('admin::pages.customers.index', $data); } diff --git a/beike/Admin/View/Components/Form/Image.php b/beike/Admin/View/Components/Form/Image.php index 122a4eda..dd51eba6 100644 --- a/beike/Admin/View/Components/Form/Image.php +++ b/beike/Admin/View/Components/Form/Image.php @@ -7,13 +7,13 @@ use Illuminate\View\Component; class Image extends Component { public string $name; - public string $image; + public string $title; public string $value; - public function __construct(string $name, ?string $image, ?string $value) + public function __construct(string $name, ?string $title, ?string $value) { $this->name = $name; - $this->image = $image ?? ''; + $this->title = $title ?? ''; $this->value = $value ?? ''; } diff --git a/public/build/beike/admin/js/app.js b/public/build/beike/admin/js/app.js index ec9a70af..40e01bd5 100644 --- a/public/build/beike/admin/js/app.js +++ b/public/build/beike/admin/js/app.js @@ -2075,7 +2075,19 @@ var base = document.querySelector('base').href; var asset = document.querySelector('meta[name="asset"]').content; var editor_language = ((_document$querySelect = document.querySelector('meta[name="editor_language"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content) || 'zh_cn'; $(document).on('click', '.open-file-manager', function (event) { - bk.fileManagerIframe(); + var _this = this; + + bk.fileManagerIframe(function (images) { + if (!$(_this).find('img').length) { + $(_this).append(''); + $(_this).find('i').remove(); + } else { + $(_this).find('img').prop('src', images[0].url); + } + + $(_this).next('input').val(images[0].path); + $(_this).next('input')[0].dispatchEvent(new Event('input')); + }); }); if (typeof Vue != 'undefined') { @@ -2117,7 +2129,7 @@ var tinymceInit = function tinymceInit() { 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", + toolbar: "undo redo | toolbarImageButton | lineheight | 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, @@ -2166,7 +2178,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ fileManagerIframe: function fileManagerIframe(callback) { var base = document.querySelector('base').href; - var $this = $(this); layer.open({ type: 2, title: '图片管理器', @@ -2180,10 +2191,7 @@ __webpack_require__.r(__webpack_exports__); var iframeWindow = window[layerInstance.find("iframe")[0]["name"]]; iframeWindow.callback = function (images) { - if (callback && typeof callback === "function") return callback(images); - $this.find('img').prop('src', images[0].url); - $this.next('input').val(images[0].path); - $this.next('input')[0].dispatchEvent(new Event('input')); + callback(images); }; } }); diff --git a/public/build/beike/shop/default/css/app.css b/public/build/beike/shop/default/css/app.css index e5d1b1fb..ef5c4131 100644 --- a/public/build/beike/shop/default/css/app.css +++ b/public/build/beike/shop/default/css/app.css @@ -365,6 +365,10 @@ body[class^=page-account-] { background: #FD560F; } +.tinymce-format-p p { + margin-bottom: 0.5rem; +} + .steps-wrap { display: flex; justify-content: space-around; @@ -525,8 +529,8 @@ header .header-content .menu-wrap .nav-link { padding-right: 1rem; } header .header-content .logo img { - max-width: 140px; - max-height: 30px; + max-width: 180px; + max-height: 50px; } header .header-content .right-btn .nav-link { color: #333; @@ -634,13 +638,7 @@ footer .footer-content .text { color: #666666; } footer .footer-content h6 { - font-weight: bold; -} -footer .footer-content .list-unstyled { - margin-bottom: 0; -} -footer .footer-content .list-unstyled li { - line-height: 26px; + font-size: 14px; } footer .footer-bottom { height: 60px; diff --git a/public/catalog/favicon.png b/public/catalog/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..08b4a455d7c0b7ff8f2aff5a2387511e62e44760 GIT binary patch literal 2309 zcmY*bc|25Y8$M=a7)i)hXc{AhW-y3p?2{$NmTaXMhQy3zF!t=S#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}v$?SEp2(Ae&mra$a?Zl~6v>xi zwL(D)mdw1qFAoA4dh`8o`@2OF;-KET_g;*o%C$#gqTj5Zfn0|e20>$rV;cyYLmLuF zajume3SOa!QdA$g6@8*!C`7syt)+ij$k1SGz`HD6oHo_t@wwG4S_zm~y7zs0vvZJP zusfKRI^q0@9BW=cTx>}YN1ytRxK@#b_L%I(6=f%(_DBycnpK8bm3GMTcsl~|oA!`# zfh&lF1U46V;M!p{9=E@xs!V?lYW&aN`#~q6Hli?5-%Ncl*@}h4R#O^<1hpojLmG z{yaMWO`B+RpvYDcpy&ZnhEtd36U$taUD0h$QgKSf>MtmdlZ18M^}ea!=xaOoi0(-BjweA^ZAX*GhM6@BiNV@li4~csz9LP)0)|4d;xWsEW7IKk~+a9W!#Q&lIq_)apF|&gZ#i2lQs7lZ}a4G-6AUm0?1u{ zetWMvHRThSF<@xYqolw!%QI@|*h@9``&9MjRo+C?UDa}_b=kZwMQm(M0u!(6IyUnrzU#+PxZuh6u+ z3j2IyG=djv-+OFqBZ)8UYy|JDdjqn<*ObFmKD-`zPkjabejBbnBbZ&~+^BN+zI~)J!hi7+q=EYx^p)vU8oD(r1f{{qG*&2ZIvPSO7X Dr5)WW literal 0 HcmV?d00001 diff --git a/resources/beike/admin/js/app.js b/resources/beike/admin/js/app.js index 4c0255c5..6a520789 100644 --- a/resources/beike/admin/js/app.js +++ b/resources/beike/admin/js/app.js @@ -9,7 +9,16 @@ const asset = document.querySelector('meta[name="asset"]').content; const editor_language = document.querySelector('meta[name="editor_language"]')?.content || 'zh_cn'; $(document).on('click', '.open-file-manager', function(event) { - bk.fileManagerIframe(); + bk.fileManagerIframe(images => { + if (!$(this).find('img').length) { + $(this).append(''); + $(this).find('i').remove() + } else { + $(this).find('img').prop('src', images[0].url); + } + $(this).next('input').val(images[0].path) + $(this).next('input')[0].dispatchEvent(new Event('input')); + }); }); if (typeof Vue != 'undefined') { @@ -50,7 +59,7 @@ const tinymceInit = () => { 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", + toolbar: "undo redo | toolbarImageButton | lineheight | 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, diff --git a/resources/beike/admin/js/common.js b/resources/beike/admin/js/common.js index 9cfea54b..de11e6f0 100644 --- a/resources/beike/admin/js/common.js +++ b/resources/beike/admin/js/common.js @@ -1,7 +1,6 @@ export default { fileManagerIframe(callback) { const base = document.querySelector('base').href; - const $this = $(this); layer.open({ type: 2, @@ -15,11 +14,7 @@ export default { success: function(layerInstance, index) { var iframeWindow = window[layerInstance.find("iframe")[0]["name"]]; iframeWindow.callback = function(images) { - if (callback && typeof(callback) === "function") return callback(images); - - $this.find('img').prop('src', images[0].url); - $this.next('input').val(images[0].path) - $this.next('input')[0].dispatchEvent(new Event('input')); + callback(images); } } }); diff --git a/resources/beike/admin/views/components/form/image.blade.php b/resources/beike/admin/views/components/form/image.blade.php index b3162a51..604f0bbc 100644 --- a/resources/beike/admin/views/components/form/image.blade.php +++ b/resources/beike/admin/views/components/form/image.blade.php @@ -1,12 +1,11 @@ -@if (0) - - - @if ($image) - + + + @if ($value) + @else - + @endif - - -@endif \ No newline at end of file + + {{ $slot }} + diff --git a/resources/beike/admin/views/pages/customers/index.blade.php b/resources/beike/admin/views/pages/customers/index.blade.php index 67a6343b..1e618837 100644 --- a/resources/beike/admin/views/pages/customers/index.blade.php +++ b/resources/beike/admin/views/pages/customers/index.blade.php @@ -1,12 +1,12 @@ @extends('admin::layouts.master') -@section('title', '顾客管理') +@section('title', '客户管理') @section('content') - 创建顾客 + 创建客户 @@ -42,10 +42,11 @@ - {{-- {{ $customers->links('admin::vendor/pagination/bootstrap-4') }} --}} + - @@ -82,6 +83,7 @@ el: '#customer-app', data: { + page: 1, customers: @json($customers ?? []), source: { @@ -110,11 +112,22 @@ } }, - beforeMount() { - + watch: { + page: function() { + this.loadData(); + }, }, + // mounted: function() { + // }, + methods: { + loadData() { + $http.get(`customers?page=${this.page}`).then((res) => { + this.customers = res.data.customers; + }) + }, + checkedCustomersCreate() { this.dialogCustomers.show = true }, diff --git a/resources/beike/admin/views/pages/design/builder/component/link_selector.blade.php b/resources/beike/admin/views/pages/design/builder/component/link_selector.blade.php index 8170c3d4..81a1f549 100644 --- a/resources/beike/admin/views/pages/design/builder/component/link_selector.blade.php +++ b/resources/beike/admin/views/pages/design/builder/component/link_selector.blade.php @@ -139,6 +139,10 @@ ], static: [ {name: '个人中心', value: 'account.index'}, + {name: '收藏列表', value: 'account.wishlist.index'}, + {name: '历史订单', value: 'account.order.index'}, + // {name: '最新商品', value: 'account.index'}, + {name: '品牌列表', value: 'brands.index'}, ], link: null, keyword: '', diff --git a/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php b/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php index 243d9d5d..6e87f22f 100644 --- a/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php +++ b/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php @@ -97,7 +97,7 @@ Vue.component('rich-text-i18n', { height: 300, plugins: "link lists fullscreen table hr wordcount image imagetools code", menubar: "", - toolbar: "undo redo | toolbarImageButton | bold italic underline strikethrough | forecolor backcolor | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | formatpainter removeformat | charmap emoticons | preview | template link anchor | code", + toolbar: "undo redo | toolbarImageButton | lineheight | bold italic underline strikethrough | forecolor backcolor | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | formatpainter removeformat | charmap emoticons | preview | template link anchor | code", toolbar_items_size: 'small', image_caption: true, toolbar_mode: 'wrap', diff --git a/resources/beike/admin/views/pages/design/builder/index.blade.php b/resources/beike/admin/views/pages/design/builder/index.blade.php index ecd834b1..af420a85 100644 --- a/resources/beike/admin/views/pages/design/builder/index.blade.php +++ b/resources/beike/admin/views/pages/design/builder/index.blade.php @@ -186,13 +186,13 @@ watch: {}, // 组件方法 methods: { - moduleUpdated(module) { + moduleUpdated: bk.debounce(function() { const data = this.form.modules[this.design.editingModuleIndex] $http.post('design/builder/preview?design=1', data, {hload: true}).then((res) => { $(previewWindow.document).find('#module-' + data.module_id).replaceWith(res); }) - }, + }, 300), addModuleButtonClicked(code) { const sourceModule = this.source.modules.find(e => e.code == code) diff --git a/resources/beike/admin/views/pages/setting.blade.php b/resources/beike/admin/views/pages/setting.blade.php index f46d03a1..d96cbb93 100644 --- a/resources/beike/admin/views/pages/setting.blade.php +++ b/resources/beike/admin/views/pages/setting.blade.php @@ -5,53 +5,83 @@ @section('content') - 基础设置 @csrf - - - - - @foreach ($countries as $country) - id == system_setting('base.country_id', '1') ? 'selected': '' }}> - {{ $country->name }} - - @endforeach - - 默认国家设置 - - - - 默认省份设置 - + @if (session('success')) + + @endif + + + 基础设置 + + + 图片设置 + + + + + + + + + + @foreach ($countries as $country) + id == system_setting('base.country_id', '1') ? 'selected': '' }}> + {{ $country->name }} + + @endforeach + + 默认国家设置 + + + + 默认省份设置 + + + + + + 默认语言设置 + + + + 默认货币设置 + + + + 管理后台目录,默认为admin + + + + 主题模板选择 + + + + 是否启用税费计算 + + + + 按什么地址计算税费 + - + + + 网站前台显示 380*100 + - - 默认语言设置 - - - 默认货币设置 - + + 显示在浏览器选项卡上的小图标,必须为PNG格式大小为:32*32 + - - 管理后台目录,默认为admin - + + 无图片或图片未找到时显示的占位图,建议尺寸:500*500 + + + - - 主题模板选择 - - - - 是否启用税费计算 - - - - 按什么地址计算税费 - 提交 diff --git a/resources/beike/shop/default/css/footer.scss b/resources/beike/shop/default/css/footer.scss index ca666fea..6204c013 100644 --- a/resources/beike/shop/default/css/footer.scss +++ b/resources/beike/shop/default/css/footer.scss @@ -60,14 +60,7 @@ footer { } h6 { - font-weight: bold; - } - - .list-unstyled { - margin-bottom: 0; - li { - line-height: 26px; - } + font-size: 14px; } } diff --git a/resources/beike/shop/default/css/global.scss b/resources/beike/shop/default/css/global.scss index e386771e..f0f4799c 100644 --- a/resources/beike/shop/default/css/global.scss +++ b/resources/beike/shop/default/css/global.scss @@ -97,6 +97,12 @@ body[class^="page-account-"] { } } +.tinymce-format-p { + p { + margin-bottom: 0.5rem; + } +} + .steps-wrap { display: flex; justify-content: space-around; diff --git a/resources/beike/shop/default/css/header.scss b/resources/beike/shop/default/css/header.scss index 2102f9aa..298b6810 100644 --- a/resources/beike/shop/default/css/header.scss +++ b/resources/beike/shop/default/css/header.scss @@ -56,8 +56,8 @@ header { .logo { img { - max-width: 140px; - max-height: 30px; + max-width: 180px; + max-height: 50px; } } diff --git a/resources/lang/en/shop/account.php b/resources/lang/en/shop/account.php index e85b4b21..554ace6a 100644 --- a/resources/lang/en/shop/account.php +++ b/resources/lang/en/shop/account.php @@ -13,4 +13,12 @@ return [ 'login' => 'Login', 'new_account' => 'New Account', 'index' => 'Account', + + 'wishlist' => [ + 'index' => 'Wishlist', + ], + + 'order' => [ + 'index' => 'Order List', + ] ]; diff --git a/resources/lang/zh_cn/shop/account.php b/resources/lang/zh_cn/shop/account.php index afd7640e..6af15539 100644 --- a/resources/lang/zh_cn/shop/account.php +++ b/resources/lang/zh_cn/shop/account.php @@ -10,7 +10,14 @@ */ return [ - 'login' => 'Login', - 'new_account' => 'New Account', 'index' => '个人中心', + 'login' => '登录', + + 'wishlist' => [ + 'index' => '收藏列表', + ], + + 'order' => [ + 'index' => '订单列表', + ] ]; diff --git a/resources/lang/zh_cn/shop/brands.php b/resources/lang/zh_cn/shop/brands.php new file mode 100644 index 00000000..c76b760a --- /dev/null +++ b/resources/lang/zh_cn/shop/brands.php @@ -0,0 +1,14 @@ + + * @created 2022-08-04 10:59:15 + * @modified 2022-08-04 10:59:15 + */ + +return [ + 'index' => '品牌列表', +]; diff --git a/themes/default/layout/footer.blade.php b/themes/default/layout/footer.blade.php index 53dfaf60..a5480296 100644 --- a/themes/default/layout/footer.blade.php +++ b/themes/default/layout/footer.blade.php @@ -26,7 +26,7 @@ @@ -38,11 +38,13 @@ {{ $link['title'][$locale] }} @foreach ($link['links'] as $item) - + @if ($item['link']) + {{ $item['type'] == 'custom' ? $item['text'][$locale] ?? '' : $item['text'] }} + @endif @endforeach @@ -51,13 +53,13 @@ 联系我们 @if ($footer_content['content']['contact']['email']) - {{ $footer_content['content']['contact']['email'] }} + {{ $footer_content['content']['contact']['email'] }} @endif @if ($footer_content['content']['contact']['telephone']) - {{ $footer_content['content']['contact']['telephone'] }} + {{ $footer_content['content']['contact']['telephone'] }} @endif @if ($footer_content['content']['contact']['address']) - {{ $footer_content['content']['contact']['address'] }} + {{ $footer_content['content']['contact']['address'] }} @endif diff --git a/themes/default/layout/header.blade.php b/themes/default/layout/header.blade.php index 5f12cc84..43f0afdd 100644 --- a/themes/default/layout/header.blade.php +++ b/themes/default/layout/header.blade.php @@ -44,8 +44,9 @@ - + + + @foreach ($categories as $category) diff --git a/themes/default/layout/master.blade.php b/themes/default/layout/master.blade.php index ad3ea2cc..a5bb0263 100644 --- a/themes/default/layout/master.blade.php +++ b/themes/default/layout/master.blade.php @@ -12,7 +12,7 @@ - {{-- --}} + diff --git a/themes/default/pages/detail.blade.php b/themes/default/pages/detail.blade.php index 8a9dcbed..85da6ebe 100644 --- a/themes/default/pages/detail.blade.php +++ b/themes/default/pages/detail.blade.php @@ -1,6 +1,6 @@ @extends('layout.master') @section('body-class', 'page-pages') -@section('title', $page['title']) +@section('title', $page['meta_title'] ?: $page['title']) @section('keywords', $page['meta_keyword']) @section('description', $page['meta_description'])