wip
This commit is contained in:
parent
a210d9c26b
commit
a417999def
|
|
@ -14,7 +14,7 @@ class DesignController extends Controller
|
|||
'editors' => ['editor-slide_show'],
|
||||
'design_settings' => setting('system.design_setting'),
|
||||
];
|
||||
return view('design.builder.index', $data);
|
||||
return view('admin::pages.design.builder.index', $data);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -99,21 +99,11 @@ class AdminServiceProvider extends ServiceProvider
|
|||
$componentName = Str::studly($folderName);
|
||||
$classBaseName = "\\Beike\\Admin\\View\\DesignBuilders\\{$componentName}";
|
||||
|
||||
$editorClass = $classBaseName . '\\Editor';
|
||||
if (!class_exists($editorClass)) {
|
||||
throw new \Exception("请先定义自定义模板类 {$editorClass}");
|
||||
if (!class_exists($classBaseName)) {
|
||||
throw new \Exception("请先定义自定义模板类 {$classBaseName}");
|
||||
}
|
||||
$this->loadViewComponentsAs('editor', [
|
||||
$aliasName => $editorClass
|
||||
]);
|
||||
|
||||
$renderClass = $classBaseName . '\\Render';
|
||||
if (!class_exists($renderClass)) {
|
||||
throw new \Exception("请先定义自定义模板类 {$renderClass}");
|
||||
}
|
||||
|
||||
$this->loadViewComponentsAs('render', [
|
||||
$aliasName => $renderClass
|
||||
$aliasName => $classBaseName
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@
|
|||
* @modified 2022-07-08 17:09:15
|
||||
*/
|
||||
|
||||
namespace Beike\Admin\View\DesignBuilders\SlideShow;
|
||||
namespace Beike\Admin\View\DesignBuilders;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class Editor extends Component
|
||||
class SlideShow extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
|
|
@ -39,6 +39,6 @@ class Editor extends Component
|
|||
'icon' => '',
|
||||
];
|
||||
|
||||
return view('design.module.slideshow.editor.index', $data);
|
||||
return view('admin::pages.design.module.slideshow', $data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Render.php
|
||||
*
|
||||
* @copyright 2022 opencart.cn - All Rights Reserved
|
||||
* @link http://www.guangdawangluo.com
|
||||
* @author Edward Yang <yangjin@opencart.cn>
|
||||
* @created 2022-07-08 17:09:15
|
||||
* @modified 2022-07-08 17:09:15
|
||||
*/
|
||||
|
||||
namespace Beike\Admin\View\DesignBuilders\SlideShow;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class Render extends Component
|
||||
{
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($settings = [])
|
||||
{
|
||||
if ($settings) {
|
||||
$this->settings = $settings;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return View|
|
||||
*/
|
||||
public function render(): View
|
||||
{
|
||||
return view('design.module.slideshow.render.index', $this->settings);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ class HomeController extends Controller
|
|||
foreach ($modules as $module) {
|
||||
$code = $module['code'];
|
||||
$content = $module['content'];
|
||||
$viewPath = "design.module.{$code}.render.index";
|
||||
$viewPath = "design.{$code}";
|
||||
if (view()->exists($viewPath)) {
|
||||
$html .= view($viewPath, $content)->render();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
(function () {
|
||||
$globalConfig.factories.slideshow = {
|
||||
make: function () {
|
||||
return {
|
||||
content: {
|
||||
style: {
|
||||
background_color: ''
|
||||
},
|
||||
full: true,
|
||||
floor: languagesFill(''),
|
||||
images: [
|
||||
{
|
||||
image: languagesFill('catalog/demo/slideshow/2.jpg'),
|
||||
show: true,
|
||||
link: {
|
||||
type: 'product',
|
||||
value:''
|
||||
}
|
||||
},
|
||||
{
|
||||
image: languagesFill('catalog/demo/slideshow/1.jpg'),
|
||||
show: false,
|
||||
link: {
|
||||
type: 'product',
|
||||
value:''
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
Loading…
Reference in New Issue