应用优化,公告改为应用实现

This commit is contained in:
devil_gong 2019-02-12 17:36:47 +08:00
parent 08bb69c3b4
commit a170fa3dc9
59 changed files with 1165 additions and 680 deletions

View File

@ -10,10 +10,8 @@
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\service\PluginsService;
/**
* 应用管理
* 应用调用入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
@ -24,13 +22,13 @@ class Plugins extends Common
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
@ -38,82 +36,116 @@ class Plugins extends Common
// 权限校验
$this->IsPower();
// 小导航
$this->view_type = input('view_type', 'home');
}
/**
* [Index 配置列表]
* [Index 首页]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @datetime 2017-02-22T16:50:32+0800
*/
public function Index()
{
// 导航参数
$this->assign('view_type', $this->view_type);
// 参数
$params = input();
// 页面类型
if($this->view_type == 'home')
// 请求参数校验
$p = [
[
'checked_type' => 'empty',
'key_name' => 'pluginsname',
'error_msg' => '应用名称有误',
],
[
'checked_type' => 'empty',
'key_name' => 'pluginscontrol',
'error_msg' => '应用控制器有误',
],
[
'checked_type' => 'empty',
'key_name' => 'pluginsaction',
'error_msg' => '应用操作方法有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
// 分页
$number = 12;
if(IS_AJAX)
{
return DataReturn($ret, -5000);
} else {
$this->assign('msg', $ret);
return $this->fetch('public/error');
}
}
// 条件
$where = PluginsService::PluginsListWhere($params);
// 应用名称/控制器/方法
$pluginsname = $params['pluginsname'];
$pluginscontrol = strtolower($params['pluginscontrol']);
$pluginsaction = strtolower($params['pluginsaction']);
// 获取总数
$total = PluginsService::PluginsTotal($where);
// 视图初始化
$this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => MyUrl('admin/plugins/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 编辑器文件存放地址定义
$this->assign('editor_path_type', 'plugins_'.$pluginsname);
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = PluginsService::PluginsList($data_params);
$this->assign('data_list', $data['data']);
// 调用应用控制器
$plugins = '\app\plugins\\'.$pluginsname.'\\'.ucfirst($pluginscontrol);
$ret = (new $plugins())->$pluginsaction($params);
return $this->fetch();
// 是否ajax
if(IS_AJAX)
{
return $ret;
} else {
return $this->fetch('upload');
// 调用应用模板
if(isset($ret['code']))
{
if($ret['code'] == 0)
{
$this->assign($ret['data']);
return $this->fetch('../../../plugins/view/'.$pluginsname.'/'.$pluginscontrol.'/'.$pluginsaction);
} else {
$this->assign('msg', $ret['msg']);
return $this->fetch('public/error');
}
} else {
$this->assign('msg', '应用返回数据格式有误');
return $this->fetch('public/error');
}
}
}
/**
* [StatusUpdate 状态更新]
* 视图初始化
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
* @version 1.0.0
* @datetime 2019-02-07T22:46:29+0800
* @param [string] $plugins_name [应用名称]
* @param [string] $plugins_control [控制器名称]
* @param [string] $plugins_action [方法]
*/
public function StatusUpdate()
public function PluginsViewInit($plugins_name, $plugins_control, $plugins_action)
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 当前操作名称
$module_name = 'plugins';
// 开始处理
$params = input();
return PluginsService::PluginsStatusUpdate($params);
// 当前操作名称
$this->assign('plugins_name', $plugins_name);
$this->assign('controller_name', $plugins_control);
$this->assign('action_name', $plugins_action);
// 控制器静态文件状态css,js
$module_css = $module_name.DS.'css'.DS.$plugins_name.DS.$plugins_control;
$module_css .= file_exists(ROOT_PATH.'static'.DS.$module_css.'.'.$plugins_action.'.css') ? '.'.$plugins_action.'.css' : '.css';
$this->assign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
$module_js = $module_name.DS.'js'.DS.$plugins_name.DS.$plugins_control;
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$plugins_action.'.js') ? '.'.$plugins_action.'.js' : '.js';
$this->assign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
}
}
?>

View File

@ -0,0 +1,119 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\service\PluginsService;
/**
* 应用管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Pluginsadmin 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();
// 小导航
$this->view_type = input('view_type', 'home');
}
/**
* [Index 配置列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 导航参数
$this->assign('view_type', $this->view_type);
// 参数
$params = input();
// 页面类型
if($this->view_type == 'home')
{
// 分页
$number = 12;
// 条件
$where = PluginsService::PluginsListWhere($params);
// 获取总数
$total = PluginsService::PluginsTotal($where);
// 分页
$page_params = array(
'number' => $number,
'total' => $total,
'where' => $params,
'page' => isset($params['page']) ? intval($params['page']) : 1,
'url' => MyUrl('admin/plugins/index'),
);
$page = new \base\Page($page_params);
$this->assign('page_html', $page->GetPageHtml());
// 获取列表
$data_params = array(
'm' => $page->GetPageStarNumber(),
'n' => $number,
'where' => $where,
);
$data = PluginsService::PluginsList($data_params);
$this->assign('data_list', $data['data']);
return $this->fetch();
} else {
return $this->fetch('upload');
}
}
/**
* [StatusUpdate 状态更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
*/
public function StatusUpdate()
{
// 是否ajax请求
if(!IS_AJAX)
{
return $this->error('非法访问');
}
// 开始处理
$params = input();
return PluginsService::PluginsStatusUpdate($params);
}
}
?>

View File

@ -45,27 +45,7 @@
<label>{{$data.common_spec_add_max_number.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_spec_add_max_number.describe}}</span></label>
<input type="number" name="{{$data.common_spec_add_max_number.only_tag}}" placeholder="{{$data.common_spec_add_max_number.describe}}" data-validation-message="{{$data.common_spec_add_max_number.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_spec_add_max_number.value}}"{{/if}} />
</div>
<!-- <div class="am-form-group">
<label>{{$data.common_share_giving_integral_frequency.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_share_giving_integral_frequency.describe}}</span></label>
<input type="number" name="{{$data.common_share_giving_integral_frequency.only_tag}}" placeholder="{{$data.common_share_giving_integral_frequency.name}}" data-validation-message="{{$data.common_share_giving_integral_frequency.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_share_giving_integral_frequency.value}}"{{/if}} />
</div>
<div class="am-form-group">
<label>{{$data.common_share_giving_integral.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_share_giving_integral.describe}}</span></label>
<input type="number" name="{{$data.common_share_giving_integral.only_tag}}" placeholder="{{$data.common_share_giving_integral.name}}" data-validation-message="{{$data.common_share_giving_integral.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_share_giving_integral.value}}"{{/if}} />
</div>
<div class="am-form-group">
<label>{{$data.common_share_view_desc.name}}</label>
<textarea rows="3" name="{{$data.common_share_view_desc.only_tag}}" class="am-radius" placeholder="{{$data.common_share_view_desc.name}}" data-validation-message="{{$data.common_share_view_desc.error_tips}}">{{if !empty($data)}}{{$data.common_share_view_desc.value}}{{/if}}</textarea>
</div> -->
<div class="am-form-group">
<label>{{$data.common_shop_notice.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_shop_notice.describe}}</span></label>
<textarea rows="3" name="{{$data.common_shop_notice.only_tag}}" class="am-radius" placeholder="{{$data.common_shop_notice.name}}" data-validation-message="{{$data.common_shop_notice.error_tips}}">{{if !empty($data)}}{{$data.common_shop_notice.value}}{{/if}}</textarea>
</div>
<div class="am-form-group">
<label>{{$data.common_user_center_notice.name}}<span class="fs-12 fw-100 cr-999">{{$data.common_user_center_notice.describe}}</span></label>
<textarea rows="3" name="{{$data.common_user_center_notice.only_tag}}" class="am-radius" placeholder="{{$data.common_user_center_notice.name}}" data-validation-message="{{$data.common_user_center_notice.error_tips}}">{{if !empty($data)}}{{$data.common_user_center_notice.value}}{{/if}}</textarea>
</div>
<div class="am-form-group">
<label>{{$data.home_search_keywords_type.name}}</label>
<select name="{{$data.home_search_keywords_type.only_tag}}" class="am-radius chosen-select c-p" data-validation-message="{{$data.home_search_keywords_type.error_tips}}">

View File

@ -1,8 +0,0 @@
<ul class="am-nav am-nav-pills table-nav">
<li {{if $view_type eq 'home'}}class="am-active"{{/if}}>
<a href="{{:MyUrl('admin/plugins/index', ['view_type'=>'home'])}}">应用管理</a>
</li>
<li {{if $view_type eq 'upload'}}class="am-active"{{/if}}>
<a href="{{:MyUrl('admin/plugins/index', ['view_type'=>'upload'])}}">上传安装</a>
</li>
</ul>

View File

@ -4,13 +4,13 @@
<div class="content-right">
<div class="content">
<!-- nav start -->
{{include file="plugins/nav" /}}
{{include file="pluginsadmin/nav" /}}
<!-- nav end -->
<!-- operation start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="am-g m-b-10 m-t-10">
<a href="{{:MyUrl('admin/plugins/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
<a href="{{:MyUrl('admin/pluginsadmin/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
</div>
{{/if}}
<!-- operation end -->
@ -30,14 +30,18 @@
<div class="am-gallery-desc">{{$v.desc}}</div>
<div class="operation">
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<a href="{{:MyUrl('admin/plugins/saveinfo', array('id'=>$v['id']))}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" title="编辑"></a>
<a href="{{:MyUrl('admin/pluginsadmin/saveinfo', array('id'=>$v['id']))}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" title="编辑"></a>
{{/if}}
<a href="{{:MyUrl('plugins/index/index', ['pluginsname'=>$v['plugins'], 'pluginscontrol'=>'index', 'pluginsaction'=>'index'])}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-gear" title="设置"></a>
<a href="{{:PluginsAdminUrl($v['plugins'], 'admin', 'index')}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-gear" title="设置"></a>
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-remove submit-ajax" data-url="{{:MyUrl('admin/plugins/uninstall')}}" data-id="10" data-view="reload" data-msg="删除后不可恢复、确认操作吗?" title="删除"></button>
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-remove submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/uninstall')}}" data-id="10" data-view="reload" data-msg="删除后不可恢复、确认操作吗?" title="删除"></button>
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/plugins/statusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1" title="状态"></a>
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/pluginsadmin/statusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1" title="状态"></a>
{{if isset($v['is_home']) and $v['is_home'] eq true}}
<a href="{{:PluginsHomeUrl($v['plugins'], 'index', 'index')}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-home" title="首页" target="_blank"></a>
{{/if}}
</div>
</div>
</li>

View File

@ -0,0 +1,8 @@
<ul class="am-nav am-nav-pills table-nav">
<li {{if $view_type eq 'home'}}class="am-active"{{/if}}>
<a href="{{:MyUrl('admin/pluginsadmin/index', ['view_type'=>'home'])}}">应用管理</a>
</li>
<li {{if $view_type eq 'upload'}}class="am-active"{{/if}}>
<a href="{{:MyUrl('admin/pluginsadmin/index', ['view_type'=>'upload'])}}">上传安装</a>
</li>
</ul>

View File

@ -4,7 +4,7 @@
<div class="content-right">
<div class="content">
<!-- nav start -->
{{include file="plugins/nav" /}}
{{include file="pluginsadmin/nav" /}}
<!-- nav end -->
<!-- form start -->

View File

@ -0,0 +1,19 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<div class="table-no"><i class="am-icon-warning cr-999"></i>
{{if isset($msg)}}
{{$msg}}
{{else /}}
异常错误
{{/if}}
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -104,9 +104,8 @@ function DataReturn($msg = '', $code = 0, $data = '')
* @version 1.0.0
* @date 2018-06-12
* @desc description
* @param string $c [控制器名称]
* @param string $a [方法名称]
* @param array $params [参数]
* @param string $path [路径地址]
* @param array $params [参数]
*/
function MyUrl($path, $params=[])
{
@ -121,6 +120,62 @@ function MyUrl($path, $params=[])
return $url;
}
/**
* 生成url地址 - 应用前端
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-06-12
* @desc description
* @param string $plugins_name [应用名称]
* @param string $plugins_control [应用控制器]
* @param string $plugins_action [应用方法]
* @param array $params [参数]
*/
function PluginsHomeUrl($plugins_name, $plugins_control, $plugins_action, $params=[])
{
$params['pluginsname'] = $plugins_name;
$params['pluginscontrol'] = $plugins_control;
$params['pluginsaction'] = $plugins_action;
$url = url('index/plugins/index', $params, true, true);
// 是否根目录访问项目
if(defined('IS_ROOT_ACCESS'))
{
$url = str_replace('public/', '', $url);
}
return $url;
}
/**
* 生成url地址 - 应用后端
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-06-12
* @desc description
* @param string $plugins_name [应用名称]
* @param string $plugins_control [应用控制器]
* @param string $plugins_action [应用方法]
* @param array $params [参数]
*/
function PluginsAdminUrl($plugins_name, $plugins_control, $plugins_action, $params=[])
{
$params['pluginsname'] = $plugins_name;
$params['pluginscontrol'] = $plugins_control;
$params['pluginsaction'] = $plugins_action;
$url = url('admin/plugins/index', $params, true, true);
// 是否根目录访问项目
if(defined('IS_ROOT_ACCESS'))
{
$url = str_replace('public/', '', $url);
}
return $url;
}
/**
* [PriceBeautify 金额美化]
* @author Devil

View File

@ -82,7 +82,6 @@ class Common extends Controller
{
// 公共顶部钩子
$this->assign('plugins_common_top_data', Hook::listen('plugins_common_top'));
//$this->assign('plugins_common_nav_top_data', Hook::listen('plugins_common_nav_top'));
}
/**
@ -223,9 +222,6 @@ class Common extends Controller
}
$this->assign('home_search_keywords', $home_search_keywords);
// 商城公告
$this->assign('common_shop_notice', MyC('common_shop_notice'));
// 友情链接
$link = LinkService::LinkList(['where'=>['is_enable'=>1]]);
$this->assign('link_list', $link['data']);

View File

@ -10,7 +10,6 @@
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\index\controller\Common;
use app\service\BannerService;
use app\service\GoodsService;
use app\service\ArticleService;

View File

@ -8,31 +8,39 @@
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\plugins\controller;
use think\Controller;
namespace app\index\controller;
/**
* 应用入口控制器
* 应用调用入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Index extends Controller
class Plugins extends Common
{
/**
* 入口
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
}
/**
* [Index 首页]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
* @datetime 2017-02-22T16:50:32+0800
*/
public function Index()
{
// 登录校验
$this->IsLogin();
// 参数
$params = input();
@ -59,7 +67,7 @@ class Index extends Controller
{
if(IS_AJAX)
{
exit(json_encode(DataReturn($ret, -5000)));
return DataReturn($ret, -5000);
} else {
$this->assign('msg', $ret);
return $this->fetch('public/error');
@ -71,53 +79,39 @@ class Index extends Controller
$pluginscontrol = strtolower($params['pluginscontrol']);
$pluginsaction = strtolower($params['pluginsaction']);
// 视图初始化
$this->PluginsViewInit($pluginsname, $pluginscontrol, $pluginsaction);
// 编辑器文件存放地址定义
$this->assign('editor_path_type', 'plugins_'.$pluginsname);
// 系统初始化
$this->SystemInit();
// 视图初始化
$this->ViewInit($pluginsname, $pluginscontrol, $pluginsaction);
// 调用应用
return controller(ucfirst($pluginscontrol), $pluginsname)->$pluginsaction($params);
}
/**
* 登录校验
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:42:35+0800
*/
protected function IsLogin()
{
if(session('admin') === null)
// 调用应用控制器
$plugins = '\app\plugins\\'.$pluginsname.'\\'.ucfirst($pluginscontrol);
$ret = (new $plugins())->ucfirst($pluginsaction)($params);
// 是否ajax
if(IS_AJAX)
{
if(IS_AJAX)
return $ret;
} else {
// 调用应用模板
if(isset($ret['code']))
{
exit(json_encode(DataReturn('登录失效,请重新登录', -400)));
if($ret['code'] == 0)
{
$this->assign($ret['data']);
return $this->fetch('../../../plugins/view/'.$pluginsname.'/'.$pluginscontrol.'/'.$pluginsaction);
} else {
$this->assign('msg', $ret['msg']);
return $this->fetch('public/error');
}
} else {
die('<script type="text/javascript">if(self.frameElement && self.frameElement.tagName == "IFRAME"){parent.location.reload();}else{window.location.href="'.MyUrl('admin/admin/logininfo').'";}</script>');
$this->assign('msg', '应用返回数据格式有误');
return $this->fetch('public/error');
}
}
}
/**
* 系统初始化
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-07
* @desc description
*/
private function SystemInit()
{
// url模式,后端采用兼容模式
\think\facade\Url::root(__MY_ROOT_PUBLIC__.'index.php?s=');
}
/**
* 视图初始化
* @author Devil
@ -128,14 +122,13 @@ class Index extends Controller
* @param [string] $plugins_control [控制器名称]
* @param [string] $plugins_action [方法]
*/
public function ViewInit($plugins_name, $plugins_control, $plugins_action)
public function PluginsViewInit($plugins_name, $plugins_control, $plugins_action)
{
// 当前操作名称
$module_name = strtolower(request()->module());
$module_name = 'plugins';
// 当前操作名称
$this->assign('plugins_name', $plugins_name);
$this->assign('module_name', $module_name);
$this->assign('controller_name', $plugins_control);
$this->assign('action_name', $plugins_action);
@ -147,9 +140,6 @@ class Index extends Controller
$module_js = $module_name.DS.'js'.DS.$plugins_name.DS.$plugins_control;
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$plugins_action.'.js') ? '.'.$plugins_action.'.js' : '.js';
$this->assign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : '');
// 图片host地址
$this->assign('attachment_host', config('shopxo.attachment_host'));
}
}
?>

View File

@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace app\index\controller;
use think\facade\Hook;
use app\service\OrderService;
use app\service\GoodsService;
use app\service\UserService;
@ -135,8 +136,8 @@ class User extends Common
$data = GoodsService::GoodsBrowseList($browse_params);
$this->assign('goods_browse_list', $data['data']);
// 用户中心公告
$this->assign('common_user_center_notice', MyC('common_user_center_notice'));
// 公共顶部钩子
$this->assign('plugins_user_center_top_data', Hook::listen('plugins_user_center_top'));
return $this->fetch();
}

View File

@ -40,38 +40,15 @@
<body>
<!-- 公共顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_header) or $is_header eq 1)}}
<div class="plugins-tag">
<span>plugins_common_top</span>
</div>
{{/if}}
{{if !empty($plugins_common_top_data) and is_array($plugins_common_top_data)}}
{{if !empty($plugins_common_top_data) and is_array($plugins_common_top_data) and (!isset($is_header) or $is_header eq 1)}}
{{foreach $plugins_common_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<!-- 商城公告 -->
{{if MyC('home_site_state') == 1 and (!isset($is_header) or $is_header eq 1)}}
{{if !empty($common_shop_notice)}}
<div class="am-alert am-alert-warning am-radius common-shop-notice" data-am-alert>
<div class="am-container">{{$common_shop_notice}}</div>
</div>
{{/if}}
{{/if}}
<!-- 公共顶部公告下钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_common_nav_top</span>
</div>
{{/if}}
{{if !empty($plugins_common_nav_top_data) and is_array($plugins_common_nav_top_data)}}
{{foreach $plugins_common_nav_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}

View File

@ -26,13 +26,19 @@
<!-- content start -->
<div class="user-content">
<div class="user-content-body">
<!-- 公告 -->
{{if !empty($common_user_center_notice)}}
<div class="am-alert am-alert-warning am-radius user-center-notice" data-am-alert>
<button type="button" class="am-close">&times;</button>
<p>{{$common_user_center_notice}}</p>
<!-- 用户中心顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_user_center_top</span>
</div>
{{/if}}
{{if !empty($plugins_user_center_top_data) and is_array($plugins_user_center_top_data)}}
{{foreach $plugins_user_center_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<!-- 基础信息 -->
<div class="user-base">

View File

@ -0,0 +1,91 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\plugins\commontopmaxpicture;
use app\service\PluginsService;
/**
* 顶部大图广告插件 - 管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Admin
{
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function index($params = [])
{
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
if($ret['code'] == 0)
{
// 数组组装
$data = [
'data' => $ret['data'],
];
return DataReturn('处理成功', 0, $data);
} else {
return $ret;
}
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function saveinfo($params = [])
{
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
if($ret['code'] == 0)
{
// 是否
$is_whether_list = [
0 => array('id' => 0, 'name' => '否', 'checked' => true),
1 => array('id' => 1, 'name' => '是'),
];
// 数组组装
$data = [
'is_whether_list' => $is_whether_list,
'data' => $ret['data'],
];
return DataReturn('处理成功', 0, $data);
} else {
return $ret;
}
}
/**
* 数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function save($params = [])
{
unset($params['max_file_size']);
return PluginsService::PluginsDataSave(['plugins'=>'commontopmaxpicture', 'data'=>$params]);
}
}
?>

View File

@ -10,17 +10,16 @@
// +----------------------------------------------------------------------
namespace app\plugins\commontopmaxpicture;
use think\Controller;
use app\service\PluginsService;
/**
* 顶部大图广告插件
* 顶部大图广告插件 - 钩子入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Index extends Controller
class Hook
{
/**
* 应用响应入口
@ -59,7 +58,7 @@ class Index extends Controller
$action_name = strtolower(request()->action());
// 获取应用数据
$ret = PluginsService::PluginsData('commontopmaxpicture');
$ret = PluginsService::PluginsData('commontopmaxpicture', ['images']);
// html拼接
$html = '<div style="text-align: center;';
@ -111,68 +110,5 @@ class Index extends Controller
return $html;
}
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function index($params = [])
{
$ret = PluginsService::PluginsData('commontopmaxpicture');
if($ret['code'] == 0)
{
$this->assign('data', $ret['data']);
return $this->fetch('commontopmaxpicture/index');
} else {
$this->assign('msg', $ret['msg']);
return $this->fetch('public/error');
}
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function saveinfo($params = [])
{
$ret = PluginsService::PluginsData('commontopmaxpicture');
if($ret['code'] == 0)
{
// 是否
$is_whether_list = array(
0 => array('id' => 0, 'name' => '否', 'checked' => true),
1 => array('id' => 1, 'name' => '是'),
);
$this->assign('is_whether_list', $is_whether_list);
$this->assign('data', $ret['data']);
return $this->fetch('commontopmaxpicture/saveinfo');
} else {
$this->assign('msg', $ret['msg']);
return $this->fetch('public/error');
}
}
/**
* 数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function save($params = [])
{
unset($params['max_file_size']);
return PluginsService::PluginsDataSave(['plugins'=>'commontopmaxpicture', 'data'=>$params]);
}
}
?>

View File

@ -8,9 +8,10 @@
"desc": "顶部大图广告,突破视觉",
"apply_terminal": ["pc"],
"apply_version": ["1.3.0"],
"is_home": false,
"sales_amount": 0
},
"hook": {
"plugins_common_top": ["app\\plugins\\commontopmaxpicture\\Index"]
"plugins_common_top": ["app\\plugins\\commontopmaxpicture\\Hook"]
}
}

View File

@ -0,0 +1,90 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\plugins\commontopnotice;
use app\service\PluginsService;
/**
* 顶部公告插件 - 管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Admin
{
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function index($params = [])
{
$ret = PluginsService::PluginsData('commontopnotice');
if($ret['code'] == 0)
{
// 数组组装
$data = [
'data' => $ret['data'],
];
return DataReturn('处理成功', 0, $data);
} else {
return $ret;
}
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function saveinfo($params = [])
{
$ret = PluginsService::PluginsData('commontopnotice');
if($ret['code'] == 0)
{
// 是否
$is_whether_list = [
0 => array('id' => 0, 'name' => '否', 'checked' => true),
1 => array('id' => 1, 'name' => '是'),
];
// 数组组装
$data = [
'is_whether_list' => $is_whether_list,
'data' => $ret['data'],
];
return DataReturn('处理成功', 0, $data);
} else {
return $ret;
}
}
/**
* 数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function save($params = [])
{
return PluginsService::PluginsDataSave(['plugins'=>'commontopnotice', 'data'=>$params]);
}
}
?>

View File

@ -0,0 +1,112 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\plugins\commontopnotice;
use app\service\PluginsService;
/**
* 顶部公告 - 钩子入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Hook
{
/**
* 应用响应入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-09T14:25:44+0800
* @param [array] $params [输入参数]
*/
public function run($params = [])
{
// 是否控制器钩子
if(isset($params['is_control']) && $params['is_control'] === true)
{
return [];
// 默认返回视图
} else {
return $this->html($params);
}
}
/**
* 视图
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public function html($params = [])
{
// 当前模块/控制器/方法
$module_name = strtolower(request()->module());
$controller_name = strtolower(request()->controller());
$action_name = strtolower(request()->action());
// 获取应用数据
$ret = PluginsService::PluginsData('commontopnotice');
// html拼接
$html = '<div class="am-alert am-alert-warning am-radius" style="margin: 0;">';
$content = '';
if($ret['code'] == 0)
{
// 内容是否为空
if(empty($ret['data']['content']))
{
return '';
}
// 有效时间
if(!empty($ret['data']['time_start']))
{
// 是否已开始
if(strtotime($ret['data']['time_start']) > time())
{
return '';
}
}
if(!empty($ret['data']['time_end']))
{
// 是否已结束
if(strtotime($ret['data']['time_end']) < time())
{
return '';
}
}
// 非全局
if($ret['data']['is_overall'] != 1)
{
// 非首页则空
if($module_name.$controller_name.$action_name != 'indexindexindex')
{
return '';
}
}
$content .= '<div class="am-container">'.$ret['data']['content'].'</div>';
} else {
$content = $ret['msg'];
}
$html .= $content;
$html .= '</div>';
return $html;
}
}
?>

View File

@ -0,0 +1,17 @@
{
"base": {
"name": "顶部公告",
"logo": "/static/upload/images/plugins_commontopnotice/2019/02/12/1549671733987652.png",
"author": "Devil",
"author_url": "https://shopxo.net/",
"version": "1.0.0",
"desc": "顶部公告,通知",
"apply_terminal": ["pc"],
"apply_version": ["1.3.0"],
"is_home": false,
"sales_amount": 0
},
"hook": {
"plugins_common_top": ["app\\plugins\\commontopnotice\\Hook"]
}
}

View File

@ -1,36 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
return [
// 模板引擎类型 支持 php think 支持扩展
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板路径
'view_path' => APP_PATH.'plugins'.DS.'view'.DS,
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{{',
// 模板引擎普通标签结束标记
'tpl_end' => '}}',
// 标签库标签开始标记
'taglib_begin' => '{{',
// 标签库标签结束标记
'taglib_end' => '}}',
];
?>

View File

@ -0,0 +1,83 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\plugins\usercentertopnotice;
use app\service\PluginsService;
/**
* 用户中心顶部公告插件 - 管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Admin
{
/**
* 首页
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function index($params = [])
{
$ret = PluginsService::PluginsData('usercentertopnotice');
if($ret['code'] == 0)
{
// 数组组装
$data = [
'data' => $ret['data'],
];
return DataReturn('处理成功', 0, $data);
} else {
return $ret;
}
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function saveinfo($params = [])
{
$ret = PluginsService::PluginsData('usercentertopnotice');
if($ret['code'] == 0)
{
// 数组组装
$data = [
'data' => $ret['data'],
];
return DataReturn('处理成功', 0, $data);
} else {
return $ret;
}
}
/**
* 数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function save($params = [])
{
return PluginsService::PluginsDataSave(['plugins'=>'usercentertopnotice', 'data'=>$params]);
}
}
?>

View File

@ -0,0 +1,102 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2018 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\plugins\usercentertopnotice;
use app\service\PluginsService;
/**
* 用户中心顶部公告 - 钩子入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Hook
{
/**
* 应用响应入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-09T14:25:44+0800
* @param [array] $params [输入参数]
*/
public function run($params = [])
{
// 是否控制器钩子
if(isset($params['is_control']) && $params['is_control'] === true)
{
return [];
// 默认返回视图
} else {
return $this->html($params);
}
}
/**
* 视图
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public function html($params = [])
{
// 当前模块/控制器/方法
$module_name = strtolower(request()->module());
$controller_name = strtolower(request()->controller());
$action_name = strtolower(request()->action());
// 获取应用数据
$ret = PluginsService::PluginsData('usercentertopnotice');
// html拼接
$html = '<div class="am-alert am-alert-warning am-radius" style="margin: 0;">';
$content = '';
if($ret['code'] == 0)
{
// 内容是否为空
if(empty($ret['data']['content']))
{
return '';
}
// 有效时间
if(!empty($ret['data']['time_start']))
{
// 是否已开始
if(strtotime($ret['data']['time_start']) > time())
{
return '';
}
}
if(!empty($ret['data']['time_end']))
{
// 是否已结束
if(strtotime($ret['data']['time_end']) < time())
{
return '';
}
}
$content .= '<div class="am-container">'.$ret['data']['content'].'</div>';
} else {
$content = $ret['msg'];
}
$html .= $content;
$html .= '</div>';
return $html;
}
}
?>

View File

@ -0,0 +1,17 @@
{
"base": {
"name": "用户中心顶部公告",
"logo": "/static/upload/images/plugins_usercentertopnotice/2019/02/12/1549671733967341.png",
"author": "Devil",
"author_url": "https://shopxo.net/",
"version": "1.0.0",
"desc": "用户中心顶部公告,通知",
"apply_terminal": ["pc"],
"apply_version": ["1.3.0"],
"is_home": false,
"sales_amount": 0
},
"hook": {
"plugins_common_top": ["app\\plugins\\usercentertopnotice\\Hook"]
}
}

View File

@ -5,14 +5,14 @@
<div class="content">
<legend>
<span class="fs-16">顶部大图</span>
<a href="{{:MyUrl('admin/plugins/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="commontopmaxpicture-content">
<div class="items">
<label>图片</label>
<div class="immages-tag">
<img src="{{if !empty($data['images_old'])}}{{$data.images_old}}{{else /}}{{$attachment_host}}/static/plugins/images/default-images.png{{/if}}" />
<img src="{{if !empty($data['images_old'])}}{{$data.images_old}}{{else /}}{{$attachment_host}}/static/plugins/images/commontopmaxpicture/default-images.png{{/if}}" />
</div>
</div>
<div class="items">
@ -63,7 +63,7 @@
{{/if}}
</div>
</div>
<a href="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'saveinfo'])}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
<a href="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
</div>
</div>
</div>

View File

@ -4,11 +4,11 @@
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'save'])}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'index'])}}" enctype="multipart/form-data">
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'index')}}" enctype="multipart/form-data">
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_image', 2048000)}}" />
<legend>
<span class="fs-16">顶部大图</span>
<a href="{{:MyUrl('plugins/index/index', ['pluginsname'=>'commontopmaxpicture', 'pluginscontrol'=>'index', 'pluginsaction'=>'index'])}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
<a href="{{:PluginsAdminUrl('commontopmaxpicture', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group am-form-file">
@ -16,7 +16,7 @@
<ul class="plug-file-upload-view plugins-images-view" data-form-name="images" data-max-number="1" data-delete="0" data-dialog-type="images">
<li>
<input type="text" name="images" value="{{if !empty($data['images'])}}{{$data.images}}{{/if}}" data-validation-message="请上传图片" required />
<img src="{{if !empty($data['images_old'])}}{{$data.images_old}}{{else /}}{{$attachment_host}}/static/plugins/images/default-images.png{{/if}}" />
<img src="{{if !empty($data['images_old'])}}{{$data.images_old}}{{else /}}{{$attachment_host}}/static/plugins/images/commontopmaxpicture/default-images.png{{/if}}" />
</li>
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-view">+上传图片</div>

View File

@ -0,0 +1,54 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<legend>
<span class="fs-16">顶部公告</span>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="commontopnotice-content">
<div class="items">
<label>公告内容</label>
<div>
{{if !empty($data['content'])}}
{{$data.content}}
{{else /}}
{{/if}}
</div>
</div>
<div class="items">
<label>是否全局</label>
<div>
{{if isset($data['is_overall']) and $data['is_overall'] eq 1}}
{{else /}}
{{/if}}
</div>
</div>
<div class="items">
<label>有效时间</label>
<div>
{{if !empty($data['time_start']) and !empty($data['time_end'])}}
{{$data.time_start}} ~ {{$data.time_end}}
{{elseif !empty($data['time_start']) and empty($data['time_end'])}}
{{$data.time_start}} ~ 长期有效
{{elseif empty($data['time_start']) and !empty($data['time_end'])}}
立即生效 ~ {{$data.time_end}}
{{else /}}
无限制
{{/if}}
</div>
</div>
<a href="{{:PluginsAdminUrl('commontopnotice', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -0,0 +1,49 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('commontopnotice', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('commontopnotice', 'admin', 'index')}}" enctype="multipart/form-data">
<legend>
<span class="fs-16">顶部公告</span>
<a href="{{:PluginsAdminUrl('commontopnotice', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group am-form-file">
<label class="block">公告内容<span class="fs-12 fw-100 cr-999">(空则不显示)</span></label>
<textarea rows="3" name="content" class="am-radius am-field-valid" placeholder="商城公告" data-validation-message="请填写公告内容">{{if !empty($data['content'])}}{{$data.content}}{{/if}}</textarea>
</div>
<div class="am-form-group">
<label>是否全局<span class="fs-12 fw-100 cr-999">(默认首页)</span></label>
<div>
{{foreach $is_whether_list as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_overall" value="{{$v.id}}" {{if isset($data['is_overall']) and $data['is_overall'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_overall']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<div class="am-form-group">
<label>有效时间<span class="fs-12 fw-100 cr-999">(留空则不限制)</span></label>
<div class="form-date">
<input type="text" autocomplete="off" name="time_start" class="Wdate am-radius" placeholder="起始时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_start'])}}value="{{$data.time_start}}"{{/if}}/>
<span>~</span>
<input type="text" autocomplete="off" class="Wdate am-radius" placeholder="结束时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_end'])}}value="{{$data.time_end}}"{{/if}}/>
</div>
</div>
<div class="am-form-group">
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -1,12 +0,0 @@
<!-- 是否启用 开始 -->
<div class="am-form-group">
<label>是否启用</label>
<div>
{{foreach :lang('common_is_enable_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_enable" value="{{$v.id}}" {{if isset($data['is_enable']) and $data['is_enable'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_enable']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 是否启用 结束 -->

View File

@ -1,39 +0,0 @@
<div class="am-popup am-radius" id="excel-import-win">
<div class="am-popup-inner">
<div class="am-popup-hd">
<h4 class="am-popup-title">导入Excel</h4>
<span data-am-modal-close class="am-close">&times;</span>
</div>
<div class="am-popup-bd">
<!-- win form start -->
<form class="am-form form-validation excel-form" action="{{$excel_import_form_url}}" method="POST" request-type="ajax-fun" request-value="ExcelImportCallback" enctype="multipart/form-data">
<input type="hidden" name="max_file_size" value="{{:MyC('home_max_limit_file', 51200000)}}" />
<div class="am-alert am-radius am-alert-tips m-t-0" data-am-alert>
{{if !empty($excel_import_format_url)}}
<p class="m-b-10"><a href="{{$excel_import_format_url}}" class="cr-blue">Excel格式下载</a><span class="m-r-5"></p>
{{/if}}
{{if !empty($excel_import_tips)}}
<p class="m-t-10">{{$excel_import_tips}}</p>
{{/if}}
<p class="cr-red">PS导入数据建议一次不要超过10万条。</p>
</div>
<div class="am-form-group am-form-file">
<button type="button" class="am-btn am-btn-default am-btn-sm am-radius"><i class="am-icon-cloud-upload"></i> 选择文件</button>
<input type="file" name="excel" multiple data-validation-message="请选择需要上传的文件" accept="application/vnd.ms-excel" required />
</div>
<div class="am-form-group">
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">确认</button>
</div>
</form>
<!-- win form end -->
<!-- import tips start -->
<div class="am-alert am-alert-success am-radius excel-import-success none">导入成功 <strong>0</strong></div>
<div class="am-panel am-panel-danger am-radius excel-import-error none">
<div class="am-panel-hd p-l-10">导入失败 <strong>0</strong></div>
<table class="am-table"><tbody></tbody></table>
</div>
<!-- import tips end -->
</div>
</div>
</div>

View File

@ -1,43 +0,0 @@
<script>
/**
* [ExcelImportCallback excel导入回调公共表单方法校验需要放在这里不能校验其它文件的方法]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-11T21:46:50+0800
* @param {[object]} data [回调数据]
*/
function ExcelImportCallback(data)
{
if(data.code == 0)
{
// 成功
if(data.data.success > 0)
{
$('.excel-import-success').removeClass('none');
$('.excel-import-success').find('strong').text(data.data.success);
} else {
$('.excel-import-success').addClass('none');
}
// 失败
if(data.data.error.length == 0)
{
$('.excel-import-error').addClass('none');
} else {
$('.excel-import-error').removeClass('none');
$('.excel-import-error').find('strong').text(data.data.error.length);
var html = '';
for(var i in data.data.error)
{
html += '<tr><td>'+data.data.error[i]+'</td></tr>';
}
$('.excel-import-error').find('table tbody').html(html);
}
} else {
Prompt(data.msg);
}
$.AMUI.progress.done();
$('.form-validation').find('button[type="submit"]').button('reset');
}
</script>

View File

@ -1,12 +0,0 @@
<!-- 性别 开始 -->
<div class="am-form-group">
<label>性别</label>
<div>
{{foreach :lang('common_gender_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="gender" value="{{$v.id}}" {{if isset($data['gender']) and $data['gender'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['gender']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 性别 结束 -->

View File

@ -1,12 +0,0 @@
<!-- 是否包含尾部 开始 -->
<div class="am-form-group">
<label>是否含尾部</label>
<div>
{{foreach :lang('common_is_footer_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_footer" value="{{$v.id}}" {{if isset($data['is_footer']) and $data['is_footer'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_footer']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 是否包含尾部 结束 -->

View File

@ -1,12 +0,0 @@
<!-- 是否满屏 开始 -->
<div class="am-form-group">
<label>是否满屏</label>
<div>
{{foreach :lang('common_is_full_screen_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_full_screen" value="{{$v.id}}" {{if isset($data['is_full_screen']) and $data['is_full_screen'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_full_screen']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 是否满屏 结束 -->

View File

@ -1,12 +0,0 @@
<!-- 是否包含头部 开始 -->
<div class="am-form-group">
<label>是否含头部</label>
<div>
{{foreach :lang('common_is_header_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_header" value="{{$v.id}}" {{if isset($data['is_header']) and $data['is_header'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_header']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 是否包含头部 结束 -->

View File

@ -1,12 +0,0 @@
<!-- 是否新窗口打开 开始 -->
<div class="am-form-group">
<label>是否新窗口打开</label>
<div>
{{foreach :lang('common_is_new_window_open_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_new_window_open" value="{{$v.id}}" {{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_new_window_open']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 是否新窗口打开 结束 -->

View File

@ -1,12 +0,0 @@
<!-- 是否显示 开始 -->
<div class="am-form-group">
<label>是否显示</label>
<div>
{{foreach :lang('common_is_show_list') as $v}}
<label class="am-radio-inline m-r-10">
<input type="radio" name="is_show" value="{{$v.id}}" {{if isset($data['is_show']) and $data['is_show'] eq $v['id']}}checked="checked"{{else /}}{{if !isset($data['is_show']) and isset($v['checked']) and $v['checked'] eq true}}checked="checked"{{/if}}{{/if}} data-am-ucheck /> {{$v.name}}
</label>
{{/foreach}}
</div>
</div>
<!-- 是否显示 结束 -->

View File

@ -1,25 +0,0 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<legend>
<span class="fs-16">顶部大图</span>
<a href="{{:MyUrl('admin/plugins/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="table-no">
<i class="am-icon-warning cr-999"></i>
{{if empty($msg)}}
没有相关数据
{{else /}}
{{$msg}}
{{/if}}
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -1,52 +0,0 @@
<!-- 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>
</body>
</html>
<!-- 类库 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/jquery/jquery-2.1.0.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/assets/js/amazeui.min.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/echarts/echarts.min.js"></script>
<!-- ueditor 编辑器 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/ueditor/ueditor.config.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/ueditor/ueditor.all.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
<!-- 颜色选择器 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/colorpicker/jquery.colorpicker.js"></script>
<!-- 元素拖拽排序插件 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/dragsort/jquery.dragsort-0.5.2.min.js"></script>
<!-- amazeui插件 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-switch/amazeui.switch.min.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-chosen/amazeui.chosen.min.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-dialog/amazeui.dialog.min.js"></script>
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-tagsinput/amazeui.tagsinput.min.js"></script>
<!-- 日期组件 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/My97DatePicker/WdatePicker.js"></script>
<!-- 隐藏编辑器初始化 -->
<script type="text/javascript">
var upload_editor = UE.getEditor("upload-editor-view", {
isShow: false,
focus: false,
enableAutoSave: false,
autoSyncData: false,
autoFloatEnabled:false,
wordCount: false,
sourceEditor: null,
scaleEnabled:true,
toolbars: [["insertimage", "insertvideo", "attachment"]]
});
</script>
<!-- 项目公共 -->
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/common/js/common.js"></script>
<!-- 控制器 -->
{{if !empty($module_js)}}
<script type='text/javascript' src="{{$Think.__MY_ROOT_PUBLIC__}}static/{{$module_js}}"></script>
{{/if}}

View File

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="{{:config('shopxo.default_charset', 'utf-8')}}" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1" />
<title>ShopXO后台管理系统</title>
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/assets/css/amazeui.css" />
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-switch/amazeui.switch.css" />
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-chosen/amazeui.chosen.css" />
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/common/lib/amazeui-tagsinput/amazeui.tagsinput.css" />
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/common/css/common.css" />
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/admin/default/css/common.css" />
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/admin/default/css/iconfontmenu.css" />
{{if !empty($module_css)}}
<link rel="stylesheet" type="text/css" href="{{$Think.__MY_ROOT_PUBLIC__}}static/{{$module_css}}" />
{{/if}}
</head>
<script type="text/javascript">
var __attachment_host__ = '{{if isset($attachment_host)}}{{$attachment_host}}{{/if}}';
</script>
<body>

View File

@ -1,45 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.)}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }
.system-message{ padding: 24px 48px; }
.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
.system-message .jump{ padding-top: 10px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
</style>
</head>
<body>
<div class="system-message">
<present name="message">
<h1>:)</h1>
<p class="success"><?php echo($message); ?></p>
<else/>
<h1>:(</h1>
<p class="error"><?php echo($error); ?></p>
{{/if}}
<p class="detail"></p>
<p class="jump">
页面自动 <a id="href" href="<?php echo($jumpUrl); ?>">跳转</a> 等待时间: <b id="wait"><?php echo($waitSecond); ?></b>
</p>
</div>
<script type="text/javascript">
(function(){
var wait = document.getElementById('wait'),href = document.getElementById('href').href;
var interval = setInterval(function(){
var time = --wait.innerHTML;
if(time <= 0) {
location.href = href;
clearInterval(interval);
};
}, 1000);
})();
</script>
</body>
</html>

View File

@ -1,45 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.)}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }
.system-message{ padding: 24px 48px; }
.system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
.system-message .jump{ padding-top: 10px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
</style>
</head>
<body>
<div class="system-message">
<present name="message">
<h1>:)</h1>
<p class="success"><?php echo($message); ?></p>
<else/>
<h1>:(</h1>
<p class="error"><?php echo($error); ?></p>
{{/if}}
<p class="detail"></p>
<p class="jump">
页面自动 <a id="href" href="<?php echo($jumpUrl); ?>">跳转</a> 等待时间: <b id="wait"><?php echo($waitSecond); ?></b>
</p>
</div>
<script type="text/javascript">
(function(){
var wait = document.getElementById('wait'),href = document.getElementById('href').href;
var interval = setInterval(function(){
var time = --wait.innerHTML;
if(time <= 0) {
location.href = href;
clearInterval(interval);
};
}, 1000);
})();
</script>
</body>
</html>

View File

@ -0,0 +1,44 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<legend>
<span class="fs-16">顶部公告</span>
<a href="{{:MyUrl('admin/pluginsadmin/index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="usercentertopnotice-content">
<div class="items">
<label>公告内容</label>
<div>
{{if !empty($data['content'])}}
{{$data.content}}
{{else /}}
{{/if}}
</div>
</div>
<div class="items">
<label>有效时间</label>
<div>
{{if !empty($data['time_start']) and !empty($data['time_end'])}}
{{$data.time_start}} ~ {{$data.time_end}}
{{elseif !empty($data['time_start']) and empty($data['time_end'])}}
{{$data.time_start}} ~ 长期有效
{{elseif empty($data['time_start']) and !empty($data['time_end'])}}
立即生效 ~ {{$data.time_end}}
{{else /}}
无限制
{{/if}}
</div>
</div>
<a href="{{:PluginsAdminUrl('usercentertopnotice', 'admin', 'saveinfo')}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit">编辑</a>
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -0,0 +1,38 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('usercentertopnotice', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('usercentertopnotice', 'admin', 'index')}}" enctype="multipart/form-data">
<legend>
<span class="fs-16">顶部公告</span>
<a href="{{:PluginsAdminUrl('usercentertopnotice', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend>
<div class="am-form-group am-form-file">
<label class="block">公告内容<span class="fs-12 fw-100 cr-999">(空则不显示)</span></label>
<textarea rows="3" name="content" class="am-radius am-field-valid" placeholder="商城公告" data-validation-message="请填写公告内容">{{if !empty($data['content'])}}{{$data.content}}{{/if}}</textarea>
</div>
<div class="am-form-group">
<label>有效时间<span class="fs-12 fw-100 cr-999">(留空则不限制)</span></label>
<div class="form-date">
<input type="text" autocomplete="off" name="time_start" class="Wdate am-radius" placeholder="起始时间" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_start'])}}value="{{$data.time_start}}"{{/if}}/>
<span>~</span>
<input type="text" autocomplete="off" class="Wdate am-radius" placeholder="结束时间" name="time_end" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})" {{if !empty($data['time_end'])}}value="{{$data.time_end}}"{{/if}}/>
</div>
</div>
<div class="am-form-group">
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -70,6 +70,7 @@ class PluginsService
'is_enable' => $v['is_enable'],
'logo_old' => $base['logo'],
'logo' => ResourcesService::AttachmentPathViewHandle($base['logo']),
'is_home' => isset($base['is_home']) ? $base['is_home'] : false,
'name' => isset($base['name']) ? $base['name'] : '',
'author' => isset($base['author']) ? $base['author'] : '',
'author_url' => isset($base['author_url']) ? $base['author_url'] : '',
@ -123,17 +124,29 @@ class PluginsService
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [string] $plugins [应用标记]
* @param [string] $plugins [应用标记]
* @param [array] $images_field [图片字段]
*/
public static function PluginsData($plugins)
public static function PluginsData($plugins, $images_field = [])
{
// 获取数据
$data = Db::name('Plugins')->where(['plugins'=>$plugins])->value('data');
if(!empty($data))
{
$data = json_decode($data, true);
$data['images_old'] = $data['images'];
$data['images'] = ResourcesService::AttachmentPathViewHandle($data['images']);
// 是否有图片需要处理
if(!empty($images_field) && is_array($images_field))
{
foreach($images_field as $field)
{
if(isset($data[$field]))
{
$data[$field.'_old'] = $data[$field];
$data[$field] = ResourcesService::AttachmentPathViewHandle($data[$field]);
}
}
}
}
return DataReturn('处理成功', 0, $data);
}

View File

@ -27,6 +27,9 @@ return [
'app_end' => [],
// 钩子测试
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\Index'],
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\Hook', 'app\\plugins\\commontopnotice\\Hook'],
// 用户中心
'plugins_user_center_top' => ['app\\plugins\\usercentertopnotice\\Hook'],
];
?>

File diff suppressed because one or more lines are too long

View File

@ -31,12 +31,6 @@ button { outline: none; }
font-size: 12px !important;
}
/* 商城公告 */
.common-shop-notice {
margin: 0;
border-left: 0;
border-right: 0;
}
/*所有超链接不要下划线*/
*, *:after, *:before{

View File

@ -52,7 +52,6 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
.user-base-right{position: absolute; right: 10px; top: 10px;}
ul.user-base-icon{left: 0; bottom: 0; width: 100%; padding: 5px 0;}
ul.user-base-icon li{float: left; width: 25%;}
.user-center-notice { margin: 0; }
}

View File

@ -0,0 +1,27 @@
/**
* 首页
*/
.commontopnotice-content .items {
margin: 10px 0 20px 0;
border-bottom: 1px dashed #f1f1f1;
padding-bottom: 20px;
}
.commontopnotice-content .edit-submit {
margin-bottom: 20px;
}
/**
* 编辑页面
*/
ul.plugins-images-view li {
width: 100%;
height: auto;
}
.form-date input {
width: 30% !important;
display: -webkit-inline-box !important;
}
.form-date span {
vertical-align: middle;
}

View File

@ -0,0 +1,27 @@
/**
* 首页
*/
.usercentertopnotice-content .items {
margin: 10px 0 20px 0;
border-bottom: 1px dashed #f1f1f1;
padding-bottom: 20px;
}
.usercentertopnotice-content .edit-submit {
margin-bottom: 20px;
}
/**
* 编辑页面
*/
ul.plugins-images-view li {
width: 100%;
height: auto;
}
.form-date input {
width: 30% !important;
display: -webkit-inline-box !important;
}
.form-date span {
vertical-align: middle;
}

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB