buy_step1.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. {include file="default/base/mall_top" /}
  2. <link rel="stylesheet" href="{$Think.HOME_SITE_ROOT}/css/home_cart.css">
  3. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  4. <!--{if $Think.config.ds_config.mapak_type eq '1'}-->
  5. <script type="text/javascript">
  6. window._AMapSecurityConfig = {
  7. securityJsCode:"{$Think.config.ds_config.gaode_jscode}",
  8. }
  9. </script>
  10. <script type="text/javascript" src="//webapi.amap.com/maps?v=2.0&key={$Think.config.ds_config.gaode_ak}"></script>
  11. <!--{else}-->
  12. <script type="text/javascript" src="{$Think.HTTP_TYPE}api.map.baidu.com/api?v=2.0&ak={$Think.config.ds_config.baidu_ak}"></script>
  13. <!--{/if}-->
  14. <div class="dsc-header">
  15. <div class="logo">
  16. <a href="{$Think.HOME_SITE_URL}"><img src="{:ds_get_pic(ATTACH_COMMON,$Think.config.ds_config.site_logo)}"/></a>
  17. </div>
  18. <ul class="dsc-flow">
  19. <li class=""><i class="iconfont">&#xe69a;</i>
  20. <p>{$Think.lang.cart_index_ensure_order}</p>
  21. <sub></sub>
  22. <div class="hr"></div>
  23. </li>
  24. <li class="current"><i class=" iconfont">&#xe731;</i>
  25. <p>{$Think.lang.cart_index_ensure_info}</p>
  26. <sub></sub>
  27. <div class="hr"></div>
  28. </li>
  29. <li class=""><i class="iconfont">&#xe64f;</i>
  30. <p>{$Think.lang.cart_index_payment}</p>
  31. <sub></sub>
  32. <div class="hr"></div>
  33. </li>
  34. <li class=""><i class="iconfont">&#xe67e;</i>
  35. <p>{$Think.lang.cart_index_buy_finish}</p>
  36. <sub></sub>
  37. <div class="hr"></div>
  38. </li>
  39. </ul>
  40. </div>
  41. <div class="dsc-line"></div>
  42. <form method="post" id="order_form" name="order_form" action="{:url('Buy/buy_step2')}">
  43. {include file="default/member/buy/buy_fcode" /}
  44. <div class="dsc-main">
  45. <div class="dsc-title">
  46. <h3>{$Think.lang.cart_index_ensure_info}</h3>
  47. <h5>{$Think.lang.check_information}</h5>
  48. </div>
  49. {include file="default/member/buy/buy_address" /}
  50. {include file="default/member/buy/buy_payment" /}
  51. {include file="default/member/buy/buy_invoice" /}
  52. {include file="default/member/buy/buy_goods_list" /}
  53. {include file="default/member/buy/buy_amount" /}
  54. <!-- 订单来源1为PC 2为手机 -->
  55. <input value="1" type="hidden" name="order_from">
  56. <!-- 来源于购物车标志 -->
  57. <input value="{$ifcart}" type="hidden" name="ifcart">
  58. <!-- offline/online -->
  59. <input value="online" name="pay_name" id="pay_name" type="hidden">
  60. <!-- 是否保存增值税发票判断标志 -->
  61. <input value="{$vat_hash}" name="vat_hash" type="hidden">
  62. <!-- 收货地址ID -->
  63. <input value="{$address_info.address_id}" name="address_id" id="address_id" type="hidden">
  64. <!-- 城市ID(运费) -->
  65. <input value="" name="buy_city_id" id="buy_city_id" type="hidden">
  66. <!-- 记录所选地区是否支持货到付款 第一个前端JS判断 第二个后端PHP判断 -->
  67. <input value="" id="allow_offpay" name="allow_offpay" type="hidden">
  68. <input value="" id="allow_offpay_batch" name="allow_offpay_batch" type="hidden">
  69. <input value="" id="offpay_hash" name="offpay_hash" type="hidden">
  70. <input value="" id="offpay_hash_batch" name="offpay_hash_batch" type="hidden">
  71. <input value="{present name='inv_info.invoice_id'}{$inv_info.invoice_id}{/present}" name="invoice_id" id="invoice_id" type="hidden">
  72. </div>
  73. </form>
  74. <script>
  75. var SUBMIT_FORM = true;
  76. //计算总运费和每个店铺小计
  77. function calcOrder() {
  78. var allTotal = 0;
  79. $('em[ds_type="eachStoreTotal"]').each(function(){
  80. store_id = $(this).attr('store_id');
  81. var eachTotal = 0;
  82. if ($('#eachStoreFreight_'+store_id).length > 0) {
  83. if($('#chain_'+store_id).val()>0){
  84. $('#eachStoreFreight_' + store_id).html('0.00');
  85. }else{
  86. $('#eachStoreFreight_' + store_id).html(number_format($('#eachStoreFreight_' + store_id).attr('data-freight'), 2));
  87. }
  88. eachTotal += parseFloat($('#eachStoreFreight_'+store_id).html());
  89. }
  90. if ($('#eachStoreGoodsTotal_'+store_id).length > 0) {
  91. eachTotal += parseFloat($('#eachStoreGoodsTotal_'+store_id).html());
  92. }
  93. if ($('#eachStoreManSong_'+store_id).length > 0) {
  94. eachTotal += parseFloat($('#eachStoreManSong_'+store_id).html());
  95. }
  96. if ($('#eachStoreVoucher_'+store_id).length > 0) {
  97. eachTotal += parseFloat($('#eachStoreVoucher_'+store_id).html());
  98. }
  99. $(this).html(number_format(eachTotal,2));
  100. allTotal += eachTotal;
  101. });
  102. //计算平台代金券
  103. if ($('#MallVoucher').length > 0) {
  104. var mallvoucharTotal = parseFloat($('#MallVoucher').html());
  105. allTotal += mallvoucharTotal;
  106. }
  107. $('#orderTotal').html(number_format(allTotal,2));
  108. }
  109. $(function(){
  110. $.ajaxSetup({
  111. async : false
  112. });
  113. $('select[dstype="voucher"]').on('change',function(){
  114. if ($(this).val() == '') {
  115. $('#eachStoreVoucher_'+items[1]).html('-0.00');
  116. } else {
  117. var items = $(this).val().split('|');
  118. $('#eachStoreVoucher_'+items[1]).html('-'+number_format(items[2],2));
  119. }
  120. calcOrder();
  121. });
  122. $('select[dstype="mallvoucher"]').on('change',function(){
  123. if ($(this).val() == '') {
  124. $('#MallVoucher').html('-0.00');
  125. } else {
  126. var items = $(this).val().split('|');
  127. $('#MallVoucher').html('-'+number_format(items[1],2));
  128. }
  129. calcOrder();
  130. });
  131. });
  132. function disableOtherEdit(showText) {
  133. $('a[ds_type="buy_edit"]').each(function() {
  134. if ($(this).css('display') != 'none') {
  135. $(this).after('<font color="#B0B0B0">' + showText + '</font>');
  136. $(this).hide();
  137. }
  138. });
  139. disableSubmitOrder();
  140. }
  141. function ableOtherEdit() {
  142. $('a[ds_type="buy_edit"]').show().next('font').remove();
  143. ableSubmitOrder();
  144. }
  145. function ableSubmitOrder() {
  146. $('#submitOrder').on('click', function() {
  147. submitNext()
  148. }).css('cursor', '').addClass('dsc-btn-acidblue');
  149. }
  150. function disableSubmitOrder() {
  151. $('#submitOrder').unbind('click').css('cursor', 'not-allowed').removeClass('dsc-btn-acidblue');
  152. }
  153. </script>
  154. {include file="default/base/mall_footer" /}