Showing
3 changed files
with
74 additions
and
48 deletions
@@ -7956,6 +7956,13 @@ optHammer.on('tap', function(e) { | @@ -7956,6 +7956,13 @@ optHammer.on('tap', function(e) { | ||
7956 | } | 7956 | } |
7957 | }); | 7957 | }); |
7958 | 7958 | ||
7959 | +function phoneHidden(phone) { | ||
7960 | + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); | ||
7961 | +} | ||
7962 | + | ||
7963 | +$('.name-phone span').html(phoneHidden($('.name-phone span').html())); | ||
7964 | + | ||
7965 | + | ||
7959 | }); | 7966 | }); |
7960 | define("js/me/fav", ["jquery","hammer","swiper","handlebars","source-map","index"], function(require, exports, module){ | 7967 | define("js/me/fav", ["jquery","hammer","swiper","handlebars","source-map","index"], function(require, exports, module){ |
7961 | /** | 7968 | /** |
@@ -9528,6 +9535,13 @@ $action.on('touchstart', 'a,span', function() { | @@ -9528,6 +9535,13 @@ $action.on('touchstart', 'a,span', function() { | ||
9528 | $(this).css('background', 'transparent'); | 9535 | $(this).css('background', 'transparent'); |
9529 | }); | 9536 | }); |
9530 | 9537 | ||
9538 | +function phoneHidden(phone) { | ||
9539 | + return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); | ||
9540 | +} | ||
9541 | + | ||
9542 | +$('.tel').each(function(index) { | ||
9543 | + $('.tel').eq(index).html(phoneHidden($('.tel').eq(index).html())); | ||
9544 | +}); | ||
9531 | }); | 9545 | }); |
9532 | define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){ | 9546 | define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){ |
9533 | /** | 9547 | /** |
@@ -9895,6 +9909,7 @@ $('.phone').on('touchend', function() { | @@ -9895,6 +9909,7 @@ $('.phone').on('touchend', function() { | ||
9895 | 9909 | ||
9896 | $('input[name = "mobile"]').on('blur', function() { | 9910 | $('input[name = "mobile"]').on('blur', function() { |
9897 | $('.phone').css('display', 'block'); | 9911 | $('.phone').css('display', 'block'); |
9912 | + $('.phone').html($('input[name = "mobile"]').val()); | ||
9898 | $('input[name = "mobile"]').attr('type', 'hidden'); | 9913 | $('input[name = "mobile"]').attr('type', 'hidden'); |
9899 | }); | 9914 | }); |
9900 | }); | 9915 | }); |
@@ -10498,7 +10513,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { | @@ -10498,7 +10513,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { | ||
10498 | goodInfo.hasPromotion = promotion; | 10513 | goodInfo.hasPromotion = promotion; |
10499 | goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', ''); | 10514 | goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', ''); |
10500 | goodsList.push(new GoodInfo(goodInfo)); | 10515 | goodsList.push(new GoodInfo(goodInfo)); |
10501 | - console.log(goodInfo); | ||
10502 | $.ajax({ | 10516 | $.ajax({ |
10503 | type: 'post', | 10517 | type: 'post', |
10504 | url: 'select', | 10518 | url: 'select', |
@@ -10844,7 +10858,8 @@ var $invoice = $('.invoice'), | @@ -10844,7 +10858,8 @@ var $invoice = $('.invoice'), | ||
10844 | queryString = $.queryString(), | 10858 | queryString = $.queryString(), |
10845 | orderInfo = order.orderInfo, | 10859 | orderInfo = order.orderInfo, |
10846 | isSubmiting, | 10860 | isSubmiting, |
10847 | - dispatchInfo; | 10861 | + dispatchInfo, |
10862 | + total; | ||
10848 | 10863 | ||
10849 | require("js/common"); | 10864 | require("js/common"); |
10850 | 10865 | ||
@@ -10902,36 +10917,36 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) { | @@ -10902,36 +10917,36 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) { | ||
10902 | orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary'); | 10917 | orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary'); |
10903 | } | 10918 | } |
10904 | 10919 | ||
10905 | -function dispacthTapEvt(e) { | ||
10906 | - var $cur = $(e.target).closest('li'); | 10920 | +// function dispacthTapEvt(e) { |
10921 | +// var $cur = $(e.target).closest('li'); | ||
10907 | 10922 | ||
10908 | - if ($cur.length === 0 || $cur.hasClass('chosed')) { | ||
10909 | - return; | ||
10910 | - } | 10923 | +// if ($cur.length === 0 || $cur.hasClass('chosed')) { |
10924 | +// return; | ||
10925 | +// } | ||
10911 | 10926 | ||
10912 | - $cur.siblings('li.chosed').removeClass('chosed'); | ||
10913 | - $cur.addClass('chosed'); | ||
10914 | -} | 10927 | +// $cur.siblings('li.chosed').removeClass('chosed'); |
10928 | +// $cur.addClass('chosed'); | ||
10929 | +// } | ||
10915 | 10930 | ||
10916 | $('.checkbox').on('touchstart', function() { | 10931 | $('.checkbox').on('touchstart', function() { |
10917 | var $this = $(this); | 10932 | var $this = $(this); |
10918 | 10933 | ||
10919 | - if ($this.hasClass('icon-cb-checked')) { | ||
10920 | - $this.removeClass('icon-cb-checked').addClass('icon-checkbox'); | 10934 | + if ($this.hasClass('icon-cb-radio')) { |
10935 | + $this.removeClass('icon-cb-radio').addClass('icon-radio'); | ||
10921 | return; | 10936 | return; |
10922 | } | 10937 | } |
10923 | - if ($this.hasClass('icon-checkbox')) { | ||
10924 | - $this.removeClass('icon-checkbox').addClass('icon-cb-checked'); | 10938 | + if ($this.hasClass('icon-radio')) { |
10939 | + $this.removeClass('icon-radio').addClass('icon-cb-radio'); | ||
10925 | } | 10940 | } |
10926 | }); | 10941 | }); |
10927 | 10942 | ||
10928 | $invoice.on('touchend', '.checkbox', function() { | 10943 | $invoice.on('touchend', '.checkbox', function() { |
10929 | var $this = $(this); | 10944 | var $this = $(this); |
10930 | 10945 | ||
10931 | - if ($this.hasClass('icon-cb-checked')) { | 10946 | + if ($this.hasClass('icon-cb-radio')) { |
10932 | $invoice.addClass('focus'); | 10947 | $invoice.addClass('focus'); |
10933 | } | 10948 | } |
10934 | - if ($this.hasClass('icon-checkbox')) { | 10949 | + if ($this.hasClass('icon-radio')) { |
10935 | $invoice.removeClass('focus'); | 10950 | $invoice.removeClass('focus'); |
10936 | } | 10951 | } |
10937 | }); | 10952 | }); |
@@ -10952,11 +10967,10 @@ function orderCompute() { | @@ -10952,11 +10967,10 @@ function orderCompute() { | ||
10952 | skuList: isLimitGood() ? orderInfo('skuList') : undefined | 10967 | skuList: isLimitGood() ? orderInfo('skuList') : undefined |
10953 | } | 10968 | } |
10954 | }).then(function(res) { | 10969 | }).then(function(res) { |
10955 | - | ||
10956 | if ($.type(res) !== 'object') { | 10970 | if ($.type(res) !== 'object') { |
10957 | window.location.reload(); | 10971 | window.location.reload(); |
10958 | } else { | 10972 | } else { |
10959 | - if (res.last_order_amount) { | 10973 | + if (typeof res.last_order_amount !== undefined) { |
10960 | res.last_order_amount = (+res.last_order_amount).toFixed(2); | 10974 | res.last_order_amount = (+res.last_order_amount).toFixed(2); |
10961 | } | 10975 | } |
10962 | if (res.use_yoho_coin) { | 10976 | if (res.use_yoho_coin) { |
@@ -10965,6 +10979,18 @@ function orderCompute() { | @@ -10965,6 +10979,18 @@ function orderCompute() { | ||
10965 | $coinCheck.find('em').show(); | 10979 | $coinCheck.find('em').show(); |
10966 | $coinUsed.show(); | 10980 | $coinUsed.show(); |
10967 | } | 10981 | } |
10982 | + total = ''; | ||
10983 | + if (res.promotion_formula_list) { | ||
10984 | + $.each(res.promotion_formula_list, function(index, value) { | ||
10985 | + total += '<li>' + | ||
10986 | + '<p>' + value.promotion + '</p>' + | ||
10987 | + '<span>' + value.promotion_amount + '</span>' + | ||
10988 | + '</li>'; | ||
10989 | + }); | ||
10990 | + $('.price-cost span').html('¥' + res.last_order_amount); | ||
10991 | + $('.bill span').html('¥' + res.last_order_amount); | ||
10992 | + $('.total').html(total); | ||
10993 | + } | ||
10968 | } | 10994 | } |
10969 | }).fail(function() { | 10995 | }).fail(function() { |
10970 | window.location.reload(); | 10996 | window.location.reload(); |
@@ -10977,10 +11003,6 @@ function submitOrder() { | @@ -10977,10 +11003,6 @@ function submitOrder() { | ||
10977 | var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), | 11003 | var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), |
10978 | msg = $('#msg').find('input').val() || orderInfo('msg'); | 11004 | msg = $('#msg').find('input').val() || orderInfo('msg'); |
10979 | 11005 | ||
10980 | - if (orderInfo('deliveryId') === 2 && !$addressWrap.data('support')) { | ||
10981 | - tip.show('当前地址不支持顺丰快递'); | ||
10982 | - return; | ||
10983 | - } | ||
10984 | if (isSubmiting) { | 11006 | if (isSubmiting) { |
10985 | return false; | 11007 | return false; |
10986 | } | 11008 | } |
@@ -11055,17 +11077,8 @@ if (!orderInfo('addressId')) { | @@ -11055,17 +11077,8 @@ if (!orderInfo('addressId')) { | ||
11055 | } | 11077 | } |
11056 | 11078 | ||
11057 | $('.dispatch-mode').on('touchend', 'li', function() { | 11079 | $('.dispatch-mode').on('touchend', 'li', function() { |
11058 | - var $defaultMode = $('.dispatch-mode [data-id="1"]'); | ||
11059 | - | ||
11060 | - if (!$addressWrap.data('support') && $(this).data('id') === 2) { | ||
11061 | - dispacthTapEvt({ | ||
11062 | - target: $defaultMode | ||
11063 | - }); | ||
11064 | - tip.show('当前地址不支持顺丰快递'); | ||
11065 | - } else { | ||
11066 | - orderInfo('deliveryId', $(this).data('id')); | ||
11067 | - orderCompute(); | ||
11068 | - } | 11080 | + orderInfo('deliveryId', $(this).data('id')); |
11081 | + orderCompute(); | ||
11069 | }); | 11082 | }); |
11070 | 11083 | ||
11071 | $('.dispatch-time').on('touchend', 'li', function() { | 11084 | $('.dispatch-time').on('touchend', 'li', function() { |
@@ -11075,7 +11088,7 @@ $('.dispatch-time').on('touchend', 'li', function() { | @@ -11075,7 +11088,7 @@ $('.dispatch-time').on('touchend', 'li', function() { | ||
11075 | $('.coin').on('touchend', function() { | 11088 | $('.coin').on('touchend', function() { |
11076 | var $this = $(this); | 11089 | var $this = $(this); |
11077 | 11090 | ||
11078 | - if ($this.find('.checkbox').hasClass('icon-cb-checked')) { | 11091 | + if ($this.find('.checkbox').hasClass('icon-cb-radio')) { |
11079 | orderInfo('yohoCoin', $this.data('yoho-coin')); | 11092 | orderInfo('yohoCoin', $this.data('yoho-coin')); |
11080 | $this.find('.can-use').hide(); | 11093 | $this.find('.can-use').hide(); |
11081 | } else { | 11094 | } else { |
@@ -11090,7 +11103,7 @@ $('.coin').on('touchend', function() { | @@ -11090,7 +11103,7 @@ $('.coin').on('touchend', function() { | ||
11090 | $invoice.on('touchend', '.checkbox', function(e) { | 11103 | $invoice.on('touchend', '.checkbox', function(e) { |
11091 | var $this = $(this); | 11104 | var $this = $(this); |
11092 | 11105 | ||
11093 | - orderInfo('invoice', $this.hasClass('icon-cb-checked')); | 11106 | + orderInfo('invoice', $this.hasClass('icon-cb-radio')); |
11094 | e.preventDefault(); | 11107 | e.preventDefault(); |
11095 | e.stopPropagation(); | 11108 | e.stopPropagation(); |
11096 | }); | 11109 | }); |
@@ -11119,34 +11132,46 @@ $('form').on('submit', function() { | @@ -11119,34 +11132,46 @@ $('form').on('submit', function() { | ||
11119 | 11132 | ||
11120 | // xwg 2016/3/21 13:22 | 11133 | // xwg 2016/3/21 13:22 |
11121 | $('.dispatch').on('touchend', 'h3', function() { | 11134 | $('.dispatch').on('touchend', 'h3', function() { |
11122 | - if ($(this).siblings('ul').find('li').length === 1) { | ||
11123 | - return false; | ||
11124 | - } | ||
11125 | - | ||
11126 | if ($(this).siblings('ul').is(':hidden')) { | 11135 | if ($(this).siblings('ul').is(':hidden')) { |
11136 | + $('.dispatch h3').removeClass('border-none'); | ||
11137 | + $(this).addClass('border-none'); | ||
11138 | + $('.down').removeClass('hide'); | ||
11139 | + $('.up').addClass('hide'); | ||
11140 | + $('.up', this).removeClass('hide'); | ||
11141 | + $('.down', this).addClass('hide'); | ||
11142 | + $('.dispatch ul').hide(); | ||
11127 | $(this).siblings('ul').show(); | 11143 | $(this).siblings('ul').show(); |
11128 | } else { | 11144 | } else { |
11145 | + $(this).removeClass('border-none'); | ||
11146 | + $('.down', this).removeClass('hide'); | ||
11147 | + $('.up', this).addClass('hide'); | ||
11129 | $(this).siblings('ul').hide(); | 11148 | $(this).siblings('ul').hide(); |
11130 | } | 11149 | } |
11131 | }); | 11150 | }); |
11132 | 11151 | ||
11133 | -$subBlock.on('touchstart', 'i', function() { | 11152 | +$subBlock.on('touchstart', 'li', function() { |
11134 | $.each($(this).parents('ul').find('i'), function() { | 11153 | $.each($(this).parents('ul').find('i'), function() { |
11135 | - $(this).removeClass('icon-cb-radio').addClass('icon-radio'); | 11154 | + $(this).parents('ul').find('i').removeClass('icon-cb-radio').addClass('icon-radio'); |
11136 | }); | 11155 | }); |
11137 | - dispatchInfo = $(this).siblings('span').html(); | 11156 | + $(this).parents('ul').hide(); |
11157 | + $('.down').removeClass('hide'); | ||
11158 | + $('.up').addClass('hide'); | ||
11159 | + $('.dispatch h3').removeClass('border-none'); | ||
11160 | + dispatchInfo = $(this).find('span').html(); | ||
11138 | $(this).parents('.sub-block').find('h3 span').html(dispatchInfo); | 11161 | $(this).parents('.sub-block').find('h3 span').html(dispatchInfo); |
11139 | - if ($(this).hasClass('icon-cb-radio')) { | ||
11140 | - $(this).addClass('icon-radio'); | ||
11141 | - } else if ($(this).hasClass('icon-radio')) { | ||
11142 | - $(this).addClass('icon-cb-radio'); | 11162 | + if ($(this).find('i').hasClass('icon-cb-radio')) { |
11163 | + $(this).find('i').addClass('icon-radio'); | ||
11164 | + } else if ($(this).find('i').hasClass('icon-radio')) { | ||
11165 | + $(this).find('i').addClass('icon-cb-radio'); | ||
11143 | } | 11166 | } |
11144 | }); | 11167 | }); |
11145 | 11168 | ||
11146 | 11169 | ||
11147 | $('.bill a').on('touchstart', function() { | 11170 | $('.bill a').on('touchstart', function() { |
11148 | orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id')); | 11171 | orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id')); |
11149 | - orderInfo('paymentType', $('.delivery-time .icon-cb-radio').data('id')); | 11172 | + orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id')); |
11173 | + | ||
11174 | + payType = $('.payment-type .icon-cb-radio').data('id'); | ||
11150 | submitOrder(); | 11175 | submitOrder(); |
11151 | }); | 11176 | }); |
11152 | 11177 | ||
@@ -11157,6 +11182,7 @@ function phoneHidden(phone) { | @@ -11157,6 +11182,7 @@ function phoneHidden(phone) { | ||
11157 | $('.info-phone').html(phoneHidden($('.info-phone').html())); | 11182 | $('.info-phone').html(phoneHidden($('.info-phone').html())); |
11158 | 11183 | ||
11159 | 11184 | ||
11185 | + | ||
11160 | }); | 11186 | }); |
11161 | define("js/cart/order-info", ["jquery","hammer"], function(require, exports, module){ | 11187 | define("js/cart/order-info", ["jquery","hammer"], function(require, exports, module){ |
11162 | /** | 11188 | /** |
@@ -11483,7 +11509,7 @@ function phoneHidden(phone) { | @@ -11483,7 +11509,7 @@ function phoneHidden(phone) { | ||
11483 | } | 11509 | } |
11484 | 11510 | ||
11485 | $('.tel').each(function(index) { | 11511 | $('.tel').each(function(index) { |
11486 | - $('.tel').eq(index).html(phoneHidden($('.tel').html())); | 11512 | + $('.tel').eq(index).html(phoneHidden($('.tel').eq(index).html())); |
11487 | }); | 11513 | }); |
11488 | 11514 | ||
11489 | }); | 11515 | }); |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
-
Please register or login to post a comment