footer builder
This commit is contained in:
parent
b1aa079c31
commit
af70118116
|
|
@ -32,8 +32,7 @@ class DesignFooterController extends Controller
|
||||||
*/
|
*/
|
||||||
public function preview(Request $request): View
|
public function preview(Request $request): View
|
||||||
{
|
{
|
||||||
$module = json_decode($request->getContent(), true);
|
$content = json_decode($request->getContent(), true);
|
||||||
$content = $module['content'] ?? '';
|
|
||||||
$viewPath = "design.footer";
|
$viewPath = "design.footer";
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,31 @@ function plugin_route($route, $params = []): string
|
||||||
return route('plugin.' . $route, $params);
|
return route('plugin.' . $route, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 product, category, brand, page 路由链接
|
||||||
|
*
|
||||||
|
* @param $type
|
||||||
|
* @param $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function type_route($type, $value): string
|
||||||
|
{
|
||||||
|
if (empty($type) || empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if ($type == 'product') {
|
||||||
|
return shop_route('products.show', ['product' => $value]);
|
||||||
|
} elseif ($type == 'category') {
|
||||||
|
return shop_route('categories.show', ['category' => $value]);
|
||||||
|
} elseif ($type == 'brand') {
|
||||||
|
return shop_route('brands.show', ['brand' => $value]);
|
||||||
|
} elseif ($type == 'page') {
|
||||||
|
return shop_route('pages.show', ['page' => $value]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否访问的后端
|
* 是否访问的后端
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|
|
||||||
|
|
@ -142,10 +142,11 @@ class DesignService
|
||||||
* 处理页尾数据
|
* 处理页尾数据
|
||||||
*
|
*
|
||||||
* @param $content
|
* @param $content
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
private static function handleFooter($content)
|
private static function handleFooter($content)
|
||||||
{
|
{
|
||||||
dd($content);
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -186,14 +187,6 @@ class DesignService
|
||||||
*/
|
*/
|
||||||
private static function handleLink($type, $value): string
|
private static function handleLink($type, $value): string
|
||||||
{
|
{
|
||||||
if ($type == 'product' && $value) {
|
return type_route($type, $value);
|
||||||
return shop_route('products.show', ['product' => $value]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($type == 'category' && $value) {
|
|
||||||
return shop_route('categories.show', ['category' => $value]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue