Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d24f6ec8
authored
Oct 16, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
微信登录
parent
709a96db
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
21 deletions
Application/Passport/View/Login/index.html
dist/js/person/login.js
Application/Passport/View/Login/index.html
View file @
d24f6ec8
...
...
@@ -16,36 +16,45 @@
<p
class=
"t2"
>
让询报价更轻松、便捷
</p>
</div>
<!--微信绑定-->
<div
class=
"wechat"
style=
"display: none"
>
<a
href=
"
javascript:;
"
class=
"btn"
>
<div
class=
"wechat"
>
<a
href=
"
authapi/v1/weixin/web/login
"
class=
"btn"
>
<i
class=
"iconfont iconjuxing22 va-m"
></i>
<span
class=
"va-m"
>
微信登录
</span>
</a>
<p
class=
"tab-sel"
>
<a
href=
"
javascript:;
"
>
验证码登录
</a>
<a
href=
"
javascript:;
"
>
密码登录
</a>
<a
href=
"
passporticsales?flag=verify
"
>
验证码登录
</a>
<a
href=
"
passporticsales?flag=password
"
>
密码登录
</a>
</p>
</div>
<!--绑定手机号-->
<div
class=
"bind-mobile layui-form"
style=
"display: none"
>
<form
class=
"bind-mobile layui-form"
style=
"display: none"
onsubmit=
"return false"
>
<input
type=
"hidden"
name=
"code_type"
value=
"2"
>
<div
class=
"input-wrap"
>
<i
class=
"iconfont iconjuxing23 va-m"
></i>
<input
type=
"text"
class=
"w w1 va-m"
placeholder=
"请输入手机号"
>
<input
type=
"text"
class=
"w w1 va-m"
placeholder=
"请输入手机号"
name=
"mobile"
>
<div
class=
"sel lineBlock va-m"
>
<select
name=
"interest"
>
<select>
<option
value=
"0"
>
大陆 +86
</option>
</select>
</div>
</div>
<!--验证码-->
<div
class=
"input-wrap"
id=
"verifiCode"
style=
"display: none"
>
<i
class=
"iconfont iconjuxing26 va-m"
></i>
<input
type=
"text"
class=
"w w1 va-m"
name=
"captcha"
placeholder=
"请输入图形验证码"
/>
<input
type=
"hidden"
class=
"w w1 va-m"
name=
"captchaUuid"
value=
""
/>
<img
src=
""
alt=
""
width=
"100"
height=
"30"
class=
"lineBlock va-m codepic"
/>
</div>
<div
class=
"input-wrap"
>
<i
class=
"iconfont iconjuxing26 va-m"
></i>
<input
type=
"text"
class=
"w w1 va-m"
placeholder=
"请输入手机
号
"
>
<
span
class=
"lineBlock text va-m"
>
发送验证码
</span
>
<input
type=
"text"
class=
"w w1 va-m"
placeholder=
"请输入手机
验证码"
name=
"smsCode
"
>
<
input
type=
"button"
name=
"codetext"
class=
"lineBlock text va-m"
value=
"发送验证码"
style=
"background: none;"
/
>
</div>
<div
class=
"btn-wrap"
>
<a
href=
"javascript:;"
class=
"btn"
>
绑定手机号
</a>
</div>
<a
href=
"javascript:;"
class=
"btn"
lay-submit
lay-filter=
"bindMobile"
>
绑定手机号
</a>
</div>
</form>
<!--验证码登录-->
<form
class=
"verify-code layui-form"
style=
"display: none"
onsubmit=
"return false"
>
<input
type=
"hidden"
name=
"code_type"
value=
"2"
>
...
...
@@ -83,7 +92,7 @@
</div>
</form>
<!--密码登录-->
<form
class=
"login layui-form"
onsubmit=
"return false"
>
<form
class=
"login layui-form"
style=
"display: none"
onsubmit=
"return false"
>
<div
class=
"input-wrap"
>
<i
class=
"iconfont iconjuxing23 va-m"
></i>
<input
type=
"text"
class=
"w w1 va-m"
placeholder=
"请输入手机号"
name=
"mobile"
>
...
...
dist/js/person/login.js
View file @
d24f6ec8
...
...
@@ -14,8 +14,31 @@
$
(
".verify-code"
).
show
();
$
(
".wechat"
).
hide
();
$
(
".login"
).
hide
();
break
;
case
'password'
:
$
(
".verify-code"
).
hide
();
$
(
".wechat"
).
hide
();
$
(
".login"
).
show
();
break
;
case
'bindmobile'
:
$
(
".verify-code"
).
hide
();
$
(
".wechat"
).
hide
();
$
(
".login"
).
hide
();
$
(
".bind-mobile"
).
show
();
break
;
}
...
...
@@ -26,12 +49,12 @@
return
this
;
},
getCode
:
function
(
opt
,
type
,
params
)
{
getCode
:
function
(
opt
,
type
,
params
,
element
)
{
var
$verifiCode
=
$
(
"#verifiCode"
),
$code
=
$
(
'input[name="code"]'
),
$codetext
=
$
(
'input[name="codetext"]'
),
$codepic
=
$
(
'.codepic'
);
var
$verifiCode
=
element
.
parents
(
'.layui-form'
).
find
(
"#verifiCode"
),
$code
=
element
.
parents
(
'.layui-form'
).
find
(
'input[name="code"]'
),
$codetext
=
element
.
parents
(
'.layui-form'
).
find
(
'input[name="codetext"]'
),
$codepic
=
element
.
parents
(
'.layui-form'
).
find
(
'.codepic'
);
if
(
type
==
'captchaInfo'
)
{
...
...
@@ -101,6 +124,7 @@
calcForm
:
function
(
ele
,
type
)
{
var
$mobile
=
$
(
ele
).
find
(
'input[name="mobile"]'
),
$password
=
$
(
ele
).
find
(
'input[name="password"]'
),
$smsCode
=
$
(
ele
).
find
(
'input[name="smsCode"]'
),
$code
=
$
(
ele
).
find
(
'input[name="code"]'
);
...
...
@@ -145,6 +169,13 @@
}
if
(
!
$smsCode
.
val
()
&&
type
===
3
)
{
$smsCode
.
parent
(
'.input-wrap'
).
addClass
(
'error'
);
return
false
;
}
$
(
'.error'
).
removeClass
(
'error'
);
...
...
@@ -156,15 +187,15 @@
//发送验证码
$
(
document
).
on
(
'click'
,
'input[name="codetext"]'
,
function
()
{
var
$verifiCode
=
$
(
"#verifiCode"
),
var
$verifiCode
=
$
(
this
).
parents
(
'.layui-form'
).
find
(
"#verifiCode"
),
captchaUuid
=
$verifiCode
.
find
(
'input[name="captchaUuid"]'
).
val
(),
captcha
=
$verifiCode
.
find
(
'input[name="captcha"]'
).
val
(),
mobile
=
$
(
'input[name="mobile"]'
).
val
();
mobile
=
$
(
this
).
parents
(
'.layui-form'
).
find
(
'input[name="mobile"]'
).
val
();
//判断是否有图形验证码id
if
(
!
captchaUuid
)
{
opt
.
getCode
(
opt
,
'captchaInfo'
);
opt
.
getCode
(
opt
,
'captchaInfo'
,
null
,
$
(
this
)
);
}
else
{
...
...
@@ -177,7 +208,7 @@
code_type
:
2
};
opt
.
getCode
(
opt
,
'mobile'
,
params
);
opt
.
getCode
(
opt
,
'mobile'
,
params
,
$
(
this
)
);
}
...
...
@@ -368,6 +399,62 @@
}
});
//微信提交
layui
.
form
.
on
(
'submit(bindMobile)'
,
function
(
data
)
{
if
(
opt
.
calcForm
(
data
.
form
,
3
))
{
$
(
data
.
elem
).
addClass
(
"layui-btn-disabled"
);
if
(
!
opt
.
isClick
)
{
opt
.
isClick
=
true
;
var
code
=
Util
.
getRequest
(
'code'
);
var
params
=
$
.
extend
({},
data
.
field
,
{
code
:
code
});
IcController
.
getData
(
apis
.
mobileBind
,
'GET'
,
params
,
function
(
res
)
{
if
(
res
.
errcode
===
0
)
{
//注入token
Util
.
setCookie
(
'token'
,
res
.
data
.
access_token
,
1
,
cookieHostname
);
Util
.
setCookie
(
'user_id'
,
res
.
data
.
user_id
,
1
,
cookieHostname
);
window
.
location
.
href
=
home_url
;
}
else
if
(
res
.
errcode
===
505
)
{
$
(
".error-text"
).
hide
();
layer
.
confirm
(
'账户被禁用,请联系0755-23940717,进行解禁'
,
{
btn
:
[
'取消'
,
'联系客服'
]
},
function
()
{
layer
.
closeAll
();
},
function
()
{
layer
.
msg
(
'0755-23940717'
,
{
time
:
8000
});
});
opt
.
isClick
=
false
;
$
(
data
.
elem
).
removeClass
(
"layui-btn-disabled"
);
}
else
{
layer
.
msg
(
res
.
errmsg
);
opt
.
isClick
=
false
;
$
(
data
.
elem
).
removeClass
(
"layui-btn-disabled"
);
}
});
}
}
});
$
(
"body"
).
keydown
(
function
()
{
...
...
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