Authored by 陈峰

merge

... ... @@ -342,6 +342,8 @@ exports.modifyMobile = (req, res, next) => {
exports.newSendMsg = (req, res, next) => {
let mobile = req.body.mobile;
let area = req.body.area || '86';
let captcha = req.body.verifyCode;
let sessionId = req.session.id;
if (!area || !mobile) {
return res.json({
... ... @@ -350,7 +352,7 @@ exports.newSendMsg = (req, res, next) => {
});
}
req.ctx(accountModel).newSendMsg(area, mobile).then(result => {
req.ctx(accountModel).newSendMsg(area, mobile, sessionId, captcha).then(result => {
return res.json(result);
}).catch(next);
};
... ...
... ... @@ -78,7 +78,14 @@ exports.verifyEmail = (req, res, next) => {
* 发验证码
*/
exports.smsBind = (req, res, next) => {
req.ctx(meGiftService).smsBind(req.body).then(result => {
let mobile = req.body.mobile;
let area = req.body.area || '86';
let captcha = req.body.verifyCode;
let sessionId = req.session.id;
req.ctx(meGiftService).smsBind({
area, mobile, captcha, id: sessionId
}).then(result => {
res.json(result);
}).catch(next);
};
... ...
... ... @@ -230,12 +230,15 @@ module.exports = class extends global.yoho.BaseModel {
}
newSendMsg(area, mobile) {
newSendMsg(area, mobile, id, captcha) {
return this.get({
data: {
method: 'app.bind.sendChangeBindMobileCodeOnly',
method: 'app.bind.sendChangeBindMobileCodeOnlyImg',
mobile: mobile,
area: area,
udid: id,
fromPage: PAGE,
degrees: captcha
}
});
}
... ...
... ... @@ -1089,8 +1089,8 @@ module.exports = class extends global.yoho.BaseModel {
}
async newSendMsg(area, mobile) {
return new AccountApi(this.ctx).newSendMsg(area, mobile);
async newSendMsg(area, mobile, sessionId, captcha) {
return new AccountApi(this.ctx).newSendMsg(area, mobile, sessionId, captcha);
}
async newBindCheck(area, mobile, code) {
... ...
... ... @@ -24,7 +24,6 @@ module.exports = class extends global.yoho.BaseModel {
catchs: ['/home/orders', '/home/index', '/home/orders/detail']},
{name: '我的收藏', href: '/home/favorite', catchs: ['/home/favorite/reduction']},
{name: '我的有货币', href: '/home/currency'},
{name: '我的红包', href: '/home/redenvelopes'},
{name: '我的优惠券', href: '/home/coupons'},
{name: '我的邀请好友', href: '/home/spread'},
{name: '我的礼品卡', href: '/home/megift'},
... ...
'use strict';
const PAGE = 'pc';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
... ... @@ -119,11 +121,14 @@ module.exports = class extends global.yoho.BaseModel {
* @param {[type]} mobile [手机号]
* @return {[type]} [{}]
*/
smsbind(area, mobile) {
smsbind(area, mobile, id, captcha) {
let options = {
method: 'app.passport.smsbind',
area: area,
mobile: mobile
mobile: mobile,
udid: id,
fromPage: PAGE,
degrees: captcha
};
return this.get({data: options});
... ...
... ... @@ -144,7 +144,7 @@ module.exports = class extends global.yoho.BaseModel {
message: '<p>绑定失败,该手机号已被绑定</p><p>请更换手机号</p>'
};
}
return this.meGiftAPi.smsbind(params.area, params.mobile);
return this.meGiftAPi.smsbind(params.area, params.mobile, params.id, params.captcha);
});
}
... ...
... ... @@ -251,7 +251,7 @@ router.post('/account/sendmobilemsg', captcha.requiredAPI, AccountController.sen
// 手机号验证第二步
router.post('/account/modifymobile', AccountController.modifyMobile);
router.post('/account/mobilesendmsg', AccountController.newSendMsg);
router.post('/account/mobilesendmsg', captcha.requiredAPI, AccountController.newSendMsg);
router.post('/account/mobilecheck', AccountController.newBindCheck);
// 地址管理
... ... @@ -283,11 +283,11 @@ router.post('/invoice/supply', invoiceController.supply);
router.get('/newuser', newUserController.check);
// 我的礼品卡
router.get('/megift', tabsMiddleware.getCommonHeader, meGiftController.index);
router.get('/megift', captcha.required, tabsMiddleware.getCommonHeader, meGiftController.index);
router.post('/megift/sendEmailCode', meGiftController.sendEmailCode);// 发送邮箱验证码
router.post('/megift/verifyEmail', meGiftController.verifyEmail);// 验证邮箱验证码
// 检查是否绑定手机号、发验证码
router.post('/megift/smsBind', meGiftController.smsBind);
router.post('/megift/smsBind', captcha.requiredAPI, meGiftController.smsBind);
router.post('/megift/changeMobile', meGiftController.changeMobile);// 修改绑定手机
router.post('/megift/activateGift', meGiftController.activateGift);// 激活礼品卡
router.get('/megift/detail', meGiftController.detail);// 消费明细
... ...
... ... @@ -41,6 +41,7 @@
</div>
</div>
</div>
{{> gee-captcha}}
{{!-- 验证邮箱模板 --}}
<script id="verify-email-tpl" type="text/html">
... ... @@ -78,6 +79,9 @@
</span>
<input type="text" placeholder="请输入手机号" class="right mobile" />
</div>
<div class="gift-group">
<div class="captcha-wrap"></div>
</div>
<div class="gift-group bind-mobile-input">
<input type="text" placeholder="短信验证码" class="left mobile-code" />
<span class="right mobile-btn">获取短信验证码</span>
... ...
... ... @@ -43,6 +43,10 @@
{{#if mobileCode}}
{{#if_cond step '===' 2}}
<!-- 这部分是手机验证第二部,需要不同的验证码 -->
<li class="user-form-li captcha-li {{#unless @root.captcha.value}}hide{{/unless}}">
<div class="safe-form-l">图形验证码:</div>
<div class="captcha-safe-form-r"></div>
</li>
<li class="user-form-li">
<div class="safe-form-l">手机验证码:</div>
<div class="safe-form-r">
... ...
... ... @@ -68,8 +68,10 @@ const bind = {
sendBindMsg: (req, res, next) => {
let mobile = req.body.mobile;
let area = req.body.area;
let sessionId = req.session.id;
let captcha = req.body.verifyCode;
req.ctx(BindService).sendBindMsg(area, mobile).then(result => {
req.ctx(BindService).sendBindMsg(area, mobile, sessionId, captcha).then(result => {
if (result && result.code) {
return res.json(result);
} else {
... ...
... ... @@ -84,8 +84,10 @@ const cert = {
sendCertMsg: (req, res, next) => {
let mobile = req.body.mobile;
let area = req.body.area;
let sessionId = req.session.id;
let captcha = req.body.verifyCode;
req.ctx(CertService).sendCertMsg(mobile, area).then(result => {
req.ctx(CertService).sendCertMsg(mobile, area, sessionId, captcha).then(result => {
if (result && result.code) {
return res.json(result);
} else {
... ...
... ... @@ -5,16 +5,21 @@
* @date 2016/06/21
*/
const PAGE = 'pc';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
sendBindMsg(area, mobile) {
sendBindMsg(area, mobile, id, captcha) {
let params = {
method: 'app.bind.sendThirdBindMobileCodeOnly',
method: 'app.bind.sendThirdBindMobileCodeOnlyImg',
mobile: mobile,
area: area,
udid: id,
fromPage: PAGE,
degrees: captcha
};
return this.get({data: params});
... ...
... ... @@ -4,6 +4,8 @@
'use strict';
const PAGE = 'pc';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
... ... @@ -27,11 +29,14 @@ module.exports = class extends global.yoho.BaseModel {
return this.get({data: params});
}
sendCertMsg(mobile, area) {
sendCertMsg(mobile, area, id, captcha) {
let params = {
method: 'app.bind.sendChangeBindMobileCodeOnly',
method: 'app.bind.sendChangeBindMobileCodeOnlyImg',
mobile: mobile,
area: area,
udid: id,
fromPage: PAGE,
degrees: captcha
};
return this.get({data: params});
... ...
... ... @@ -62,16 +62,16 @@ router.get('/passport/autosign/renren', login.common.beforeLogin, login.renren.l
router.get('/passport/login/renren/callback', login.renren.callback);
// 第三方登录后绑定手机号
router.get('/passport/thirdlogin/index', bind.indexPage);
router.get('/passport/thirdlogin/index', captcha.required, bind.indexPage);
router.get('/passport/thirdlogin/bindsuccess', bind.bindSuccess);
router.post('/passport/autouserinfo/sendBindMsg', bind.sendBindMsg);
router.post('/passport/autouserinfo/sendBindMsg', captcha.requiredAPI, bind.sendBindMsg);
router.post('/passport/autouserinfo/bindMobile', bind.bindMobile);
// 未实名认证的老邮箱用户登录绑定手机号
router.get('/passport/cert/index', cert.index); /** 输入手机号码页面 **/
router.get('/passport/cert/index', captcha.required, cert.index); /** 输入手机号码页面 **/
router.get('/passport/cert/success', cert.success); /** 成功提示页面 **/
router.post('/passport/cert/check', cert.check);
router.post('/passport/cert/sendCertMsg', cert.sendCertMsg);
router.post('/passport/cert/sendCertMsg', captcha.requiredAPI, cert.sendCertMsg);
router.post('/passport/cert/certMobile', cert.certMobile);
/**
... ...
... ... @@ -42,6 +42,11 @@
</div>
</div>
</div>
<div class="yohobindrow captcha">
<div class="name phonetag"></div>
<div class="content captcha-wrap">
</div>
</div>
<div class="yohobindrow">
<div class="name phonetag">验证码</div>
<div class="content">
... ... @@ -78,3 +83,5 @@
<a href="javascript:void(0)" class="yohobindbtn" id="bindfirststep">下一步</a>
</div>
</div>
{{> gee-captcha}}
\ No newline at end of file
... ...
... ... @@ -40,6 +40,11 @@
</div>
</div>
</div>
<div class="yohobindrow captcha">
<div class="name phonetag"></div>
<div class="content captcha-wrap">
</div>
</div>
<div class="yohobindrow">
<div class="name phonetag">验证码</div>
<div class="content">
... ... @@ -76,3 +81,5 @@
<a href="javascript:void(0)" class="yohobindbtn left" id="bindfirststep">下一步</a>
</div>
</div>
{{> gee-captcha}}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@
'use strict';
const Promise = require('bluebird');
const _ = require('lodash');
const co = Promise.coroutine;
const Api = require('./detail-consult-api');
... ... @@ -26,8 +27,7 @@ module.exports = class extends global.yoho.BaseModel {
if (!consultList.code || consultList.code !== 200) {
return [];
}
return consultList.data.list.map(value => {
return _.get(consultList, 'data.list', []).map(value => {
return {
avatar: detailHelper.DEFAULT_AVATAR_ICO,
question: value.ask,
... ... @@ -38,7 +38,7 @@ module.exports = class extends global.yoho.BaseModel {
like: parseInt(value.like, 10),
isUseful: value.is_useful === 'Y',
useful: parseInt(value.useful, 10),
totakl: value.total
total: value.total
};
});
... ...
... ... @@ -102,7 +102,7 @@ router.post('/detail/notify/cancel', auth, notify.cancel); // 删
// 全球购routers
router.get('/list/global', '/list/global', globalCtrl.list); // 全球购列表页
router.get('/list/global/:pathQs','/list/global/:pathQs', paramParse, globalCtrl.list); // 全球购列表页
router.get('/list/global/:pathQs', '/list/global/:pathQs', paramParse, globalCtrl.list); // 全球购列表页
router.get('/global/list', globalCtrl.list); // 全球购列表页 【老路由,待删】
router.get('/global/detail', globalCtrl.detail);
router.get(/\/global\/([\d]+)(.*)/, globalCtrl.detail);
... ...
... ... @@ -27,55 +27,48 @@ const channelMap = {
const sortMap = {
boys: [
{misort: 18, viewNum: 5},
{misort: 20, viewNum: 5},
{misort: 16, viewNum: 5},
{misort: 21, viewNum: 5},
{misort: 44, viewNum: 5},
{misort: 26, viewNum: 5},
{misort: 27, viewNum: 5},
{misort: 1900, viewNum: 5},
{misort: 12, viewNum: 5},
{misort: 45, viewNum: 5},
{misort: 1892, viewNum: 5},
{misort: 1896, viewNum: 5},
{misort: 49, viewNum: 5},
{misort: 60, viewNum: 5},
{misort: 1896, viewNum: 5},
{misort: 39, viewNum: 5},
{misort: 59, viewNum: 5}
{misort: 61, viewNum: 5},
{misort: 59, viewNum: 5},
{misort: 65, viewNum: 5},
],
girls: [
{misort: 18, viewNum: 4},
{misort: 20, viewNum: 4},
{misort: 21, viewNum: 4},
{misort: 16, viewNum: 4},
{misort: 1900, viewNum: 4},
{misort: 1892, viewNum: 4},
{misort: 21, viewNum: 4},
{misort: 32, viewNum: 4},
{misort: 12, viewNum: 4},
{misort: 26, viewNum: 4},
{misort: 27, viewNum: 4},
{misort: 31, viewNum: 4},
{misort: 1896, viewNum: 4},
{misort: 44, viewNum: 4},
{misort: 27, viewNum: 4},
{misort: 26, viewNum: 4},
{misort: 45, viewNum: 4},
{misort: 48, viewNum: 4},
{misort: 49, viewNum: 4},
{misort: 66, viewNum: 4},
{misort: 39, viewNum: 4},
{misort: 60, viewNum: 4}
{misort: 65, viewNum: 4},
{misort: 50, viewNum: 4},
{misort: 61, viewNum: 4}
],
kids: [
{misort: 400, viewNum: 4},
{misort: 430, viewNum: 4},
{misort: 423, viewNum: 4},
{misort: 396, viewNum: 4},
{misort: 404, viewNum: 4},
{misort: 406, viewNum: 4},
{misort: 366, viewNum: 4},
{misort: 370, viewNum: 4},
{misort: 371, viewNum: 4},
{misort: 368, viewNum: 4},
{misort: 384, viewNum: 4},
{misort: 406, viewNum: 4},
{misort: 369, viewNum: 4},
{misort: 388, viewNum: 4},
{misort: 392, viewNum: 4},
{misort: 429, viewNum: 4},
{misort: 448, viewNum: 4},
{misort: 408, viewNum: 4},
{misort: 414, viewNum: 4}
{misort: 414, viewNum: 4},
],
lifestyle: [
{msort: 1170, viewNum: 5},
... ...
... ... @@ -115,6 +115,7 @@
"yoho-jquery-pjax": "0.0.1",
"yoho-jquery-placeholder": "^2.3.1",
"yoho-jquery-qrcode": "^0.14.0",
"yoho-qs": "^1.0.1",
"yoho-slider": "0.0.2",
"yoho-swiper": "^3.3.1"
}
... ...
var $ = require('yoho-jquery'),
Captcha = require('../plugins/captcha');
Captcha = require('../plugins/captcha'),
qs = require('yoho-qs');
// 一直是极验证码
var captcha = new Captcha('.captcha-wrap', {
... ... @@ -13,7 +14,7 @@ require('../common/promise');
$('.confirm').on('click', function() {
captcha.check().then(function() {
window.jumpUrl(window.queryString().refer || '//www.yohobuy.com');
window.jumpUrl(qs.refer ? decodeURIComponent(qs.refer) : '//www.yohobuy.com');
});
});
... ...
var $ = require('yoho-jquery'),
Captcha = require('../plugins/captcha'),
Hbs = require('yoho-handlebars'),
dialog = require('../common/dialog');
var meGift;
var captcha;
require('yoho-jquery-placeholder');
require('../common');
... ... @@ -240,6 +242,11 @@ meGift = {
}]
}).show();
captcha = new Captcha('.captcha-wrap', {checkURI: ''}).init();
captcha.onSuccess(function() {
$('.me-gift-confirm').find('.mobile-btn').trigger('click');
});
setTimeout(function() {
$('[placeholder]', dg.$el).placeholder(); // ie8 兼容 placeholder
}, 10);
... ... @@ -264,7 +271,8 @@ meGift = {
this.postAjax('/home/megift/smsBind', {
area: area,
mobile: mobile
mobile: mobile,
verifyCode: captcha.getResults()
}, verifyData).then(function(res) {
if (res.code === 200) {
that.intTimer($('.mobile-btn'));
... ...
... ... @@ -25,11 +25,8 @@ var sInt,
var baseQs;
var captcha = new Captcha('.captcha-safe-form-r', {checkURI: ''}).init();
var captcha;
captcha.onSuccess(function() {
$('#send-mobile-code').trigger('click');
});
require('../common');
... ... @@ -347,7 +344,8 @@ function sendMobileMsg2(mobileV) {
var $code = $('#inputcode2'),
$ccheckInfo = $code.parent().find('.check-info');
var reqData = {
mobile: mobileV
mobile: mobileV,
verifyCode: captcha.getResults()
};
$.post('/home/account/mobilesendmsg', reqData, function(result) {
... ... @@ -549,9 +547,24 @@ function submitForm() {
}
}
}
function loadCaptcha() {
var step = $('.progress-bar .cur').index();
$(function() {
if (step === 0) {
captcha = new Captcha('.captcha-safe-form-r', {checkURI: ''}).init();
captcha.onSuccess(function() {
$('#send-mobile-code').trigger('click');
});
} else if (step === 1) {
captcha = new Captcha('.captcha-safe-form-r', {checkURI: ''}).init();
captcha.onSuccess(function() {
$('#send-mobile-code2').trigger('click');
});
}
}
$(function() {
loadCaptcha();
if ($('.res-info').length > 0) {
setTimeout(function() {
toHome();
... ...
... ... @@ -4,6 +4,7 @@
* @date: 2016/1/21
*/
var $ = require('yoho-jquery');
var Captcha = require('../../plugins/captcha');
var phoneRegx = require('../common/mail-phone-regx').phoneRegx;
var nopermissionoption = $('#nopermissionmessage').html(); // 倒计时dom
... ... @@ -20,6 +21,12 @@ var thirdOpenId = $('#openId').val(),
var Alert = require('../../common/dialog').Alert;
var dialog = require('../cert/dialog');
var passwordCaptchaImg = new Captcha('.captcha-wrap', {checkURI: ''}).init();
passwordCaptchaImg.onSuccess(function() {
$('#sendmessage').trigger('click');
});
require('../../simple-header');
... ... @@ -160,7 +167,8 @@ function sendMessageValidate() {
url: '/passport/autouserinfo/sendBindMsg',
data: {
mobile: $('#mobile').val(),
area: $('#areacode').val()
area: $('#areacode').val(),
verifyCode: passwordCaptchaImg.getResults(),
}
}).then(function(data) {
... ...
... ... @@ -4,6 +4,7 @@
* @date: 2018/1/18
*/
var $ = require('yoho-jquery');
var Captcha = require('../../plugins/captcha');
var phoneRegx = require('../common/mail-phone-regx').phoneRegx;
var choosedpic = 'https://cdn.yoho.cn/yohobuy/assets/img/passport/choosed.png';// 已选择图片
... ... @@ -17,7 +18,11 @@ var dialog = require('./dialog');
var nopermissionoption = $('#nopermissionmessage').html();
var sendmessagehtml = $('.validatewrapper').html();
var second = +$('.second').text();
var passwordCaptchaImg = new Captcha('.captcha-wrap', {checkURI: ''}).init();
passwordCaptchaImg.onSuccess(function() {
$('#sendmessage').trigger('click');
});
require('../../simple-header');
function changeSecond() {
... ... @@ -80,6 +85,7 @@ function sendMessageValidate() {
data: {
mobile: mobile,
area: area,
verifyCode: passwordCaptchaImg.getResults(),
}
}).then(function(data) {
if (data.code === 200) {
... ...
... ... @@ -135,6 +135,10 @@
.gift-group {
margin-top: 10px;
overflow: hidden;
.img-check {
margin-bottom: 0;
}
}
.left {
... ...
... ... @@ -38,6 +38,7 @@
margin: 0 auto;
padding-top: 122px;
min-height: 550px;
padding-bottom: 50px;
width: 980px;
.img-check-tip {
... ... @@ -72,6 +73,11 @@
width: 485px;
height: 40px;
&.captcha {
height: auto;
margin-bottom: 0;
}
.name {
float: left;
margin-right: 14px;
... ...