feat/task1-c-wallet
gongfuxiang 2019-02-09 09:15:23 +08:00
parent bfa775339b
commit a22f25ae87
81 changed files with 1487 additions and 80 deletions

View File

@ -0,0 +1,87 @@
<?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 Plugins 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->Is_Login();
// 权限校验
$this->Is_Power();
}
/**
* [Index 配置列表]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
// 参数
$params = input();
// 分页
$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();
}
}
?>

View File

@ -33,7 +33,6 @@
<div class="am-form-group">
<label>官网地址<span class="fs-12 fw-100 cr-999">带http://或https://</span></label>
<input type="url" placeholder="官网地址" name="website_url" data-validation-message="官网地址格式有误" class="am-radius" {{if !empty($data)}} value="{{$data.website_url}}"{{/if}} />
</div>
<div class="am-form-group am-form-file">

View File

@ -44,7 +44,7 @@
<textarea class="am-radius am-validate" name="content" rows="5" minlength="50" maxlength="105000" {{if !IsMobile()}}id="editor-tag" data-url="{{:MyUrl('admin/ueditor/index', ['path_type'=>'customview'])}}" placeholder="内容长度最少 50~105000 个字符" {{else /}} placeholder="内容长度最少 50~105000 个字符更多编辑功能请使用电脑访问" {{/if}} data-validation-message="内容长度最少 50~105000 个字符" required>{{if !empty($data)}}{{$data.content}}{{/if}}</textarea>
</div>
<div class="am-form-group">
<input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}}" />
<input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
<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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>是否启用</label>
<div>
{{foreach $common_is_enable_list as $v}}
{{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>

View File

@ -9,11 +9,11 @@
<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>
<notempty name="excel_import_format_url">
<p class="m-b-)}}<a href="{{$excel_import_format_url}}" class="cr-blue">Excel格式下载</a><span class="m-r-5)}}</p>
{{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}}
<notempty name="excel_import_tips">
<p class="m-t-1)}}{{$excel_import_tips}}</p>
{{if !empty($excel_import_tips)}}
<p class="m-t-10">{{$excel_import_tips}}</p>
{{/if}}
<p class="cr-red">PS导入数据建议一次不要超过10万条。</p>
</div>
@ -30,7 +30,7 @@
<!-- 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-1)}} <strong>0</strong></div>
<div class="am-panel-hd p-l-10">导入失败 <strong>0</strong></div>
<table class="am-table"><tbody></tbody></table>
</div>
<!-- import tips end -->

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>性别</label>
<div>
{{foreach $common_gender_list as $v}}
{{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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>是否含尾部</label>
<div>
{{foreach $common_is_footer_list as $v}}
{{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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>是否满屏</label>
<div>
{{foreach $common_is_full_screen_list as $v}}
{{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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>是否含头部</label>
<div>
{{foreach $common_is_header_list as $v}}
{{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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>是否新窗口打开</label>
<div>
{{foreach $common_is_new_window_open_list as $v}}
{{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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>是否显示</label>
<div>
{{foreach $common_is_show_list as $v}}
{{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>

View File

@ -2,7 +2,7 @@
<div class="am-form-group">
<label>{{:lang('common_view_user_status_name')}}</label>
<select name="status" class="am-radius c-p" data-validation-message="{{:lang('common_user_status_format')}}" required>
{{foreach $common_user_status_list as $v}}
{{foreach :lang('common_user_status_list') as $v}}
<option value="{{$v.id}}" {{if isset($data['status']) and $data['status'] eq $v['id']}}selected{{else /}}{{if !isset($data['status']) and isset($v['checked']) and $v['checked'] eq true}}selected{{/if}}{{/if}}>{{$v.name}}</option>
{{/foreach}}
</select>

View File

@ -89,7 +89,7 @@
{{if empty($v['add_time_time'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.add_time_time}}{{/if}}
</td>
<td class="view-operation">
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('admin/message/Delete')}}" data-id="{{$v.id}}"> 删除</button>
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('admin/message/delete')}}" data-id="{{$v.id}}"> 删除</button>
</td>
</tr>
{{/foreach}}

View File

@ -90,14 +90,14 @@
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-cubes submit-ajax" data-url="{{:MyUrl('admin/payment/install')}}" data-id="{{$v.payment}}" data-view="reload" data-msg="安装进行中、确认操作吗?"> 安装</button>
{{if !in_array($v['payment'], $cannot_deleted_list)}}
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('admin/payment/Delete')}}" data-id="{{$v.payment}}"> 删除</button>
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('admin/payment/delete')}}" data-id="{{$v.payment}}"> 删除</button>
{{/if}}
{{else /}}
<a href="{{:MyUrl('admin/payment/saveinfo', array('id'=>$v['id']))}}">
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit"> 编辑</button>
</a>
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-genderless submit-ajax" data-url="{{:MyUrl('admin/payment/uninstall')}}" data-id="{{$v.payment}}" data-view="reload" data-msg="卸载后不可恢复、确认操作吗?"> 卸载</button>
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-remove submit-ajax" data-url="{{:MyUrl('admin/payment/uninstall')}}" data-id="{{$v.payment}}" data-view="reload" data-msg="卸载后不可恢复、确认操作吗?"> 卸载</button>
{{/if}}
</td>
</tr>

View File

@ -0,0 +1,38 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
{{if !empty($data_list)}}
<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-bordered" data-am-gallery="{}">
{{foreach $data_list as $v}}
<li>
<div class="am-gallery-item">
<img src="{{$v.logo}}" class="icon" />
<div class="base">
<h3 class="name">{{$v.name}}</h3>
<p>作者:{{$v.author}}</p>
<p>主页:<a href="{{$v.author_url}}" target="_blank">{{$v.author_url}}</a></p>
<p>版本:{{$v.version}}</p>
</div>
<div class="am-gallery-desc">{{$v.desc}}</div>
<div class="operation">
<a href="{{:MyUrl('plugins/index/index', ['control'=>$v['plugins'], 'action'=>'index'])}}" class="am-btn am-btn-default am-btn-xs am-radius am-icon-gear"> 设置</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="卸载后不可恢复、确认操作吗?"> 卸载</button>
</div>
</div>
</li>
{{/foreach}}
</ul>
{{else /}}
hello
{{/if}}
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -68,7 +68,7 @@
<i class="am-icon-plus c-p m-r-5"></i>
<label class="c-p">
{{else /}}
<label class="c-p m-l-2)}}
<label class="c-p m-l-20">
{{/if}}
<span>{{if !empty($v['icon'])}}<span class="iconfont {{$v.icon}}"></span>{{/if}} {{$v.name}}</span>
</label>

View File

@ -1,23 +0,0 @@
<!-- delete html start -->
<div class="am-modal am-modal-confirm" tabindex="-1" id="common-confirm-delete">
<div class="am-modal-dialog am-radius">
<div class="am-modal-bd">删除后无法恢复,确定继续吗?</div>
<div class="am-modal-footer">
<span class="am-modal-btn" data-am-modal-cancel>取消</span>
<span class="am-modal-btn" data-am-modal-confirm>确认</span>
</div>
</div>
</div>
<!-- delete html end -->
<!-- delete html start -->
<div class="am-modal am-modal-confirm" tabindex="-1" id="common-confirm-cancel">
<div class="am-modal-dialog am-radius">
<div class="am-modal-bd">取消后无法恢复,确定继续吗?</div>
<div class="am-modal-footer">
<span class="am-modal-btn" data-am-modal-cancel>取消</span>
<span class="am-modal-btn" data-am-modal-confirm>确认</span>
</div>
</div>
</div>
<!-- delete html end -->

View File

@ -1,6 +1,4 @@
<!-- commom html -->
{{include file="public/common" /}}
<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>

View File

@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace app\index\controller;
use think\facade\Hook;
use think\Controller;
use app\service\GoodsService;
use app\service\NavigationService;
@ -64,6 +65,24 @@ class Common extends Controller
// 视图初始化
$this->ViewInit();
// 公共钩子初始化
$this->CommonPluginsInit();
}
/**
* 公共钩子初始化
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-07
* @desc description
*/
private function CommonPluginsInit()
{
// 公共顶部钩子
$this->assign('plugins_common_top_data', Hook::listen('plugins_common_top'));
//$this->assign('plugins_common_nav_top_data', Hook::listen('plugins_common_nav_top'));
}
/**
@ -210,6 +229,9 @@ class Common extends Controller
// 友情链接
$link = LinkService::LinkList(['where'=>['is_enable'=>1]]);
$this->assign('link_list', $link['data']);
// 开发模式
$this->assign('shopxo_is_develop', config('shopxo.is_develop'));
}
/**

View File

@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\index\controller\Common;
use app\service\BannerService;
use app\service\GoodsService;
use app\service\ArticleService;
@ -65,6 +66,7 @@ class Index extends Common
// 用户订单状态
$user_order_status = OrderService::OrderStatusStepTotal(['user_type'=>'user', 'user'=>$this->user, 'is_comments'=>1]);
$this->assign('user_order_status', $user_order_status['data']);
return $this->fetch();
}
}

View File

@ -39,6 +39,20 @@
</head>
<body>
<!-- 公共顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_common_top</span>
</div>
{{/if}}
{{if !empty($plugins_common_top_data) and is_array($plugins_common_top_data)}}
{{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)}}
@ -46,4 +60,18 @@
<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

@ -0,0 +1,165 @@
<?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 think\Controller;
use app\service\PluginsService;
/**
* 顶部广告插件
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class CommonTopMaxPicture extends Controller
{
public function run($params = [])
{
// 是否控制器
if(isset($params['is_control']) && $params['is_control'] === true)
{
return [];
// 默认返回视图
} else {
return $this->html();
}
}
/**
* 视图
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
*/
public function html()
{
$ret = PluginsService::PluginsData('commontopmaxpicture');
$html = '<div style="text-align: center;';
$content = '';
if($ret['code'] == 0)
{
// 背景色
if(!empty($ret['data']['bg_color']))
{
$html .= 'background: '.$ret['data']['bg_color'].';';
}
$content .= '<a href="'.(empty($ret['data']['url']) ? 'javascript:;' : $ret['data']['url']).'" '.($ret['data']['is_new_window_open'] == 1 ? 'target="_blank"' : '').'>';
$content .= '<img src="'.$ret['data']['images'].'" />';
$content .= '</a>';
} else {
$content = $ret['msg'];
}
$html .= '">';
$html .= $content;
$html .= '</div>';
return $html;
}
/**
* 配置信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
*/
public function config()
{
// 基础信息
$base = [
'author' => 'Devil',
'blog' => 'http://gong.gg',
'name' => '顶部广告',
'version' => '1.0.0',
'sales_amount' => 0,
];
// 后台配置
$admin = [
];
// 控制器钩子
$control_hook = [
'plugins_control_hook' => [
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\CommonTopMaxPicture'],
],
];
return [
'base' => $base,
'admin' => $admin,
'control_hook' => $control_hook,
];
}
/**
* 首页
* @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)
{
$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

@ -0,0 +1,36 @@
<?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,120 @@
<?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\controller;
use think\Controller;
/**
* 插件入口控制器
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Index extends Controller
{
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function Index()
{
// 登录校验
$this->IsLogin();
// 参数
$params = input();
$control = strtolower($params['control']);
$action = strtolower($params['action']);
// 编辑器文件存放地址定义
$this->assign('editor_path_type', 'plugins_'.$control);
// 系统初始化
$this->SystemInit();
// 视图初始化
$this->ViewInit($control, $action);
// 调用插件
return controller(ucfirst($control), $control)->$action(input('post.'));
}
/**
* 登录校验
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:42:35+0800
*/
protected function IsLogin()
{
if(session('admin') === null)
{
if(IS_AJAX)
{
exit(json_encode(DataReturn('登录失效,请重新登录', -400)));
} 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>');
}
}
}
/**
* 系统初始化
* @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
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T22:46:29+0800
* @param [string] $controller_name [控制器名称]
* @param [string] $action_name [方法]
*/
public function ViewInit($controller_name, $action_name)
{
// 当前操作名称
$module_name = strtolower(request()->module());
// 当前操作名称
$this->assign('module_name', $module_name);
$this->assign('controller_name', $controller_name);
$this->assign('action_name', $action_name);
// 控制器静态文件状态css,js
$module_css = $module_name.DS.'css'.DS.$controller_name;
$module_css .= file_exists(ROOT_PATH.'static'.DS.$module_css.'.'.$action_name.'.css') ? '.'.$action_name.'.css' : '.css';
$this->assign('module_css', file_exists(ROOT_PATH.'static'.DS.$module_css) ? $module_css : '');
$module_js = $module_name.DS.'js'.DS.$controller_name;
$module_js .= file_exists(ROOT_PATH.'static'.DS.$module_js.'.'.$action_name.'.js') ? '.'.$action_name.'.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

@ -0,0 +1,50 @@
{{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="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}}" />
</div>
</div>
<div class="items">
<label>背景色</label>
<div class="bg-color-tag" {{if !empty($data['bg_color'])}}style="background:{{$data.bg_color}}"{{/if}}></div>
</div>
<div class="items">
<label>链接地址</label>
<div>
{{if !empty($data['url'])}}
<a href="{{$data.url}}" target="_blank">{{$data.url}}</a>
{{else /}}
{{/if}}
</div>
</div>
<div class="items">
<label>是否新窗口打开</label>
<div>
{{if isset($data['is_new_window_open']) and $data['is_new_window_open'] eq 1}}
{{else /}}
{{/if}}
</div>
</div>
<a href="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'saveinfo'])}}" class="am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block">编辑</a>
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -0,0 +1,51 @@
{{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="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'save'])}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('plugins/index/index', ['control'=>'commontopmaxpicture', 'action'=>'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', ['control'=>'commontopmaxpicture', 'action'=>'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">建议1200像数X80像数</span></label>
<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}}" />
</li>
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-images-view">+上传图片</div>
</div>
<div class="am-form-group">
<label>背景色</label>
<input type="hidden" name="bg_color" value="{{if !empty($data['bg_color'])}}{{$data.bg_color}}{{/if}}" />
<button class="am-btn am-btn-default colorpicker-submit bg-color-tag am-btn-block bk-cr-white t-r" type="button" data-input-tag="button.bg-color-tag" data-color-tag="input[name='bg_color']" data-color-style="background-color" {{if !empty($data['bg_color'])}}style="background:{{$data.bg_color}}"{{/if}}>
<img src="{{$attachment_host}}/static/common/images/colorpicker.png" />
</button>
</div>
<div class="am-form-group">
<label>链接地址<span class="fs-12 fw-100 cr-999">带http://或https://</span></label>
<input type="url" placeholder="链接地址" name="url" data-validation-message="链接地址格式有误" class="am-radius" {{if !empty($data)}} value="{{$data.url}}"{{/if}} />
</div>
{{include file="lib/is_new_window_open" /}}
<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

@ -0,0 +1,12 @@
<!-- 是否启用 开始 -->
<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

@ -0,0 +1,39 @@
<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

@ -0,0 +1,43 @@
<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

@ -0,0 +1,12 @@
<!-- 性别 开始 -->
<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

@ -0,0 +1 @@

View File

@ -0,0 +1,12 @@
<!-- 是否包含尾部 开始 -->
<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

@ -0,0 +1,12 @@
<!-- 是否满屏 开始 -->
<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

@ -0,0 +1,12 @@
<!-- 是否包含头部 开始 -->
<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

@ -0,0 +1,12 @@
<!-- 是否新窗口打开 开始 -->
<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

@ -0,0 +1,12 @@
<!-- 是否显示 开始 -->
<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

@ -0,0 +1,25 @@
{{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

@ -0,0 +1,52 @@
<!-- 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

@ -0,0 +1,22 @@
<!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__ = '{{$attachment_host}}';
</script>
<body>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,45 @@
<!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,45 @@
<!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

@ -34,6 +34,7 @@ class PayLogService
$data = Db::name('PayLog')->field('payment AS id, payment_name AS name')->group('payment')->select();
return DataReturn('处理成功', 0, $data);
}
/**
* 后台管理员列表
* @author Devil

View File

@ -0,0 +1,243 @@
<?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\service;
use think\Db;
use app\service\ResourcesService;
/**
* 应用服务层
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class PluginsService
{
/**
* 列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function PluginsList($params = [])
{
$where = empty($params['where']) ? [] : $params['where'];
$m = isset($params['m']) ? intval($params['m']) : 0;
$n = isset($params['n']) ? intval($params['n']) : 10;
$order_by = empty($params['order_by']) ? 'id desc' : $params['order_by'];
// 获取数据列表
$data = Db::name('Plugins')->limit($m, $n)->order($order_by)->select();
return DataReturn('处理成功', 0, self::PluginsDataHandle($data));
}
/**
* 数据处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $data [数据]
*/
private static function PluginsDataHandle($data)
{
if(!empty($data))
{
foreach($data as &$v)
{
// 基础数据
$v['logo_old'] = $v['logo'];
$v['logo'] = ResourcesService::AttachmentPathViewHandle($v['logo']);
$v['apply_terminal'] = empty($v['apply_terminal']) ? '' : json_decode($v['apply_terminal'], true);
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
}
}
return $data;
}
/**
* 总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public static function PluginsTotal($where = [])
{
return (int) Db::name('Plugins')->where($where)->count();
}
/**
* 列表条件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public static function PluginsListWhere($params = [])
{
$where = [];
return $where;
}
/**
* 根据应用标记获取数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [string] $plugins [应用标记]
*/
public static function PluginsData($plugins)
{
// 获取数据
$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']);
}
return DataReturn('处理成功', 0, $data);
}
/**
* 应用数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [string] $plugins [应用标记]
*/
public static function PluginsDataSave($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'plugins',
'error_msg' => '应用标记不能为空',
],
[
'checked_type' => 'isset',
'key_name' => 'data',
'error_msg' => '数据参数不能为空',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// 数据更新
if(Db::name('Plugins')->where(['plugins'=>$params['plugins']])->update(['data'=>json_encode($params['data']), 'upd_time'=>time()]))
{
return DataReturn('操作成功');
}
return DataReturn('操作失败', -100);
}
/**
* 状态更新
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
*/
public static function PluginsStatusUpdate($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('Plugins')->where(['id'=>$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 Delete($params = [])
{
// 请求参数
$p = [
[
'checked_type' => 'empty',
'key_name' => 'id',
'error_msg' => '操作id有误',
],
];
$ret = ParamsChecked($params, $p);
if($ret !== true)
{
return DataReturn($ret, -1);
}
// tttttttttt
return DataReturn('删除失败或资源不存在', -100);
// 删除操作
if(Db::name('Plugins')->where(['id'=>$params['id']])->delete())
{
return DataReturn('删除成功');
}
return DataReturn('删除失败或资源不存在', -100);
}
}
?>

View File

@ -25,5 +25,8 @@ return [
'log_write' => [],
// 应用结束
'app_end' => [],
// 钩子测试
'plugins_common_top' => ['app\\plugins\\commontopmaxpicture\\CommonTopMaxPicture'],
];
?>

View File

@ -19,7 +19,7 @@ return [
// 应用地址
'app_host' => '',
// 应用调试模式
'app_debug' => false,
'app_debug' => true,
// 应用Trace
'app_trace' => false,
// 是否支持多模块

View File

@ -14,6 +14,9 @@
// +----------------------------------------------------------------------
return [
// 开发模式
'is_develop' => false,
// 默认编码
'default_charset' => 'utf-8',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,79 @@
.content ul {
padding: 0px;
width: calc(100% + 10px);
margin-left: -5px;
}
.content ul .icon {
width: 80px;
height: 80px;
border-radius: 10px;
box-shadow: 0px 10px 10px -6px rgba(0,0,0,.4);
}
.content ul.am-gallery-bordered .am-gallery-item {
box-shadow: none;
border: 1px solid #d4d4d4;
border-radius: 2px;
}
.content ul.am-gallery-bordered .am-gallery-item:hover {
border: 1px solid #999;
box-shadow: 0px 12px 12px -10px rgba(0,0,0,.4);
}
.content ul li {
position: relative;
}
.content ul li .base {
position: absolute;
top: 10px;
left: 100px;
width: calc(100% - 112px);
}
.content ul li .base h3 {
font-weight: 700;
color: #333;
margin: 2px 0px 3px 0px;
}
.content ul li .base p {
line-height: 18px;
margin: 0;
font-size: 12px;
font-weight: 300;
color: #999;
}
.content ul li .base h3, .content ul li .base p {
word-wrap: normal;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.content ul.am-gallery-bordered .am-gallery-desc {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 10px;
min-height: 32px;
line-height: 16px;
font-weight: 300;
color: #b3b3b3;
}
.content ul li .operation {
border-top: 1px dashed #eee;
padding: 10px 0 5px 0;
}
@media only screen and (max-width: 641px) {
.content ul .icon {
width: 65px;
height: 65px;
}
.content ul li .base {
left: 85px;
width: calc(100% - 97px);
}
.content ul li .base h3 {
margin: 0px;
}
.content ul li .base p {
line-height: 16px;
}
}

View File

@ -2,7 +2,7 @@
* /
*/
.tree-list li { list-style-type: none; padding-left: 5px !important; }
.tree-list li label { display: inline; margin-left: 10px; }
.tree-list li label { display: inline; }
.list-find { margin: 0px 0px 5px 35px; overflow: hidden; padding-top: 5px !important; }
.tree-list i { width: 10px; }
.list-find li { line-height: 26px; }

View File

@ -0,0 +1 @@

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

1
public/static/admin/index.html Executable file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -757,4 +757,22 @@ button { outline: none !important; }
position: fixed;
right: 50px;
bottom: 100px;
}
/**
*
*/
.plugins-tag {
text-align: center;
padding: 5px;
}
.plugins-tag span {
font-size: 16px;
font-weight: bold;
color: #e90000;
text-shadow: 1px 1px #bfbfbf;
background: #ffdfdf;
padding: 5px 8px;
border-radius: 3px;
border: 1px solid #ffd4d4;
}

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

1
public/static/index/index.html Executable file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,28 @@
/**
*
*/
.commontopmaxpicture-content .items {
margin: 10px 0 20px 0;
border-bottom: 1px dashed #f1f1f1;
padding-bottom: 20px;
}
.commontopmaxpicture-content .items .immages-tag {
border: 1px solid #eee;
text-align: center;
}
.commontopmaxpicture-content .items .immages-tag img {
max-width: 100%;
}
.commontopmaxpicture-content .items .bg-color-tag {
width: 100%;
height: 50px;
border: 1px solid #eee;
}
/**
*
*/
ul.plugins-images-view li {
width: 100%;
height: auto;
}

View File

@ -0,0 +1 @@

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB