首页拖转装修优化+新增页面设计

This commit is contained in:
Devil 2021-06-24 22:47:40 +08:00
parent 89f680ffdd
commit c1a17ecf42
56 changed files with 1512 additions and 124 deletions

View File

@ -268,6 +268,10 @@ class Common extends Controller
// 默认不加载百度地图api
$this->assign('is_load_baidu_map_api', 0);
// 布局样式+管理
$this->assign('is_load_layout', 0);
$this->assign('is_load_layout_admin', 0);
// 是否加载附件组件
$this->assign('is_load_upload_editor', !empty($this->admin) ? 1 : 0);

View File

@ -0,0 +1,226 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\service\DesignService;
use app\service\GoodsService;
use app\service\BrandService;
use app\layout\service\BaseLayout;
/**
* 页面设计管理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-10
* @desc description
*/
class Design extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->IsLogin();
// 权限校验
$this->IsPower();
}
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-10
* @desc description
*/
public function Index()
{
// 总数
$total = DesignService::DesignTotal($this->form_where);
// 分页
$page_params = [
'number' => $this->page_size,
'total' => $total,
'where' => $this->data_request,
'page' => $this->page,
'url' => MyUrl('admin/design/index'),
];
$page = new \base\Page($page_params);
// 获取列表
$data_params = [
'm' => $page->GetPageStarNumber(),
'n' => $this->page_size,
'where' => $this->form_where,
'order_by' => $this->form_order_by['data'],
];
$ret = DesignService::DesignList($data_params);
// 基础参数赋值
$this->assign('params', $this->data_request);
$this->assign('page_html', $page->GetPageHtml());
$this->assign('data_list', $ret['data']);
return $this->fetch();
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-10
* @desc description
*/
public function SaveInfo()
{
// 是否指定id、不存在则增加数据
if(empty($this->data_request['id']))
{
$ret = DesignService::DesignSave();
if($ret['code'] == 0)
{
return redirect(MyUrl('admin/design/saveinfo', ['id'=>$ret['data']]));
} else {
$this->assign('msg', $ret['msg']);
return $this->fetch('public/tips_error');
}
}
// 获取数据
$data_params = [
'where' => [
'id' => intval($this->data_request['id']),
],
'm' => 0,
'n' => 1,
];
$ret = DesignService::DesignList($data_params);
if(empty($ret['data']) || empty($ret['data'][0]))
{
$this->assign('to_title', '去添加 >>');
$this->assign('to_url', MyUrl('admin/design/saveinfo'));
$this->assign('msg', '编辑数据为空、请重新添加');
return $this->fetch('public/tips_error');
}
$data = $ret['data'][0];
// 配置处理
$layout_data = BaseLayout::ConfigAdminHandle($data['config']);
$this->assign('layout_data', $layout_data);
$this->assign('data', $data);
unset($data['config']);
// 页面列表
$pages_list = BaseLayout::PagesList();
$this->assign('pages_list', $pages_list);
// 商品分类
$goods_category = GoodsService::GoodsCategoryAll();
$this->assign('goods_category_list', $goods_category);
// 商品搜索分类(分类)
$this->assign('layout_goods_category', $goods_category);
$this->assign('layout_goods_category_field', 'gci.category_id');
// 品牌
$this->assign('brand_list', BrandService::CategoryBrand());
// 静态数据
$this->assign('border_style_type_list', BaseLayout::$border_style_type_list);
$this->assign('goods_view_list_show_style', BaseLayout::$goods_view_list_show_style);
$this->assign('many_images_view_list_show_style', BaseLayout::$many_images_view_list_show_style);
// 首页商品排序规则
$this->assign('goods_order_by_type_list', lang('goods_order_by_type_list'));
$this->assign('goods_order_by_rule_list', lang('goods_order_by_rule_list'));
// 加载布局样式+管理
$this->assign('is_load_layout', 1);
$this->assign('is_load_layout_admin', 1);
// 编辑器文件存放地址定义
$this->assign('editor_path_type', DesignService::AttachmentPathTypeValue($data['id']));
return $this->fetch();
}
/**
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-29
* @desc description
*/
public function Save()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
return DesignService::DesignSave($this->data_post);
}
/**
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-31
* @desc description
*/
public function StatusUpdate()
{
// 是否ajax
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始操作
return DesignService::DesignStatusUpdate($this->data_post);
}
/**
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-31
* @desc description
*/
public function Delete()
{
// 是否ajax
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始操作
return DesignService::DesignDelete($this->data_post);
}
}
?>

View File

@ -0,0 +1,189 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\form;
/**
* 页面设计动态表格-管理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-05-16
* @desc description
*/
class Design
{
// 基础条件
public $condition_base = [];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-05-16
* @desc description
* @param [array] $params [输入参数]
*/
public function Run($params = [])
{
return [
// 基础配置
'base' => [
'key_field' => 'id',
'status_field' => 'is_enable',
'is_search' => 1,
'search_url' => MyUrl('admin/design/index'),
'is_delete' => 1,
'delete_url' => MyUrl('admin/design/delete'),
'delete_key' => 'ids',
],
// 表单配置
'form' => [
[
'view_type' => 'checkbox',
'is_checked' => 0,
'checked_text' => '反选',
'not_checked_text' => '全选',
'align' => 'center',
'width' => 80,
],
[
'label' => '基础信息',
'view_type' => 'module',
'view_key' => 'design/module/info',
'grid_size' => 'sm',
'is_sort' => 1,
'sort_field' => 'name',
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
'placeholder' => '请输入名称'
],
],
[
'label' => '访问次数',
'view_type' => 'field',
'view_key' => 'access_count',
'is_sort' => 1,
'search_config' => [
'form_type' => 'section',
],
],
[
'label' => '是否启用',
'view_type' => 'status',
'view_key' => 'is_enable',
'post_url' => MyUrl('admin/design/statusupdate'),
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
'data' => lang('common_is_text_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '是否含头部',
'view_type' => 'status',
'view_key' => 'is_header',
'post_url' => MyUrl('admin/design/statusupdate'),
'align' => 'center',
'is_sort' => 1,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
'data' => lang('common_is_text_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => '是否含尾部',
'view_type' => 'status',
'view_key' => 'is_footer',
'post_url' => MyUrl('admin/design/statusupdate'),
'align' => 'center',
'is_sort' => 1,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
'data' => lang('common_is_text_list'),
'data_key' => 'id',
'data_name' => 'name',
'is_multiple' => 1,
],
],
[
'label' => 'SEO标题',
'view_type' => 'field',
'view_key' => 'seo_title',
'is_sort' => 1,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => 'SEO关键字',
'view_type' => 'field',
'view_key' => 'seo_keywords',
'is_sort' => 1,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => 'SEO描述',
'view_type' => 'field',
'view_key' => 'seo_desc',
'grid_size' => 'sm',
'is_sort' => 1,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
],
],
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time',
'is_sort' => 1,
'search_config' => [
'form_type' => 'datetime',
],
],
[
'label' => '更新时间',
'view_type' => 'field',
'view_key' => 'upd_time',
'is_sort' => 1,
'search_config' => [
'form_type' => 'datetime',
],
],
[
'label' => '操作',
'view_type' => 'operate',
'view_key' => 'design/module/operate',
'align' => 'center',
'fixed' => 'right',
],
],
];
}
}
?>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/admin/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/admin/index', $params)}}">
<legend>
<span class="am-text-default">管理员{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/admin/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/admin/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>用户名{{if empty($data)}}<span class="am-form-group-label-tips-must">必填</span><span class="am-form-group-label-tips">创建后不可更改</span>{{else /}}<span class="am-form-group-label-tips">不可更改</span>{{/if}}</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/answer/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/answer/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">问答{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/answer/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/answer/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-alert am-alert-secondary user-info" data-am-alert>
<p class="am-text-lg">用户信息</p>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/appcenternav/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/appcenternav/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">手机用户中心导航{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/appcenternav/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/appcenternav/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/apphomenav/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/apphomenav/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">手机首页导航{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/apphomenav/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/apphomenav/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/article/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/article/index', $params)}}">
<legend>
<span class="am-text-default">文章{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/article/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/article/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>标题</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/brand/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/brand/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">品牌{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/brand/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/brand/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/customview/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/customview/index', $params)}}">
<legend>
<span class="am-text-default">自定义页面{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/customview/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/customview/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>标题</label>

View File

@ -0,0 +1,31 @@
{{include file="public/header" /}}
<!-- header nav start -->
{{if isset($is_header) and $is_header eq 1}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
{{/if}}
<!-- header nav end -->
<!-- content start -->
<div class="am-container">
{{if !empty($layout_data)}}
{{include file="../../../layout/view/view" /}}
{{else /}}
{{include file="public/not_data" /}}
{{/if}}
</div>
<!-- content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -0,0 +1,9 @@
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
<a href="{{:MyUrl('admin/design/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus" target="_blank"> 新增</a>
<!-- 父级内容 -->
{__block__}
{{/block}}

View File

@ -0,0 +1,11 @@
<!-- 基础信息 -->
{{if !empty($module_data)}}
<div class="am-nbfc">
<a href="{{:MyUrl('index/design/index', ['id'=>$module_data['id']])}}}" target="_blank" title="{{$module_data.name}}">
<img src="{{if empty($module_data['logo'])}}{{$attachment_host}}/static/common/images/module-default-images.png{{else /}}{{$module_data.logo}}{{/if}}" class="am-img-thumbnail am-radius am-margin-right-xs am-fl" width="60" height="60" />
</a>
<a href="{{:MyUrl('index/design/index', ['id'=>$module_data['id']])}}}" target="_blank" title="{{$module_data.name}}">
<span class="am-nowrap-initial">{{$module_data.name}}</span>
</a>
</div>
{{/if}}

View File

@ -0,0 +1,15 @@
<!-- 操作栏 -->
{{if !empty($module_data)}}
<a class="am-btn am-btn-default am-btn-xs am-radius am-btn-block" href="{{:MyUrl('index/design/index', ['id'=>$module_data['id']])}}" target="_blank">
<i class="am-icon-eye"></i>
<span>查看</span>
</a>
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/design/saveinfo', array_merge($params, ['id'=>$module_data['id']]))}}" target="_blank">
<i class="am-icon-edit"></i>
<span>编辑</span>
</a>
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/design/delete')}}" data-id="{{$module_data.id}}" data-key="ids">
<i class="am-icon-trash-o"></i>
<span>删除</span>
</button>
{{/if}}

View File

@ -0,0 +1,73 @@
<!-- 基础数据编辑 -->
<div class="am-popup popup-not-title" id="popup-saveinfo">
<div class="am-popup-inner">
<span data-am-modal-close class="am-close am-close-alt am-icon-times"></span>
<div class="am-popup-bd am-padding-0">
<form class="am-form form-validation am-padding-sm" request-type="sync" request-value="FormBackSaveinfoEdit">
<!-- 基础信息 -->
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<h3 class="am-panel-title">基础信息</h3>
</div>
<div class="am-panel-bd am-padding-vertical-xs">
<div class="am-form-group am-form-file">
<label class="block">logo<span class="am-form-group-label-tips">选传</span><span class="am-form-group-label-tips">建议大小300*300px</span></label>
<ul class="plug-file-upload-view shop-logo-images-view" data-form-name="logo" data-max-number="1" data-dialog-type="images">
{{if !empty($data['logo'])}}
<li>
<input type="text" name="logo" value="{{$data.logo}}" data-validation-message="请上传logo" />
<img src="{{$data.logo}}" />
<i>×</i>
</li>
{{/if}}
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.shop-logo-images-view">+上传logo</div>
</div>
<div class="am-form-group">
<label>名称<span class="am-form-group-label-tips-must">必填</span></label>
<input type="text" name="name" placeholder="名称格式1~16个字符" maxlength="16" data-validation-message="名称格式1~16个字符" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
</div>
<div class="am-form-group">
<label class="block">是否启用<span class="am-form-group-label-tips">可选、默认是</span></label>
<input name="is_enable" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if isset($data['is_enable']) and $data['is_enable'] eq 1}}checked="true"{{/if}} />
</div>
<div class="am-form-group">
<label class="block">是否含头部<span class="am-form-group-label-tips">可选、默认是</span></label>
<input name="is_header" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_header']) and $data['is_header'] eq 1) or !isset($data['is_header'])}}checked="true"{{/if}} />
</div>
<div class="am-form-group">
<label class="block">是否含尾部<span class="am-form-group-label-tips">可选、默认是</span></label>
<input name="is_footer" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_footer']) and $data['is_footer'] eq 1) or !isset($data['is_footer'])}}checked="true"{{/if}} />
</div>
</div>
</div>
<!-- SEO -->
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<h3 class="am-panel-title">SEO<span class="am-form-group-label-tips">选填</span></h3>
</div>
<div class="am-panel-bd am-padding-vertical-xs">
{{include file="lib/seo" /}}
</div>
</div>
<!-- 操作 -->
<div class="am-text-center am-padding-sm am-nbfc">
<input type="hidden" name="id" value="{{if !empty($data['id'])}}{{$data.id}}{{/if}}" />
<button type="button" class="am-btn am-btn-warning am-btn-xs am-radius am-margin-right-lg" data-am-modal-close>
<i class="am-icon-paint-brush"></i>
<span>取消</span>
</button>
<button type="submit" class="am-btn am-btn-primary am-btn-xs am-radius btn-loading-example am-margin-left-lg" data-am-loading="{loadingText:'处理中...'}">
<i class="am-icon-save"></i>
<span>确认</span>
</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -0,0 +1,54 @@
{{include file="public/header" /}}
{{if !empty($data)}}
<div class="am-container">
<legend class="am-padding-horizontal-xs am-padding-bottom-xs">
<img src="{{if empty($data['logo'])}}{{$attachment_host}}/static/common/images/module-default-images.png{{else /}}{{$data.logo}}{{/if}}" class="am-img-thumbnail am-radius page-top-nav-logo" />
<span class="page-top-nav-title">
<span>{{$data.name}}</span>
<a href="javascript:;" class="am-icon-eyedropper am-margin-left-xs" data-am-modal="{target: '#popup-saveinfo'}"></a>
</span>
<a href="{{:MyUrl('index/design/index', ['id'=>$data['id']])}}" target="_blank" class="am-fr">查看 >></a>
</legend>
<div class="am-padding-bottom-sm">
<div class="layout-operate-container am-fr" data-save-url="{{:MyUrl('admin/design/save')}}" data-json="{{:urlencode(json_encode($data))}}">
<a href="javascript:;" class="am-btn am-btn-warning am-btn-xs am-radius window-close-event" data-msg="请确认数据是否保存、继续关闭本页吗?">关闭</a>
<button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-margin-left-sm" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
{{include file="../../../layout/view/base" /}}
</div>
</div>
<!-- 页面编辑-->
{{include file="design/popup_saveinfo" /}}
{{else /}}
<div class="table-no">
<i class="am-icon-warning"></i>
<span>请先添加数据</span>
<a href="{{:MyUrl('admin/design/saveinfo')}}" class="am-text-secondary am-margin-left-sm"> 去添加数据 >></a>
</div>
{{/if}}
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
<script type="text/javascript">
// 基础数据保存回调处理
function FormBackSaveinfoEdit(e)
{
var $page = $('.layout-operate-container');
$page.attr('data-json', encodeURIComponent(JSON.stringify(e)));
// logo
$('.page-top-nav-logo').attr('src', e.logo || '{{$attachment_host}}/static/common/images/module-default-images.png');
// 名称
$('.page-top-nav-title span').text(e.name || '默认页面');
// 关闭弹窗
$('#popup-saveinfo').modal('close');
}
</script>
<!-- layout formback -->
{{include file="../../../layout/view/form_back" /}}

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/goods/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/goods/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">商品{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/goods/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/goods/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<nav class="goods-nav">

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/goodscomments/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/goodscomments/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">商品评论{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/goodscomments/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/goodscomments/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-alert am-alert-secondary goods-info" data-am-alert>
<p class="am-text-lg">商品信息</p>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/goodsparamstemplate/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/goodsparamstemplate/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">商品参数{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/goodsparamstemplate/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/goodsparamstemplate/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/payment/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/payment/index')}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">支付方式{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/payment/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/payment/index')}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -5,7 +5,7 @@
{{block name="form_operate_top"}}
<legend>
<span class="am-text-default">支付请求日志</span>
<a href="{{:MyUrl('admin/paylog/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/paylog/index')}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<!-- 父级内容 -->

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/pluginsadmin/saveinfo')}}" method="POST" request-type="form" enctype="multipart/form-data">
<legend>
<span class="am-text-default">应用{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/pluginsadmin/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/pluginsadmin/index')}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">应用{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">

View File

@ -125,6 +125,9 @@
<!-- 项目公共 -->
<script type='text/javascript' src="{{$public_host}}static/common/js/common.js?v={{:MyC('home_static_cache_version')}}"></script>
<script type='text/javascript' src="{{$public_host}}static/admin/{{$default_theme}}/js/common.js?v={{:MyC('home_static_cache_version')}}"></script>
{{if isset($is_load_layout_admin) and $is_load_layout_admin eq 1}}
<script type='text/javascript' src="{{$public_host}}static/common/js/layout.admin.js?v={{:MyC('home_static_cache_version')}}"></script>
{{/if}}
<!-- 应用插件公共js -->
{{if !empty($plugins_js)}}

View File

@ -11,6 +11,12 @@
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/common/lib/amazeui-tagsinput/amazeui.tagsinput.css?v={{:MyC('home_static_cache_version')}}" />
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/common/css/common.css?v={{:MyC('home_static_cache_version')}}" />
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/admin/{{$default_theme}}/css/common.css?v={{:MyC('home_static_cache_version')}}" />
{{if isset($is_load_layout) and $is_load_layout eq 1}}
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/common/css/layout.css?v={{:MyC('home_static_cache_version')}}" />
{{/if}}
{{if isset($is_load_layout_admin) and $is_load_layout_admin eq 1}}
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/common/css/layout.admin.css?v={{:MyC('home_static_cache_version')}}" />
{{/if}}
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/admin/{{$default_theme}}/css/iconfontmenu.css?v={{:MyC('home_static_cache_version')}}" />
{{if !empty($plugins_css)}}
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/{{$plugins_css}}?v={{:MyC('home_static_cache_version')}}" />

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/quicknav/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/quicknav/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">快捷导航{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/quicknav/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/quicknav/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/role/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/role/index', $params)}}">
<legend>
<span class="am-text-default">角色{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/role/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/role/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>角色名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/slide/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/slide/index', $params)}}" enctype="multipart/form-data">
<legend>
<span class="am-text-default">轮播{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/slide/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/slide/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>名称</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/user/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/user/index', $params)}}">
<legend>
<span class="am-text-default">用户{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/user/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/user/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>用户名</label>

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/useraddress/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/useraddress/index', $params)}}">
<legend>
<span class="am-text-default">用户地址{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/useraddress/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/useraddress/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
{{if !empty($data) and !empty($data['user'])}}
<div class="am-alert am-alert-secondary am-nbfc am-margin-top-0">

View File

@ -7,7 +7,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/warehouse/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/warehouse/index', $params)}}">
<legend>
<span class="am-text-default">仓库{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
<a href="{{:MyUrl('admin/warehouse/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/warehouse/index', $params)}}" class="am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">

View File

@ -0,0 +1,98 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\service\SeoService;
use app\service\DesignService;
use app\layout\service\BaseLayout;
/**
* 页面设计
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Design extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
}
/**
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-31
* @desc description
*/
public function Index()
{
$data = [];
if(!empty($this->data_request['id']))
{
$data_params = [
'where' => [
'id' => intval($this->data_request['id']),
],
'm' => 0,
'n' => 1,
];
$ret = DesignService::DesignList($data_params);
if($ret['code'] == 0 && !empty($ret['data']) && !empty($ret['data'][0]))
{
$data = $ret['data'][0];
}
}
if(!empty($data))
{
// 访问统计
DesignService::DesignAccessCountInc(['design_id'=>$data['id']]);
// 配置处理
$layout_data = BaseLayout::ConfigHandle($data['config']);
$this->assign('layout_data', $layout_data);
// 加载布局样式
$this->assign('is_load_layout', 1);
// seo
$seo_title = empty($data['seo_title']) ? $data['name'] : $data['seo_title'];
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($seo_title, 2));
if(!empty($data['seo_keywords']))
{
$this->assign('home_seo_site_keywords', $data['seo_keywords']);
}
if(!empty($data['seo_desc']))
{
$this->assign('home_seo_site_description', $data['seo_desc']);
}
// 头尾
$this->assign('is_header', $data['is_header']);
$this->assign('is_footer', $data['is_footer']);
return $this->fetch();
}
$this->assign('msg', '页面不存在或已删除');
return $this->fetch('public/tips_error');
}
}
?>

View File

@ -77,8 +77,12 @@ class Index extends Common
$pages_list = BaseLayout::PagesList();
$this->assign('pages_list', $pages_list);
// 商品分类
$goods_category = GoodsService::GoodsCategoryAll();
$this->assign('goods_category_list', $goods_category);
// 商品搜索分类(分类)
$this->assign('layout_goods_category', GoodsService::GoodsCategoryAll());
$this->assign('layout_goods_category', $goods_category);
$this->assign('layout_goods_category_field', 'gci.category_id');
// 品牌

View File

@ -0,0 +1,31 @@
{{include file="public/header" /}}
<!-- header nav start -->
{{if isset($is_header) and $is_header eq 1}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
{{/if}}
<!-- header nav end -->
<!-- content start -->
<div class="am-container">
{{if !empty($layout_data)}}
{{include file="../../../layout/view/view" /}}
{{else /}}
{{include file="public/not_data" /}}
{{/if}}
</div>
<!-- content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -133,8 +133,8 @@
{{if isset($is_design) and $is_design eq 1}}
<div class="am-margin-top-sm">
<div class="layout-operate-container am-fr" data-save-url="{{$layout_save_url}}">
<a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-warning am-radius">取消</a>
<button type="button" class="am-btn am-btn-success am-radius am-margin-left-sm" data-am-loading="{loadingText:'处理中...'}">保存</button>
<a href="{{$Think.__MY_URL__}}" class="am-btn am-btn-warning am-btn-xs am-radius">取消</a>
<button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-margin-left-sm" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
{{include file="../../../layout/view/base" /}}
</div>
@ -393,5 +393,7 @@
{{include file="public/footer" /}}
<!-- layout formback -->
{{include file="../../../layout/view/form_back" /}}
{{if isset($is_design) and $is_design eq 1}}
<!-- layout formback -->
{{include file="../../../layout/view/form_back" /}}
{{/if}}

View File

@ -26,7 +26,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('index/personal/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('index/personal/index')}}">
<legend>
<span class="legend-title">个人资料</span>
<a href="{{:MyUrl('index/personal/index')}}" class="am-fr am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('index/personal/index')}}" class="am-fr am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>昵称</label>

View File

@ -26,7 +26,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('index/safety/verifycheck')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('index/safety/newemailinfo')}}">
<legend>
<span class="legend-title">原电子邮箱校验</span>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>电子邮箱</label>

View File

@ -26,7 +26,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('index/safety/loginpwdupdate')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('index/safety/index')}}">
<legend>
<span class="legend-title">登录密码修改</span>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>当前密码</label>

View File

@ -26,7 +26,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('index/safety/verifycheck')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('index/safety/newmobileinfo')}}">
<legend>
<span class="legend-title">原手机号码校验</span>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>手机号码</label>

View File

@ -26,7 +26,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('index/safety/accountsupdate')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('index/safety/index')}}">
<legend>
<span class="legend-title">新电子邮箱校验</span>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>电子邮箱</label>

View File

@ -26,7 +26,7 @@
<form class="am-form form-validation view-save" action="{{:MyUrl('index/safety/accountsupdate')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('index/safety/index')}}">
<legend>
<span class="legend-title">新手机号码校验</span>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-xs am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('index/safety/index')}}" class="am-fr am-margin-top-sm am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group">
<label>手机号码</label>

View File

@ -9,7 +9,7 @@
<!-- 外边距 -->
{{include file="../../../layout/view/public/style/margin" key="" required="" /}}
<div class="am-margin-top-sm">
<button type="submit" class="am-btn am-btn-primary am-btn-block">确认</button>
<button type="submit" class="am-btn am-btn-primary am-btn-xs am-btn-block">确认</button>
</div>
</form>
</div>

View File

@ -4,13 +4,13 @@
<span data-am-modal-close class="am-close am-close-alt am-icon-times"></span>
{{if !empty($pages_list)}}
<form class="am-form" action="false">
<div data-am-widget="tabs" class="am-tabs am-tabs-d2">
<div data-am-widget="tabs" class="am-tabs am-tabs-d2 am-margin-0">
<ul class="am-tabs-nav am-cf">
<li class="am-active"><a href="[data-tab-panel-0]">系统页面</a></li>
<li><a href="[data-tab-panel-1]">扩展模块</a></li>
</ul>
<div class="am-tabs-bd">
<div data-tab-panel-0 class="am-tab-panel am-active">
<div data-tab-panel-0 class="am-tab-panel am-padding-0 am-active">
<ul class="am-scrollable-vertical am-list am-list-border am-text-left">
{{foreach $pages_list.common.data as $ks=>$vs}}
<li class="page-{{$vs.value}}">
@ -22,7 +22,7 @@
{{/foreach}}
</ul>
</div>
<div data-tab-panel-1 class="am-tab-panel">
<div data-tab-panel-1 class="am-tab-panel am-padding-0">
<div class="am-scrollable-vertical">
{{foreach $pages_list.plugins.data as $k=>$v}}
<section data-am-widget="accordion" class="am-accordion am-accordion-default" data-am-accordion='{ "multiple": true }'>
@ -50,7 +50,7 @@
</div>
</div>
<div class="am-padding-sm">
<button type="button" class="am-btn am-btn-primary am-btn-block pages-confirm-submit">确认</button>
<button type="button" class="am-btn am-btn-primary am-btn-xs am-btn-block pages-confirm-submit">确认</button>
</div>
</form>
{{else /}}

View File

@ -26,7 +26,7 @@
<input name="is_nav_dot" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch />
</div>
<div class="am-margin-top-sm">
<button type="submit" class="am-btn am-btn-primary am-btn-block">确认</button>
<button type="submit" class="am-btn am-btn-primary am-btn-xs am-btn-block">确认</button>
</div>
</form>
</div>

View File

@ -19,7 +19,7 @@
</div>
</div>
<div class="am-margin-top-sm">
<button type="submit" class="am-btn am-btn-primary am-btn-block">确认</button>
<button type="submit" class="am-btn am-btn-primary am-btn-xs am-btn-block">确认</button>
</div>
</form>
</div>

View File

@ -4,13 +4,13 @@
<div class="am-offcanvas-content am-padding-0">
<form class="am-form form-validation-module-offcanvas-goods" request-type="sync" request-value="FormBackModuleConfigGoods">
<input type="hidden" name="goods_data_type" value="goods" />
<div data-am-widget="tabs" class="am-tabs am-tabs-d2 am-margin-bottom-lg" data-am-tabs="{noSwipe: 1}">
<div data-am-widget="tabs" class="am-tabs am-tabs-d2 am-margin-0" data-am-tabs="{noSwipe: 1}">
<ul class="am-tabs-nav am-cf">
<li class="am-active"><a href="[data-tab-panel-0]" data-value="goods">选择商品</a></li>
<li><a href="[data-tab-panel-1]" data-value="category">选择分类</a></li>
</ul>
<div class="am-tabs-bd am-padding-sm">
<div data-tab-panel-0 class="am-tab-panel am-active">
<div data-tab-panel-0 class="am-tab-panel am-padding-0 am-active">
<input type="hidden" name="goods_ids" value="" />
<div class="form-view-choice-container" data-value="goods">
<div class="form-view-choice-container-content">
@ -21,7 +21,7 @@
</div>
<ul class="config-goods-list am-cf am-margin-top-sm"></ul>
</div>
<div data-tab-panel-1 class="am-tab-panel">
<div data-tab-panel-1 class="am-tab-panel am-padding-0">
<div class="am-form-group am-form-group-refreshing">
<label>商品分类<span class="am-form-group-label-tips-must">必选</span></label>
<div class="form-view-choice-container am-margin-top-xs offcanvas-config-goods-category-container" data-value="category">
@ -60,7 +60,7 @@
</div>
<!-- 内容样式 -->
<div class="am-panel am-panel-default">
<div class="am-panel am-panel-default am-margin-top-lg">
<div class="am-panel-hd">内容样式</div>
<div class="am-panel-bd">
<!-- 行展示数量 -->

View File

@ -4,7 +4,7 @@
<span data-am-modal-close class="am-close am-close-alt am-icon-times"></span>
<div class="am-popup-bd am-padding-0">
<form class="am-form form-validation-module-popup-goods-search layout-forth-selection-container" request-type="sync" request-value="FormBackModulePopupGoodsSearch">
<div data-am-widget="tabs" class="am-tabs am-tabs-d2">
<div data-am-widget="tabs" class="am-tabs am-tabs-d2 am-margin-0">
<ul class="am-tabs-nav am-cf">
<li class="am-active"><a href="[data-tab-panel-0]" data-value="category">商品分类</a></li>
<li><a href="[data-tab-panel-1]" data-value="brand">品牌</a></li>
@ -12,14 +12,14 @@
<li><a href="[data-tab-panel-3]" data-value="other">无需条件</a></li>
</ul>
<div class="am-tabs-bd">
<div data-tab-panel-0 class="am-tab-panel am-active">
<div data-tab-panel-0 class="am-tab-panel am-padding-0 am-active">
<div class="layout-category-choice">
<div class="goods-category-choice am-padding-sm form-container-category">
{{include file="../../../layout/view/public/common/goods_category_choice" /}}
</div>
</div>
</div>
<div data-tab-panel-1 class="am-tab-panel">
<div data-tab-panel-1 class="am-tab-panel am-padding-0">
<div class="layout-category-choice">
<div class="goods-category-choice am-padding-sm form-container-brand">
<div class="goods-category-choice-content am-nbfc">
@ -36,7 +36,7 @@
</div>
</div>
</div>
<div data-tab-panel-2 class="am-tab-panel">
<div data-tab-panel-2 class="am-tab-panel am-padding-0">
<div class="am-form-group am-form-group-refreshing">
<div class="am-padding-sm form-container-keywords">
<p class="am-margin-top-sm am-text-warning am-text-center">搜索关键字格式1~30个字符</p>
@ -46,7 +46,7 @@
</div>
</div>
</div>
<div data-tab-panel-3 class="am-tab-panel">
<div data-tab-panel-3 class="am-tab-panel am-padding-0">
<p class="am-margin-top-lg am-padding-top-lg am-text-warning am-text-center">无需搜索条件、直接进入搜索页面</p>
</div>
</div>

View File

@ -0,0 +1,247 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\service;
use think\Db;
use app\service\ResourcesService;
/**
* 页面设计服务层
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-02-14
* @desc description
*/
class DesignService
{
/**
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-16
* @desc description
* @param [array] $params [输入参数]
*/
public static function DesignList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$field = empty($params['field']) ? '*' : $params['field'];
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
// 获取数据
$data = Db::name('Design')->where($where)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
foreach($data as &$v)
{
// 时间
if(array_key_exists('add_time', $v))
{
$v['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
}
if(array_key_exists('upd_time', $v))
{
$v['upd_time'] = date('Y-m-d H:i:s', $v['upd_time']);
}
}
}
return DataReturn('处理成功', 0, $data);
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-16
* @desc description
* @param [array] $where [条件]
*/
public static function DesignTotal($where = [])
{
return (int) Db::name('Design')->where($where)->count();
}
/**
* 保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-16
* @desc description
* @param [array] $params [输入参数]
*/
public static function DesignSave($params = [])
{
// 附件
$data_fields = ['logo'];
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
// 配置信息
$config = empty($params['config']) ? '' : (is_array($params['config']) ? json_encode($params['config'], JSON_UNESCAPED_UNICODE) : htmlspecialchars_decode($params['config'])) ;
// 数据
$data = [
'name' => empty($params['name']) ? '默认页面'.date('mdHi') : $params['name'],
'logo' => $attachment['data']['logo'],
'config' => $config,
'seo_title' => empty($params['seo_title']) ? '' : $params['seo_title'],
'seo_keywords' => empty($params['seo_keywords']) ? '' : $params['seo_keywords'],
'seo_desc' => empty($params['seo_desc']) ? '' : $params['seo_desc'],
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 1,
'is_header' => isset($params['is_header']) ? intval($params['is_header']) : 1,
'is_footer' => isset($params['is_footer']) ? intval($params['is_footer']) : 1,
];
if(empty($params['id']))
{
$data['add_time'] = time();
$data_id = Db::name('Design')->insertGetId($data);
if($data_id <= 0)
{
return DataReturn('添加失败', -1);
}
} else {
$data_id = intval($params['id']);
$data['upd_time'] = time();
if(Db::name('Design')->where(['id'=>$data_id])->update($data) === false)
{
return DataReturn('更新失败', -1);
}
}
return DataReturn('操作成功', 0, $data_id);
}
/**
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-23
* @desc description
* @param [array] $params [输入参数]
*/
public static function DesignStatusUpdate($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '操作id有误',
],
[
'checked_type' => 'empty',
'key_name' => 'field',
'error_msg' => '字段有误',
],
[
'checked_type' => 'in',
'key_name' => 'state',
'checked_data' => [0,1],
'error_msg' => '状态有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 数据更新
if(Db::name('Design')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state']), 'upd_time'=>time()]))
{
return DataReturn('操作成功');
}
return DataReturn('操作失败', -100);
}
/**
* 删除
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-18
* @desc description
* @param [array] $params [输入参数]
*/
public static function DesignDelete($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'ids',
'error_msg' => '操作id有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 是否数组
if(!is_array($params['ids']))
{
$params['ids'] = explode(',', $params['ids']);
}
// 删除操作
if(Db::name('Design')->where(['id'=>$params['ids']])->delete())
{
// 删除数据库附件
foreach($params['ids'] as $v)
{
ResourcesService::AttachmentPathTypeDelete(self::AttachmentPathTypeValue($v));
}
return DataReturn('删除成功');
}
return DataReturn('删除失败', -100);
}
/**
* 页面访问统计加1
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-15
* @desc description
* @param [array] $params [输入参数]
*/
public static function DesignAccessCountInc($params = [])
{
if(!empty($params['design_id']))
{
return Db::name('Design')->where(['id'=>intval($params['design_id'])])->setInc('access_count');
}
return false;
}
/**
* 附件标识
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-06-23
* @desc description
* @param [int] $data_id [数据 id]
*/
public static function AttachmentPathTypeValue($data_id)
{
return 'design-'.$data_id;
}
}
?>

View File

@ -135,6 +135,10 @@ return array (
array (
0 => 'app\\plugins\\shop\\Hook',
),
'plugins_view_admin_login_info' =>
array (
0 => 'app\\plugins\\shop\\Hook',
),
'plugins_view_home_floor_bottom' =>
array (
0 => 'app\\plugins\\salerecords\\Hook',

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,8 @@ time, mark, audio, video {
.c-r {cursor:w-resize;}
.c-p {cursor:pointer;}
.c-m {cursor: move !important;}
legend {padding-bottom:0.2rem !important; margin-bottom: 1rem; }
legend {margin-bottom: 1rem; }
legend a.am-fr{margin-top: 10px;}
.am-popup-bd {background:#fff;}
.cr-eee {color:#eee !important;}
.cr-ccc {color:#ccc !important;}

View File

@ -84,7 +84,7 @@
top: -28px;
width: 100%;
-webkit-box-shadow: 0 -5px 10px rgb(0 0 0 / 60%);
box-shadow: 0 -5px 10px rgb(0 0 0 / 60%);
box-shadow: 0 -5px 10px rgb(0 0 0 / 20%);
}
.layout-view .layout-submit {
padding: 2px 5px;
@ -253,7 +253,7 @@
padding: 10px;
border-top: 1px solid #dfdfdf;
background: #f5f5f5;
z-index: 2;
z-index: 100;
}
.module-offcanvas-container .text-tips {
color: #ccc;
@ -417,9 +417,10 @@
/**
* 页面选择
*/
#modal-module-pages-select .am-scrollable-vertical {
border-bottom: 1px solid #dedede;
margin-bottom: 0;
#modal-module-pages-select .am-tabs-bd {
border-style: solid;
border-width: 0 0 1px 0;
border-color: #eee;
}
#modal-module-pages-select .am-scrollable-vertical a {
text-decoration: none;
@ -434,6 +435,9 @@
#modal-module-pages-select .am-accordion-default:last-child {
margin-bottom: 0;
}
#modal-module-pages-select .am-tabs-bd ul {
margin-bottom: 0;
}
#modal-module-pages-select .am-tabs-bd ul li {
border-width: 1px 0;
}
@ -586,18 +590,18 @@
*/
#popup-module-goods-search .am-tabs-bd {
padding-bottom: 50px;
}
.ss {
position: absolute;
left: 25px;
bottom: 25px;
width: calc(100% - 50px);
background: #f8f8f8;
z-index: 0;
border: 0;
}
/**
* 布局保存
*/
.page-top-nav-logo {
width: 30px;
height: 30px;
vertical-align: middle;
}
.layout-operate-container .am-btn {
padding: 4px 10px;
}

View File

@ -2917,4 +2917,21 @@ $(function()
}
});
// 关闭窗口
$(document).on('click', '.window-close-event', function()
{
if(confirm($(this).data('msg') || '您确定要关闭本页吗?'))
{
var user_agent = navigator.userAgent;
if(user_agent.indexOf('Firefox') != -1 || user_agent.indexOf('Chrome') != -1)
{
location.href = 'about:blank';
} else {
window.opener = null;
window.open('', '_self');
}
window.close();
}
});
});

View File

@ -2962,4 +2962,60 @@ $(function()
{
OffcanvasConfigPagesRemove($(this), e);
});
// 页面布局数据保存
var $layout_operate_container = $('.layout-operate-container');
$layout_operate_container.on('click', 'button', function()
{
// 基础配置
var data = $layout_operate_container.attr('data-json') || null;
if(data != null)
{
data = JSON.parse(decodeURIComponent(data)) || null;
}
if(data == null)
{
data = {};
}
// 设计配置
data['config'] = JSON.stringify(LayoutViewConfig());
// 保存数据
var $this = $(this);
$this.button('loading');
$.ajax({
url: $layout_operate_container.data('save-url'),
type: 'post',
data: data,
dataType: 'json',
success:function(res)
{
if(res['code'] == 0)
{
Prompt(res.msg, 'success');
setTimeout(function()
{
var url = $layout_operate_container.find('a').attr('href') || null;
if(url == null || url == 'javascript:;')
{
window.location.reload();
} else {
window.location.href = url;
}
}, 1500);
} else {
$this.button('reset');
Prompt(res.msg);
}
},
error:function(xhr, type)
{
$this.button('reset');
var msg = HtmlToString(xhr.responseText) || '异常错误';
Prompt(msg, null, 30);
}
});
});
});

View File

@ -39,38 +39,4 @@ $(function()
{
FloorResizeHandle();
});
// 布局保存
$('.layout-operate-container button').on('click', function()
{
var $this = $(this);
$this.button('loading');
$.ajax({
url: $('.layout-operate-container').data('save-url'),
type: 'post',
data: {"config": JSON.stringify(LayoutViewConfig())},
dataType: 'json',
success:function(res)
{
if(res['code'] == 0)
{
Prompt(res.msg, 'success');
setTimeout(function()
{
window.location.href = __my_url__;
}, 1500);
} else {
$this.button('reset');
Prompt(res.msg);
}
},
error:function(res)
{
$this.button('reset');
var msg = HtmlToString(xhr.responseText) || '异常错误';
Prompt(msg, null, 30);
}
});
});
});

View File

@ -41,6 +41,9 @@ Route::rule('buy', 'index/buy/index', 'GET|POST');
// 文章
Route::get('article'.$ds.':id', 'index/article/index');
// 页面设计
Route::get('design'.$ds.':id', 'index/design/index');
// 用户
Route::get('login', 'index/user/logininfo');
Route::get('login'.$ds.'modal', 'index/user/modallogininfo');