Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
______--______
ShopXO
提交
5bc00c4c
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,发现更多精彩内容 >>
提交
5bc00c4c
编写于
2月 28, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
后台导航优化
上级
6f5e567b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
214 addition
and
66 deletion
+214
-66
application/admin/controller/Admin.php
application/admin/controller/Admin.php
+19
-10
application/admin/view/default/public/menu.html
application/admin/view/default/public/menu.html
+11
-1
public/static/admin/default/css/common.css
public/static/admin/default/css/common.css
+26
-4
public/static/admin/default/js/index.js
public/static/admin/default/js/index.js
+158
-51
未找到文件。
application/admin/controller/Admin.php
浏览文件 @
5bc00c4c
...
...
@@ -153,17 +153,26 @@ class Admin extends Common
*/
public
function
Save
()
{
// 登录校验
$this
->
IsLogin
();
// 是否ajax
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 开始操作
// 登录校验
$this
->
IsLogin
();
// 参数
$params
=
input
(
'post.'
);
// 不是操作自己的情况下
if
(
!
isset
(
$params
[
'id'
])
||
$params
[
'id'
]
!=
$this
->
admin
[
'id'
])
{
// 权限校验
$this
->
IsPower
();
}
// 开始操作
$params
[
'admin'
]
=
$this
->
admin
;
return
AdminService
::
AdminSave
(
$params
);
}
...
...
@@ -177,18 +186,18 @@ class Admin extends Common
*/
public
function
Delete
()
{
// 登录校验
$this
->
IsLogin
();
// 权限校验
$this
->
IsPower
();
// 是否ajax
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
// 登录校验
$this
->
IsLogin
();
// 权限校验
$this
->
IsPower
();
// 开始操作
$params
=
input
(
'post.'
);
$params
[
'admin'
]
=
$this
->
admin
;
...
...
application/admin/view/default/public/menu.html
浏览文件 @
5bc00c4c
<div
class=
"admin-sidebar am-offcanvas
am-padding-0
"
id=
"admin-offcanvas"
>
<div
class=
"admin-sidebar am-offcanvas"
id=
"admin-offcanvas"
>
<div
class=
"am-offcanvas-bar admin-offcanvas-bar"
>
<ul
class=
"am-list admin-sidebar-list common-left-menu"
>
<li>
...
...
@@ -37,4 +37,14 @@
{{/foreach}}
</ul>
</div>
</div>
<button
class=
"am-btn am-btn-primary am-radius am-btn-xs menu-scaling-submit am-hide-sm-only am-icon-angle-double-left"
data-status=
"0"
></button>
<div
class=
"menu-mini-container-tips am-animation-slide-right"
>
<div
class=
"mui-mbar-tab-tip"
>
◆
</div>
<span></span>
</div>
<div
class=
"menu-mini-container-popup am-animation-slide-right"
>
<div
class=
"mui-mbar-tab-tip"
>
◆
</div>
<ul></ul>
</div>
\ No newline at end of file
public/static/admin/default/css/common.css
浏览文件 @
5bc00c4c
...
...
@@ -376,16 +376,19 @@ ul {margin-top:0;}
.admin-sidebar-sub
{
margin-top
:
0
;
margin-bottom
:
0
;
box-shadow
:
0
16px
8px
-15px
#e2e2e2
inset
;
background
:
#404040
;
padding-left
:
24px
;}
.admin-sidebar-sub
li
:first-child
{
border-top
:
1px
solid
#dedede
;}
.admin-sidebar
{
height
:
100%
;
overflow-x
:
hidden
;
overflow-y
:
scroll
;
-webkit-overflow-scrolling
:
touch
;}
.admin-sidebar
.am-icon-angle-down
{
margin-top
:
3px
;}
@media
only
screen
and
(
min-width
:
641px
)
{
.admin-sidebar
{
display
:
block
;
position
:
static
;
background
:
none
;
width
:
245px
;
z-index
:
1
;}
.admin-sidebar
{
display
:
block
;
width
:
185px
;
z-index
:
1
;
position
:
static
;}
.admin-offcanvas-bar
{
position
:
static
;
width
:
auto
;
background
:
none
;
-webkit-transform
:
translate3d
(
0
,
0
,
0
);
-ms-transform
:
translate3d
(
0
,
0
,
0
);
transform
:
translate3d
(
0
,
0
,
0
);
overflow-y
:
visible
;
min-height
:
100%
;}
.admin-offcanvas-bar
:after
{
content
:
none
;}
#ifcontent
{
width
:
calc
(
100%
-
185px
);
}
}
@media
only
screen
and
(
max-width
:
640px
)
{
.admin-sidebar
{
width
:
inherit
;}
.admin-offcanvas-bar
{
background
:
#f3f3f3
;}
.admin-offcanvas-bar
:after
{
background
:
#BABABA
;}
.admin-sidebar-list
a
:hover
,
.admin-sidebar-list
a
:active
{
-webkit-transition
:
background-color
.3s
ease
;
-moz-transition
:
background-color
.3s
ease
;
-ms-transition
:
background-color
.3s
ease
;
-o-transition
:
background-color
.3s
ease
;
transition
:
background-color
.3s
ease
;
background
:
#E4E4E4
;}
.admin-sidebar
.am-offcanvas-bar
{
width
:
70%
;
}
}
.common-nav-bar
{
position
:
fixed
;
z-index
:
10
;
bottom
:
30px
;
right
:
20px
;}
.admin
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
display
:
-webkit-flex
;
padding-top
:
51px
;
background
:
#fff
;}
...
...
@@ -394,8 +397,9 @@ ul {margin-top:0;}
.content-right
{
overflow
:
auto
;
flex
:
1
;
-webkit-flex
:
1
;}
.content-right
.content
{
padding
:
10px
10px
0
10px
;}
.admin-sidebar-list
li
a
{
padding
:
0.6rem
0
0.6rem
1.6rem
;}
.common-left-menu
a
:hover
,
.common-left-menu-active
{
background
:
#767778
;
color
:
#fff
!important
;}
#ifcontent
{
border
:
0px
;
width
:
100%
;
overflow-x
:
hidden
;}
.common-left-menu
a
:hover
{
background
:
rgba
(
118
,
119
,
120
,
0.1
);
}
.common-left-menu-active
{
background
:
rgba
(
118
,
119
,
120
,
0.3
)
!important
;
color
:
#fff
!important
;}
#ifcontent
{
border
:
0px
;
overflow-x
:
hidden
;}
.am-table
>
tbody
>
tr
>
td
{
vertical-align
:
top
;}
.admin-offcanvas-bar
,
.admin-offcanvas-bar
.am-list
>
li
{
background
:
#36373c
;
}
.admin-offcanvas-bar
.am-list
>
li
{
border
:
1px
solid
#2e2e31
;
}
...
...
@@ -428,4 +432,22 @@ ul {margin-top:0;}
html
,
body
{
overflow-x
:
hidden
;
}
}
\ No newline at end of file
}
.menu-mini
.nav-name
,
.menu-mini
.am-icon-angle-down
,
.menu-mini
.admin-sidebar-sub
{
display
:
none
}
.menu-mini
.admin-sidebar-list
li
a
{
padding-left
:
10px
}
/**
* mini开关
*/
.menu-scaling-submit
{
position
:
absolute
;
left
:
189px
;
top
:
55px
;
opacity
:
.6
;
width
:
30px
;
height
:
25px
;
padding
:
2px
10px
;
box-shadow
:
0
0
3px
1px
#208fd5
;
font-size
:
18px
;}
/**
* mini小icon
*/
.menu-mini-container-tips
{
position
:
absolute
;
left
:
65px
;
top
:
0
;
padding
:
0
10px
;
width
:
auto
;
height
:
35px
;
line-height
:
35px
;
text-align
:
center
;
color
:
#fff
;
background-color
:
#4884ff
;
-webkit-box-shadow
:
0
0
5px
rgba
(
0
,
0
,
0
,
.2
);
-moz-box-shadow
:
0
0
5px
rgba
(
0
,
0
,
0
,
.2
);
box-shadow
:
0
0
5px
rgba
(
0
,
0
,
0
,
.2
);
font-weight
:
700
;
display
:
none
}
.menu-mini-container-tips
span
{
font-size
:
12px
}
.menu-mini-container-tips
.mui-mbar-tab-tip
,
.menu-mini-container-popup
.mui-mbar-tab-tip
{
position
:
absolute
;
width
:
16px
;
height
:
16px
;
line-height
:
16px
;
text-align
:
center
;
font-size
:
16px
;
font-family
:
"\5b8b\4f53"
;
top
:
10px
;
left
:
-8px
;
z-index
:
0
;
color
:
#4884ff
}
/**
* mini子菜单
*/
.menu-mini-container-popup
{
background
:
#36373c
;
position
:
absolute
;
left
:
65px
;
top
:
0
;
min-width
:
120px
;
height
:
auto
;
display
:
none
}
.menu-mini-container-popup
ul
{
margin
:
0
;
padding
:
0
}
.menu-mini-container-popup
ul
li
{
line-height
:
35px
;
list-style-type
:
none
}
.menu-mini-container-popup
ul
li
a
{
padding
:
0
10px
;
display
:
block
;
color
:
#fff
}
.menu-mini-container-popup
ul
li
a
:hover
{
background
:
rgba
(
118
,
119
,
120
,
0.1
)}
.menu-mini-container-popup
ul
li
a
span
{
font-size
:
12px
}
.menu-mini-container-popup
ul
li
:not
(
:last-child
)
{
border-bottom
:
1px
solid
#2e2e31
}
.menu-mini-container-popup
.mui-mbar-tab-tip
{
color
:
#36373c
}
\ No newline at end of file
public/static/admin/default/js/index.js
浏览文件 @
5bc00c4c
/**
* 全屏操作
*/
var
$fullscreen
=
$
.
AMUI
.
fullscreen
;
$
(
'
#admin-fullscreen
'
).
on
(
'
click
'
,
function
()
$
(
function
()
{
$fullscreen
.
toggle
();
});
if
(
$fullscreen
.
enabled
)
{
$
(
document
).
on
(
$fullscreen
.
raw
.
fullscreenchange
,
function
()
/**
* 全屏操作
*/
var
$fullscreen
=
$
.
AMUI
.
fullscreen
;
$
(
'
#admin-fullscreen
'
).
on
(
'
click
'
,
function
()
{
$tag
=
$
(
'
.admin-fulltext
'
);
$tag
.
text
(
$fullscreen
.
isFullscreen
?
$tag
.
attr
(
'
fulltext-exit
'
)
:
$tag
.
attr
(
'
fulltext-open
'
));
$fullscreen
.
toggle
();
});
}
/**
* url加载
*/
$
(
'
.common-left-menu, .common-nav-top
'
).
find
(
'
li a
'
).
on
(
'
click
'
,
function
()
{
var
link
=
$
(
this
).
data
(
'
url
'
);
var
type
=
$
(
this
).
data
(
'
type
'
);
if
(
link
!=
undefined
)
if
(
$fullscreen
.
enabled
)
{
// 打开url地址
$
(
'
#ifcontent
'
).
attr
(
'
src
'
,
link
);
$
(
document
).
on
(
$fullscreen
.
raw
.
fullscreenchange
,
function
()
{
$tag
=
$
(
'
.admin-fulltext
'
);
$tag
.
text
(
$fullscreen
.
isFullscreen
?
$tag
.
attr
(
'
fulltext-exit
'
)
:
$tag
.
attr
(
'
fulltext-open
'
));
});
}
// 顶部菜单事件,关闭弹层
if
(
type
==
'
nav
'
)
/**
* url加载
*/
$
(
document
).
on
(
'
click
'
,
'
.common-left-menu li a, .common-nav-top li a, .menu-mini-container-popup ul li a
'
,
function
()
{
var
link
=
$
(
this
).
data
(
'
url
'
);
var
type
=
$
(
this
).
data
(
'
type
'
);
if
(
link
!=
undefined
)
{
if
(
$
(
document
).
width
()
<
641
)
// 打开url地址
$
(
'
#ifcontent
'
).
attr
(
'
src
'
,
link
);
// 顶部菜单事件,关闭弹层
if
(
type
==
'
nav
'
)
{
if
(
$
(
document
).
width
()
<
641
)
{
$
(
'
.header-nav-submit
'
).
trigger
(
'
click
'
);
}
else
{
$
(
this
).
parents
(
'
.common-nav-top
'
).
trigger
(
'
click
'
);
}
}
// 关闭左侧弹层
if
(
type
==
'
menu
'
)
{
$
(
'
#admin-offcanvas
'
).
offCanvas
(
'
close
'
);
}
}
else
{
// 左侧菜单剪头方向处理
if
(
type
==
'
menu
'
)
{
$
(
'
.header-nav-submit
'
).
trigger
(
'
click
'
);
}
else
{
$
(
this
).
parents
(
'
.common-nav-top
'
).
trigger
(
'
click
'
);
if
(
$
(
this
).
find
(
'
i
'
).
length
>
0
)
{
$
(
this
).
find
(
'
i
'
).
toggleClass
(
'
left-menu-more-ico-rotate
'
);
}
}
}
});
/**
* 菜单选择
*/
$
(
'
.common-left-menu li a
'
).
on
(
'
click
'
,
function
()
{
$
(
'
.common-left-menu a
'
).
removeClass
(
'
common-left-menu-active
'
);
$
(
this
).
addClass
(
'
common-left-menu-active
'
);
});
// 关闭左侧弹层
if
(
type
==
'
menu
'
)
/**
* mini伸缩开关
*/
$
(
'
.menu-scaling-submit
'
).
on
(
'
click
'
,
function
()
{
var
status
=
$
(
this
).
attr
(
'
data-status
'
)
||
0
;
$
(
'
#admin-offcanvas ul
'
).
css
(
'
opacity
'
,
0.1
);
$
(
'
.menu-mini-container-popup
'
).
hide
();
$
(
'
.menu-mini-container-tips
'
).
hide
();
if
(
status
==
0
)
{
$
(
'
#admin-offcanvas
'
).
offCanvas
(
'
close
'
);
$
(
this
).
animate
({
left
:
"
64px
"
},
300
);
$
(
this
).
removeClass
(
'
am-icon-angle-double-left
'
).
addClass
(
'
am-icon-angle-double-right
'
);
$
(
'
#admin-offcanvas
'
).
addClass
(
'
menu-mini
'
);
$
(
'
#admin-offcanvas
'
).
animate
({
width
:
"
60px
"
},
300
);
$
(
'
#ifcontent
'
).
css
({
"
width
"
:
"
calc(100% - 60px)
"
});
}
else
{
$
(
this
).
animate
({
left
:
"
189px
"
},
300
);
$
(
this
).
removeClass
(
'
am-icon-angle-double-right
'
).
addClass
(
'
am-icon-angle-double-left
'
);
$
(
'
#admin-offcanvas
'
).
animate
({
width
:
"
185px
"
},
300
);
setTimeout
(
function
()
{
$
(
'
#admin-offcanvas
'
).
removeClass
(
'
menu-mini
'
);
$
(
'
#ifcontent
'
).
css
({
"
width
"
:
"
calc(100% - 185px)
"
});
},
300
);
}
}
else
{
// 左侧菜单剪头方向处理
if
(
type
==
'
menu
'
)
{
if
(
$
(
this
).
find
(
'
i
'
).
length
>
0
)
{
$
(
this
).
find
(
'
i
'
).
toggleClass
(
'
left-menu-more-ico-rotate
'
);
}
}
}
});
$
(
'
#admin-offcanvas ul
'
).
animate
({
opacity
:
1
},
300
);
$
(
this
).
attr
(
'
data-status
'
,
status
==
0
?
1
:
0
);
});
/**
* mini菜单操作
*/
var
timer_menu
=
null
;
$
(
document
).
on
(
'
mouseenter
'
,
'
.menu-mini li
'
,
function
()
{
clearTimeout
(
timer_menu
);
var
html
=
$
(
this
).
find
(
'
ul.admin-sidebar-sub
'
).
html
()
||
null
;
var
top
=
$
(
this
).
offset
().
top
;
var
win_height
=
$
(
window
).
height
();
if
(
html
==
null
)
{
$
(
'
.menu-mini-container-popup
'
).
hide
();
$
(
'
.menu-mini-container-tips
'
).
show
();
$
(
'
.menu-mini-container-tips span
'
).
text
(
$
(
this
).
find
(
'
span.nav-name
'
).
text
());
$
(
'
.menu-mini-container-tips
'
).
css
(
'
top
'
,
top
);
}
else
{
$
(
'
.menu-mini-container-popup ul
'
).
html
(
html
);
$
(
'
.menu-mini-container-tips
'
).
hide
();
$
(
'
.menu-mini-container-popup
'
).
show
();
// 容器是否超出底部
var
h
=
$
(
'
.menu-mini-container-popup
'
).
height
();
if
(
h
+
top
>
win_height
)
{
$
(
'
.menu-mini-container-popup
'
).
css
(
'
top
'
,
win_height
-
h
);
}
else
{
$
(
'
.menu-mini-container-popup
'
).
css
(
'
top
'
,
top
);
}
}
});
$
(
document
).
on
(
'
mouseleave
'
,
'
.menu-mini li
'
,
function
()
{
$
(
'
.menu-mini-container-tips
'
).
hide
();
clearTimeout
(
timer_menu
);
timer_menu
=
setTimeout
(
function
()
{
$
(
'
.menu-mini-container-tips
'
).
hide
();
if
((
$
(
'
.menu-mini-container-popup
'
).
attr
(
'
data-is-leave
'
)
||
0
)
==
0
)
{
$
(
'
.menu-mini-container-popup
'
).
hide
();
}
},
3000
);
});
$
(
document
).
on
(
'
mouseenter
'
,
'
.menu-mini-container-popup
'
,
function
()
{
$
(
this
).
attr
(
'
data-is-leave
'
,
1
);
}).
mouseleave
(
function
()
{
$
(
this
).
attr
(
'
data-is-leave
'
,
0
);
$
(
this
).
hide
();
});
// 浏览器窗口实时事件
$
(
window
).
resize
(
function
()
{
// 小屏幕关闭mini导航
if
(
$
(
document
).
width
()
<=
640
)
{
$
(
'
.menu-scaling-submit
'
).
attr
(
'
data-status
'
,
0
);
$
(
'
.menu-scaling-submit
'
).
css
({
"
left
"
:
"
189px
"
});
$
(
'
.menu-scaling-submit
'
).
removeClass
(
'
am-icon-angle-double-right
'
).
addClass
(
'
am-icon-angle-double-left
'
);
$
(
'
#admin-offcanvas
'
).
css
({
"
width
"
:
"
inherit
"
});
$
(
'
#admin-offcanvas
'
).
removeClass
(
'
menu-mini
'
);
$
(
'
#ifcontent
'
).
css
({
"
width
"
:
"
100%
"
});
}
else
{
if
((
$
(
'
.menu-scaling-submit
'
).
attr
(
'
data-status
'
)
||
0
)
==
0
)
{
$
(
'
#admin-offcanvas
'
).
css
({
"
width
"
:
"
185px
"
});
$
(
'
#ifcontent
'
).
css
({
"
width
"
:
"
calc(100% - 185px)
"
});
}
}
});
/**
* 菜单选择
*/
$
(
'
.common-left-menu li a
'
).
on
(
'
click
'
,
function
()
{
$
(
'
.common-left-menu a
'
).
removeClass
(
'
common-left-menu-active
'
);
$
(
this
).
addClass
(
'
common-left-menu-active
'
);
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录