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
3a530d58
Commit
3a530d58
authored
Dec 14, 2017
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common.css,common.js暂存
parent
f620d693
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
229 additions
and
328 deletions
+229
-328
agent_detail.html
application/app/view/index/agent_detail.html
+14
-3
agent_detail.css
public/app/css/agent_detail.css
+6
-0
common.css
public/app/css/common.css
+172
-2
bg_yellow.png
public/app/images/bg_yellow.png
+0
-0
pic_bigstar_black.png
public/app/images/pic_bigstar_black.png
+0
-0
pic_bigstar_yellow.png
public/app/images/pic_bigstar_yellow.png
+0
-0
pic_smallstar_black.png
public/app/images/pic_smallstar_black.png
+0
-0
pic_smallstar_yellow.png
public/app/images/pic_smallstar_yellow.png
+0
-0
agent_detail.js
public/app/js/agent_detail.js
+32
-0
common.js
public/app/js/common.js
+5
-323
No files found.
application/app/view/index/agent_detail.html
View file @
3a530d58
...
@@ -8,16 +8,27 @@
...
@@ -8,16 +8,27 @@
<meta
name=
"Keywords"
content=
""
/>
<meta
name=
"Keywords"
content=
""
/>
<meta
name=
"Description"
content=
""
/>
<meta
name=
"Description"
content=
""
/>
<link
rel=
"stylesheet"
href=
"/app/css/common.css"
>
<link
rel=
"stylesheet"
href=
"/app/css/common.css"
>
<link
rel=
"stylesheet"
href=
"/app/css/agent_detail.css"
>
</head>
</head>
<body>
<body>
<header
id=
"header"
>
<header
id=
"header"
>
<a
class=
"ps-back"
href=
"javascript:(history.length>1?history.go(-1):window.location='/');"
id=
"back_btn"
></a>
<a
class=
"ps-back"
href=
"javascript:(history.length>1?history.go(-1):window.location='/');"
id=
"back_btn"
></a>
<h2
id=
"title"
>
跟进
</h2>
<h2
id=
"title"
>
同联经纪人店铺
</h2>
</header>
</header>
<div
class=
"header_seat"
></div>
<div
class=
"header_seat"
></div>
<div
class=
"user-info-area oh"
>
<div
class=
"fl oh"
>
<div
class=
"portrait-area oh"
></div>
<div
class=
"info-p-area"
></div>
</div>
<div
class=
"fr"
></div>
</div>
<p>
3333333333
</p>
<script
src=
"/app/js/jquery-1122-min.js"
></script>
<script
src=
"/app/js/jquery-1122-min.js"
charset=
"UTF-8"
></script>
<script
src=
"/app/js/common.js"
charset=
"UTF-8"
></script>
<script
src=
"/app/js/agent_detail.js"
charset=
"UTF-8"
></script>
</body>
</body>
</html>
</html>
public/app/css/agent_detail.css
0 → 100644
View file @
3a530d58
@charset
"utf-8"
;
.user-info-area
{
background-image
:
url('/app/images/bg_yellow.png')
;
background-size
:
7.5rem
2.3rem
;
height
:
2.3rem
;
}
public/app/css/common.css
View file @
3a530d58
@charset
"utf-8"
;
@charset
"utf-8"
;
body
,
div
,
dl
,
dt
,
dd
,
ul
,
ol
,
li
,
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
pre
,
code
,
form
,
fieldset
,
legend
,
input
,
textarea
,
p
,
blockquote
,
th
,
td
,
hr
,
button
,
article
,
aside
,
details
,
figcaption
,
figure
,
footer
,
header
,
hgroup
,
menu
,
nav
,
section
{
margin
:
0
;
padding
:
0
}
input
,
select
,
textarea
{
font-size
:
100%
}
table
{
border-collapse
:
collapse
;
border-spacing
:
0
}
fieldset
,
img
{
border
:
0
}
abbr
,
acronym
{
border
:
0
;
font-variant
:
normal
}
del
{
text-decoration
:
line-through
}
address
,
caption
,
cite
,
code
,
dfn
,
em
,
th
,
var
{
font-style
:
normal
;
font-weight
:
500
}
ol
,
ul
{
list-style
:
none
}
caption
,
th
{
text-align
:
left
}
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
font-size
:
100%
;
font-weight
:
500
}
q
:before
,
q
:after
{
content
:
''
}
sub
,
sup
{
font-size
:
75%
;
line-height
:
0
;
position
:
relative
;
vertical-align
:
baseline
}
sup
{
top
:
-.5em
}
sub
{
bottom
:
-.25em
}
ins
,
a
{
text-decoration
:
none
}
:focus
{
outline
:
0
}
a
{
overflow
:
hidden
;
text-decoration
:
none
;
text-align
:
inherit
;
color
:
inherit
;
border
:
0
;
cursor
:
pointer
}
a
:visited
{
text-decoration
:
none
}
a
:hover
{
text-decoration
:
none
}
a
:active
{
text-decoration
:
none
}
body
,
div
,
dl
,
dt
,
dd
,
ul
,
ol
,
li
,
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
pre
,
code
,
form
,
fieldset
,
legend
,
input
,
textarea
,
p
,
blockquote
,
th
,
td
,
hr
,
button
,
article
,
aside
,
details
,
figcaption
,
figure
,
footer
,
header
,
hgroup
,
menu
,
nav
,
section
{
margin
:
0
;
padding
:
0
}
input
,
select
,
textarea
{
font-size
:
100%
}
table
{
border-collapse
:
collapse
;
border-spacing
:
0
}
fieldset
,
img
{
border
:
0
}
abbr
,
acronym
{
border
:
0
;
font-variant
:
normal
}
del
{
text-decoration
:
line-through
}
address
,
caption
,
cite
,
code
,
dfn
,
em
,
th
,
var
{
font-style
:
normal
;
font-weight
:
500
}
ol
,
ul
{
list-style
:
none
}
caption
,
th
{
text-align
:
left
}
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
font-size
:
100%
;
font-weight
:
500
}
q
:before
,
q
:after
{
content
:
''
}
sub
,
sup
{
font-size
:
75%
;
line-height
:
0
;
position
:
relative
;
vertical-align
:
baseline
}
sup
{
top
:
-.5em
}
sub
{
bottom
:
-.25em
}
ins
,
a
{
text-decoration
:
none
}
:focus
{
outline
:
0
}
a
{
overflow
:
hidden
;
text-decoration
:
none
;
text-align
:
inherit
;
color
:
inherit
;
border
:
0
;
cursor
:
pointer
}
a
:visited
{
text-decoration
:
none
}
a
:hover
{
text-decoration
:
none
}
a
:active
{
text-decoration
:
none
}
input
{
.oh
{
overflow
:
hidden
;
}
.fl
{
float
:
left
;
}
.fr
{
float
:
right
;
}
.tc
{
text-align
:
center
;
}
.ellipsis
{
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
input
{
outline
:
none
;
outline
:
none
;
-webkit-appearance
:
none
;
/*解决苹果机上input的内阴影*/
-webkit-appearance
:
none
;
/*解决苹果机上input的内阴影*/
-moz-appearance
:
none
;
-moz-appearance
:
none
;
...
@@ -46,7 +63,7 @@ header .ps-back {
...
@@ -46,7 +63,7 @@ header .ps-back {
display
:
block
;
display
:
block
;
width
:
.88rem
;
width
:
.88rem
;
height
:
.88rem
;
height
:
.88rem
;
background
:
url('
..
/images/ic_back_black@2x.png')
no-repeat
0.3rem
center
;
background
:
url('
/app
/images/ic_back_black@2x.png')
no-repeat
0.3rem
center
;
background-size
:
.36rem
.28rem
;
background-size
:
.36rem
.28rem
;
}
}
...
@@ -84,3 +101,156 @@ header .share-tips>span{
...
@@ -84,3 +101,156 @@ header .share-tips>span{
background-color
:
#8a8a8a
;
background-color
:
#8a8a8a
;
float
:
left
;
float
:
left
;
}
}
/*************************分页加载相关样式loading*********************************/
.loading_pic
{
font-size
:
0.2rem
;
text-align
:
center
;
width
:
100%
;
position
:
fixed
;
top
:
7rem
;
display
:
none
;
}
.loading_pic
>
img
{
width
:
1.2rem
;
display
:
block
;
margin
:
0
auto
;
}
.loading_pic
>
p
{
font-size
:
0.2rem
;
color
:
#333
;
text-align
:
center
;
margin-top
:
0.1rem
;
color
:
rgb
(
51
,
51
,
51
);
}
.no_more
{
font-size
:
0.28rem
;
height
:
0.5rem
;
line-height
:
0.5rem
;
text-align
:
center
;
display
:
none
;
margin-top
:
0.1rem
;
color
:
#999999
;
}
.zanwu_data
{
background
:
white
url('../images/zanwu_shuju.png')
no-repeat
center
0.3rem
/
2.31rem
1.75rem
;
padding-top
:
2.35rem
;
font-size
:
.28rem
;
line-height
:
.5rem
;
text-align
:
center
;
color
:
#999
;
display
:
none
;
}
/*.ic_wushuju{
width: 2.31rem;
height: 1.75rem;
margin: 0 auto;
}*/
.loading_pic_samll
{
overflow
:
hidden
;
width
:
0.5rem
;
height
:
0.5rem
;
position
:
fixed
;
top
:
3rem
;
left
:
50%
;
margin-left
:
-0.25rem
;
display
:
none
;
}
.loading_pic_samll
>
img
{
float
:
left
;
width
:
0.5rem
;
height
:
0.5rem
;
}
a
#jump_link
{
height
:
1rem
;
float
:
right
;
overflow
:
hidden
;
}
/*时间轴等图片点击之后的轮播图*/
#pic_box
{
display
:
none
;
}
/*定义加载的动画*/
@keyframes
loader4
{
from
{
transform
:
rotate
(
0deg
);
}
to
{
transform
:
rotate
(
360deg
);
}
}
@-webkit-keyframes
loader4
{
from
{
-webkit-transform
:
rotate
(
0deg
);
}
to
{
-webkit-transform
:
rotate
(
360deg
);
}
}
/*底部浮窗*/
.fix_area_bottom
{
width
:
100%
;
position
:
fixed
;
bottom
:
0
;
left
:
0
;
z-index
:
9999
;
display
:
none
;
}
.fix_area_bottom
>
div
{
width
:
100%
;
height
:
1rem
;
background
:
rgba
(
0
,
0
,
0
,
0.6
);
position
:
absolute
;
bottom
:
0
;
left
:
0
;
font-size
:
0.28rem
;
color
:
white
;
}
.fix_area_bottom
>
div
>
div
{
width
:
50%
;
float
:
left
;
}
.fix_area_bottom
>
div
>
div
:nth-of-type
(
1
)
{
text-align
:
right
;
line-height
:
1rem
;
}
.fix_area_bottom
>
div
>
div
:nth-of-type
(
2
)
{
}
.fix_area_bottom
>
div
>
div
:nth-of-type
(
2
)>
p
{
margin-left
:
0.5rem
;
background-color
:
#ff9419
;
width
:
2.5rem
;
height
:
0.44rem
;
border-radius
:
0.12rem
;
text-align
:
center
;
overflow
:
hidden
;
margin-top
:
0.28rem
;
}
.fix_area_bottom
>
div
>
div
:nth-of-type
(
2
)>
p
>
img
{
width
:
0.28rem
;
float
:
left
;
margin
:
0.08rem
0.12rem
0
;
}
.fix_area_bottom
>
div
>
div
:nth-of-type
(
2
)>
p
>
a
{
color
:
white
;
float
:
left
;
line-height
:
0.44rem
;
}
#fix_area_bottom_btn
{
position
:
absolute
;
right
:
0
;
bottom
:
1rem
;
width
:
0.96rem
;
height
:
0.96rem
;
overflow
:
hidden
;
}
#fix_area_bottom_btn
>
img
{
float
:
left
;
width
:
0.36rem
;
margin
:
0.3rem
;
}
public/app/images/bg_yellow.png
0 → 100644
View file @
3a530d58
40.8 KB
public/app/images/pic_bigstar_black.png
0 → 100644
View file @
3a530d58
1.57 KB
public/app/images/pic_bigstar_yellow.png
0 → 100644
View file @
3a530d58
1.57 KB
public/app/images/pic_smallstar_black.png
0 → 100644
View file @
3a530d58
1.39 KB
public/app/images/pic_smallstar_yellow.png
0 → 100644
View file @
3a530d58
1.39 KB
public/app/js/agent_detail.js
0 → 100644
View file @
3a530d58
$
(
function
(){
$
.
ajax
({
type
:
'get'
,
url
:
ServerHost
+
'/api/brokerDetail/731'
,
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
[
'code'
]
==
200
)
{
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
alert
(
XMLHttpRequest
.
status
);
alert
(
XMLHttpRequest
.
readyState
);
alert
(
textStatus
);
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
});
\ No newline at end of file
public/app/js/common.js
View file @
3a530d58
(
function
()
{
var
ServerHost
=
location
.
origin
;
var
_url
=
window
.
location
.
href
;
//如果是在登录、注册、忘记密码、大讲堂、微楼书界面都不进行是否登录的判断
//预览功能资讯,不用登录
if
(
_url
.
indexOf
(
"login"
)
<
0
&&
_url
.
indexOf
(
"index"
)
<
0
&&
_url
.
indexOf
(
"top_line"
)
<
0
&&
_url
.
indexOf
(
"invite_register.html"
)
<
0
&&
_url
.
indexOf
(
"forgotten.html"
)
<
0
&&
_url
.
indexOf
(
"news2.html"
)
<
0
&&
_url
.
indexOf
(
"details.html"
)
<
0
&&
_url
.
indexOf
(
"dajiangtang.html"
)
<
0
&&
_url
.
indexOf
(
"dajiangtang2.html"
)
<
0
&&
_url
.
indexOf
(
"register.html"
)
<
0
&&
_url
.
indexOf
(
"zyzy"
)
<
0
&&
_url
.
indexOf
(
"comechang"
)
<
0
&&
_url
.
indexOf
(
"_app.html"
)
<
0
&&
_url
.
indexOf
(
"_pc.html"
)
<
0
&&
_url
.
indexOf
(
"_ft.html"
)
<
0
&&
_url
.
indexOf
(
"_tl.html"
)
<
0
&&
_url
.
indexOf
(
".html?token="
)
<
0
&&
_url
.
indexOf
(
"appEnter=1"
)
<
0
&&
_url
.
indexOf
(
"treaty.html"
)
<
0
&&
_url
.
indexOf
(
"customerinfo"
)
<
0
&&
_url
.
indexOf
(
"imagebody"
)
<
0
&&
_url
.
indexOf
(
"invite_intro"
)
<
0
&&
_url
.
indexOf
(
"poster_intro"
)
<
0
&&
_url
.
indexOf
(
"come_intro"
)
<
0
&&
_url
.
indexOf
(
"aa_liudan.html"
)
<
0
&&
_url
.
indexOf
(
"binding"
)
<
0
&&
_url
.
indexOf
(
"customerinfo_weixin"
)
<
0
&&
_url
.
indexOf
(
"customerinfo_weixin2"
)
<
0
&&
_url
.
indexOf
(
"details_tl.html"
)
<
0
&&
_url
.
indexOf
(
"achieve_sub_"
)
<
0
&&
_url
.
indexOf
(
"baidu_position.html"
)
<
0
&&
_url
.
indexOf
(
"success_story.html"
)
<
0
&&
_url
.
indexOf
(
"success_story_ft.html"
)
<
0
&&
_url
.
indexOf
(
"app_jump.html"
)
<
0
&&
_url
.
indexOf
(
"information.html"
)
<
0
&&
_url
.
indexOf
(
"money_banner.html"
)
<
0
)
{
checklogin
();
}
else
{
console
.
log
(
'no goto'
);
}
})();
//binding.html是微信公众号的入口文件,需要免登录
//从location.href里获取参数
//从location.href里获取参数
function
getUrlParam
(
name
)
{
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
...
@@ -59,197 +14,11 @@ function getUrlStringParam(str, name) {
...
@@ -59,197 +14,11 @@ function getUrlStringParam(str, name) {
return
null
;
return
null
;
}
}
//检查登录的函数 by xishifeng
function
checklogin
()
{
var
_token
=
localStorage
.
getItem
(
"token"
);
//获取本地存储的token
var
_weixin
=
localStorage
.
getItem
(
"weixin"
);
if
(
_token
===
null
||
_token
===
""
){
alert
(
"请重新登录"
);
if
(
_weixin
===
"1"
){
window
.
location
.
href
=
"/weixin/binding.php"
;
}
else
{
window
.
location
.
href
=
"/"
+
ServerURl
+
"/login.html?r="
+
Math
.
random
();
}
return
false
;
}
$
.
ajax
({
type
:
"post"
,
// url: ServerHost + "/AppTab5/AppH5Page",
url
:
ServerHost
+
"/AppTab5/about_Token"
,
data
:
{
'token'
:
_token
},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
&&
data
[
'status'
]
==
'0'
){
console
.
log
(
'already login'
);
}
else
{
if
(
_weixin
===
"1"
){
window
.
location
.
href
=
"/weixin/binding.php"
;
}
else
{
window
.
location
.
href
=
"/"
+
ServerURl
+
"/login.html?r="
+
Math
.
random
();
}
};
},
error
:
function
()
{
console
.
warn
(
"获取token失败"
);
}
});
}
function
dianji_fx
()
{
/*分享添加*/
var
foot_a001
=
1
;
var
html001
=
"<footer style='position: fixed; left: 0px; right: 0px; bottom: 0px; top: 0px; background: rgba(34, 34, 34, 0.7) none repeat scroll 0% 0%; z-index: 1000;'>"
+
"<div onclick='quxiao()' style='width: 100%; margin-top: 0.88rem; height: 10rem;' class='fl'></div>"
+
"<div class='share' style=padding-bottom:0.1rem>"
+
"<ul> <li style='margin-left:2%;' click='WeiXinShareBtn()'>"
+
" <a><img src='images/icon_1.png' alt='朋友圈'></a><span>朋友圈</span></li>"
+
"<li><a><img src='images/icon_2.png' alt='微信好友'></a><span>微信好友</span> </li>"
+
" <li><a><img src='images/icon_3.png' alt='新浪微博'></a><span>新浪微博</span> </li>"
+
" <li style=' margin-right: 1%;'> <a><img src='images/icon_4.png' alt=QQ好友></a><span>QQ好友</span> </li>"
+
"</ul></div></footer>"
;
if
(
foot_a001
==
1
)
{
$
(
"body"
).
after
(
html001
);
foot_a001
=
0
;
}
else
{
$
(
"footer"
).
remove
();
foot_a001
=
1
;
}
}
function
quxiao
()
{
$
(
"footer"
).
remove
();
foot_a001
=
1
;
}
//电话号取第一位
function
str_array1
(
str
)
{
array2
=
new
Array
();
array2
=
str
.
split
(
"|"
);
return
array2
[
0
];
}
//分享到朋友圈功能
function
WeiXinShareBtn
(
/*title,link,content,img_url*/
)
{
if
(
typeof
WeixinJSBridge
==
"undefined"
)
{
alert
(
"请先通过微信搜索 wow36kr 添加36氪为好友,通过微信分享文章 "
);
}
else
{
WeixinJSBridge
.
invoke
(
'shareTimeline'
,
{
"title"
:
"36氪"
,
"link"
:
"http://www.36kr.com"
,
"desc"
:
"关注互联网创业"
,
"img_url"
:
"http://www.36kr.com/assets/images/apple-touch-icon.png"
});
}
}
//类似2,209,347.00大数值显示优化
function
commafy
(
num
)
{
//1.先去除空格,判断是否空值和非数
num
=
num
+
""
;
num
=
num
.
replace
(
/
[
]
/g
,
""
);
//去除空格
if
(
num
==
""
)
{
return
;
}
if
(
isNaN
(
num
))
{
return
;
}
//2.针对是否有小数点,分情况处理
var
index
=
num
.
indexOf
(
"."
);
if
(
index
==
-
1
)
{
//无小数点
var
reg
=
/
(
-
?\d
+
)(\d{3})
/
;
while
(
reg
.
test
(
num
))
{
num
=
num
.
replace
(
reg
,
"$1,$2"
);
}
}
else
{
var
intPart
=
num
.
substring
(
0
,
index
);
var
pointPart
=
num
.
substring
(
index
+
1
,
num
.
length
);
var
reg
=
/
(
-
?\d
+
)(\d{3})
/
;
while
(
reg
.
test
(
intPart
))
{
intPart
=
intPart
.
replace
(
reg
,
"$1,$2"
);
}
num
=
intPart
+
"."
+
pointPart
;
}
return
num
;
}
//$("body").append('<span id="result_end"></span>');
//提示弹窗1 --大飞
function
alert2
(
name
)
{
var
htmlalert
=
"<div id='result_end' style='top: 30%; font-size: 0.3rem; z-index: 999; position: fixed; text-align: center; padding: 0.5rem; border-radius: 0.1rem; width: 2rem; left: 30%; color: rgb(79, 79, 79); border: 1px solid rgb(238, 238, 238); background: rgb(248, 249, 250) none repeat scroll 0% 0%; box-shadow: 0px 1px 2px 1px rgb(79, 79, 79);'>"
+
name
+
"</div>"
;
$
(
"#result_end"
).
html
(
htmlalert
);
$
(
"#result_end"
).
fadeToggle
(
3000
);
}
//仿ios弹窗 --大飞
function
alert_ff
(
name
)
{
var
html
=
"<footer style='position: fixed; left: 0px; right: 0px; bottom: 0px; top: 0px; background: rgba(34, 34, 34, 0.35) none repeat scroll 0% 0%; z-index: 1000;padding-top: 6rem;' id='footerid_ios2'>"
+
"<div style='width: 100%;' class='fl'>"
+
"<div class='self_pass'>"
+
"<p>"
+
name
+
"</p>"
+
"<p onclick='off_tc()' style='padding-top:0.1rem;width:100%;border-top:1px solid #eee;color:#3399FF'>确认</p>"
+
"</div>"
+
"</div>"
+
"</footer>"
;
$
(
"#result_end"
).
html
(
html
);
}
function
off_tc
()
{
$
(
"#footerid_ios2"
).
fadeOut
(
100
);
}
//删除图片
function
del_img
(
id
)
{
$
.
ajax
({
url
:
ServerHost
+
"/houseinfos/del_img"
,
data
:
{
"id"
:
id
,
},
type
:
"POST"
,
dataType
:
"json"
,
asycn
:
false
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
data
==
1
&&
$
(
'#del_'
+
id
).
remove
();
},
error
:
function
()
{}
});
}
//手机号码格式正则验证 by xishifeng
//手机号码格式正则验证 by xishifeng
function
is_mobile
(
text
)
{
function
is_mobile
(
text
)
{
/^1
[
34578
]\d{9}
$/
.
test
(
text
)?
1
:
0
;
/^1
[
34578
]\d{9}
$/
.
test
(
text
)?
1
:
0
;
}
}
//节流函数 xishifeng 2017.05.12
function
throttleV2
(
fn
,
delay
,
mustRunDelay
)
{
var
timer
=
null
;
var
t_start
;
return
function
()
{
var
context
=
this
,
args
=
arguments
,
t_curr
=
+
new
Date
();
clearTimeout
(
timer
);
if
(
!
t_start
)
{
t_start
=
t_curr
;
}
if
(
t_curr
-
t_start
>=
mustRunDelay
)
{
fn
.
apply
(
context
,
args
);
t_start
=
t_curr
;
}
else
{
timer
=
setTimeout
(
function
()
{
fn
.
apply
(
context
,
args
);
},
delay
);
}
}
}
//device判断设备是安卓还是苹果 by xishfieng 2017.04.26
//device判断设备是安卓还是苹果 by xishfieng 2017.04.26
var
device
=
{
var
device
=
{
isAndroid
:
function
()
{
isAndroid
:
function
()
{
...
@@ -266,7 +35,7 @@ var device = {
...
@@ -266,7 +35,7 @@ var device = {
function
Compatible
(
obj
)
{
function
Compatible
(
obj
)
{
if
(
device
.
isIos
())
{
if
(
device
.
isIos
())
{
try
{
try
{
if
(
obj
[
'hrefIos'
]
===
undefined
&&
obj
[
'hrefIos'
]
===
''
){
if
(
obj
[
'hrefIos'
]
===
undefined
||
obj
[
'hrefIos'
]
===
''
){
window
.
webkit
.
messageHandlers
.
AppModel
.
postMessage
(
obj
.
paraIos
);
//webkit.messageHandlers.AppModel.postMessage可以直接调用,ios系统都支持
window
.
webkit
.
messageHandlers
.
AppModel
.
postMessage
(
obj
.
paraIos
);
//webkit.messageHandlers.AppModel.postMessage可以直接调用,ios系统都支持
}
else
if
(
obj
[
'hrefIos'
]
!==
null
){
}
else
if
(
obj
[
'hrefIos'
]
!==
null
){
window
.
location
.
href
=
obj
[
'hrefIos'
];
window
.
location
.
href
=
obj
[
'hrefIos'
];
...
@@ -294,7 +63,6 @@ function Compatible(obj) {
...
@@ -294,7 +63,6 @@ function Compatible(obj) {
function
h5Page
(
token
,
fn
)
{
function
h5Page
(
token
,
fn
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
// url: ServerHost + "/AppTab5/AppH5Page",
url
:
ServerHost
+
"/AppTab5/about_Token"
,
url
:
ServerHost
+
"/AppTab5/about_Token"
,
data
:
{
data
:
{
'token'
:
token
'token'
:
token
...
@@ -329,25 +97,6 @@ function h5Page(token, fn) {
...
@@ -329,25 +97,6 @@ function h5Page(token, fn) {
alert
(
'token验证接口数据错误'
);
alert
(
'token验证接口数据错误'
);
}
}
};
};
// if(data === null || data.length === 0){
// //如果是正常的token值,返回的data.data是一个对象,data.data.length是undefined
// //这个时候data.data是空数
// console.warn("token失效");
// try{
// layer.open({
// content: 'token失效,请重新登录',
// skin: 'msg',
// time: 2
// });
// }catch(e){
// alert('token失效,请重新登录');
// }
// return false;
// }else{
// setLoginStorage(data, data.token, data.data.usertable);
// console.log(data);
// fn(data); //回调函数
// }
},
},
error
:
function
()
{
error
:
function
()
{
console
.
warn
(
"获取token失败"
);
console
.
warn
(
"获取token失败"
);
...
@@ -391,73 +140,6 @@ function clearLoginStorage(data, _token, _usertable){
...
@@ -391,73 +140,6 @@ function clearLoginStorage(data, _token, _usertable){
localStorage
.
removeItem
(
'userinfo'
);
localStorage
.
removeItem
(
'userinfo'
);
}
}
//是否退出登录(确认)的方法封装 by xishifeng
function
set_loginout
(){
try
{
layer
.
open
({
content
:
"是否退出当前账号?"
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(){
loginout
();
}
});
}
catch
(
e
){
if
(
confirm
(
"是否退出当前账号?"
)){
loginout
();
}
}
}
//退出登录的方法封装 by xishifeng
function
loginout
(){
var
token
=
localStorage
.
getItem
(
"token"
);
$
.
ajax
({
url
:
ServerHost
+
"/AppTab5/logout"
,
data
:{
"token"
:
token
,
'version'
:
fujuVersion
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
data
){
//删除缓存的用户名,密码,token
var
weixin
=
localStorage
.
getItem
(
"weixin"
);
clearLoginStorage
();
if
(
data
.
status
==
0
){
if
(
weixin
===
"1"
){
window
.
location
.
href
=
"/weixin/binding.php"
;
}
else
{
window
.
location
.
href
=
"/"
+
ServerURl
+
"/login.html?r="
+
Math
.
random
();
}
}
else
{
try
{
layer
.
open
({
content
:
data
.
msg
,
skin
:
'msg'
,
time
:
2
//2秒后自动关闭
});
}
catch
(
e
){
alert
(
data
.
msg
);
}
return
false
;
}
},
error
:
function
(){
console
.
warn
(
'ajax error'
);
try
{
layer
.
open
({
content
:
'网络错误'
,
skin
:
'msg'
,
time
:
2
//2秒后自动关闭
});
}
catch
(
e
){
alert
(
"网络错误"
);
}
}
});
}
//字符串格式化
//字符串格式化
String
.
prototype
.
stringFormat
=
function
(){
String
.
prototype
.
stringFormat
=
function
(){
var
formatted
=
this
;
var
formatted
=
this
;
...
@@ -490,6 +172,5 @@ function hideTel(str){
...
@@ -490,6 +172,5 @@ function hideTel(str){
return
_arr
.
join
(
''
);
return
_arr
.
join
(
''
);
}
else
{
}
else
{
return
str
;
return
str
;
}
}
}
}
\ No newline at end of file
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