Authored by Rock Zhang

更新到20160421静态资源

@@ -209,7 +209,7 @@ function reMarginFooter(fixedElement) { @@ -209,7 +209,7 @@ function reMarginFooter(fixedElement) {
209 a.async = 1; 209 a.async = 1;
210 a.src = j; 210 a.src = j;
211 m.parentNode.insertBefore(a, m); 211 m.parentNode.insertBefore(a, m);
212 -})(window, document, 'script', '//cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas'); 212 +})(window, document, 'script', ('https:' == document.location.protocol ? 'https' : 'http') + '://' + 'cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
213 213
214 (function() { 214 (function() {
215 var uid = getUid(); 215 var uid = getUid();
@@ -301,6 +301,15 @@ $.extend({ @@ -301,6 +301,15 @@ $.extend({
301 } 301 }
302 }); 302 });
303 303
  304 +//临时修改 footer
  305 +function phoneHidden(phone) {
  306 + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  307 +}
  308 +
  309 +if ($('.user-name').text().length === 11) {
  310 + $('.user-name').html(phoneHidden($('.user-name').text()));
  311 +}
  312 +
304 //暴露公共接口 313 //暴露公共接口
305 window.cookie = cookie; 314 window.cookie = cookie;
306 315
@@ -3924,7 +3933,8 @@ var $ = require("jquery"); @@ -3924,7 +3933,8 @@ var $ = require("jquery");
3924 var trim = $.trim; 3933 var trim = $.trim;
3925 3934
3926 //邮箱验证规则 3935 //邮箱验证规则
3927 -var emailRegx = /^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; 3936 +var emailRegx =
  3937 +/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+[_|\_|\.|-]?@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
3928 3938
3929 //手机号码验证规则 3939 //手机号码验证规则
3930 var phoneRegx = { 3940 var phoneRegx = {
@@ -4049,6 +4059,7 @@ module.exports = { @@ -4049,6 +4059,7 @@ module.exports = {
4049 pwdValidate: pwdValidate, 4059 pwdValidate: pwdValidate,
4050 selectCssHack: selectCssHack 4060 selectCssHack: selectCssHack
4051 }; 4061 };
  4062 +
4052 }); 4063 });
4053 define("js/passport/register/code", ["jquery"], function(require, exports, module){ 4064 define("js/passport/register/code", ["jquery"], function(require, exports, module){
4054 /** 4065 /**
@@ -8489,6 +8500,13 @@ optHammer.on('tap', function(e) { @@ -8489,6 +8500,13 @@ optHammer.on('tap', function(e) {
8489 } 8500 }
8490 }); 8501 });
8491 8502
  8503 +function phoneHidden(phone) {
  8504 + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  8505 +}
  8506 +
  8507 +$('.name-phone span').html(phoneHidden($('.name-phone span').html()));
  8508 +
  8509 +
8492 }); 8510 });
8493 define("js/me/fav", ["jquery","hammer","swiper","handlebars","source-map","index"], function(require, exports, module){ 8511 define("js/me/fav", ["jquery","hammer","swiper","handlebars","source-map","index"], function(require, exports, module){
8494 /** 8512 /**
@@ -10062,6 +10080,13 @@ $action.on('touchstart', 'a,span', function() { @@ -10062,6 +10080,13 @@ $action.on('touchstart', 'a,span', function() {
10062 $(this).css('background', 'transparent'); 10080 $(this).css('background', 'transparent');
10063 }); 10081 });
10064 10082
  10083 +function phoneHidden(phone) {
  10084 + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  10085 +}
  10086 +
  10087 +$('.tel').each(function(index) {
  10088 + $('.tel').eq(index).html(phoneHidden($('.tel').eq(index).html()));
  10089 +});
10065 }); 10090 });
10066 define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){ 10091 define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){
10067 /** 10092 /**
@@ -10416,6 +10441,22 @@ if (chinaAddressList) { @@ -10416,6 +10441,22 @@ if (chinaAddressList) {
10416 }); 10441 });
10417 } 10442 }
10418 10443
  10444 +function phoneHidden(phone) {
  10445 + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  10446 +}
  10447 +
  10448 +$('.phone').html(phoneHidden($('.phone').html()));
  10449 +
  10450 +$('.phone').on('touchend', function() {
  10451 + $(this).css('display', 'none');
  10452 + $('input[name = "mobile"]').attr('type', 'text');
  10453 +});
  10454 +
  10455 +$('input[name = "mobile"]').on('blur', function() {
  10456 + $('.phone').css('display', 'block');
  10457 + $('.phone').html($('input[name = "mobile"]').val());
  10458 + $('input[name = "mobile"]').attr('type', 'hidden');
  10459 +});
10419 }); 10460 });
10420 define("js/me/logistic", ["jquery","hammer","lazyload"], function(require, exports, module){ 10461 define("js/me/logistic", ["jquery","hammer","lazyload"], function(require, exports, module){
10421 /** 10462 /**
@@ -11120,13 +11161,15 @@ function GoodInfo(properties) { @@ -11120,13 +11161,15 @@ function GoodInfo(properties) {
11120 this.buy_number = properties.buy_number; 11161 this.buy_number = properties.buy_number;
11121 this.product_sku = properties.product_sku; 11162 this.product_sku = properties.product_sku;
11122 this.selected = properties.selected; 11163 this.selected = properties.selected;
  11164 + this.hasPromotion = properties.hasPromotion;
11123 } 11165 }
11124 11166
11125 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods 11167 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
11126 $('.cart-goods').on('touchstart', '.checkbox', function() { 11168 $('.cart-goods').on('touchstart', '.checkbox', function() {
11127 var $this = $(this), 11169 var $this = $(this),
11128 $good = $this.closest('.shopping-cart-good'), 11170 $good = $this.closest('.shopping-cart-good'),
11129 - id = $good.data('id'); 11171 + id = $good.data('id'),
  11172 + promotion = $good.data('promotion');
11130 11173
11131 var goodsList = [], 11174 var goodsList = [],
11132 goodInfo = {}; 11175 goodInfo = {};
@@ -11139,9 +11182,9 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -11139,9 +11182,9 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
11139 goodInfo.goods_type = $('#cartType').val(); 11182 goodInfo.goods_type = $('#cartType').val();
11140 goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y'; 11183 goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
11141 goodInfo.product_sku = id; 11184 goodInfo.product_sku = id;
  11185 + goodInfo.hasPromotion = promotion;
11142 goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', ''); 11186 goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
11143 goodsList.push(new GoodInfo(goodInfo)); 11187 goodsList.push(new GoodInfo(goodInfo));
11144 -  
11145 $.ajax({ 11188 $.ajax({
11146 type: 'post', 11189 type: 'post',
11147 url: 'select', 11190 url: 'select',
@@ -11178,17 +11221,21 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -11178,17 +11221,21 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
11178 * @return false or undefined 11221 * @return false or undefined
11179 * 11222 *
11180 */ 11223 */
11181 -function showEditPannelWithSku(html, id, isSelected, isEditNum) {  
11182 - if (html.length < 2) { 11224 +function showEditPannelWithSku(html, id, isSelected, isEditNum, skn) {
  11225 + var $html = $(html);
  11226 +
  11227 + if (!$html.hasClass('chose-panel')) {
11183 tip.show('出错啦!'); 11228 tip.show('出错啦!');
11184 return false; 11229 return false;
11185 } 11230 }
11186 11231
  11232 + // 记录成功加载的选择框
  11233 + previousEditSkn = skn;
  11234 +
11187 //删掉页面上原有的pannel 11235 //删掉页面上原有的pannel
11188 chosePanel.remove(); 11236 chosePanel.remove();
11189 11237
11190 - $(html).appendTo('#mainCart');  
11191 - 11238 + $html.appendTo('#mainCart');
11192 11239
11193 chosePanel.init(); 11240 chosePanel.init();
11194 chosePanel.setEditModeWithSknId(id, isSelected); 11241 chosePanel.setEditModeWithSknId(id, isSelected);
@@ -11223,9 +11270,6 @@ $('.icon-edit').on('touchstart', function(e) { @@ -11223,9 +11270,6 @@ $('.icon-edit').on('touchstart', function(e) {
11223 return; 11270 return;
11224 } 11271 }
11225 11272
11226 - previousEditSkn = skn;  
11227 -  
11228 -  
11229 $checkBox = $this.closest('.info').siblings('.checkbox'); 11273 $checkBox = $this.closest('.info').siblings('.checkbox');
11230 $tag = $this.closest('.deps').siblings('.few-tag'); 11274 $tag = $this.closest('.deps').siblings('.few-tag');
11231 11275
@@ -11239,7 +11283,6 @@ $('.icon-edit').on('touchstart', function(e) { @@ -11239,7 +11283,6 @@ $('.icon-edit').on('touchstart', function(e) {
11239 11283
11240 loading.showLoadingMask(); 11284 loading.showLoadingMask();
11241 11285
11242 -  
11243 $.ajax({ 11286 $.ajax({
11244 url: '/cart/index/goodinfo', 11287 url: '/cart/index/goodinfo',
11245 data: { 11288 data: {
@@ -11247,7 +11290,7 @@ $('.icon-edit').on('touchstart', function(e) { @@ -11247,7 +11290,7 @@ $('.icon-edit').on('touchstart', function(e) {
11247 buy_num: count 11290 buy_num: count
11248 }, 11291 },
11249 success: function(res) { 11292 success: function(res) {
11250 - showEditPannelWithSku(res, id, $checkBox.hasClass('icon-cb-checked'), canEditNum); 11293 + showEditPannelWithSku(res, id, $checkBox.hasClass('icon-cb-checked'), canEditNum, skn);
11251 }, 11294 },
11252 error: function() { 11295 error: function() {
11253 tip.show('网络异常'); 11296 tip.show('网络异常');
@@ -11272,6 +11315,7 @@ $('.icon-del').on('touchstart', function(e) { @@ -11272,6 +11315,7 @@ $('.icon-del').on('touchstart', function(e) {
11272 } 11315 }
11273 }, function() { 11316 }, function() {
11274 var id = $this.closest('.shopping-cart-good').data('id'), 11317 var id = $this.closest('.shopping-cart-good').data('id'),
  11318 + promotion = $this.closest('.shopping-cart-good').data('promotion'),
11275 count = $this.data('count'); 11319 count = $this.data('count');
11276 11320
11277 $.ajax({ 11321 $.ajax({
@@ -11279,6 +11323,7 @@ $('.icon-del').on('touchstart', function(e) { @@ -11279,6 +11323,7 @@ $('.icon-del').on('touchstart', function(e) {
11279 url: '/cart/index/del', 11323 url: '/cart/index/del',
11280 data: { 11324 data: {
11281 sku: id, 11325 sku: id,
  11326 + hasPromotion: promotion,
11282 count: count 11327 count: count
11283 } 11328 }
11284 }).then(function(data) { 11329 }).then(function(data) {
@@ -11366,6 +11411,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { @@ -11366,6 +11411,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
11366 $good = $(good); 11411 $good = $(good);
11367 11412
11368 goodInfo.product_sku = $(good).data('id'); 11413 goodInfo.product_sku = $(good).data('id');
  11414 + goodInfo.hasPromotion = $(good).data('promotion');
11369 goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', ''); 11415 goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
11370 11416
11371 goodsList.push(new GoodInfo(goodInfo)); 11417 goodsList.push(new GoodInfo(goodInfo));
@@ -11461,7 +11507,7 @@ setTimeout(function() { @@ -11461,7 +11507,7 @@ setTimeout(function() {
11461 }, 0); 11507 }, 0);
11462 11508
11463 }); 11509 });
11464 -define("js/cart/order-ensure", ["jquery","lazyload","hammer","handlebars","source-map"], function(require, exports, module){ 11510 +define("js/cart/order-ensure", ["jquery","lazyload","hammer"], function(require, exports, module){
11465 /** 11511 /**
11466 * 订单确认 11512 * 订单确认
11467 * @author: xuqi<qi.xu@yoho.cn> 11513 * @author: xuqi<qi.xu@yoho.cn>
@@ -11470,25 +11516,22 @@ define("js/cart/order-ensure", ["jquery","lazyload","hammer","handlebars","sourc @@ -11470,25 +11516,22 @@ define("js/cart/order-ensure", ["jquery","lazyload","hammer","handlebars","sourc
11470 11516
11471 var $ = require("jquery"), 11517 var $ = require("jquery"),
11472 lazyLoad = require("lazyload"), 11518 lazyLoad = require("lazyload"),
11473 - Hammer = require("hammer"),  
11474 - Handlebars = require("handlebars"),  
11475 tip = require("js/plugin/tip"), 11519 tip = require("js/plugin/tip"),
11476 loading = require("js/plugin/loading"), 11520 loading = require("js/plugin/loading"),
11477 order = require("js/cart/order-info"); 11521 order = require("js/cart/order-info");
11478 11522
11479 -var dispatchModeHammer,  
11480 - dispatchTimeHammer,  
11481 - $invoice = $('.invoice'),  
11482 - $price = $('.price-cal'), 11523 +var $invoice = $('.invoice'),
11483 $couponUse = $('.coupon-use.used'), 11524 $couponUse = $('.coupon-use.used'),
11484 $addressWrap = $('.address-wrap'), 11525 $addressWrap = $('.address-wrap'),
11485 $coinCheck = $('.coin-check'), 11526 $coinCheck = $('.coin-check'),
11486 $coinUsed = $('.coin .used'), 11527 $coinUsed = $('.coin .used'),
  11528 + $subBlock = $('.sub-block'),
11487 payType, 11529 payType,
11488 - priceTmpl = Handlebars.compile($('#tmpl-price').html()),  
11489 queryString = $.queryString(), 11530 queryString = $.queryString(),
11490 orderInfo = order.orderInfo, 11531 orderInfo = order.orderInfo,
11491 - isSubmiting; 11532 + isSubmiting,
  11533 + dispatchInfo,
  11534 + total;
11492 11535
11493 require("js/common"); 11536 require("js/common");
11494 11537
@@ -11535,7 +11578,7 @@ isLimitGood() && (function() { @@ -11535,7 +11578,7 @@ isLimitGood() && (function() {
11535 11578
11536 var data = getQueryParam(); 11579 var data = getQueryParam();
11537 11580
11538 - data['type'] = 'limitcode'; 11581 + data.type = 'limitcode';
11539 11582
11540 a.push(data); 11583 a.push(data);
11541 orderInfo('skuList', JSON.stringify(a)); 11584 orderInfo('skuList', JSON.stringify(a));
@@ -11546,42 +11589,36 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) { @@ -11546,42 +11589,36 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
11546 orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary'); 11589 orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
11547 } 11590 }
11548 11591
11549 -function dispacthTapEvt(e) {  
11550 - var $cur = $(e.target).closest('li'); 11592 +// function dispacthTapEvt(e) {
  11593 +// var $cur = $(e.target).closest('li');
11551 11594
11552 - if ($cur.length === 0 || $cur.hasClass('chosed')) {  
11553 - return;  
11554 - }  
11555 -  
11556 - $cur.siblings('li.chosed').removeClass('chosed');  
11557 - $cur.addClass('chosed');  
11558 -}  
11559 -  
11560 -dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);  
11561 -dispatchModeHammer.on('tap', dispacthTapEvt); 11595 +// if ($cur.length === 0 || $cur.hasClass('chosed')) {
  11596 +// return;
  11597 +// }
11562 11598
11563 -dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);  
11564 -dispatchTimeHammer.on('tap', dispacthTapEvt); 11599 +// $cur.siblings('li.chosed').removeClass('chosed');
  11600 +// $cur.addClass('chosed');
  11601 +// }
11565 11602
11566 $('.checkbox').on('touchstart', function() { 11603 $('.checkbox').on('touchstart', function() {
11567 var $this = $(this); 11604 var $this = $(this);
11568 11605
11569 - if ($this.hasClass('icon-cb-checked')) {  
11570 - $this.removeClass('icon-cb-checked').addClass('icon-checkbox'); 11606 + if ($this.hasClass('icon-cb-radio')) {
  11607 + $this.removeClass('icon-cb-radio').addClass('icon-radio');
11571 return; 11608 return;
11572 } 11609 }
11573 - if ($this.hasClass('icon-checkbox')) {  
11574 - $this.removeClass('icon-checkbox').addClass('icon-cb-checked'); 11610 + if ($this.hasClass('icon-radio')) {
  11611 + $this.removeClass('icon-radio').addClass('icon-cb-radio');
11575 } 11612 }
11576 }); 11613 });
11577 11614
11578 $invoice.on('touchend', '.checkbox', function() { 11615 $invoice.on('touchend', '.checkbox', function() {
11579 var $this = $(this); 11616 var $this = $(this);
11580 11617
11581 - if ($this.hasClass('icon-cb-checked')) { 11618 + if ($this.hasClass('icon-cb-radio')) {
11582 $invoice.addClass('focus'); 11619 $invoice.addClass('focus');
11583 } 11620 }
11584 - if ($this.hasClass('icon-checkbox')) { 11621 + if ($this.hasClass('icon-radio')) {
11585 $invoice.removeClass('focus'); 11622 $invoice.removeClass('focus');
11586 } 11623 }
11587 }); 11624 });
@@ -11602,12 +11639,10 @@ function orderCompute() { @@ -11602,12 +11639,10 @@ function orderCompute() {
11602 skuList: isLimitGood() ? orderInfo('skuList') : undefined 11639 skuList: isLimitGood() ? orderInfo('skuList') : undefined
11603 } 11640 }
11604 }).then(function(res) { 11641 }).then(function(res) {
11605 - var priceHtml;  
11606 -  
11607 if ($.type(res) !== 'object') { 11642 if ($.type(res) !== 'object') {
11608 window.location.reload(); 11643 window.location.reload();
11609 } else { 11644 } else {
11610 - if (res.last_order_amount) { 11645 + if (typeof res.last_order_amount !== undefined) {
11611 res.last_order_amount = (+res.last_order_amount).toFixed(2); 11646 res.last_order_amount = (+res.last_order_amount).toFixed(2);
11612 } 11647 }
11613 if (res.use_yoho_coin) { 11648 if (res.use_yoho_coin) {
@@ -11616,12 +11651,18 @@ function orderCompute() { @@ -11616,12 +11651,18 @@ function orderCompute() {
11616 $coinCheck.find('em').show(); 11651 $coinCheck.find('em').show();
11617 $coinUsed.show(); 11652 $coinUsed.show();
11618 } 11653 }
11619 - priceHtml = priceTmpl({  
11620 - cartPayData: res.promotion_formula_list,  
11621 - price: res.last_order_amount 11654 + total = '';
  11655 + if (res.promotion_formula_list) {
  11656 + $.each(res.promotion_formula_list, function(index, value) {
  11657 + total += '<li>' +
  11658 + '<p>' + value.promotion + '</p>' +
  11659 + '<span>' + value.promotion_amount + '</span>' +
  11660 + '</li>';
11622 }); 11661 });
11623 -  
11624 - $price.html(priceHtml); 11662 + $('.price-cost span').html('¥' + res.last_order_amount);
  11663 + $('.bill span').html('¥' + res.last_order_amount);
  11664 + $('.total').html(total);
  11665 + }
11625 } 11666 }
11626 }).fail(function() { 11667 }).fail(function() {
11627 window.location.reload(); 11668 window.location.reload();
@@ -11634,10 +11675,6 @@ function submitOrder() { @@ -11634,10 +11675,6 @@ function submitOrder() {
11634 var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), 11675 var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
11635 msg = $('#msg').find('input').val() || orderInfo('msg'); 11676 msg = $('#msg').find('input').val() || orderInfo('msg');
11636 11677
11637 - if (orderInfo('deliveryId') === 2 && !$addressWrap.data('support')) {  
11638 - tip.show('当前地址不支持顺丰快递');  
11639 - return;  
11640 - }  
11641 if (isSubmiting) { 11678 if (isSubmiting) {
11642 return false; 11679 return false;
11643 } 11680 }
@@ -11712,17 +11749,8 @@ if (!orderInfo('addressId')) { @@ -11712,17 +11749,8 @@ if (!orderInfo('addressId')) {
11712 } 11749 }
11713 11750
11714 $('.dispatch-mode').on('touchend', 'li', function() { 11751 $('.dispatch-mode').on('touchend', 'li', function() {
11715 - var $defaultMode = $('.dispatch-mode [data-id="1"]');  
11716 -  
11717 - if (!$addressWrap.data('support') && $(this).data('id') === 2) {  
11718 - dispacthTapEvt({  
11719 - target: $defaultMode  
11720 - });  
11721 - tip.show('当前地址不支持顺丰快递');  
11722 - } else {  
11723 orderInfo('deliveryId', $(this).data('id')); 11752 orderInfo('deliveryId', $(this).data('id'));
11724 orderCompute(); 11753 orderCompute();
11725 - }  
11726 }); 11754 });
11727 11755
11728 $('.dispatch-time').on('touchend', 'li', function() { 11756 $('.dispatch-time').on('touchend', 'li', function() {
@@ -11732,7 +11760,7 @@ $('.dispatch-time').on('touchend', 'li', function() { @@ -11732,7 +11760,7 @@ $('.dispatch-time').on('touchend', 'li', function() {
11732 $('.coin').on('touchend', function() { 11760 $('.coin').on('touchend', function() {
11733 var $this = $(this); 11761 var $this = $(this);
11734 11762
11735 - if ($this.find('.checkbox').hasClass('icon-cb-checked')) { 11763 + if ($this.find('.checkbox').hasClass('icon-cb-radio')) {
11736 orderInfo('yohoCoin', $this.data('yoho-coin')); 11764 orderInfo('yohoCoin', $this.data('yoho-coin'));
11737 $this.find('.can-use').hide(); 11765 $this.find('.can-use').hide();
11738 } else { 11766 } else {
@@ -11747,7 +11775,7 @@ $('.coin').on('touchend', function() { @@ -11747,7 +11775,7 @@ $('.coin').on('touchend', function() {
11747 $invoice.on('touchend', '.checkbox', function(e) { 11775 $invoice.on('touchend', '.checkbox', function(e) {
11748 var $this = $(this); 11776 var $this = $(this);
11749 11777
11750 - orderInfo('invoice', $this.hasClass('icon-cb-checked')); 11778 + orderInfo('invoice', $this.hasClass('icon-cb-radio'));
11751 e.preventDefault(); 11779 e.preventDefault();
11752 e.stopPropagation(); 11780 e.stopPropagation();
11753 }); 11781 });
@@ -11768,13 +11796,65 @@ $('.pay-mode').on('click', 'li', function() { @@ -11768,13 +11796,65 @@ $('.pay-mode').on('click', 'li', function() {
11768 orderInfo('paymentTypeId', $this.data('pay-id')); 11796 orderInfo('paymentTypeId', $this.data('pay-id'));
11769 orderInfo('paymentType', $this.data('pay-type')); 11797 orderInfo('paymentType', $this.data('pay-type'));
11770 payType = $this.data('pay-type'); 11798 payType = $this.data('pay-type');
11771 - submitOrder();  
11772 }); 11799 });
11773 11800
11774 $('form').on('submit', function() { 11801 $('form').on('submit', function() {
11775 return false; 11802 return false;
11776 }); 11803 });
11777 11804
  11805 +// xwg 2016/3/21 13:22
  11806 +$('.dispatch').on('touchend', 'h3', function() {
  11807 + if ($(this).siblings('ul').is(':hidden')) {
  11808 + $('.dispatch h3').removeClass('border-none');
  11809 + $(this).addClass('border-none');
  11810 + $('.down').removeClass('hide');
  11811 + $('.up').addClass('hide');
  11812 + $('.up', this).removeClass('hide');
  11813 + $('.down', this).addClass('hide');
  11814 + $('.dispatch ul').hide();
  11815 + $(this).siblings('ul').show();
  11816 + } else {
  11817 + $(this).removeClass('border-none');
  11818 + $('.down', this).removeClass('hide');
  11819 + $('.up', this).addClass('hide');
  11820 + $(this).siblings('ul').hide();
  11821 + }
  11822 +});
  11823 +
  11824 +$subBlock.on('touchstart', 'li', function() {
  11825 + $.each($(this).parents('ul').find('i'), function() {
  11826 + $(this).parents('ul').find('i').removeClass('icon-cb-radio').addClass('icon-radio');
  11827 + });
  11828 + $(this).parents('ul').hide();
  11829 + $('.down').removeClass('hide');
  11830 + $('.up').addClass('hide');
  11831 + $('.dispatch h3').removeClass('border-none');
  11832 + dispatchInfo = $(this).find('span').html();
  11833 + $(this).parents('.sub-block').find('h3 span').html(dispatchInfo);
  11834 + if ($(this).find('i').hasClass('icon-cb-radio')) {
  11835 + $(this).find('i').addClass('icon-radio');
  11836 + } else if ($(this).find('i').hasClass('icon-radio')) {
  11837 + $(this).find('i').addClass('icon-cb-radio');
  11838 + }
  11839 +});
  11840 +
  11841 +
  11842 +$('.bill a').on('touchstart', function() {
  11843 + orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id'));
  11844 + orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id'));
  11845 +
  11846 + payType = $('.payment-type .icon-cb-radio').data('id');
  11847 + submitOrder();
  11848 +});
  11849 +
  11850 +function phoneHidden(phone) {
  11851 + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  11852 +}
  11853 +
  11854 +$('.info-phone').html(phoneHidden($('.info-phone').html()));
  11855 +
  11856 +
  11857 +
11778 }); 11858 });
11779 define("js/cart/order-info", ["jquery","hammer"], function(require, exports, module){ 11859 define("js/cart/order-info", ["jquery","hammer"], function(require, exports, module){
11780 /** 11860 /**
@@ -12054,4 +12134,12 @@ $confim.on('touchend', '.confim', function() { @@ -12054,4 +12134,12 @@ $confim.on('touchend', '.confim', function() {
12054 } 12134 }
12055 }); 12135 });
12056 12136
  12137 +function phoneHidden(phone) {
  12138 + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  12139 +}
  12140 +
  12141 +$('.tel').each(function(index) {
  12142 + $('.tel').eq(index).html(phoneHidden($('.tel').eq(index).html()));
  12143 +});
  12144 +
12057 }); 12145 });
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.