Authored by weiqingting

优化 登录跳转

... ... @@ -248,23 +248,26 @@ exports.index = (req, res, next) => {
options.loginUrl = '//m.yohobuy.com/activity/student/register';
if (options.isApp) {
if (options.isLogin) {
if (options.isStudent) {
options.loginUrl = false;
} else {
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
}
} else {
// no login
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
}
} else {
if (options.isLogin) {
if (options.isStudent) {
options.loginUrl = false;
}
}
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
}
// if (options.isApp) {
// if (options.isLogin) {
// if (options.isStudent) {
// options.loginUrl = false;
// } else {
// options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
// }
// } else {
// // no login
// options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
// }
// } else {
// if (options.isLogin) {
// if (options.isStudent) {
// options.loginUrl = false;
// }
// }
// }
// console.log(options);
res.render('student', options);
... ... @@ -291,9 +294,12 @@ exports.register = (req, res, next) => {
}
Promise.all([verifiedStudentTotal(), getEducationLevelList()]).then((arr) => {
if (req.__USER__.isStudent) {
refer = '/activity/student?uid=' + req.__USER__.uid;// 所有认证过的,都跳转学生首页
refer = '/activity/student';// 所有认证过的,都跳转学生首页
if(req.__USER__.isApp){
refer = refer + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
}else{
refer = refer + '?uid='+ req.__USER__.uid;
}
res.redirect(helpers.urlFormat(refer));
} else {
res.render('register', {
... ... @@ -413,19 +419,18 @@ exports.isLogin = (req, res, next) => {
next();
return;
}
// refer = decodeURI(req.cookies.refer)||req.get("refer");
//
// if (refer) {
// refer = decodeURI(req.cookies.refer)||req.get("refer");
// } else {
// refer = '/activity/student/register';
// }
//没有登录
if(yoho.isApp){
if(!yoho.isLogin){
url = url + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + yoho.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
res.redirect(url);
}
}
if (req.path === '/student/register' && !yoho.isStudent) {
url = '/activity/student/register';
}
// if (req.path === '/student/register' && !yoho.isStudent) {
// url = '/activity/student/register';
// }
res.redirect(helpers.urlFormat('/signin.html', {
refer: url
}));
... ...
... ... @@ -8,15 +8,19 @@
<div class="mobile-container">
<div class="mobile-wrap yoho-page student">
<section class='s-text'>
<h6>认证资格说明</h6>
<p>1、全日制大学及硕士博士研究生</p>
<p>2、学校在可选范围内,有部分学校可能暂未收录,后期会尽快添加</p>
<p>3、每个学号只能认证一个有货账户</p>
<h6>特权详细说明</h6>
<p>1、学生购买指定商品,可享受9折优惠,与vip折扣不可同时享受,但取低</p>
<p>2、学生购物每一元可赠送1个yoho币</p>
<p>3、学生所在学校购物金额当月累计最高,可获得3个免单名额,每月抽奖</p>
<p>4、不定期学生专享活动</p>
<h6>新品立享9折</h6>
<p>1、学生购买原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受。</p>
<h6>每满100返100有货币</h6>
<p>1、学生购买商品时,商品金额每满100元即可获得100有货币;</p>
<p>2、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>
<p>3、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细</p>
<h6>免单抽奖</h6>
<p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>
<p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>
<p>3、免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p>
<h6>学生专享活动</h6>
<p>1、每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p>
<h6></h6>
</section>
</div>
</div>
... ...