wip
This commit is contained in:
parent
d064095e92
commit
5bf30c4649
|
|
@ -15,4 +15,4 @@ yarn-error.log
|
|||
/.vscode
|
||||
mix-manifest.json
|
||||
package-lock.json
|
||||
beike/node_modules
|
||||
beike/node_modules
|
||||
|
|
@ -6,7 +6,6 @@ use Illuminate\View\View;
|
|||
use Illuminate\Http\Request;
|
||||
use Beike\Services\DesignService;
|
||||
use Beike\Repositories\SettingRepo;
|
||||
use Beike\Repositories\LanguageRepo;
|
||||
|
||||
class DesignController extends Controller
|
||||
{
|
||||
|
|
@ -20,7 +19,6 @@ class DesignController extends Controller
|
|||
{
|
||||
$data = [
|
||||
'editors' => ['editor-slide_show', 'editor-image401', 'editor-tab_product', 'editor-image100', 'editor-brand'],
|
||||
'languages' => LanguageRepo::all(),
|
||||
'design_settings' => system_setting('base.design_setting'),
|
||||
];
|
||||
return view('admin::pages.design.builder.index', $data);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use Illuminate\View\View;
|
|||
use Illuminate\Http\Request;
|
||||
use Beike\Services\DesignService;
|
||||
use Beike\Repositories\SettingRepo;
|
||||
use Beike\Repositories\LanguageRepo;
|
||||
|
||||
class DesignFooterController extends Controller
|
||||
{
|
||||
|
|
@ -19,13 +18,11 @@ class DesignFooterController extends Controller
|
|||
public function index(Request $request): View
|
||||
{
|
||||
$data = [
|
||||
// 'languages' => LanguageRepo::all(),
|
||||
'design_settings' => system_setting('base.footer_setting'),
|
||||
];
|
||||
return view('admin::pages.design.builder.footer', $data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 预览模块显示结果
|
||||
*
|
||||
|
|
@ -36,20 +33,13 @@ class DesignFooterController extends Controller
|
|||
public function preview(Request $request): View
|
||||
{
|
||||
$module = json_decode($request->getContent(), true);
|
||||
$moduleId = $module['module_id'] ?? '';
|
||||
$moduleCode = $module['code'] ?? '';
|
||||
$content = $module['content'] ?? '';
|
||||
$viewPath = "design.{$moduleCode}";
|
||||
|
||||
$viewData = [
|
||||
'code' => $moduleCode,
|
||||
'module_id' => $moduleId,
|
||||
'view_path' => $viewPath,
|
||||
'content' => DesignService::handleModuleContent($moduleCode, $content),
|
||||
'design' => (bool)$request->get('design')
|
||||
];
|
||||
// $viewData = [
|
||||
// 'content' => DesignService::handleModuleContent($moduleCode, $content),
|
||||
// 'design' => (bool)$request->get('design')
|
||||
// ];
|
||||
|
||||
return view($viewPath, $viewData);
|
||||
// return view($viewPath, $viewData);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -63,12 +53,12 @@ class DesignFooterController extends Controller
|
|||
public function update(Request $request): array
|
||||
{
|
||||
$content = json_decode($request->getContent(), true);
|
||||
$moduleData = DesignService::handleRequestModules($content);
|
||||
|
||||
$data = [
|
||||
'type' => 'system',
|
||||
'space' => 'base',
|
||||
'name' => 'design_setting',
|
||||
'value' => json_encode($moduleData),
|
||||
'name' => 'footer_setting',
|
||||
'value' => json_encode($content),
|
||||
'json' => 1
|
||||
];
|
||||
SettingRepo::createOrUpdate($data);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ Route::prefix($adminName)
|
|||
Route::post('design/builder/preview', [Controllers\DesignController::class, 'preview'])->name('design.module.preview');
|
||||
|
||||
Route::get('design_footer/builder', [Controllers\DesignFooterController::class, 'index'])->name('design_footer.index');
|
||||
Route::put('design_footer/builder', [Controllers\designFooterController::class, 'update'])->name('design_footer.update');
|
||||
|
||||
Route::put('edit', [Controllers\EditController::class, 'update'])->name('edit');
|
||||
Route::get('edit/locale', [Controllers\EditController::class, 'locale'])->name('edit.locale');
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -142,7 +142,7 @@
|
|||
</div>
|
||||
</draggable>
|
||||
<div class="add-item">
|
||||
<el-button type="primary" size="small" @click="addBottomLink" icon="el-icon-circle-plus-outline">添加链接</el-button>
|
||||
<el-button type="primary" plain size="mini" @click="addBottomLink" icon="el-icon-circle-plus-outline">添加链接</el-button>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
|
@ -258,9 +258,9 @@
|
|||
},
|
||||
|
||||
saveButtonClicked() {
|
||||
// $http.put('design/builder', this.form).then((res) => {
|
||||
// layer.msg(res.message)
|
||||
// })
|
||||
$http.put('design_footer/builder', this.form).then((res) => {
|
||||
layer.msg(res.message)
|
||||
})
|
||||
},
|
||||
|
||||
selectorShow(index) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue