Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
7555b249
Commit
7555b249
authored
Mar 15, 2018
by
刘丹
Committed by
hujun
Mar 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单
parent
b2845d47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
public.js
public/resource/js/public.js
+4
-0
menu_template_tpl.html
public/resource/template/menu_template_tpl.html
+1
-1
No files found.
public/resource/js/public.js
View file @
7555b249
...
@@ -30,13 +30,17 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html'], function (doT, $,t
...
@@ -30,13 +30,17 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html'], function (doT, $,t
function
menu_bar
()
{
function
menu_bar
()
{
var
user_info_obj
=
localStorage
.
getItem
(
'user_info'
);
//读取缓存
var
user_info_obj
=
localStorage
.
getItem
(
'user_info'
);
//读取缓存
$
(
"#menu_bar"
).
append
(
template
);
$
(
"#menu_bar"
).
append
(
template
);
if
(
typeof
user_info_obj
===
'string'
)
{
if
(
typeof
user_info_obj
===
'string'
)
{
var
user_info
=
JSON
.
parse
(
user_info_obj
);
var
user_info
=
JSON
.
parse
(
user_info_obj
);
console
.
log
(
user_info
);
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#dropdownMenu1"
).
append
(
user_info
[
'name'
]);
$
(
"#dropdownMenu1"
).
append
(
user_info
[
'name'
]);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
user_info
[
'menu'
]));
$
(
"#menu_bar"
).
html
(
doTtmpl
(
user_info
[
'menu'
]));
}
else
{
}
else
{
$
.
ajax
({
$
.
ajax
({
url
:
'/index/getMenu'
,
url
:
'/index/getMenu'
,
...
...
public/resource/template/menu_template_tpl.html
View file @
7555b249
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
[
%
for
(
var
item
in
it
){
%
]
[
%
for
(
var
item
in
it
){
%
]
<
li
class
=
"dropdown"
>
<
li
class
=
"dropdown"
>
[
%
if
(
it
[
item
][
"_child"
]
==
undefined
||
it
[
item
][
"_child"
].
length
==
0
)
{
%
]
[
%
if
(
it
[
item
][
"_child"
]
==
undefined
||
it
[
item
][
"_child"
].
length
==
0
)
{
%
]
<
a
href
=
"[%= it[item]['name'] %]"
>
[
%=
it
[
item
][
"title"
]
%
]
<
/a
>
<
a
href
=
"[%= it[item]['name'] %]"
>
<
span
class
=
"glyphicon glyphicon-credit-card"
aria
-
hidden
=
"true"
><
/span> <span class="span-list">
[
%= it[item
][
"title"
]
%]</
span
>
<
/a
>
[
%
}
else
{
%
]
[
%
}
else
{
%
]
<
a
href
=
""
class
=
"dropdown-toggle"
data
-
toggle
=
"dropdown"
>
<
span
class
=
"glyphicon glyphicon-credit-card"
aria
-
hidden
=
"true"
><
/span><span class="span-list">
[
%= it[item
][
"title"
]
%]</
span
>
<
a
href
=
""
class
=
"dropdown-toggle"
data
-
toggle
=
"dropdown"
>
<
span
class
=
"glyphicon glyphicon-credit-card"
aria
-
hidden
=
"true"
><
/span><span class="span-list">
[
%= it[item
][
"title"
]
%]</
span
>
<
span
class
=
"glyphicon glyphicon-hand-down"
aria
-
hidden
=
"true"
><
/span></
a
>
<
span
class
=
"glyphicon glyphicon-hand-down"
aria
-
hidden
=
"true"
><
/span></
a
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment