Authored by Rock Zhang

更新到20160421静态资源

... ... @@ -209,7 +209,7 @@ function reMarginFooter(fixedElement) {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', '//cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
})(window, document, 'script', ('https:' == document.location.protocol ? 'https' : 'http') + '://' + 'cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
(function() {
var uid = getUid();
... ... @@ -301,6 +301,15 @@ $.extend({
}
});
//临时修改 footer
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
if ($('.user-name').text().length === 11) {
$('.user-name').html(phoneHidden($('.user-name').text()));
}
//暴露公共接口
window.cookie = cookie;
... ... @@ -3924,7 +3933,8 @@ var $ = require("jquery");
var trim = $.trim;
//邮箱验证规则
var emailRegx = /^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
var emailRegx =
/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+[_|\_|\.|-]?@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
//手机号码验证规则
var phoneRegx = {
... ... @@ -4048,7 +4058,8 @@ module.exports = {
bindClearEvt: bindClearEvt,
pwdValidate: pwdValidate,
selectCssHack: selectCssHack
};
};
});
define("js/passport/register/code", ["jquery"], function(require, exports, module){
/**
... ... @@ -8488,6 +8499,13 @@ optHammer.on('tap', function(e) {
});
}
});
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.name-phone span').html(phoneHidden($('.name-phone span').html()));
});
define("js/me/fav", ["jquery","hammer","swiper","handlebars","source-map","index"], function(require, exports, module){
... ... @@ -10061,7 +10079,14 @@ $action.on('touchstart', 'a,span', function() {
}).on('touchend touchcancel', 'a,span', function() {
$(this).css('background', 'transparent');
});
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.tel').each(function(index) {
$('.tel').eq(index).html(phoneHidden($('.tel').eq(index).html()));
});
});
define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){
/**
... ... @@ -10415,7 +10440,23 @@ if (chinaAddressList) {
tip.show('获取省市区列表失败');
});
}
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.phone').html(phoneHidden($('.phone').html()));
$('.phone').on('touchend', function() {
$(this).css('display', 'none');
$('input[name = "mobile"]').attr('type', 'text');
});
$('input[name = "mobile"]').on('blur', function() {
$('.phone').css('display', 'block');
$('.phone').html($('input[name = "mobile"]').val());
$('input[name = "mobile"]').attr('type', 'hidden');
});
});
define("js/me/logistic", ["jquery","hammer","lazyload"], function(require, exports, module){
/**
... ... @@ -11120,13 +11161,15 @@ function GoodInfo(properties) {
this.buy_number = properties.buy_number;
this.product_sku = properties.product_sku;
this.selected = properties.selected;
this.hasPromotion = properties.hasPromotion;
}
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$('.cart-goods').on('touchstart', '.checkbox', function() {
var $this = $(this),
$good = $this.closest('.shopping-cart-good'),
id = $good.data('id');
id = $good.data('id'),
promotion = $good.data('promotion');
var goodsList = [],
goodInfo = {};
... ... @@ -11139,9 +11182,9 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
goodInfo.goods_type = $('#cartType').val();
goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
goodInfo.product_sku = id;
goodInfo.hasPromotion = promotion;
goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
goodsList.push(new GoodInfo(goodInfo));
$.ajax({
type: 'post',
url: 'select',
... ... @@ -11178,17 +11221,21 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
* @return false or undefined
*
*/
function showEditPannelWithSku(html, id, isSelected, isEditNum) {
if (html.length < 2) {
function showEditPannelWithSku(html, id, isSelected, isEditNum, skn) {
var $html = $(html);
if (!$html.hasClass('chose-panel')) {
tip.show('出错啦!');
return false;
}
// 记录成功加载的选择框
previousEditSkn = skn;
//删掉页面上原有的pannel
chosePanel.remove();
$(html).appendTo('#mainCart');
$html.appendTo('#mainCart');
chosePanel.init();
chosePanel.setEditModeWithSknId(id, isSelected);
... ... @@ -11223,9 +11270,6 @@ $('.icon-edit').on('touchstart', function(e) {
return;
}
previousEditSkn = skn;
$checkBox = $this.closest('.info').siblings('.checkbox');
$tag = $this.closest('.deps').siblings('.few-tag');
... ... @@ -11239,7 +11283,6 @@ $('.icon-edit').on('touchstart', function(e) {
loading.showLoadingMask();
$.ajax({
url: '/cart/index/goodinfo',
data: {
... ... @@ -11247,7 +11290,7 @@ $('.icon-edit').on('touchstart', function(e) {
buy_num: count
},
success: function(res) {
showEditPannelWithSku(res, id, $checkBox.hasClass('icon-cb-checked'), canEditNum);
showEditPannelWithSku(res, id, $checkBox.hasClass('icon-cb-checked'), canEditNum, skn);
},
error: function() {
tip.show('网络异常');
... ... @@ -11272,6 +11315,7 @@ $('.icon-del').on('touchstart', function(e) {
}
}, function() {
var id = $this.closest('.shopping-cart-good').data('id'),
promotion = $this.closest('.shopping-cart-good').data('promotion'),
count = $this.data('count');
$.ajax({
... ... @@ -11279,6 +11323,7 @@ $('.icon-del').on('touchstart', function(e) {
url: '/cart/index/del',
data: {
sku: id,
hasPromotion: promotion,
count: count
}
}).then(function(data) {
... ... @@ -11366,6 +11411,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
$good = $(good);
goodInfo.product_sku = $(good).data('id');
goodInfo.hasPromotion = $(good).data('promotion');
goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
goodsList.push(new GoodInfo(goodInfo));
... ... @@ -11461,7 +11507,7 @@ setTimeout(function() {
}, 0);
});
define("js/cart/order-ensure", ["jquery","lazyload","hammer","handlebars","source-map"], function(require, exports, module){
define("js/cart/order-ensure", ["jquery","lazyload","hammer"], function(require, exports, module){
/**
* 订单确认
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -11470,25 +11516,22 @@ define("js/cart/order-ensure", ["jquery","lazyload","hammer","handlebars","sourc
var $ = require("jquery"),
lazyLoad = require("lazyload"),
Hammer = require("hammer"),
Handlebars = require("handlebars"),
tip = require("js/plugin/tip"),
loading = require("js/plugin/loading"),
order = require("js/cart/order-info");
var dispatchModeHammer,
dispatchTimeHammer,
$invoice = $('.invoice'),
$price = $('.price-cal'),
var $invoice = $('.invoice'),
$couponUse = $('.coupon-use.used'),
$addressWrap = $('.address-wrap'),
$coinCheck = $('.coin-check'),
$coinUsed = $('.coin .used'),
$subBlock = $('.sub-block'),
payType,
priceTmpl = Handlebars.compile($('#tmpl-price').html()),
queryString = $.queryString(),
orderInfo = order.orderInfo,
isSubmiting;
isSubmiting,
dispatchInfo,
total;
require("js/common");
... ... @@ -11535,7 +11578,7 @@ isLimitGood() && (function() {
var data = getQueryParam();
data['type'] = 'limitcode';
data.type = 'limitcode';
a.push(data);
orderInfo('skuList', JSON.stringify(a));
... ... @@ -11546,42 +11589,36 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
}
function dispacthTapEvt(e) {
var $cur = $(e.target).closest('li');
if ($cur.length === 0 || $cur.hasClass('chosed')) {
return;
}
$cur.siblings('li.chosed').removeClass('chosed');
$cur.addClass('chosed');
}
// function dispacthTapEvt(e) {
// var $cur = $(e.target).closest('li');
dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);
dispatchModeHammer.on('tap', dispacthTapEvt);
// if ($cur.length === 0 || $cur.hasClass('chosed')) {
// return;
// }
dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);
dispatchTimeHammer.on('tap', dispacthTapEvt);
// $cur.siblings('li.chosed').removeClass('chosed');
// $cur.addClass('chosed');
// }
$('.checkbox').on('touchstart', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
$this.removeClass('icon-cb-checked').addClass('icon-checkbox');
if ($this.hasClass('icon-cb-radio')) {
$this.removeClass('icon-cb-radio').addClass('icon-radio');
return;
}
if ($this.hasClass('icon-checkbox')) {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
if ($this.hasClass('icon-radio')) {
$this.removeClass('icon-radio').addClass('icon-cb-radio');
}
});
$invoice.on('touchend', '.checkbox', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
if ($this.hasClass('icon-cb-radio')) {
$invoice.addClass('focus');
}
if ($this.hasClass('icon-checkbox')) {
if ($this.hasClass('icon-radio')) {
$invoice.removeClass('focus');
}
});
... ... @@ -11602,12 +11639,10 @@ function orderCompute() {
skuList: isLimitGood() ? orderInfo('skuList') : undefined
}
}).then(function(res) {
var priceHtml;
if ($.type(res) !== 'object') {
window.location.reload();
} else {
if (res.last_order_amount) {
if (typeof res.last_order_amount !== undefined) {
res.last_order_amount = (+res.last_order_amount).toFixed(2);
}
if (res.use_yoho_coin) {
... ... @@ -11616,12 +11651,18 @@ function orderCompute() {
$coinCheck.find('em').show();
$coinUsed.show();
}
priceHtml = priceTmpl({
cartPayData: res.promotion_formula_list,
price: res.last_order_amount
});
$price.html(priceHtml);
total = '';
if (res.promotion_formula_list) {
$.each(res.promotion_formula_list, function(index, value) {
total += '<li>' +
'<p>' + value.promotion + '</p>' +
'<span>' + value.promotion_amount + '</span>' +
'</li>';
});
$('.price-cost span').html('¥' + res.last_order_amount);
$('.bill span').html('¥' + res.last_order_amount);
$('.total').html(total);
}
}
}).fail(function() {
window.location.reload();
... ... @@ -11634,10 +11675,6 @@ function submitOrder() {
var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
msg = $('#msg').find('input').val() || orderInfo('msg');
if (orderInfo('deliveryId') === 2 && !$addressWrap.data('support')) {
tip.show('当前地址不支持顺丰快递');
return;
}
if (isSubmiting) {
return false;
}
... ... @@ -11712,17 +11749,8 @@ if (!orderInfo('addressId')) {
}
$('.dispatch-mode').on('touchend', 'li', function() {
var $defaultMode = $('.dispatch-mode [data-id="1"]');
if (!$addressWrap.data('support') && $(this).data('id') === 2) {
dispacthTapEvt({
target: $defaultMode
});
tip.show('当前地址不支持顺丰快递');
} else {
orderInfo('deliveryId', $(this).data('id'));
orderCompute();
}
orderInfo('deliveryId', $(this).data('id'));
orderCompute();
});
$('.dispatch-time').on('touchend', 'li', function() {
... ... @@ -11732,7 +11760,7 @@ $('.dispatch-time').on('touchend', 'li', function() {
$('.coin').on('touchend', function() {
var $this = $(this);
if ($this.find('.checkbox').hasClass('icon-cb-checked')) {
if ($this.find('.checkbox').hasClass('icon-cb-radio')) {
orderInfo('yohoCoin', $this.data('yoho-coin'));
$this.find('.can-use').hide();
} else {
... ... @@ -11747,7 +11775,7 @@ $('.coin').on('touchend', function() {
$invoice.on('touchend', '.checkbox', function(e) {
var $this = $(this);
orderInfo('invoice', $this.hasClass('icon-cb-checked'));
orderInfo('invoice', $this.hasClass('icon-cb-radio'));
e.preventDefault();
e.stopPropagation();
});
... ... @@ -11768,12 +11796,64 @@ $('.pay-mode').on('click', 'li', function() {
orderInfo('paymentTypeId', $this.data('pay-id'));
orderInfo('paymentType', $this.data('pay-type'));
payType = $this.data('pay-type');
submitOrder();
});
$('form').on('submit', function() {
return false;
});
// xwg 2016/3/21 13:22
$('.dispatch').on('touchend', 'h3', function() {
if ($(this).siblings('ul').is(':hidden')) {
$('.dispatch h3').removeClass('border-none');
$(this).addClass('border-none');
$('.down').removeClass('hide');
$('.up').addClass('hide');
$('.up', this).removeClass('hide');
$('.down', this).addClass('hide');
$('.dispatch ul').hide();
$(this).siblings('ul').show();
} else {
$(this).removeClass('border-none');
$('.down', this).removeClass('hide');
$('.up', this).addClass('hide');
$(this).siblings('ul').hide();
}
});
$subBlock.on('touchstart', 'li', function() {
$.each($(this).parents('ul').find('i'), function() {
$(this).parents('ul').find('i').removeClass('icon-cb-radio').addClass('icon-radio');
});
$(this).parents('ul').hide();
$('.down').removeClass('hide');
$('.up').addClass('hide');
$('.dispatch h3').removeClass('border-none');
dispatchInfo = $(this).find('span').html();
$(this).parents('.sub-block').find('h3 span').html(dispatchInfo);
if ($(this).find('i').hasClass('icon-cb-radio')) {
$(this).find('i').addClass('icon-radio');
} else if ($(this).find('i').hasClass('icon-radio')) {
$(this).find('i').addClass('icon-cb-radio');
}
});
$('.bill a').on('touchstart', function() {
orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id'));
orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id'));
payType = $('.payment-type .icon-cb-radio').data('id');
submitOrder();
});
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.info-phone').html(phoneHidden($('.info-phone').html()));
});
define("js/cart/order-info", ["jquery","hammer"], function(require, exports, module){
... ... @@ -12053,5 +12133,13 @@ $confim.on('touchend', '.confim', function() {
orderInfo('address', null);
}
});
function phoneHidden(phone) {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}
$('.tel').each(function(index) {
$('.tel').eq(index).html(phoneHidden($('.tel').eq(index).html()));
});
});
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.