提交 3001fa16 编写于 作者: D Devil

上传附件组件开关优化、拖拽设计优化

上级 20c867cc
......@@ -268,6 +268,9 @@ class Common extends Controller
// 默认不加载百度地图api
$this->assign('is_load_baidu_map_api', 0);
// 是否加载附件组件
$this->assign('is_load_upload_editor', !empty($this->admin) ? 1 : 0);
// 站点名称
$this->assign('admin_theme_site_name', MyC('admin_theme_site_name', 'ShopXO', true));
......
......@@ -51,7 +51,7 @@
</div>
<!-- commom html -->
<textarea id="upload-editor-view" data-url="{{:MyUrl('admin/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type])}}" style="display: none;"></textarea>
<textarea id="upload-editor-view" data-url="{{if isset($is_load_upload_editor) and $is_load_upload_editor eq 1}}{{:MyUrl('admin/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type])}}{{/if}}" style="display: none;"></textarea>
<!-- 公共底部钩子 -->
{{if !empty($plugins_admin_view_common_bottom_data) and is_array($plugins_admin_view_common_bottom_data) and (!isset($is_footer) or $is_footer eq 1)}}
......
......@@ -24,6 +24,7 @@ use app\service\SearchService;
use app\service\ConfigService;
use app\service\LinkService;
use app\service\UserService;
use app\service\AdminService;
use app\service\QuickNavService;
/**
......@@ -427,6 +428,9 @@ class Common extends Controller
// 默认不加载百度地图api
$this->assign('is_load_baidu_map_api', 0);
// 是否加载附件组件
$this->assign('is_load_upload_editor', (!empty($this->user) || AdminService::LoginInfo()) ? 1 : 0);
// 存在地图事件则载入
if(in_array(3, array_column($this->nav_quick, 'event_type')))
{
......
<!-- commom html -->
<textarea id="upload-editor-view" data-url="{{if !empty($user)}}{{:MyUrl('index/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type])}}{{/if}}" style="display: none;"></textarea>
<textarea id="upload-editor-view" data-url="{{if isset($is_load_upload_editor) and $is_load_upload_editor eq 1}}{{:MyUrl('index/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type])}}{{/if}}" style="display: none;"></textarea>
<!-- footer start -->
{{if !isset($is_footer) or $is_footer eq 1}}
......
......@@ -431,13 +431,43 @@ class BaseLayout
case 'goods' :
if(!empty($value) && $value['id'])
{
$url = MyUrl('index/goods/index', ['id'=>$value['id']]);
$url = ($client_type == 'pc') ? MyUrl('index/goods/index', ['id'=>$value['id']]) : '/pages/goods-detail/goods-detail?goods_id='.$value['id'];
}
break;
// 商品分类
case 'goods_search' :
$url = 'goods_search';
$gsp = [];
if(!empty($value))
{
if(!is_array($value))
{
$value = json_decode(urldecode($value), true);
}
if(!empty($value) && !empty($value['type']) && !empty($value['value']))
{
switch($value['type'])
{
// 关键字
case 'keywords' :
$gsp = ($client_type == 'pc') ? ['wd'=>StrToAscii($value['value'])] : '?keywords='.$value['value'];
break;
// 分类
case 'category' :
$category_id = $value['value'][count($value['value'])-1]['id'];
$gsp = ($client_type == 'pc') ? ['category_id'=>$category_id] : '?category_id='.$category_id;
break;
// 品牌
case 'brand' :
$gsp = ($client_type == 'pc') ? ['brand_id'=>$value['value']['id']] : '?brand_id='.$value['value']['id'];
break;
}
}
}
// 默认搜索页面、无条件
$url = ($client_type == 'pc') ? MyUrl('index/search/index', $gsp) : '/pages/goods-search/goods-search'.(empty($gsp) ? '' : $gsp);
break;
}
}
......
<!-- 侧边栏 - 模块配置 - 图片 -->
<div id="offcanvas-module-config-images" class="am-offcanvas module-offcanvas-container" data-default-images="{{$attachment_host}}/static/plugins/images/shop/renovation/module-default-images.png">
<div id="offcanvas-module-config-images" class="am-offcanvas module-offcanvas-container" data-default-images="{{$attachment_host}}/static/common/images/module-default-images.png">
<div class="am-offcanvas-bar">
<div class="am-offcanvas-content am-padding-0">
<form class="am-form form-validation-module-offcanvas-images" request-type="sync" request-value="FormBackModuleConfigImages">
......@@ -11,7 +11,7 @@
<ul class="plug-file-upload-view module-images-type-images-view" data-form-name="content_images" data-max-number="1" data-delete="0" data-dialog-type="images">
<li>
<input type="text" name="content_images" data-validation-message="请上传图片" value="" required />
<img src="{{$attachment_host}}/static/plugins/images/shop/renovation/module-default-images.png" />
<img src="{{$attachment_host}}/static/common/images/module-default-images.png" />
</li>
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.module-images-type-images-view">+上传图片</div>
......
<!-- 侧边栏 - 模块配置 - 多图 -->
<div id="offcanvas-module-config-many-images" class="am-offcanvas module-offcanvas-container" data-default-images="{{$attachment_host}}/static/plugins/images/shop/renovation/module-default-images.png">
<div id="offcanvas-module-config-many-images" class="am-offcanvas module-offcanvas-container" data-default-images="{{$attachment_host}}/static/common/images/module-default-images.png">
<div class="am-offcanvas-bar">
<div class="am-offcanvas-content am-padding-0">
<form class="am-form form-validation-module-offcanvas-many-images" request-type="sync" request-value="FormBackModuleConfigManyImages">
......
<!-- 侧边栏 - 模块配置 - 视频 -->
<div id="offcanvas-module-config-video" class="am-offcanvas module-offcanvas-container" data-default-images="{{$attachment_host}}/static/plugins/images/shop/renovation/module-default-images.png">
<div id="offcanvas-module-config-video" class="am-offcanvas module-offcanvas-container" data-default-images="{{$attachment_host}}/static/common/images/module-default-images.png">
<div class="am-offcanvas-bar">
<div class="am-offcanvas-content am-padding-0">
<form class="am-form form-validation-module-offcanvas-video" request-type="sync" request-value="FormBackModuleConfigVideo">
......
......@@ -3,12 +3,13 @@
<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-module-popup-goods-search" request-type="sync" request-value="FormBackModulePopupGoodsSearch">
<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">
<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>
<li><a href="[data-tab-panel-2]" data-value="keywords">关键字</a></li>
<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">
......@@ -45,6 +46,9 @@
</div>
</div>
</div>
<div data-tab-panel-3 class="am-tab-panel">
<p class="am-margin-top-lg am-padding-top-lg am-text-warning am-text-center">无需搜索条件、直接进入搜索页面</p>
</div>
</div>
</div>
......
......@@ -579,4 +579,18 @@
.layout-category-choice .form-container-category .goods-category-choice-content ul.am-margin-left-lg {
margin-left: 20px;
}
}
/**
* 商品搜索弹窗
*/
#popup-module-goods-search .am-tabs-bd {
padding-bottom: 50px;
}
.ss {
position: absolute;
left: 25px;
bottom: 25px;
width: calc(100% - 50px);
background: #f8f8f8;
}
\ No newline at end of file
......@@ -1293,17 +1293,12 @@ function FormBackModulePopupGoodsSearchHandle(data)
// 输入关键字去除引号
params['value'] = value.replace(new RegExp('"', 'g'), '').replace(new RegExp("'", 'g'), '');
break;
// 默认
default :
Prompt('类型未处理['+type+']');
return false;
}
// 数据赋值并关闭弹窗
var show_name = ModuleConfigGoodsSearchPageShowName(params);
var $page = $modal_pages_select.find('.am-tabs-bd ul li.page-goods_search a');
$page.find('span').text($page.data('name')+''+show_name+'');
$page.find('span').text($page.data('name')+show_name);
$page.attr('data-json', encodeURIComponent(JSON.stringify(params)));
$popup_goods_search.modal('close');
}
......@@ -1529,7 +1524,7 @@ function ModuleConfigGoodsSearchPageShowName(data)
break;
}
}
return name;
return (name || null) == null ? '' : ''+name+'';
}
/**
......@@ -2335,10 +2330,10 @@ $(function()
var index = 0;
var type = 'category';
var value = null;
if(json != null && (json.type || null) != null && (json.value || null) != null)
if(json != null && (json.type || null) != null)
{
// 基础参数
var arr = ['category', 'brand', 'keywords'];
var arr = ['category', 'brand', 'keywords', 'other'];
index = arr.indexOf(json.type);
type = json.type;
value = json.value || null;
......@@ -2452,7 +2447,7 @@ $(function()
}
// 显示名称
to_name += ''+ModuleConfigGoodsSearchPageShowName(json)+'';
to_name += ModuleConfigGoodsSearchPageShowName(json);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册