|
@@ -6,6 +6,7 @@ namespace App\Distributor\Controllers;
|
|
|
use App\Distributor\Actions\MenuShow;
|
|
|
use App\Distributor\Repositories\DistProduct;
|
|
|
use App\Distributor\Repositories\DistProductCategory;
|
|
|
+use App\Distributor\Repositories\DistVideoCategory;
|
|
|
use App\Distributor\Repositories\SiteMenu;
|
|
|
use App\Distributor\Repositories\SitePages;
|
|
|
use App\Distributor\Repositories\SitePagesTag;
|
|
@@ -53,12 +54,6 @@ class SiteMenuController extends AdminDistController
|
|
|
$tree->maxDepth(2);
|
|
|
//标题显示
|
|
|
$tree->branch(function ($branch) {
|
|
|
-// $arr[] = $branch['title'];
|
|
|
-// if ($branch['uri']) {
|
|
|
-// // $arr[] = SiteMenu::generateUri($branch['menu_type'], $branch['menu_config'],false);
|
|
|
-// $arr[] = $branch['uri'];
|
|
|
-// }
|
|
|
-// return implode(' - ', $arr);
|
|
|
return $branch['title'];
|
|
|
});
|
|
|
//是否显示操作
|
|
@@ -115,6 +110,9 @@ class SiteMenuController extends AdminDistController
|
|
|
})->when(1, function (Form $form) use ($menuConfig,$thisObject) {
|
|
|
//文章标签
|
|
|
$form->select('pages_tag')->options('api/tag')->value($thisObject->getArrayValue('pages_tag',$menuConfig));
|
|
|
+ })->when(2, function (Form $form) use ($menuConfig,$thisObject) {
|
|
|
+ //视频
|
|
|
+ $form->select('video_category')->options(DistVideoCategory::selectOptions())->value($thisObject->getArrayValue('video_category',$menuConfig));
|
|
|
});
|
|
|
})
|
|
|
->when(2, function (Form $form) use ($menuConfig,$thisObject) {
|
|
@@ -136,7 +134,11 @@ class SiteMenuController extends AdminDistController
|
|
|
->when(4, function (Form $form) use ($menuConfig,$thisObject) {
|
|
|
$form->select('landing_page',admin_trans_label('landing_page'))->options('api/landing-pages')
|
|
|
->value($thisObject->getArrayValue('landing_page',$menuConfig));
|
|
|
+ })->when(5, function (Form $form) use ($menuConfig,$thisObject) {
|
|
|
+ $form->select('videos',admin_trans_label('videos'))->options('api/videos')
|
|
|
+ ->value($thisObject->getArrayValue('videos',$menuConfig));
|
|
|
});
|
|
|
+
|
|
|
//显示
|
|
|
$form->switch('show')->default(1);
|
|
|
//隐藏字段
|
|
@@ -145,7 +147,7 @@ class SiteMenuController extends AdminDistController
|
|
|
$form->hidden('uri');
|
|
|
$form->hidden('dist_id'); // 隐藏dist_id字段,用于保存
|
|
|
//以下字段不保存
|
|
|
- $form->ignore(['collections_type','product_category','pages_tag','product','pages','url','landing_page']);
|
|
|
+ $form->ignore(['collections_type','product_category','pages_tag','product','pages','url','landing_page','videos','video_category']);
|
|
|
//保存事件
|
|
|
$form->submitted(function (Form $form) use ($thisObject) {
|
|
|
$result = $thisObject->convertMenuConfig($form);
|
|
@@ -163,11 +165,13 @@ class SiteMenuController extends AdminDistController
|
|
|
$menuConfig = [
|
|
|
'collections_type' => $form->input('collections_type'),
|
|
|
'product_category' => $form->input('product_category'),
|
|
|
+ 'video_category' => $form->input('video_category'),
|
|
|
'pages_tag' => $form->input('pages_tag'),
|
|
|
'product' => $form->input('product'),
|
|
|
'pages' => $form->input('pages'),
|
|
|
'url' => $form->input('url'),
|
|
|
'landing_page' => $form->input('landing_page'),
|
|
|
+ 'videos' => $form->input('videos'),
|
|
|
];
|
|
|
$menuType = $form->input('menu_type');
|
|
|
$uri = SiteMenu::generateUri($menuType,$menuConfig);
|