应用开发
parent
e6cd42047a
commit
fdd1af9156
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\petscms;
|
||||
|
||||
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 Admin extends Controller
|
||||
{
|
||||
/**
|
||||
* 首页
|
||||
* @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('petscms');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/petscms/admin/index');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑页面
|
||||
* @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('petscms');
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
// 是否
|
||||
$is_whether_list = [
|
||||
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('../../../plugins/view/petscms/admin/saveinfo');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据保存
|
||||
* @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'=>'petscms', 'data'=>$params]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\petscms;
|
||||
|
||||
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 Hook extends Controller
|
||||
{
|
||||
/**
|
||||
* 应用响应入口
|
||||
* @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_backend']) && $params['is_backend'] === true && !empty($params['hook_name']))
|
||||
{
|
||||
return DataReturn('无需处理', 0);
|
||||
|
||||
// 默认返回视图
|
||||
} 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('petscms');
|
||||
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 '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('data', $ret['data']);
|
||||
return $this->fetch('../../../plugins/view/petscms/index/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\petscms;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\petscms\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 宠物管理系统 - 用户宠物管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Pets extends Controller
|
||||
{
|
||||
/**
|
||||
* 订单查询入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function index($params = [])
|
||||
{
|
||||
return $this->fetch('../../../plugins/view/petscms/pets/index');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\petscms;
|
||||
|
||||
use think\Controller;
|
||||
use app\plugins\petscms\Service;
|
||||
use app\service\PluginsService;
|
||||
|
||||
/**
|
||||
* 宠物管理系统 - 宠物管理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class PetsAdmin extends Controller
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Index($params = [])
|
||||
{
|
||||
return $this->fetch('../../../plugins/view/petscms/petsadmin/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/编辑页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function SaveInfo($params = [])
|
||||
{
|
||||
return $this->fetch('../../../plugins/view/petscms/petsadmin/saveinfo');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\plugins\petscms;
|
||||
|
||||
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 Service
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"base":{
|
||||
"plugins":"petscms",
|
||||
"name":"宠物管理系统",
|
||||
"logo":"\/static\/upload\/images\/plugins_petscms\/2019\/04\/09\/1554814711403578.jpg",
|
||||
"author":"Devil",
|
||||
"author_url":"https:\/\/shopxo.net\/",
|
||||
"version":"1.0.0",
|
||||
"desc":"宠物管理系统",
|
||||
"apply_terminal":[
|
||||
"pc",
|
||||
"h5"
|
||||
],
|
||||
"apply_version":[
|
||||
"1.5.0"
|
||||
],
|
||||
"is_home":false
|
||||
},
|
||||
"hook":{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{{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="petscms-content">
|
||||
<ul class="index-list am-avg-sm-1 am-avg-md-2 am-avg-lg-4">
|
||||
<li>
|
||||
<a href="{{:PluginsAdminUrl('petscms', 'petsadmin', 'index')}}">
|
||||
<div class="title">宠物管理</div>
|
||||
<div class="desc">宠物列表管理</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
|
|
@ -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('petscms', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('petscms', 'admin', 'index')}}" enctype="multipart/form-data">
|
||||
<legend>
|
||||
<span class="fs-16">宠物管理系统</span>
|
||||
<a href="{{:PluginsAdminUrl('petscms', '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="am-form-group-label-tips">空则不显示</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="am-form-group-label-tips">默认首页</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="am-form-group-label-tips">留空则不限制</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 am-form-group-refreshing">
|
||||
<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 -->
|
||||
|
|
@ -0,0 +1 @@
|
|||
user - pets
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
petsadmin - index
|
||||
|
||||
<a href="{{:PluginsAdminUrl('petscms', 'petsadmin', 'saveinfo')}}">新增</a>
|
||||
|
|
@ -0,0 +1 @@
|
|||
saveinfo
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* 首页
|
||||
*/
|
||||
.petscms-content .index-list li {
|
||||
padding: 10px;
|
||||
}
|
||||
.petscms-content .index-list li a {
|
||||
background: #eee;
|
||||
display: block;
|
||||
padding: 20px 10px 10px 10px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
min-height: 100px;
|
||||
}
|
||||
.petscms-content .index-list li a .title {
|
||||
font-size: 20px;
|
||||
}
|
||||
.petscms-content .index-list li a .desc {
|
||||
color: #999;
|
||||
}
|
||||
.petscms-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;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Loading…
Reference in New Issue