Authored by 杨延青

Merge branch 'feature/wechatLogin' into 'release/0110'

wechat quick login



See merge request !1655
... ... @@ -182,6 +182,19 @@ const common = {
}
next();
},
wechatQuickLoginCheck: (req, res, next) => {
let refer = req.query.refer;
// 仅yoluck业务展示快捷登陆引导页
if (req.yoho.isWechat && refer && refer.indexOf('activity/yoluck') > 0) {
_.assign(res.locals, {
wechatQuickLoginRefer: encodeURIComponent(refer),
useWechatQuickLogin: true
});
}
next();
},
clearCookie: (req, res, next) => {
res.clearCookie('_SESSION_KEY', {
domain: 'yohobuy.com'
... ...
... ... @@ -147,6 +147,7 @@ const loginNew = new LoginNew();
router.get('/passport/login',
login.common.clearCookie,
login.common.wechatQuickLoginCheck,
validateCode.load,
login.common.beforeLogin,
loginNew.loginPage); // 普通登录
... ... @@ -164,6 +165,7 @@ router.post('/passport/register-new',
reg.register); // 注册请求
router.get('/passport/sms_login',
login.common.clearCookie,
login.common.wechatQuickLoginCheck,
validateCode.load,
smsLogin.smsLoginPage); // 短信验证码登录
router.post('/passport/sms_login/step1_check', validateCode.check, smsLogin.indexCheck);
... ... @@ -174,6 +176,7 @@ router.get('/signin.html',
login.common.thirdLogin,
// login.common.weixinCheck,
login.common.wechatQuickLoginCheck,
validateCode.load,
login.common.beforeLogin,
smsLogin.smsLoginPage); // 短信验证码登录
... ... @@ -181,6 +184,7 @@ router.get('/signin.html',
router.get('/signin.htm',
login.common.clearCookie,
login.common.thirdLogin,
login.common.wechatQuickLoginCheck,
validateCode.load,
login.common.beforeLogin,
smsLogin.smsLoginPage); // 短信验证码登录
... ...
... ... @@ -26,7 +26,7 @@
<a id="getPswrdBtn" href="javascript:void(0);">忘记密码?</a>
</div>
</form>
{{!-- <div class="third-party-login">
{{!-- <div class="third-party-login">
<div class="tip-box">
<span class="left-line"></span>
<span class="tip">使用第三方登录</span>
... ... @@ -48,4 +48,5 @@
<a class="by-mobile" onclick="location.href='{{phoneRetriveUrl}}'">手机找回</a>
</div>
</div>
{{> passport/wechat-quick-login}}
</div>
... ...
... ... @@ -35,7 +35,7 @@
<a id="getPswrdBtn" href="javascript:void(0);">忘记密码?</a>
</div>
</form>
{{!-- <div class="third-party-login">
{{!-- <div class="third-party-login">
<div class="tip-box">
<span class="left-line"></span>
<span class="tip">使用第三方登录</span>
... ... @@ -56,4 +56,5 @@
<a class="by-mobile" onclick="location.href='{{phoneRetriveUrl}}'">手机找回</a>
</div>
</div>
{{> passport/wechat-quick-login}}
</div>
... ...
{{#if @root.useWechatQuickLogin}}
<div class="wechat-quick-wrap">
<div class="quick-login-main">
<div class="quick-login-logo"></div>
<div class="local-login-btn quick-btn">使用有货账号登录</div>
<div class="quick-login-btn quick-btn">
<a href="/passport/login/wechat?refer={{@root.wechatQuickLoginRefer}}">微信快捷登录</a>
</div>
</div>
</div>
{{/if}}
... ...
... ... @@ -14,6 +14,8 @@ const validate = new Validate($captcha, {
}
});
require('./wechat-quick-login');
class Login {
constructor() {
this.view = {
... ...
const $ = require('yoho-jquery');
(function() {
let $quickWrap = $('.wechat-quick-wrap');
if (!$quickWrap.length) {
return;
}
$quickWrap.on('click', '.local-login-btn', function() {
$quickWrap.hide();
});
}());
... ...
... ... @@ -13,6 +13,8 @@ const validate = new Validate($captcha, {
}
});
require('../login/wechat-quick-login');
class SmsLoginNew extends Page {
constructor() {
super();
... ...
@import "~scss/layout/img-check";
@import "wechat-quick-login";
@mixin banner-box-elem {
position: absolute;
... ...
@import "~scss/layout/img-check";
@import "wechat-quick-login";
@mixin banner-box-elem {
position: absolute;
... ...
.wechat-quick-wrap {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #fff;
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
.quick-login-main {
width: 100%;
margin-top: -50px;
}
.quick-login-logo {
width: 372px;
height: 374px;
background-image: url("img/passport/quick-login-logo.png");
background-size: 100% 100%;
margin: auto;
margin-bottom: 180px;
}
.quick-btn {
width: 68%;
height: 80px;
color: #fff;
line-height: 82px;
background-color: #444;
margin: 30px auto;
text-align: center;
border-radius: 40px;
overflow: hidden;
a {
width: 100%;
color: #fff;
display: block;
}
}
}
... ...