Authored by 毕凯

Merge branch 'feature/loginview' into 'release/6.0.1'

inviteCode



See merge request !844
... ... @@ -11,7 +11,7 @@ class Reg {
/**
* 注册页面
*/
regPage(req, res) {
regPage(req, res, next) {
if (req.user.uid) {
return res.redirect(req.get('refer') || '/');
}
... ... @@ -47,13 +47,26 @@ class Reg {
if (req.session.phoneReg.count == null) { // eslint-disable-line
req.session.phoneReg.count = 5;
}
res.render('reg/reg-new', {
module: 'passport',
page: 'reg-new',
localCss: true,
width750: true,
countrys: RegService.getAreaData() // 地区信息列表
});
co(function* () {
let inviteValue = '';
let inviteCode = req.query.inviteCode;
if (inviteCode) {
let inviteUserInfo = yield RegService.inviteUserInfo(inviteCode);
inviteValue = _.get(inviteUserInfo, 'data.trendWord', inviteCode);
}
res.render('reg/reg-new', {
module: 'passport',
page: 'reg-new',
localCss: true,
width750: true,
inviteValue: inviteValue,
countrys: RegService.getAreaData() // 地区信息列表
});
})().catch(next);
}
/**
... ...
... ... @@ -114,6 +114,16 @@ const RegService = {
}
return api.post('', params);
},
/**
* 好友邀请信息
*/
inviteUserInfo(inviteCode) {
return api.get('', {
method: 'app.invitecode.userinfo',
inviteCode: inviteCode
});
}
};
... ...
... ... @@ -25,7 +25,7 @@
id="passwordEyeIcon" class="eye"><i class="iconfont eye-close">&#xe716;</i><i class="iconfont eye-open hide">&#xe714;</i></span>
</div>
<div class="form-group invite-code">
<label for="inviteCode" class="iconfont">&#xe71e;</label><input type="text" name="inviteCode" placeholder="好友潮流口令(非必填)" autocomplete="off">
<label for="inviteCode" class="iconfont">&#xe71e;</label><input type="text" name="inviteCode" placeholder="好友潮流口令(非必填)" autocomplete="off" value="{{inviteValue}}">
</div>
<input name="token" type="hidden" value="{{token}}">
<div data-geetest="{{useGeetest}}" id="js-img-check"{{#unless useGeetest}} class="full-img-verify"{{/unless}}></div>
... ...