Authored by hf

do gulp gzip css js

... ... @@ -2328,7 +2328,7 @@ $channelLink.on('touchstart', function() {
});
});
define("js/passport/entry", ["jquery"], function(require, exports, module){
define("js/passport/entry", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/**
* 注册、登录、密码找回打包入口
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -2350,6 +2350,9 @@ require("js/passport/back/code");
require("js/passport/back/email");
require("js/passport/back/email-success");
require("js/passport/back/new-password");
// 绑定手机号
require("js/passport/bind/bind");
});
define("js/passport/register/register", ["jquery"], function(require, exports, module){
/**
... ... @@ -3309,6 +3312,210 @@ $btnOk.on('touchstart', function() {
}
});
});
define("js/passport/bind/bind", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/**
* 注册
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("jquery");
var $phoneNum = $('#phone-num'),
$countrySelect = $('#country-select'),
$areaCode = $('#area-code'),
$openId = $('#openId'),
$nickname = $('#nickname'),
$sourceType = $('#sourceType'),
$btnNext = $('#btn-next');
var api = require("js/passport/api"),
tip = require("js/plugin/tip"),
dialog = require("js/me/dialog");
var trim = $.trim;
var showErrTip = tip.show;
function nextStep(url, mobileNo, areaCode) {
$.ajax({
type: 'POST',
url: '/passport/bind/sendBindMsg',
data: {
phoneNum: mobileNo,
areaCode: areaCode.replace('+', '')
},
success: function(res) {
console.log(res.data);
location.href = url;
},
error: function() {
tip.show('出错了,请重试!');
}
});
}
api.selectCssHack($('#country-select'));
api.bindClearEvt();
$phoneNum.bind('input', function() {
if (trim($phoneNum.val()) === '') {
$btnNext.addClass('disable');
} else {
$btnNext.removeClass('disable');
}
});
$countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$btnNext.on('touchstart', function() {
var pn = trim($phoneNum.val()),
openId = trim($openId.val()),
nickname = trim($nickname.val()),
sourceType = trim($sourceType.val()),
areaCode = $countrySelect.val();
if ($btnNext.hasClass('disable')) {
return;
}
if (api.phoneRegx[areaCode].test(pn)) {
$.ajax({
url: '/passport/bind/bindCheck',
type: 'POST',
data: {
areaCode: areaCode.replace('+', ''),
phoneNum: pn,
openId: openId,
sourceType: sourceType,
nickname: nickname
},
success: function(res) {
console.log(res);
//res : {
// code: 'xxx',
// data: {
// isReg: 0,
// next: 'xxxx'
// },
// message: 'xxxx',
//}
if (res.code === 200) {
if (res.data.isReg === 1) {
dialog.showDialog({
dialogText: '该手机号已注册过有货\n' + pn + ',确定绑定吗?',
hasFooter: {
leftBtnText: '更换号码',
rightBtnText: '继续绑定'
}
}, function() {
nextStep(res.data.next, pn, areaCode);
});
} else {
nextStep(res.data.next, pn, areaCode);
}
} else {
showErrTip(res.message);
}
}
});
} else {
showErrTip('手机号格式不正确,请重新输入');
}
});
});
define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/*
* @Description: dialog
* @Time: 2015/11/18
* @author: chenglong.wang
*/
var $ = require("jquery"),
Handlebars = require("handlebars"),
Hammer = require("hammer");
var $dialogWrapper,
dialogTpl,
dialogTemplate;
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
dialogTemplate = Handlebars.compile(dialogTpl);
exports.showDialog = function(data, callback) {
var dialogStr = dialogTemplate(data),
$dialogBox,
defaultHideDuraton,
dialogWrapperHammer;
$('.dialog-wrapper').remove();
$('body').append($(dialogStr));
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
// 显示
if (data.fast) {
$dialogWrapper.css({
display: 'block'
});
} else {
$dialogWrapper.fadeIn();
}
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
});
//隐藏
if (data.autoHide) {
defaultHideDuraton = 1000;
if (data.autoHide > 1) {
defaultHideDuraton = data.autoHide;
}
setTimeout(function() {
$dialogWrapper.fadeOut();
}, defaultHideDuraton);
}
dialogWrapperHammer.on('tap', function(event) {
if ($(event.target).hasClass('dialog-left-btn')) {
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
}
});
};
});
define("js/product/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){
/**
* 产品打包入口
... ... @@ -5940,93 +6147,6 @@ $(window).scroll(function() {
getOrders();
});
define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/*
* @Description: dialog
* @Time: 2015/11/18
* @author: chenglong.wang
*/
var $ = require("jquery"),
Handlebars = require("handlebars"),
Hammer = require("hammer");
var $dialogWrapper,
dialogTpl,
dialogTemplate;
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
dialogTemplate = Handlebars.compile(dialogTpl);
exports.showDialog = function(data, callback) {
var dialogStr = dialogTemplate(data),
$dialogBox,
defaultHideDuraton,
dialogWrapperHammer;
$('.dialog-wrapper').remove();
$('body').append($(dialogStr));
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
// 显示
if (data.fast) {
$dialogWrapper.css({
display: 'block'
});
} else {
$dialogWrapper.fadeIn();
}
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
});
//隐藏
if (data.autoHide) {
defaultHideDuraton = 1000;
if (data.autoHide > 1) {
defaultHideDuraton = data.autoHide;
}
setTimeout(function() {
$dialogWrapper.fadeOut();
}, defaultHideDuraton);
}
dialogWrapperHammer.on('tap', function(event) {
if ($(event.target).hasClass('dialog-left-btn')) {
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
}
});
};
});
define("js/me/order-detail", ["jquery","lazyload","hammer","handlebars","source-map"], function(require, exports, module){
/**
* 订单详情页
... ...
This diff could not be displayed because it is too large.
... ... @@ -18,4 +18,7 @@ require('./back/mobile');
require('./back/code');
require('./back/email');
require('./back/email-success');
require('./back/new-password');
\ No newline at end of file
require('./back/new-password');
// 绑定手机号
require('./bind/bind');
\ No newline at end of file
... ...