From 2e4115dbe696e957d3135007815ada343a42015a Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Tue, 9 Aug 2022 10:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E5=B0=BE=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DesignFooterController.php | 2 +- public/build/beike/admin/css/design.css | 34 ++++ public/build/beike/admin/js/app.js | 111 +++++++------ public/build/beike/shop/default/css/app.css | 12 +- public/build/beike/shop/default/js/app.js | 7 + resources/beike/admin/css/design/app.scss | 46 ++++++ resources/beike/admin/js/app.js | 68 +++----- resources/beike/admin/js/common.js | 34 ++++ .../component/image_selector.blade.php | 11 +- .../builder/component/link_selector.blade.php | 4 +- .../component/rich_text_i18n.blade.php | 153 ++++++++++++++++++ .../pages/design/builder/footer.blade.php | 140 +++++++++++----- .../admin/views/pages/pages/form.blade.php | 2 +- resources/beike/shop/default/css/footer.scss | 2 +- resources/beike/shop/default/js/common.js | 7 + themes/default/layout/footer.blade.php | 6 +- 16 files changed, 495 insertions(+), 144 deletions(-) create mode 100644 resources/beike/admin/js/common.js create mode 100644 resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php diff --git a/beike/Admin/Http/Controllers/DesignFooterController.php b/beike/Admin/Http/Controllers/DesignFooterController.php index 54ca99db..12b2a714 100644 --- a/beike/Admin/Http/Controllers/DesignFooterController.php +++ b/beike/Admin/Http/Controllers/DesignFooterController.php @@ -19,7 +19,7 @@ class DesignFooterController extends Controller public function index(Request $request): View { $data = [ - 'languages' => LanguageRepo::all(), + // 'languages' => LanguageRepo::all(), 'design_settings' => system_setting('base.footer_setting'), ]; return view('admin::pages.design.builder.footer', $data); diff --git a/public/build/beike/admin/css/design.css b/public/build/beike/admin/css/design.css index 541350f5..a7e99e1e 100644 --- a/public/build/beike/admin/css/design.css +++ b/public/build/beike/admin/css/design.css @@ -339,6 +339,40 @@ body.page-design .autocomplete-group-wrapper .item-group-wrapper .item i.right:h color: #222; } +.footer-link-item { + padding: 6px 10px; + background: #f5f5f5; + margin-bottom: 10px; + position: relative; +} +.footer-link-item:hover .remove-item { + display: block; +} +.footer-link-item .icon-rank { + position: absolute; + top: 11px; + left: 10px; + z-index: 9; +} +.footer-link-item .link-selector-wrap > .title { + padding-left: 20px; +} +.footer-link-item .remove-item { + position: absolute; + display: none; + top: 0; + right: 0; + background: red; + color: #fff; + z-index: 9; + padding: 0 4px; + cursor: pointer; + border-radius: 0 0 0 4px; +} +.footer-link-item .remove-item:hover { + background: #c70000; +} + .file-manager-box .layui-layer-title { background-color: #293042; color: #fff; diff --git a/public/build/beike/admin/js/app.js b/public/build/beike/admin/js/app.js index d78e6fb3..1da0244a 100644 --- a/public/build/beike/admin/js/app.js +++ b/public/build/beike/admin/js/app.js @@ -2063,34 +2063,18 @@ module.exports = { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _js_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../js/http */ "./resources/js/http.js"); +/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ "./resources/beike/admin/js/common.js"); var _document$querySelect; window.$http = _js_http__WEBPACK_IMPORTED_MODULE_0__["default"]; + +window.bk = _common__WEBPACK_IMPORTED_MODULE_1__["default"]; 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) { - var $this = $(this); - layer.open({ - type: 2, - title: '图片管理器', - shadeClose: false, - skin: 'file-manager-box', - scrollbar: false, - shade: 0.4, - area: ['1060px', '680px'], - content: "".concat(base, "/file_manager"), - success: function success(layerInstance, index) { - var iframeWindow = window[layerInstance.find("iframe")[0]["name"]]; - - iframeWindow.callback = function (images) { - $this.find('img').prop('src', images[0].url); - $this.next('input').val(images[0].path); - $this.next('input')[0].dispatchEvent(new Event('input')); - }; - } - }); + bk.fileManagerIframe(); }); if (typeof Vue != 'undefined') { @@ -2126,7 +2110,7 @@ $(document).ready(function ($) { tinymceInit(); }); -function tinymceInit() { +var tinymceInit = function tinymceInit() { if (typeof tinymce == 'undefined') { return; } @@ -2148,40 +2132,75 @@ function tinymceInit() { fontsize_formats: "10px 12px 14px 18px 24px 36px", relative_urls: true, setup: function setup(ed) { + var height = ed.getElement().dataset.tinymceHeight; // console.log(ed); + // 修改 tinymce 的高度 + // if (height) { + // ed.theme.resizeTo(null, height); + // } + ed.ui.registry.addButton('toolbarImageButton', { // text: '', icon: 'image', onAction: function onAction() { - layer.open({ - type: 2, - title: '图片管理器', - shadeClose: false, - skin: 'file-manager-box', - scrollbar: false, - shade: 0.4, - area: ['1060px', '680px'], - content: "".concat(base, "/file_manager"), - success: function success(layerInstance, index) { - var iframeWindow = window[layerInstance.find("iframe")[0]["name"]]; - - iframeWindow.callback = function (images) { - if (images.length) { - images.forEach(function (e) { - ed.insertContent("")); - }); - } - }; + bk.fileManagerIframe(function (images) { + if (images.length) { + images.forEach(function (e) { + ed.insertContent("")); + }); } }); } - }); // ed.on('change', function(e) { - // if (e.target.targetElm.dataset.key) { - // app.form[e.target.targetElm.dataset.key] = ed.getContent() - // } - // }); + }); } }); -} +}; + +/***/ }), + +/***/ "./resources/beike/admin/js/common.js": +/*!********************************************!*\ + !*** ./resources/beike/admin/js/common.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* + * @copyright 2022 opencart.cn - All Rights Reserved. + * @link https://www.guangdawangluo.com + * @Author PS + * @Date 2022-08-09 09:39:34 + * @LastEditTime 2022-08-09 09:43:18 + */ +/* 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: '图片管理器', + shadeClose: false, + skin: 'file-manager-box', + scrollbar: false, + shade: 0.4, + area: ['1060px', '680px'], + content: "".concat(base, "/file_manager"), + success: function success(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')); + }; + } + }); + } +}); /***/ }), diff --git a/public/build/beike/shop/default/css/app.css b/public/build/beike/shop/default/css/app.css index 137ab57f..aa6425e1 100644 --- a/public/build/beike/shop/default/css/app.css +++ b/public/build/beike/shop/default/css/app.css @@ -582,27 +582,27 @@ footer { background: #fafafa; margin-top: 5rem; } -footer .footer-top { +footer .services-wrap { padding: 2.2rem 0; border-bottom: 1px solid #e4e4e4; } -footer .footer-top .service-item { +footer .services-wrap .service-item { display: flex; align-items: center; } -footer .footer-top .service-item .icon { +footer .services-wrap .service-item .icon { width: 34px; margin-right: 14px; } -footer .footer-top .service-item p { +footer .services-wrap .service-item p { margin-bottom: 0; } -footer .footer-top .service-item .title { +footer .services-wrap .service-item .title { margin-bottom: 2px; font-weight: bold; color: #333; } -footer .footer-top .service-item .sub-title { +footer .services-wrap .service-item .sub-title { font-size: 0.6rem; color: #8D94A0; } diff --git a/public/build/beike/shop/default/js/app.js b/public/build/beike/shop/default/js/app.js index f19978a3..df61bd0b 100644 --- a/public/build/beike/shop/default/js/app.js +++ b/public/build/beike/shop/default/js/app.js @@ -2065,6 +2065,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); +/* + * @copyright 2022 opencart.cn - All Rights Reserved. + * @link https://www.guangdawangluo.com + * @Author PS + * @Date 2022-08-04 17:22:54 + * @LastEditTime 2022-08-09 09:40:08 + */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ /** * @description: 获取购物车数据 diff --git a/resources/beike/admin/css/design/app.scss b/resources/beike/admin/css/design/app.scss index 6e0b2f3d..1feb12f1 100644 --- a/resources/beike/admin/css/design/app.scss +++ b/resources/beike/admin/css/design/app.scss @@ -430,6 +430,52 @@ body.page-design { } } +.footer-link-item { + padding: 6px 10px; + background: #f5f5f5; + margin-bottom: 10px; + position: relative; + + &:hover { + .remove-item { + display: block; + } + } + + .icon-rank { + position: absolute; + top: 11px; + left: 10px; + z-index: 9; + } + + .link-selector-wrap { + > .title { + padding-left: 20px; + } + + .selector-type .title { + // line-height: 1.42857; + } + } + + .remove-item { + position: absolute; + display: none; + top: 0; + right: 0; + background: red; + color: #fff; + z-index: 9; + padding: 0 4px; + cursor: pointer; + border-radius: 0 0 0 4px; + &:hover { + background: #c70000; + } + } +} + .file-manager-box { .layui-layer-title { background-color: #293042; diff --git a/resources/beike/admin/js/app.js b/resources/beike/admin/js/app.js index 1c6f3818..c1c68744 100644 --- a/resources/beike/admin/js/app.js +++ b/resources/beike/admin/js/app.js @@ -1,30 +1,14 @@ import http from "../../../js/http"; window.$http = http; +import common from "./common"; +window.bk = common; + const base = document.querySelector('base').href; 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) { - const $this = $(this); - - layer.open({ - type: 2, - title: '图片管理器', - shadeClose: false, - skin: 'file-manager-box', - scrollbar: false, - shade: 0.4, - area: ['1060px', '680px'], - content: `${base}/file_manager`, - success: function(layerInstance, index) { - var iframeWindow = window[layerInstance.find("iframe")[0]["name"]]; - iframeWindow.callback = function(images) { - $this.find('img').prop('src', images[0].url); - $this.next('input').val(images[0].path) - $this.next('input')[0].dispatchEvent(new Event('input')); - } - } - }); + bk.fileManagerIframe(); }); if (typeof Vue != 'undefined') { @@ -53,7 +37,7 @@ $(document).ready(function ($) { tinymceInit() }); -function tinymceInit() { +const tinymceInit = () => { if (typeof tinymce == 'undefined') { return; } @@ -75,38 +59,28 @@ function tinymceInit() { "微软雅黑='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) { + setup: function(ed) { + const height = ed.getElement().dataset.tinymceHeight; + // console.log(ed); + // 修改 tinymce 的高度 + // if (height) { + // ed.theme.resizeTo(null, height); + // } + ed.ui.registry.addButton('toolbarImageButton',{ // text: '', icon: 'image', onAction:function() { - layer.open({ - type: 2, - title: '图片管理器', - shadeClose: false, - skin: 'file-manager-box', - scrollbar: false, - shade: 0.4, - area: ['1060px', '680px'], - content: `${base}/file_manager`, - success: function(layerInstance, index) { - var iframeWindow = window[layerInstance.find("iframe")[0]["name"]]; - iframeWindow.callback = function(images) { - if (images.length) { - images.forEach(e => { - ed.insertContent(``); - }); - } - } + bk.fileManagerIframe(images => { + if (images.length) { + images.forEach(e => { + ed.insertContent(``); + }); } - }); + }) } }); - // 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/js/common.js b/resources/beike/admin/js/common.js new file mode 100644 index 00000000..213560cd --- /dev/null +++ b/resources/beike/admin/js/common.js @@ -0,0 +1,34 @@ +/* + * @copyright 2022 opencart.cn - All Rights Reserved. + * @link https://www.guangdawangluo.com + * @Author PS + * @Date 2022-08-09 09:39:34 + * @LastEditTime 2022-08-09 09:43:18 + */ +export default { + fileManagerIframe(callback) { + const base = document.querySelector('base').href; + const $this = $(this); + + layer.open({ + type: 2, + title: '图片管理器', + shadeClose: false, + skin: 'file-manager-box', + scrollbar: false, + shade: 0.4, + area: ['1060px', '680px'], + content: `${base}/file_manager`, + 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')); + } + } + }); + }, +} \ No newline at end of file diff --git a/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php b/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php index 357aab4f..f18c9166 100644 --- a/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php +++ b/resources/beike/admin/views/pages/design/builder/component/image_selector.blade.php @@ -23,7 +23,14 @@
- +
+ +
+ +
+
+
+
选择 删除 @@ -51,7 +58,7 @@ data: function () { return { - tabActiveId: $language_id, + tabActiveId: $locale, languages: $languages, internalValues: {}, id: 'image-selector-'+ randomString(4), 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 1cd9bbe5..bf5c3f48 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 @@ -288,8 +288,8 @@ }, updateData() { - this.value.type = this.value.type || 'category'; - this.value.link = this.value.link || ''; + this.value.type = this.value?.type || 'category'; + this.value.link = this.value?.link || ''; this.link = JSON.parse(JSON.stringify(this.value)); if (this.type) { this.types = this.types.filter(e => e.type == this.type); 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 new file mode 100644 index 00000000..243d9d5d --- /dev/null +++ b/resources/beike/admin/views/pages/design/builder/component/rich_text_i18n.blade.php @@ -0,0 +1,153 @@ + + + + + diff --git a/resources/beike/admin/views/pages/design/builder/footer.blade.php b/resources/beike/admin/views/pages/design/builder/footer.blade.php index 7739afaf..a859d7b3 100644 --- a/resources/beike/admin/views/pages/design/builder/footer.blade.php +++ b/resources/beike/admin/views/pages/design/builder/footer.blade.php @@ -16,6 +16,7 @@ + @@ -31,7 +32,7 @@
- +
启用
@@ -69,27 +70,102 @@
+ +
+
logo
+ +
+
+
简介
+ +
+
+ @for ($i = 1; $i <= 3; $i++) + +
+
配置标题
+ +
+
+
链接
+ + + + +
+ 添加链接 +
+ @endfor + + +
+
联系电话
+ +
+
+
地址
+ +
+
+
邮箱
+ +
+
+ + + + + + + + + +
+ 添加链接 +
+
- +
@include('admin::pages.design.builder.component.image_selector') @include('admin::pages.design.builder.component.link_selector') @include('admin::pages.design.builder.component.text_i18n') + @include('admin::pages.design.builder.component.rich_text_i18n')