Authored by 毕凯

个人中心登录处理

... ... @@ -129,6 +129,7 @@ const index = (params) => {
signinUrl: helpers.urlFormat('/signin.html', {
refer: helpers.urlFormat('/home')
}),
referUrl: helpers.urlFormat('/home'),
verifyUrl: helpers.urlFormat('/activity/student/register')
};
... ...
... ... @@ -20,7 +20,7 @@
{{/unless}}
{{^}}
<div class="user-info">
<a class="login-btn" href="{{signinUrl}}">
<a class="login-btn" href="{{signinUrl}}" data-refer="{{referUrl}}">
登录/注册
</a>
{{#if @root.studentSwitch}}
... ...
... ... @@ -10,6 +10,8 @@ require('common');
let $ = require('yoho-jquery'),
noticeScroll = require('plugin/notice-scroll');
let yohoApp = require('../yoho-app');
let $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
... ... @@ -82,3 +84,10 @@ $('.res-c').on('click', 'a', function() {
}, true);
}
});
$('.login-btn').on('click', function() {
let refer = $(this).data('refer') || '';
yohoApp.goLogin(refer);
return false;
});
... ...
... ... @@ -130,8 +130,13 @@ yoho = {
goLogin: function(refer, data) {
let url;
if (refer.indexOf('//') === 0) {
refer = location.protocol + refer;
}
url = 'http://m.yohobuy.com/signin.html?refer=' + encodeURIComponent(refer);
refer = yoho.parseUrl(refer || location.href);
if (this.isApp) {
url = location.href;
if (this.isAndroid) {
... ...