diff --git a/beike/Admin/Http/Controllers/DesignController.php b/beike/Admin/Http/Controllers/DesignController.php index 4765cf9b..cb4efe05 100644 --- a/beike/Admin/Http/Controllers/DesignController.php +++ b/beike/Admin/Http/Controllers/DesignController.php @@ -18,7 +18,7 @@ class DesignController extends Controller public function index(Request $request): View { $data = [ - 'editors' => ['editor-slide_show', 'editor-image401', 'editor-tab_product', 'editor-image100', 'editor-brand'], + 'editors' => ['editor-slide_show', 'editor-image401', 'editor-tab_product', 'editor-product', 'editor-image100', 'editor-brand', 'editor-icons'], 'design_settings' => system_setting('base.design_setting'), ]; diff --git a/beike/Admin/View/DesignBuilders/Icons.php b/beike/Admin/View/DesignBuilders/Icons.php new file mode 100644 index 00000000..80e5af1a --- /dev/null +++ b/beike/Admin/View/DesignBuilders/Icons.php @@ -0,0 +1,44 @@ + + * @created 2022-07-08 17:09:15 + * @modified 2022-07-08 17:09:15 + */ + +namespace Beike\Admin\View\DesignBuilders; + +use Illuminate\Contracts\View\View; +use Illuminate\View\Component; + +class Icons extends Component +{ + /** + * Create a new component instance. + * + * @return void + */ + public function __construct() + { + } + + /** + * Get the view / contents that represent the component. + * + * @return View + */ + public function render(): View + { + $data['register'] = [ + 'code' => 'icons', + 'sort' => 0, + 'name' => trans('admin/design_builder.module_icons'), + 'icon' => '', + ]; + + return view('admin::pages.design.module.icons', $data); + } +} diff --git a/beike/Admin/View/DesignBuilders/Product.php b/beike/Admin/View/DesignBuilders/Product.php new file mode 100644 index 00000000..0ce3d92a --- /dev/null +++ b/beike/Admin/View/DesignBuilders/Product.php @@ -0,0 +1,44 @@ + + * @created 2022-07-08 17:09:15 + * @modified 2022-07-08 17:09:15 + */ + +namespace Beike\Admin\View\DesignBuilders; + +use Illuminate\View\Component; +use Illuminate\Contracts\View\View; + +class Product extends Component +{ + /** + * Create a new component instance. + * + * @return void + */ + public function __construct() + { + } + + /** + * Get the view / contents that represent the component. + * + * @return View + */ + public function render(): View + { + $data['register'] = [ + 'code' => 'product', + 'sort' => 0, + 'name' => trans('admin/design_builder.module_product'), + 'icon' => '', + ]; + + return view('admin::pages.design.module.product', $data); + } +} diff --git a/beike/Services/DesignService.php b/beike/Services/DesignService.php index 643dc63f..e2e37859 100644 --- a/beike/Services/DesignService.php +++ b/beike/Services/DesignService.php @@ -49,6 +49,10 @@ class DesignService return self::handleBrand($content); } elseif ($moduleCode == 'tab_product') { return self::handleTabProducts($content); + } elseif ($moduleCode == 'product') { + return self::handleProducts($content); + } elseif ($moduleCode == 'icons') { + return self::handleIcons($content); } return $content; @@ -111,6 +115,35 @@ class DesignService return $content; } + /** + * 处理 icons 模块 + * + * @param $content + * @return array + * @throws \Exception + */ + private static function handleIcons($content): array + { + $content['title'] = $content['title'][locale()] ?? ''; + + if (empty($content['images'])) { + return $content; + } + + $images = []; + foreach ($content['images'] as $image) { + $images[] = [ + 'image' => image_origin($image['image'] ?? ''), + 'text' => $image['text'][locale()] ?? '', + 'link' => self::handleLink($image['link']['type'] ?? '', $image['link']['value'] ?? ''), + ]; + } + + $content['images'] = $images; + + return $content; + } + /** * 处理选项卡商品列表模块 * @@ -137,6 +170,19 @@ class DesignService return $content; } + /** + * 处理商品模块 + * + * @param $content + * @return array + */ + private static function handleProducts($content): array + { + $content['products'] = ProductRepo::getProductsByIds($content['products'])->jsonSerialize(); + $content['title'] = $content['title'][locale()] ?? ''; + return $content; + } + /** * 处理图片以及链接 * @throws \Exception diff --git a/resources/beike/admin/views/pages/design/module/icons.blade.php b/resources/beike/admin/views/pages/design/module/icons.blade.php new file mode 100644 index 00000000..e3fa9823 --- /dev/null +++ b/resources/beike/admin/views/pages/design/module/icons.blade.php @@ -0,0 +1,104 @@ + + + diff --git a/resources/beike/admin/views/pages/design/module/product.blade.php b/resources/beike/admin/views/pages/design/module/product.blade.php new file mode 100644 index 00000000..6321f9a5 --- /dev/null +++ b/resources/beike/admin/views/pages/design/module/product.blade.php @@ -0,0 +1,138 @@ + + + diff --git a/resources/beike/shop/default/css/module/slideshow.scss b/resources/beike/shop/default/css/module/slideshow.scss index 9595f0b1..f18b2a60 100644 --- a/resources/beike/shop/default/css/module/slideshow.scss +++ b/resources/beike/shop/default/css/module/slideshow.scss @@ -31,27 +31,39 @@ .swiper-button-prev,.swiper-button-next { width: 34px; height: 37px; - color: #333; + color: #999; @media (max-width: 768px) { display: none; } - &:after { - font-size: 22px; + &:hover { + color: $primary; } + + &:after { + font-size: 26px; + } + } .swiper-button-prev { - left: -50px; + left: -40px; } .swiper-button-next { - right: -50px; + right: -40px; } .swiper-pagination { .swiper-pagination-bullet-active { background: $primary; } + + &.rectangle { + span { + border-radius: 0; + height: 3px; + } + } } } \ No newline at end of file diff --git a/resources/beike/shop/default/css/product-style.scss b/resources/beike/shop/default/css/product-style.scss index 07ff8a86..491c15f4 100644 --- a/resources/beike/shop/default/css/product-style.scss +++ b/resources/beike/shop/default/css/product-style.scss @@ -120,7 +120,7 @@ font-weight: bold; } - .price-lod { + .price-old { color: #aaa; margin-left: 4px; text-decoration: line-through; diff --git a/resources/lang/de/admin/design_builder.php b/resources/lang/de/admin/design_builder.php index 56c6fcb8..68497bd6 100644 --- a/resources/lang/de/admin/design_builder.php +++ b/resources/lang/de/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => 'eine Zeile vier Bilder PRO', 'module_slideshow' => 'Folienmodul', 'module_tab_products' => 'Tab-Produkte', + 'module_product' => 'Warenmodul', + 'module_icons' => 'Symbolmodul', ]; diff --git a/resources/lang/en/admin/design_builder.php b/resources/lang/en/admin/design_builder.php index 3c18b65d..af1e5179 100644 --- a/resources/lang/en/admin/design_builder.php +++ b/resources/lang/en/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => 'For Image PRO Module', 'module_slideshow' => 'Slideshow Module', 'module_tab_products' => 'Tab Products Module', + 'module_product' => 'Products Module', + 'module_icons' => 'Icon module', ]; diff --git a/resources/lang/es/admin/design_builder.php b/resources/lang/es/admin/design_builder.php index 837b521e..379063e5 100644 --- a/resources/lang/es/admin/design_builder.php +++ b/resources/lang/es/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => 'Cuatro imágenes en una línea PRO', 'module_slideshow' => 'módulo de presentación de diapositivas', 'module_tab_products' => 'elemento de pestaña', + 'module_product' => 'módulo de productos básicos', + 'module_icons' => 'módulo de iconos', ]; diff --git a/resources/lang/fr/admin/design_builder.php b/resources/lang/fr/admin/design_builder.php index a5ff3615..08e2111f 100644 --- a/resources/lang/fr/admin/design_builder.php +++ b/resources/lang/fr/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => 'une ligne quatre images PRO', 'module_slideshow' => 'module diapositive', 'module_tab_products' => 'onglet produits', + 'module_product' => 'module marchandise', + 'module_icons' => 'module d\'icônes', ]; diff --git a/resources/lang/it/admin/design_builder.php b/resources/lang/it/admin/design_builder.php index 40dfd465..0672c3b9 100644 --- a/resources/lang/it/admin/design_builder.php +++ b/resources/lang/it/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => 'una riga quattro immagini PRO', 'module_slideshow' => 'modulo diapositiva', 'module_tab_products' => 'scheda prodotti', + 'module_product' => 'modulo merci', + 'module_icons' => 'modulo icona', ]; diff --git a/resources/lang/ja/admin/design_builder.php b/resources/lang/ja/admin/design_builder.php index 0f14ca71..9422651d 100644 --- a/resources/lang/ja/admin/design_builder.php +++ b/resources/lang/ja/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => '1 行 4 つの画像 PRO', 'module_slideshow' => 'スライド モジュール', 'module_tab_products' => 'タブ製品', + 'module_product' => '商品モジュール', + 'module_icons' => 'アイコンモジュール', ]; diff --git a/resources/lang/ru/admin/design_builder.php b/resources/lang/ru/admin/design_builder.php index e6880981..6bba1927 100644 --- a/resources/lang/ru/admin/design_builder.php +++ b/resources/lang/ru/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => 'Четыре картинки в одну строку PRO', 'module_slideshow' => 'модуль слайд-шоу', 'module_tab_products' => 'элемент вкладки', + 'module_product' => 'товарный модуль', + 'module_icons' => 'модуль значков', ]; diff --git a/resources/lang/zh_cn/admin/design_builder.php b/resources/lang/zh_cn/admin/design_builder.php index bce18d2b..d10a7758 100644 --- a/resources/lang/zh_cn/admin/design_builder.php +++ b/resources/lang/zh_cn/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => '一行四图 PRO', 'module_slideshow' => '幻灯片模块', 'module_tab_products' => '选项卡商品', + 'module_product' => '商品模块', + 'module_icons' => '图标模块', ]; diff --git a/resources/lang/zh_hk/admin/design_builder.php b/resources/lang/zh_hk/admin/design_builder.php index 62198813..1544baf5 100644 --- a/resources/lang/zh_hk/admin/design_builder.php +++ b/resources/lang/zh_hk/admin/design_builder.php @@ -15,4 +15,6 @@ return [ 'module_four_image_pro' => '一行四圖 PRO', 'module_slideshow' => '幻燈片模塊', 'module_tab_products' => '選項卡商品', + 'module_icons' => '圖標模塊', + 'module_product' => '商品模塊', ]; diff --git a/themes/default/design/icons.blade.php b/themes/default/design/icons.blade.php new file mode 100644 index 00000000..0dfad8e4 --- /dev/null +++ b/themes/default/design/icons.blade.php @@ -0,0 +1,21 @@ +
+ @include('design._partial._module_tool') + +
+
{{ $content['title'] }}
+
+
+ @foreach ($content['images'] as $image) + + @endforeach +
+
+
+
\ No newline at end of file diff --git a/themes/default/design/product.blade.php b/themes/default/design/product.blade.php new file mode 100644 index 00000000..d78ae709 --- /dev/null +++ b/themes/default/design/product.blade.php @@ -0,0 +1,67 @@ +
+ @include('design._partial._module_tool') + +
+
+
{{ $content['title'] }}
+ @if ($content['products']) +
+
+ @foreach ($content['products'] as $product) +
+ @include('shared.product') +
+ @endforeach +
+
+
+
+
+ @elseif (!$content['products'] and $design) +
+ @for ($s = 0; $s < 4; $s++) +
+
+
+
请配置商品
+
+ 66.66 + 99.99 +
+
+
+ @endfor +
+ @endif +
+
+ + +
\ No newline at end of file diff --git a/themes/default/shared/product.blade.php b/themes/default/shared/product.blade.php index e0562330..caf04e9f 100644 --- a/themes/default/shared/product.blade.php +++ b/themes/default/shared/product.blade.php @@ -31,7 +31,9 @@
{{ $product['name_format'] }}
{{ $product['price_format'] }} - {{ $product['origin_price_format'] }} + @if ($product['price'] != $product['origin_price'] && $product['origin_price'] > 0) + {{ $product['origin_price_format'] }} + @endif
@if (request('style_list') == 'list')