Authored by 毕凯

优化微信登录

... ... @@ -190,6 +190,10 @@ if ($('.freebie').length > 0) {
});
}
if (/MicroMessenger/i.test(navigator.userAgent)) {
$('.btn-login').attr('href', '/passport/login/wechat?refer=' + location.href);
}
$('.btn-balance').on('touchend', function() {
var info = window.cookie('order-info');
... ...
... ... @@ -146,13 +146,22 @@ function reMarginFooter(fixedElement) {
var backToTopHammer;
var loginUrl;
rePosFooter(); //计算底部位置
if (user === 0) {
if (/MicroMessenger/i.test(navigator.userAgent)) {
loginUrl = '//m.yohobuy.com/passport/login/wechat?refer=' + location.href;
$('.login-btn').attr('href', loginUrl);
} else {
loginUrl = '//m.yohobuy.com/signin.html?refer=' + location.href;
}
//未登录
$op.prepend(
'<a href="//m.yohobuy.com/signin.html?refer=' + location.href + '">登录</a>' +
'<a href="' + loginUrl + '">登录</a>' +
'<span class="sep-line">|</span>' +
'<a href="//m.yohobuy.com/reg.html">注册</a>'
);
... ... @@ -308,6 +317,3 @@ window.getShoppingKey = getShoppingKey;
window.rePosFooter = rePosFooter;
window.reMarginFooter = reMarginFooter;
... ...
... ... @@ -7,8 +7,8 @@
<div class="content">
{{#if bindPwd}}
<div class="bind-tip">
<p class="title">绑定成功!</p>
您以后还可以使 机号+密码的形式登录有货哦!
<p class="title">绑定成功!</p>
您以后还可以使手机号+密码的形式登录有货哦!
</div>
{{/if}}
<div class="input-container row has-eye">
... ...
... ... @@ -31,9 +31,16 @@ class IndexController extends AbstractAction
{
$uid = $this->getUid($useSession);
if (!$uid) {
$isWeixin = stripos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false;
if ($isWeixin) {
$this->go(Helpers::url('/passport/login/wechat', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
}
else {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
}
}
}
/*
* 购物车首页
... ...