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
557449b3
Commit
557449b3
authored
Jan 09, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改js
parent
56e86b15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
82 deletions
+2
-82
public.js
public/resource/js/public.js
+2
-82
No files found.
public/resource/js/public.js
View file @
557449b3
...
@@ -32,65 +32,13 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
...
@@ -32,65 +32,13 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
dataObj
.
init
();
dataObj
.
init
();
});
});
}
}
//是否有导航栏的标识
var
haveMenu
=
!~
location
.
href
.
indexOf
(
'/userModalList'
);
haveMenu
&&
menu_bar
(
function
(){
//回调部分
//记录tab的点击状态,对应的标签内容展开,并高亮显示
var
_hash
=
location
.
pathname
.
replace
(
'/admin.php/'
,
'/'
);
var
_tempObj
=
$
(
'[href="'
+
_hash
+
'"]'
);
_tempObj
.
addClass
(
'active-a'
).
siblings
().
removeClass
(
'active-a'
);
_tempObj
.
closest
(
'.dropdown-menu'
).
prev
().
attr
(
'aria-expanded'
,
true
).
parents
().
addClass
(
'open'
).
siblings
().
removeClass
(
'open'
);
});
function
menu_bar
(
fn
)
{
var
user_info_obj
=
JSON
.
parse
(
decodeURIComponent
(
localStorage
.
getItem
(
'pcUserInfo'
)));
//读取缓存
//登录时间无效 直接跳转登录页面
if
(
!
user_info_obj
){
alert
(
'登录失效,请您重新登录'
);
window
.
location
.
href
=
"login.html"
;
}
$
(
"#menu_bar"
).
append
(
template
);
if
(
user_info_obj
)
{
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
// alert(user_info_obj['name'])
// $ ("#dropdownMenu1").append(user_info_obj['name']);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
user_info_obj
[
'menu'
]));
//回调
fn
&&
fn
();
}
else
{
$
.
ajax
({
url
:
'/index/getMenu'
,
type
:
'POST'
,
async
:
true
,
data
:
""
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
data
.
data
.
menu
));
//回调
fn
&&
fn
();
}
});
}
}
$
(
"#logout"
).
click
(
function
()
{
$
(
"#logout"
).
click
(
function
()
{
localStorage
.
removeItem
(
'pcUserInfo'
);
localStorage
.
removeItem
(
'pcUserInfo'
);
});
});
var
_doc
=
$
(
document
);
var
_doc
=
$
(
document
);
//显示 隐藏城市 默认显示 当前账号 所在城市
//显示 隐藏城市 默认显示 当前账号 所在城市
haveMenu
&&
$
.
ajax
({
$
.
ajax
({
url
:
'/index/getSiteList'
,
url
:
'/index/getSiteList'
,
type
:
'GET'
,
type
:
'GET'
,
async
:
true
,
async
:
true
,
...
@@ -338,7 +286,7 @@ function urlDeal(urlStr, httpStr) {
...
@@ -338,7 +286,7 @@ function urlDeal(urlStr, httpStr) {
}
}
function
dealPunctuation
(
str
)
{
//处理跟进内容 多个标点符号 截取
function
dealPunctuation
(
str
)
{
//处理跟进内容 多个标点符号 截取
return
(
str
+
'!!!!!'
)
.
replace
(
/!!!!!/g
,
''
).
replace
(
/!!!!!/g
,
''
).
replace
(
/
\?\?\?\?\?
/g
,
''
).
replace
(
/?????/g
,
''
).
replace
(
/。。。。。/g
,
''
);
return
str
.
replace
(
/!!!!!/g
,
''
).
replace
(
/!!!!!/g
,
''
).
replace
(
/
\?\?\?\?\?
/g
,
''
).
replace
(
/?????/g
,
''
).
replace
(
/。。。。。/g
,
''
);
}
}
/**
/**
...
@@ -376,31 +324,3 @@ function getFlatternDistance(lat1,lng1,lat2,lng2){
...
@@ -376,31 +324,3 @@ function getFlatternDistance(lat1,lng1,lat2,lng2){
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
return
s
;
return
s
;
}
}
//获取前n天的时间
function
getBeforeDate
(
n
){
var
d
=
new
Date
();
var
year
=
d
.
getFullYear
();
var
mon
=
d
.
getMonth
()
+
1
;
var
day
=
d
.
getDate
();
if
(
day
<=
n
){
if
(
mon
>
1
)
{
mon
=
mon
-
1
;
}
else
{
year
=
year
-
1
;
mon
=
12
;
}
}
d
.
setDate
(
d
.
getDate
()
-
n
);
year
=
d
.
getFullYear
();
mon
=
d
.
getMonth
()
+
1
;
day
=
d
.
getDate
();
s
=
year
+
"-"
+
(
mon
<
10
?(
'0'
+
mon
):
mon
)
+
"-"
+
(
day
<
10
?(
'0'
+
day
):
day
)
return
s
;
};
//年-月-日 转化为时间戳
function
getTimeStamp
(
date
){
var
oDate
=
new
Date
(
date
);
var
time_cha
=
oDate
.
getTime
();
return
time_cha
;
};
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