Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
150f4a725d4b0b157df9abee3a7887727ea3f2d1
1 parent
bca682f3
build tip plugin
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
92 additions
and
96 deletions
static/js/guang/info.js
static/js/guang/plus-star.js
static/js/passport/api.js
static/js/passport/back/email-success.js
static/js/passport/back/email.js
static/js/passport/back/mobile.js
static/js/passport/back/new-password.js
static/js/passport/code.js
static/js/passport/login/interational.js
static/js/passport/login/login.js
static/js/passport/register/password.js
static/js/passport/register/register.js
static/js/plugin/tip.js
static/sass/index.scss
static/sass/passport/_common.scss
static/js/guang/info.js
View file @
150f4a7
...
...
@@ -8,7 +8,7 @@ var $ = require('yoho.zepto'),
ellipsis
=
require
(
'mlellipsis'
),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
api
=
require
(
'../api
'
);
var
tip
=
require
(
'../plugin/tip
'
);
ellipsis
.
init
();
...
...
@@ -33,10 +33,10 @@ function initInfosEvt($container) {
if
(
code
===
200
)
{
$likeBtn
.
next
(
'.like-count'
).
text
(
data
.
data
);
}
else
if
(
code
===
400
)
{
api
.
alert
(
'未登录'
);
tip
.
show
(
'未登录'
);
}
},
function
()
{
api
.
alert
(
'网络断开连接了~'
);
tip
.
show
(
'网络断开连接了~'
);
});
});
}
...
...
static/js/guang/plus-star.js
View file @
150f4a7
...
...
@@ -12,7 +12,7 @@ var $intro = $('#intro'),
$imt
=
$
(
'#intro-more-txt'
),
$infosContainer
=
$
(
'#related-infos-container'
);
var
info
Api
=
require
(
'./info'
);
var
info
=
require
(
'./info'
);
var
mIntro
,
aIntro
;
...
...
@@ -30,8 +30,8 @@ setTimeout(function() {
aIntro
=
$intro
.
attr
(
'title'
);
});
infoApi
.
initInfosEvt
(
$infosContainer
);
infoApi
.
setLazyLoadAndMellipsis
(
$infosContainer
.
find
(
'.guang-info'
));
info
.
initInfosEvt
(
$infosContainer
);
info
.
setLazyLoadAndMellipsis
(
$infosContainer
.
find
(
'.guang-info'
));
//文字介绍收起与展开
$
(
'#more-intro'
).
bind
(
'touchstart'
,
function
()
{
...
...
static/js/passport/api.js
View file @
150f4a7
...
...
@@ -25,46 +25,6 @@ var phoneRegx = {
'+61'
:
/^
[
0
-
9
]{
11
}
$
/
};
//错误验证
var
$errTip
,
tipTime
;
/**
* 初始化错误提示
*/
function
initErrTip
()
{
var
errTipHtml
=
'<div id="err-tip" class="err-tip"></div>'
;
//插入错误提示HTML
$
(
'.passport-page'
).
append
(
errTipHtml
);
$errTip
=
$
(
'#err-tip'
);
$errTip
.
on
(
'touchstart'
,
function
()
{
$errTip
.
fadeOut
();
//清除Timeout
clearTimeout
(
tipTime
);
});
}
/**
* 显示错误提示
*/
function
showErrTip
(
content
)
{
if
(
typeof
$errTip
===
'undefined'
)
{
return
;
}
$errTip
.
text
(
content
).
show
();
//若2秒内未点击则自动消失
tipTime
=
setTimeout
(
function
()
{
if
(
$errTip
.
css
(
'display'
)
===
'block'
)
{
$errTip
.
fadeOut
();
}
},
2000
);
}
//密码显示隐藏
function
bindEyesEvt
()
{
var
$hasEye
=
$
(
'.has-eye'
),
...
...
@@ -161,8 +121,6 @@ function selectCssHack($countrySelect) {
module
.
exports
=
{
emailRegx
:
emailRegx
,
phoneRegx
:
phoneRegx
,
initErrTip
:
initErrTip
,
showErrTip
:
showErrTip
,
bindEyesEvt
:
bindEyesEvt
,
bindClearEvt
:
bindClearEvt
,
pwdValidate
:
pwdValidate
,
...
...
static/js/passport/back/email-success.js
View file @
150f4a7
...
...
@@ -8,10 +8,8 @@ var $ = require('yoho.zepto');
var
$resend
=
$
(
'#resend'
);
var
api
=
require
(
'../api'
),
showErrTip
=
api
.
showErrTip
;
api
.
initErrTip
();
var
tip
=
require
(
'../../plugin/tip'
),
showErrTip
=
tip
.
show
;
$resend
.
on
(
'touchstart'
,
function
(
e
)
{
e
.
preventDefault
();
...
...
static/js/passport/back/email.js
View file @
150f4a7
...
...
@@ -9,11 +9,10 @@ var $email = $('#email'),
$btnSure
=
$
(
'#btn-sure'
);
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
api
.
initErrTip
();
var
showErrTip
=
tip
.
show
;
api
.
bindClearEvt
();
...
...
static/js/passport/back/mobile.js
View file @
150f4a7
...
...
@@ -11,11 +11,10 @@ var $phoneNum = $('#phone-num'),
$btnNext
=
$
(
'#btn-next'
);
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
api
.
initErrTip
();
var
showErrTip
=
tip
.
show
;
api
.
bindClearEvt
();
...
...
static/js/passport/back/new-password.js
View file @
150f4a7
...
...
@@ -9,11 +9,10 @@ var $pwd = $('#pwd'),
$btnOk
=
$
(
'#btn-ok'
);
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
api
.
initErrTip
();
var
showErrTip
=
tip
.
show
;
api
.
bindEyesEvt
();
...
...
static/js/passport/code.js
View file @
150f4a7
...
...
@@ -11,9 +11,10 @@ module.exports = function(useInRegister) {
$captchaTip
=
$
(
'#captcha-tip'
);
var
api
=
require
(
'./api'
);
var
tip
=
require
(
'../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
var
showErrTip
=
tip
.
show
;
var
urlMid
=
useInRegister
?
'register'
:
'back'
;
...
...
@@ -31,8 +32,6 @@ module.exports = function(useInRegister) {
},
1000
);
}
api
.
initErrTip
();
api
.
bindClearEvt
();
$captcha
.
bind
(
'input'
,
function
()
{
...
...
static/js/passport/login/interational.js
View file @
150f4a7
...
...
@@ -15,9 +15,10 @@ var $phoneNum = $('#phone-num'),
pwdPass
=
false
;
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
var
showErrTip
=
tip
.
show
;
//登录按钮状态切换
function
switchLoginBtnStatus
()
{
...
...
@@ -31,9 +32,6 @@ function switchLoginBtnStatus() {
//Android-UC下显示select的direction:rtl无效的临时解决办法
api
.
selectCssHack
(
$countrySelect
);
//初始化ErrTip
api
.
initErrTip
();
//显示隐藏密码
api
.
bindEyesEvt
();
...
...
static/js/passport/login/login.js
View file @
150f4a7
...
...
@@ -16,9 +16,10 @@ var $account = $('#account'),
pwdPass
=
false
;
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
var
showErrTip
=
tip
.
show
;
//登录按钮状态切换
function
switchLoginBtnStatus
()
{
...
...
@@ -41,9 +42,6 @@ function hideRetrivePanel() {
$ways
.
slideUp
();
}
//初始化ErrTip
api
.
initErrTip
();
//密码显示与隐藏
api
.
bindEyesEvt
();
...
...
static/js/passport/register/password.js
View file @
150f4a7
...
...
@@ -9,11 +9,10 @@ var $pwd = $('#pwd'),
$btnSure
=
$
(
'#btn-sure'
);
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
api
.
initErrTip
();
var
showErrTip
=
tip
.
show
;
api
.
bindEyesEvt
();
...
...
static/js/passport/register/register.js
View file @
150f4a7
...
...
@@ -11,11 +11,10 @@ var $phoneNum = $('#phone-num'),
$btnNext
=
$
(
'#btn-next'
);
var
api
=
require
(
'../api'
);
var
tip
=
require
(
'../../plugin/tip'
);
var
trim
=
$
.
trim
;
var
showErrTip
=
api
.
showErrTip
;
api
.
initErrTip
();
var
showErrTip
=
tip
.
show
;
api
.
bindClearEvt
();
...
...
static/js/plugin/tip.js
0 → 100644
View file @
150f4a7
/**
* 弹框提示
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var
$
=
require
(
'yoho.zepto'
);
var
$tip
,
tipItime
;
/**
* 初始化提示框
*/
(
function
()
{
var
tipHtml
=
'<div id="yoho-tip" class="yoho-tip"></div>'
;
//插入提示HTML
$
(
'.yoho-page'
).
append
(
tipHtml
);
$tip
=
$
(
'#yoho-tip'
);
$tip
.
on
(
'touchstart'
,
function
()
{
$tip
.
hide
();
//清除Timeout
clearTimeout
(
tipItime
);
});
}());
/**
* 显示提示
*/
function
show
(
con
,
dur
)
{
var
content
,
duration
;
if
(
typeof
con
===
'undefined'
)
{
return
;
}
content
=
con
.
toString
();
duration
=
(
dur
&&
dur
>
0
)
?
dur
:
2000
;
$tip
.
text
(
content
).
show
();
tipItime
=
setTimeout
(
function
()
{
if
(
$tip
.
css
(
'display'
)
===
'block'
)
{
$tip
.
hide
();
}
},
duration
);
}
exports
.
show
=
show
;
\ No newline at end of file
...
...
static/sass/index.scss
View file @
150f4a7
...
...
@@ -66,4 +66,22 @@ a {
-moz-osx-font-smoothing
:
grayscale
;
}
.yoho-tip
{
position
:
absolute
;
display
:
none
;
text-align
:
center
;
width
:
70%
;
padding
:
34px
0
;
top
:
50%
;
left
:
50%
;
margin-left
:
-35%
;
margin-top
:
-45px
;
background-color
:
#000
;
opacity
:
0
.7
;
color
:
#fff
;
font-size
:
18px
;
border
:
none
;
@include
border-radius
(
10px
);
}
@import
"layout/header"
,
"layout/footer"
,
"good"
,
"passport/index"
,
"guang/index"
;
\ No newline at end of file
...
...
static/sass/passport/_common.scss
View file @
150f4a7
...
...
@@ -159,22 +159,4 @@ body.passport-body {
.row
{
margin-bottom
:
10px
;
}
.err-tip
{
position
:
absolute
;
display
:
none
;
text-align
:
center
;
width
:
70%
;
padding
:
34px
0
;
top
:
50%
;
left
:
50%
;
margin-left
:
-35%
;
margin-top
:
-45px
;
background-color
:
#000
;
opacity
:
0
.7
;
color
:
#fff
;
font-size
:
18px
;
border
:
none
;
@include
border-radius
(
10px
);
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment