Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
______--______
ShopXO
提交
3919b724
ShopXO
项目概览
______--______
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3919b724
编写于
2月 09, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
顶部大图广告应用优化
上级
a22f25ae
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
163 addition
and
27 deletion
+163
-27
application/admin/controller/Plugins.php
application/admin/controller/Plugins.php
+20
-0
application/admin/view/default/plugins/index.html
application/admin/view/default/plugins/index.html
+3
-1
application/plugins/commontopmaxpicture/CommonTopMaxPicture.php
...ation/plugins/commontopmaxpicture/CommonTopMaxPicture.php
+53
-10
application/plugins/view/commontopmaxpicture/index.html
application/plugins/view/commontopmaxpicture/index.html
+25
-1
application/plugins/view/commontopmaxpicture/saveinfo.html
application/plugins/view/commontopmaxpicture/saveinfo.html
+30
-1
application/service/PluginsService.php
application/service/PluginsService.php
+1
-6
config/shopxo.sql
config/shopxo.sql
+8
-8
public/static/admin/default/css/plugins.css
public/static/admin/default/css/plugins.css
+12
-0
public/static/plugins/css/commontopmaxpicture.css
public/static/plugins/css/commontopmaxpicture.css
+11
-0
未找到文件。
application/admin/controller/Plugins.php
浏览文件 @
3919b724
...
@@ -83,5 +83,25 @@ class Plugins extends Common
...
@@ -83,5 +83,25 @@ class Plugins extends Common
return
$this
->
fetch
();
return
$this
->
fetch
();
}
}
/**
* [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
);
}
}
}
?>
?>
\ No newline at end of file
application/admin/view/default/plugins/index.html
浏览文件 @
3919b724
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<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=
"{}"
>
<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}}
{{foreach $data_list as $v}}
<li>
<li>
<div
class=
"am-gallery-item
"
>
<div
id=
"data-list-{{$v.id}}"
class=
"am-gallery-item {{if $v['is_enable'] neq 1}}am-active{{/if}}
"
>
<img
src=
"{{$v.logo}}"
class=
"icon"
/>
<img
src=
"{{$v.logo}}"
class=
"icon"
/>
<div
class=
"base"
>
<div
class=
"base"
>
<h3
class=
"name"
>
{{$v.name}}
</h3>
<h3
class=
"name"
>
{{$v.name}}
</h3>
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
<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>
<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>
<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>
<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"
></a>
</div>
</div>
</div>
</div>
</li>
</li>
...
...
application/plugins/commontopmaxpicture/CommonTopMaxPicture.php
浏览文件 @
3919b724
...
@@ -14,7 +14,7 @@ use think\Controller;
...
@@ -14,7 +14,7 @@ use think\Controller;
use
app\service\PluginsService
;
use
app\service\PluginsService
;
/**
/**
* 顶部广告插件
* 顶部
大图
广告插件
* @author Devil
* @author Devil
* @blog http://gong.gg/
* @blog http://gong.gg/
* @version 0.0.1
* @version 0.0.1
...
@@ -22,9 +22,17 @@ use app\service\PluginsService;
...
@@ -22,9 +22,17 @@ use app\service\PluginsService;
*/
*/
class
CommonTopMaxPicture
extends
Controller
class
CommonTopMaxPicture
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
=
[])
public
function
run
(
$params
=
[])
{
{
// 是否控制器
// 是否控制器
钩子
if
(
isset
(
$params
[
'is_control'
])
&&
$params
[
'is_control'
]
===
true
)
if
(
isset
(
$params
[
'is_control'
])
&&
$params
[
'is_control'
]
===
true
)
{
{
return
[];
return
[];
...
@@ -44,12 +52,47 @@ class CommonTopMaxPicture extends Controller
...
@@ -44,12 +52,47 @@ class CommonTopMaxPicture extends Controller
*/
*/
public
function
html
()
public
function
html
()
{
{
// 当前模块/控制器/方法
$module_name
=
strtolower
(
request
()
->
module
());
$controller_name
=
strtolower
(
request
()
->
controller
());
$action_name
=
strtolower
(
request
()
->
action
());
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'commontopmaxpicture'
);
$ret
=
PluginsService
::
PluginsData
(
'commontopmaxpicture'
);
// html拼接
$html
=
'<div style="text-align: center;'
;
$html
=
'<div style="text-align: center;'
;
$content
=
''
;
$content
=
''
;
if
(
$ret
[
'code'
]
==
0
)
if
(
$ret
[
'code'
]
==
0
)
{
{
// 有效时间
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
''
;
}
}
// 背景色
// 背景色
if
(
!
empty
(
$ret
[
'data'
][
'bg_color'
]))
if
(
!
empty
(
$ret
[
'data'
][
'bg_color'
]))
{
{
...
@@ -86,11 +129,6 @@ class CommonTopMaxPicture extends Controller
...
@@ -86,11 +129,6 @@ class CommonTopMaxPicture extends Controller
'sales_amount'
=>
0
,
'sales_amount'
=>
0
,
];
];
// 后台配置
$admin
=
[
];
// 控制器钩子
// 控制器钩子
$control_hook
=
[
$control_hook
=
[
'plugins_control_hook'
=>
[
'plugins_control_hook'
=>
[
...
@@ -100,7 +138,6 @@ class CommonTopMaxPicture extends Controller
...
@@ -100,7 +138,6 @@ class CommonTopMaxPicture extends Controller
return
[
return
[
'base'
=>
$base
,
'base'
=>
$base
,
'admin'
=>
$admin
,
'control_hook'
=>
$control_hook
,
'control_hook'
=>
$control_hook
,
];
];
}
}
...
@@ -139,6 +176,13 @@ class CommonTopMaxPicture extends Controller
...
@@ -139,6 +176,13 @@ class CommonTopMaxPicture extends Controller
$ret
=
PluginsService
::
PluginsData
(
'commontopmaxpicture'
);
$ret
=
PluginsService
::
PluginsData
(
'commontopmaxpicture'
);
if
(
$ret
[
'code'
]
==
0
)
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'
]);
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'commontopmaxpicture/saveinfo'
);
return
$this
->
fetch
(
'commontopmaxpicture/saveinfo'
);
}
else
{
}
else
{
...
@@ -148,7 +192,7 @@ class CommonTopMaxPicture extends Controller
...
@@ -148,7 +192,7 @@ class CommonTopMaxPicture extends Controller
}
}
/**
/**
* 保存
*
数据
保存
* @author Devil
* @author Devil
* @blog http://gong.gg/
* @blog http://gong.gg/
* @version 1.0.0
* @version 1.0.0
...
@@ -160,6 +204,5 @@ class CommonTopMaxPicture extends Controller
...
@@ -160,6 +204,5 @@ class CommonTopMaxPicture extends Controller
unset
(
$params
[
'max_file_size'
]);
unset
(
$params
[
'max_file_size'
]);
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'commontopmaxpicture'
,
'data'
=>
$params
]);
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'commontopmaxpicture'
,
'data'
=>
$params
]);
}
}
}
}
?>
?>
\ No newline at end of file
application/plugins/view/commontopmaxpicture/index.html
浏览文件 @
3919b724
...
@@ -39,7 +39,31 @@
...
@@ -39,7 +39,31 @@
{{/if}}
{{/if}}
</div>
</div>
</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
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=
"{{: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 edit-submit"
>
编辑
</a>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
application/plugins/view/commontopmaxpicture/saveinfo.html
浏览文件 @
3919b724
...
@@ -35,7 +35,36 @@
...
@@ -35,7 +35,36 @@
<input
type=
"url"
placeholder=
"链接地址"
name=
"url"
data-validation-message=
"链接地址格式有误"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.url}}"
{{/
if
}}
/>
<input
type=
"url"
placeholder=
"链接地址"
name=
"url"
data-validation-message=
"链接地址格式有误"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.url}}"
{{/
if
}}
/>
</div>
</div>
{{include file="lib/is_new_window_open" /}}
<div
class=
"am-form-group"
>
<label>
是否新窗口打开
</label>
<div>
{{foreach $is_whether_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>
<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"
>
<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>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
...
...
application/service/PluginsService.php
浏览文件 @
3919b724
...
@@ -178,11 +178,6 @@ class PluginsService
...
@@ -178,11 +178,6 @@ class PluginsService
'key_name'
=>
'id'
,
'key_name'
=>
'id'
,
'error_msg'
=>
'操作id有误'
,
'error_msg'
=>
'操作id有误'
,
],
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'field'
,
'error_msg'
=>
'未指定操作字段'
,
],
[
[
'checked_type'
=>
'in'
,
'checked_type'
=>
'in'
,
'key_name'
=>
'state'
,
'key_name'
=>
'state'
,
...
@@ -197,7 +192,7 @@ class PluginsService
...
@@ -197,7 +192,7 @@ class PluginsService
}
}
// 数据更新
// 数据更新
if
(
Db
::
name
(
'Plugins'
)
->
where
([
'id'
=>
$params
[
'id'
]])
->
update
([
$params
[
'field'
]
=>
intval
(
$params
[
'state'
]),
'upd_time'
=>
time
()]))
if
(
Db
::
name
(
'Plugins'
)
->
where
([
'id'
=>
$params
[
'id'
]])
->
update
([
'is_enable'
=>
intval
(
$params
[
'state'
]),
'upd_time'
=>
time
()]))
{
{
return
DataReturn
(
'操作成功'
);
return
DataReturn
(
'操作成功'
);
}
}
...
...
config/shopxo.sql
浏览文件 @
3919b724
此差异已折叠。
点击以展开。
public/static/admin/default/css/plugins.css
浏览文件 @
3919b724
...
@@ -14,6 +14,10 @@
...
@@ -14,6 +14,10 @@
border
:
1px
solid
#d4d4d4
;
border
:
1px
solid
#d4d4d4
;
border-radius
:
2px
;
border-radius
:
2px
;
}
}
.content
ul
.am-gallery-bordered
.am-gallery-item.am-active
{
border
:
1px
solid
#ffeaea
;
background
:
#fffbfb
;
}
.content
ul
.am-gallery-bordered
.am-gallery-item
:hover
{
.content
ul
.am-gallery-bordered
.am-gallery-item
:hover
{
border
:
1px
solid
#999
;
border
:
1px
solid
#999
;
box-shadow
:
0px
12px
12px
-10px
rgba
(
0
,
0
,
0
,
.4
);
box-shadow
:
0px
12px
12px
-10px
rgba
(
0
,
0
,
0
,
.4
);
...
@@ -61,6 +65,14 @@
...
@@ -61,6 +65,14 @@
border-top
:
1px
dashed
#eee
;
border-top
:
1px
dashed
#eee
;
padding
:
10px
0
5px
0
;
padding
:
10px
0
5px
0
;
}
}
.content
ul
li
.submit-state
{
width
:
28px
;
height
:
28px
;
border-radius
:
2px
;
}
.content
ul
li
.submit-state.am-default
{
background-color
:
#e6e6e6
;
}
@media
only
screen
and
(
max-width
:
641px
)
{
@media
only
screen
and
(
max-width
:
641px
)
{
.content
ul
.icon
{
.content
ul
.icon
{
width
:
65px
;
width
:
65px
;
...
...
public/static/plugins/css/commontopmaxpicture.css
浏览文件 @
3919b724
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
height
:
50px
;
height
:
50px
;
border
:
1px
solid
#eee
;
border
:
1px
solid
#eee
;
}
}
.commontopmaxpicture-content
.edit-submit
{
margin-bottom
:
20px
;
}
/**
/**
* 编辑页面
* 编辑页面
...
@@ -25,4 +28,12 @@
...
@@ -25,4 +28,12 @@
ul
.plugins-images-view
li
{
ul
.plugins-images-view
li
{
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
}
.form-date
input
{
width
:
30%
!important
;
display
:
-webkit-inline-box
!important
;
}
.form-date
span
{
vertical-align
:
middle
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录