提交 8827d7d2 编写于 作者: D devil_gong

应用

上级 bc655123
...@@ -32,11 +32,28 @@ class Admin extends Controller ...@@ -32,11 +32,28 @@ class Admin extends Controller
*/ */
public function index($params = []) public function index($params = [])
{ {
$ret = PluginsService::PluginsData('petscms'); return $this->fetch('../../../plugins/view/petscms/admin/index');
}
/**
* 配置管理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public function base($params = [])
{
$ret = PluginsService::PluginsData('petscms', ['logo', 'pets_default_images']);
if($ret['code'] == 0) if($ret['code'] == 0)
{ {
if(!empty($ret['data']['not_bind_desc']))
{
$ret['data']['not_bind_desc'] = str_replace("\n", '<br />', $ret['data']['not_bind_desc']);
}
$this->assign('data', $ret['data']); $this->assign('data', $ret['data']);
return $this->fetch('../../../plugins/view/petscms/admin/index'); return $this->fetch('../../../plugins/view/petscms/admin/base');
} else { } else {
return $ret['msg']; return $ret['msg'];
} }
...@@ -52,7 +69,7 @@ class Admin extends Controller ...@@ -52,7 +69,7 @@ class Admin extends Controller
*/ */
public function saveinfo($params = []) public function saveinfo($params = [])
{ {
$ret = PluginsService::PluginsData('petscms'); $ret = PluginsService::PluginsData('petscms', ['logo', 'pets_default_images'], false);
if($ret['code'] == 0) if($ret['code'] == 0)
{ {
// 是否 // 是否
......
...@@ -154,8 +154,16 @@ class Pets extends Controller ...@@ -154,8 +154,16 @@ class Pets extends Controller
); );
$ret = Service::PetsList($data_params); $ret = Service::PetsList($data_params);
$data = empty($ret['data'][0]) ? [] : $ret['data'][0]; $data = empty($ret['data'][0]) ? [] : $ret['data'][0];
$this->assign('data', $data); $this->assign('data', $data);
// 基础信息
$ret = PluginsService::PluginsData('petscms', ['logo', 'pets_default_images']);
if(!empty($ret['data']['not_bind_desc']))
{
$ret['data']['not_bind_desc'] = str_replace("\n", '<br />', $ret['data']['not_bind_desc']);
}
$this->assign('plugins_base_data', $ret['data']);
$this->assign('params', $params); $this->assign('params', $params);
return $this->fetch('../../../plugins/view/petscms/pets/detail'); return $this->fetch('../../../plugins/view/petscms/pets/detail');
} }
......
...@@ -35,7 +35,7 @@ class PetsAdmin extends Controller ...@@ -35,7 +35,7 @@ class PetsAdmin extends Controller
public function index($params = []) public function index($params = [])
{ {
// 分页 // 分页
$number = 10; $number = MyC('admin_page_number', 10, true);
// 条件 // 条件
$where = Service::PetsListWhere($params); $where = Service::PetsListWhere($params);
...@@ -210,7 +210,7 @@ class PetsAdmin extends Controller ...@@ -210,7 +210,7 @@ class PetsAdmin extends Controller
} }
// 分页 // 分页
$number = 10; $number = MyC('admin_page_number', 10, true);
// 条件 // 条件
$where = [ $where = [
......
# 宠物管理系统宠物 - 应用
DROP TABLE `s_plugins_petscms_pets`;
# 宠物管理系统宠物丢失帮助数据 - 应用
DROP TABLE `s_plugins_petscms_help`;
\ No newline at end of file
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<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="petscms-content">
<div class="items">
<label>宠物未绑定提示信息</label>
<div>
{{if !empty($data['not_bind_desc'])}}
{{$data.not_bind_desc|raw}}
{{else /}}
{{/if}}
</div>
</div>
<div class="items">
<label>宠物领取名称</label>
<div>
{{if !empty($data['pets_take'])}}
{{$data.pets_take}}
{{else /}}
我要领取
{{/if}}
</div>
</div>
<div class="items">
<label>提供信息名称</label>
<div>
{{if !empty($data['lose_provide'])}}
{{$data.lose_provide}}
{{else /}}
我要提供信息
{{/if}}
</div>
</div>
<div class="items">
<label>二维码logo</label>
<div class="immages-tag">
<img src="{{if !empty($data['logo'])}}{{$data.logo}}{{else /}}{{$attachment_host}}/static/plugins/images/petscms/default-images.png{{/if}}" />
</div>
</div>
<div class="items">
<label>宠物默认图片</label>
<div class="immages-tag">
<img src="{{if !empty($data['pets_default_images'])}}{{$data.pets_default_images}}{{else /}}{{$attachment_host}}/static/plugins/images/petscms/pets-default-images.jpg{{/if}}" />
</div>
</div>
<a href="{{:PluginsAdminUrl('petscms', '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 -->
\ No newline at end of file
...@@ -10,10 +10,16 @@ ...@@ -10,10 +10,16 @@
<div class="petscms-content"> <div class="petscms-content">
<ul class="index-list am-avg-sm-1 am-avg-md-2 am-avg-lg-4"> <ul class="index-list am-avg-sm-1 am-avg-md-2 am-avg-lg-4">
<li>
<a href="{{:PluginsAdminUrl('petscms', 'admin', 'base')}}">
<div class="title">配置管理</div>
<div class="desc">基础信息配置</div>
</a>
</li>
<li> <li>
<a href="{{:PluginsAdminUrl('petscms', 'petsadmin', 'index')}}"> <a href="{{:PluginsAdminUrl('petscms', 'petsadmin', 'index')}}">
<div class="title">宠物管理</div> <div class="title">宠物管理</div>
<div class="desc">宠物列表管理</div> <div class="desc">宠物创建、编辑、删除、解绑、二维码下载等等...</div>
</a> </a>
</li> </li>
</ul> </ul>
......
...@@ -4,35 +4,53 @@ ...@@ -4,35 +4,53 @@
<div class="content-right"> <div class="content-right">
<div class="content"> <div class="content">
<!-- form start --> <!-- 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"> <form class="am-form form-validation view-save" action="{{:PluginsAdminUrl('petscms', 'admin', 'save')}}" method="POST" request-type="ajax-url" request-value="{{:PluginsAdminUrl('petscms', 'admin', 'base')}}" enctype="multipart/form-data">
<legend> <legend>
<span class="fs-16">宠物管理系统</span> <span class="fs-16">宠物管理系统</span>
<a href="{{:PluginsAdminUrl('petscms', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a> <a href="{{:PluginsAdminUrl('petscms', 'admin', 'base')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
</legend> </legend>
<div class="am-form-group am-form-file"> <div class="am-form-group am-form-file">
<label class="block">公告内容<span class="am-form-group-label-tips">空则不显示</span></label> <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> <textarea rows="3" name="not_bind_desc" class="am-radius am-field-valid" placeholder="宠物未绑定提示信息" data-validation-message="请填写宠物未绑定提示信息">{{if !empty($data['not_bind_desc'])}}{{$data.not_bind_desc}}{{/if}}</textarea>
</div> </div>
<div class="am-form-group"> <div class="am-form-group">
<label>是否全局<span class="am-form-group-label-tips">默认首页</span></label> <label>宠物领取名称<span class="am-form-group-label-tips">默认 我要领取</span></label>
<div> <input type="text" name="pets_take" placeholder="宠物领取名称" maxlength="30" data-validation-message="宠物领取名称格式最多 30 个字符" class="am-radius" value="{{if !empty($data['pets_take'])}}{{$data.pets_take}}{{else /}}我要领取{{/if}}" />
{{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>
<div class="am-form-group"> <div class="am-form-group">
<label>有效时间<span class="am-form-group-label-tips">留空则不限制</span></label> <label>提供信息名称<span class="am-form-group-label-tips">默认 我要提供信息</span></label>
<div class="form-date"> <input type="text" name="lose_provide" placeholder="提供信息名称" maxlength="30" data-validation-message="提供信息名称格式最多 30 个字符" class="am-radius" value="{{if !empty($data['lose_provide'])}}{{$data.lose_provide}}{{else /}}我要提供信息{{/if}}" />
<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}}/> </div>
<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 class="am-form-group am-form-file">
</div> <label class="block">二维码logo<span class="am-form-group-label-tips">建议50像数X50像数</span></label>
<ul class="plug-file-upload-view plugins-logo-view" data-form-name="logo" data-max-number="1" data-dialog-type="images">
{{if !empty($data['logo'])}}
<li>
<input type="text" name="logo" value="{{$data.logo_old}}" data-validation-message="请上传二维码logo" />
<img src="{{$data.logo}}" />
<i>×</i>
</li>
{{/if}}
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-logo-view">+上传图片</div>
</div>
<div class="am-form-group am-form-file">
<label class="block">宠物默认图片<span class="am-form-group-label-tips">建议350像数X350像数</span></label>
<ul class="plug-file-upload-view plugins-pets_default_images-view" data-form-name="pets_default_images" data-max-number="1" data-dialog-type="images">
{{if !empty($data['pets_default_images'])}}
<li>
<input type="text" name="pets_default_images" value="{{$data.pets_default_images_old}}" data-validation-message="请上传宠物默认图片" />
<img src="{{$data.pets_default_images}}" />
<i>×</i>
</li>
{{/if}}
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.plugins-pets_default_images-view">+上传图片</div>
</div> </div>
<div class="am-form-group am-form-group-refreshing"> <div class="am-form-group am-form-group-refreshing">
......
...@@ -17,17 +17,27 @@ ...@@ -17,17 +17,27 @@
{{if isset($data['user_id']) and $data['user_id'] gt 0}} {{if isset($data['user_id']) and $data['user_id'] gt 0}}
<div class="top"> <div class="top">
<div class="am-u-md-4 photo"> <div class="am-u-md-4 photo">
{{if !empty($data['photo'])}} <div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false, "slideshow":false}'>
<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false, "slideshow":false}'> <ul class="am-slides">
<ul class="am-slides"> {{if !empty($data['photo'])}}
{{foreach $data.photo as $photo}} {{foreach $data.photo as $photo}}
<li> <li>
<img src="{{$photo.images}}" alt="{{$data.title}}" /> <img src="{{$photo.images}}" alt="{{$data.title}}" />
</li> </li>
{{/foreach}} {{/foreach}}
</ul> {{else /}}
</div> {{if !empty($plugins_base_data['pets_default_images'])}}
{{/if}} <li>
<img src="{{$plugins_base_data.pets_default_images}}" alt="{{$data.title}}" />
</li>
{{else /}}
<li>
<img src="{{$attachment_host}}/static/plugins/images/petscms/pets-default-images.jpg" alt="{{$data.title}}" />
</li>
{{/if}}
{{/if}}
</ul>
</div>
</div> </div>
<div class="am-u-md-8 base"> <div class="am-u-md-8 base">
<h1>{{$data.title}}</h1> <h1>{{$data.title}}</h1>
...@@ -75,7 +85,7 @@ ...@@ -75,7 +85,7 @@
</ul> </ul>
{{if isset($data['status']) and $data['status'] eq 1}} {{if isset($data['status']) and $data['status'] eq 1}}
<button type="button" class="am-btn am-btn-primary am-radius am-icon-pencil provide-submit" data-am-modal="{target: '#lose-provide-popup'}"> 我要提供信息</button> <button type="button" class="am-btn am-btn-primary am-radius am-icon-pencil provide-submit" data-am-modal="{target: '#lose-provide-popup'}"> {{if empty($plugins_base_data['lose_provide'])}}我要提供信息{{else /}}{{$plugins_base_data.lose_provide}}{{/if}}</button>
<!-- 提供信息窗口 --> <!-- 提供信息窗口 -->
<div class="am-popup" id="lose-provide-popup"> <div class="am-popup" id="lose-provide-popup">
...@@ -205,11 +215,13 @@ ...@@ -205,11 +215,13 @@
{{/if}} {{/if}}
{{else /}} {{else /}}
<div class="pets-not-bind"> <div class="pets-not-bind">
<i class="am-icon-github-alt am-animation-slide-top"></i> <p><i class="am-icon-github-alt am-animation-slide-top"></i></p>
<div class="am-alert am-alert-secondary am-animation-shake" data-am-alert> {{if !empty($plugins_base_data['not_bind_desc'])}}
该宠物还没有主人领取,立即领取可爱的宠物宝宝哦! <div class="am-alert am-alert-secondary am-animation-shake" data-am-alert>
</div> {{$plugins_base_data.not_bind_desc|raw}}
<a href="{{:PluginsHomeUrl('petscms', 'pets', 'saveinfo', ['pest_no'=>$data['pest_no']])}}" class="am-btn am-btn-primary am-radius am-icon-get-pocket am-animation-slide-bottom"> 我要领取</a> </div>
{{/if}}
<a href="{{:PluginsHomeUrl('petscms', 'pets', 'saveinfo', ['pest_no'=>$data['pest_no']])}}" class="am-btn am-btn-primary am-radius am-icon-get-pocket am-animation-slide-bottom"> {{if empty($plugins_base_data['pets_take'])}}我要领取{{else /}}{{$plugins_base_data.pets_take}}{{/if}}</a>
</div> </div>
{{/if}} {{/if}}
</div> </div>
......
...@@ -31,12 +31,16 @@ class PluginsService ...@@ -31,12 +31,16 @@ class PluginsService
* @desc description * @desc description
* @param [string] $plugins [应用标记] * @param [string] $plugins [应用标记]
* @param [array] $attachment_field [附件字段] * @param [array] $attachment_field [附件字段]
* @param [boolean] $is_cache [是否缓存读取, 默认true]
*/ */
public static function PluginsData($plugins, $attachment_field = []) public static function PluginsData($plugins, $attachment_field = [], $is_cache = true)
{ {
// 从缓存获取数据 // 从缓存获取数据
$key = config('shopxo.cache_plugins_data_key').$plugins; $key = config('shopxo.cache_plugins_data_key').$plugins;
$data = cache($key); if($is_cache === true)
{
$data = cache($key);
}
if(empty($data)) if(empty($data))
{ {
// 获取数据 // 获取数据
......
...@@ -32,8 +32,8 @@ legend {padding-bottom:0.2rem !important; margin-bottom: 1rem; } ...@@ -32,8 +32,8 @@ legend {padding-bottom:0.2rem !important; margin-bottom: 1rem; }
.cr-green { color: #4aaa4a !important; } .cr-green { color: #4aaa4a !important; }
.cr-blue { color: #4abbf5 !important; } .cr-blue { color: #4abbf5 !important; }
.cr-yellow { color: #e4bfbc !important; } .cr-yellow { color: #e4bfbc !important; }
.am-form select,.am-form textarea,.am-form input[type="text"],.am-form input[type="password"],.am-form input[type="datetime"],.am-form input[type="datetime-local"],.am-form input[type="date"],.am-form input[type="month"],.am-form input[type="time"],.am-form input[type="week"],.am-form input[type="number"],.am-form input[type="email"],.am-form input[type="url"],.am-form input[type="search"],.am-form input[type="tel"],.am-form input[type="color"],.am-form-field {font-size:1.4rem !important;} .am-form select,.am-form textarea,.am-form input[type="text"],.am-form input[type="password"],.am-form input[type="datetime"],.am-form input[type="datetime-local"],.am-form input[type="date"],.am-form input[type="month"],.am-form input[type="time"],.am-form input[type="week"],.am-form input[type="number"],.am-form input[type="email"],.am-form input[type="url"],.am-form input[type="search"],.am-form input[type="tel"],.am-form input[type="color"],.am-form-field {font-size:12px !important;}
select {height:32px !important;} select {height:28px !important;}
.bk-cr-gray {background:#f3f3f3 !important;} .bk-cr-gray {background:#f3f3f3 !important;}
.bk-cr-ffd {background:#ffd !important;} .bk-cr-ffd {background:#ffd !important;}
.bk-cr-white {background-color: #fff;} .bk-cr-white {background-color: #fff;}
...@@ -43,12 +43,13 @@ select {height:32px !important;} ...@@ -43,12 +43,13 @@ select {height:32px !important;}
.o-h { overflow: hidden; } .o-h { overflow: hidden; }
.submit-state { font-size: 16px; width: 25px; height: 25px; line-height: 25px; } .submit-state { font-size: 16px; width: 25px; height: 25px; line-height: 25px; }
input:hover, select:hover, textarea:hover, .chosen-choices:hover, .chosen-single:hover { border-style:solid; border-width:1px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; border:1px solid #4FACF5 !important; box-shadow:0 0 5px #4FACF5 !important; } input:hover, select:hover, textarea:hover, .chosen-choices:hover, .chosen-single:hover { border-style:solid; border-width:1px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; border:1px solid #4FACF5 !important; box-shadow:0 0 5px #4FACF5 !important; }
.am-input-group-sm > .am-input-group-btn > .am-btn { height: 32px; } .am-input-group-sm > .am-input-group-btn > .am-btn { height: 28px; font-size: 12px !important; }
.left-menu-more-ico-rotate {-webkit-transform: rotate(-90deg);transform: rotate(-90deg);-webkit-transition: all 300ms;transition: all 300ms;} .left-menu-more-ico-rotate {-webkit-transform: rotate(-90deg);transform: rotate(-90deg);-webkit-transition: all 300ms;transition: all 300ms;}
.am-icon-angle-down {-webkit-transition: all 300ms;transition: all 300ms;} .am-icon-angle-down {-webkit-transition: all 300ms;transition: all 300ms;}
.am-radio-inline input[type="radio"] { margin-left: 0px !important; } .am-radio-inline input[type="radio"] { margin-left: 0px !important; }
.am-alert-tips { background-color: #ffffe9; border-color: #faebd2; color: #888; } .am-alert-tips { background-color: #ffffe9; border-color: #faebd2; color: #888; }
.am-alert-tips, .am-alert-tips * { font-size: 12px; } .am-alert-tips, .am-alert-tips * { font-size: 12px; }
.am-btn-sm { font-size: 12px; }
body {margin:0;color:#797979;} body {margin:0;color:#797979;}
html,body {position:relative;background:#fff;height:100%;width:100%;} html,body {position:relative;background:#fff;height:100%;width:100%;}
......
...@@ -12,12 +12,33 @@ ...@@ -12,12 +12,33 @@
text-align: center; text-align: center;
min-height: 100px; min-height: 100px;
} }
.petscms-content .index-list li a:hover {
background: #e3e3e3;
}
.petscms-content .index-list li a .title { .petscms-content .index-list li a .title {
font-size: 20px; font-size: 20px;
} }
.petscms-content .index-list li a .desc { .petscms-content .index-list li a .desc {
color: #999; color: #999;
} }
/**
* 配置管理
*/
.petscms-content .items {
margin: 10px 0 20px 0;
border-bottom: 1px dashed #f1f1f1;
padding-bottom: 20px;
}
.petscms-content .items .immages-tag {
border: 1px solid #eee;
text-align: center;
max-width: 100px;
padding: 5px;
}
.petscms-content .items .immages-tag img {
max-width: 100%;
}
.petscms-content .edit-submit { .petscms-content .edit-submit {
margin-bottom: 20px; margin-bottom: 20px;
} }
......
...@@ -102,9 +102,10 @@ ...@@ -102,9 +102,10 @@
padding: 10px 0; padding: 10px 0;
float: left; float: left;
width: 50%; width: 50%;
border-top: 1px solid #f0faff;
} }
.base ul.basic li:not(:last-child) { .base ul.basic li:first-child, .base ul.basic li:nth-child(2) {
border-bottom: 1px solid #f0faff; border-top: 0;
} }
.base ul.basic li span:first-child { .base ul.basic li span:first-child {
font-weight: 500; font-weight: 500;
...@@ -142,12 +143,10 @@ ...@@ -142,12 +143,10 @@
} }
.lose ul.person li { .lose ul.person li {
padding: 8px 0; padding: 8px 0;
border-top: 1px solid #ffe4d0;
} }
.lose ul.person li:not(:last-child) { .lose ul.person li:first-child {
border-bottom: 1px solid #ffe4d0; border-top: 0;
}
.lose ul.person li:last-child {
padding-bottom: 0;
} }
.lose ul.person li.tel a { .lose ul.person li.tel a {
color: #70cfff; color: #70cfff;
...@@ -188,9 +187,8 @@ form.form-validation #map { ...@@ -188,9 +187,8 @@ form.form-validation #map {
float: left; float: left;
width: 50%; width: 50%;
} }
.lose ul.person li:nth-last-child(2) { .lose ul.person li:nth-child(2) {
border-bottom: 0; border-top: 0;
padding-bottom: 0;
} }
} }
@media only screen and (min-width:1025px) { @media only screen and (min-width:1025px) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册