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');
... ... @@ -237,4 +241,4 @@ $cartNav.on('touchstart', 'li', function(e) {
});
//提前触发lazyload
$(window).scrollTop(1).scrollTop(0);
\ No newline at end of file
$(window).scrollTop(1).scrollTop(0);
... ...
... ... @@ -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,7 +31,14 @@ class IndexController extends AbstractAction
{
$uid = $this->getUid($useSession);
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
$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))));
}
}
}
... ... @@ -551,7 +558,7 @@ class IndexController extends AbstractAction
$deliveryId = $this->get('deliveryId', ''); //配送方式,1表示普通快递,2表示顺丰速运
$paymentType = $this->get('paymentType', ''); //支付方式,1表示在线支付,2表示货到付款
$couponCode = $this->get('couponCode', ''); //优惠券码
$yohoCoin = $this->get('yohoCoin', ''); //使用的YOHO币数量
$yohoCoin = $this->get('yohoCoin', ''); //使用的YOHO币数量
$data = CartModel::getPackageInfo($uid, $cartType, $skuList, $orderCode, $sessionKey, $deliveryId, $paymentType, $couponCode, $yohoCoin);
... ...