buy_virtual_step2.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. {include file="default/base/mall_top" /}
  2. <link rel="stylesheet" href="{$Think.HOME_SITE_ROOT}/css/home_cart.css">
  3. <div class="dsc-header">
  4. <div class="logo">
  5. <a href="{$Think.HOME_SITE_URL}"><img src="{:ds_get_pic(ATTACH_COMMON,$Think.config.ds_config.site_logo)}"/></a>
  6. </div>
  7. </div>
  8. <div class="dsc-line"></div>
  9. <div class="dsc-main">
  10. <div class="dsc-title">
  11. <h3>{$Think.lang.cart_index_ensure_info}</h3>
  12. {if $goods_info.virtual_type==0}
  13. <h5>{$Think.lang.exchange_code_send_phone}</h5>
  14. {/if}
  15. </div>
  16. <form action="{:url('Buyvirtual/buy_step3')}" method="POST" id="form_buy" name="form_buy">
  17. <input type="hidden" name="goods_id" value="{$goods_info.goods_id}">
  18. <input type="hidden" name="quantity" value="{$goods_info.quantity}">
  19. {if $goods_info.virtual_type==0}
  20. <div class="dsc-receipt-info">
  21. <div class="dsc-receipt-info-title">
  22. <h3>{$Think.lang.electronic_exchange_code}</h3></div>
  23. <div id="invoice_list" class="dsc-candidate-items">
  24. <ul style="overflow: visible;">
  25. <li>{$Think.lang.cart_step1_mobile_num}:
  26. <div class="parentCls"><input name="buyer_phone" class="text" autocomplete = "off" type="text" id="buyer_phone" value="{:encrypt_show($member_info.member_mobile,4,4)}" maxlength="11" onfocus="clearMobile(this)"></div>
  27. </li>
  28. </ul>
  29. <p><i class="iconfont">&#xe73b;</i>{$Think.lang.exchange_code_instructions}</p>
  30. </div>
  31. </div>
  32. {/if}
  33. <div class="dsc-receipt-info"><div class="dsc-receipt-info-title">
  34. <h3>{$Think.lang.virtual_service_goods_list}</h3><a href="{:url('Buyvirtual/buy_step1',['goods_id'=>$Request.post.goods_id,'quantity'=>$Request.post.quantity])}">{$Think.lang.back_up}</a></div>
  35. <table class="dsc-table-style" ds_type="table_cart">
  36. <thead>
  37. <tr>
  38. <th colspan="3">{$Think.lang.cart_index_store_goods}</th>
  39. <th class="w150">{$Think.lang.cart_index_price}({$Think.lang.ds_yuan})</th>
  40. <th class="w80">{$Think.lang.cart_index_amount}</th>
  41. <th class="w150">{$Think.lang.cart_index_sum}({$Think.lang.ds_yuan})</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <tr>
  46. <th colspan="20">{$Think.lang.cart_step1_store}:<a href="{:url('Store/index',['store_id'=>$store_info.store_id])}">{$store_info.store_name}</a> <span member_id="{$store_info.member_id}"></span>
  47. </th>
  48. </tr>
  49. <tr class="shop-list">
  50. <td class="w10"></td>
  51. <td class="w60"><a href="{:url('Goods/index',['goods_id'=>$goods_info.goods_id])}" target="_blank" class="dsc-goods-thumb"><img src="{:goods_thumb($goods_info)}" alt="{$goods_info.goods_name}" /></a></td>
  52. <td class="tl"><dl class="dsc-goods-info">
  53. <dt><a href="{:url('Goods/index',['goods_id'=>$goods_info.goods_id])}" target="_blank">{$goods_info.goods_name}</a></dt>
  54. <dd>
  55. {present name="goods_info.ifgroupbuy"}
  56. <span class="groupbuy">{$Think.lang.snap_up}</span>
  57. {/present}
  58. </dd>
  59. </dl></td>
  60. <td class="w120">
  61. <em id="item_price">{$goods_info.goods_price}</em>
  62. <!--{if $goods_info.goods_price<$goods_info.goods_original_price}-->
  63. <div><del>{$goods_info.goods_original_price}</del></div>
  64. <!--{/if}-->
  65. </td>
  66. <td class="w120">{$goods_info.quantity}</td>
  67. <td><em id="item_subtotal">{$goods_info.goods_total}</em></td>
  68. </tr>
  69. <!-- S 留言 -->
  70. <tr>
  71. <td class="w10"></td>
  72. <td class="tl" colspan="2">{$Think.lang.buyer_message}:
  73. <textarea name="buyer_msg" class="dsc-msg-textarea" maxlength="150" placeholder="{$Think.lang.trade_show}" title="{$Think.lang.trade_show}"></textarea></td>
  74. <td class="tl" colspan="10"></td>
  75. </tr>
  76. <!-- E 留言 -->
  77. <!-- S voucher list -->
  78. {notempty name="store_voucher_list"}
  79. <tr>
  80. <td class="tr" colspan="20"><div class="dsc-store-account">
  81. <!--{if $goods_info.goods_discount_total>0}-->
  82. <dl>
  83. <dt>{$Think.lang.amount_of_goods}:</dt>
  84. <dd><em>{$goods_info.goods_original_total}</em>{$Think.lang.ds_yuan}</dd>
  85. </dl>
  86. <dl class="mansong">
  87. <dt>{$Think.lang.amount_of_discount}:</dt>
  88. <dd><em>{$goods_info.goods_discount_total}</em>{$Think.lang.ds_yuan}</dd>
  89. </dl>
  90. <!--{/if}-->
  91. <dl class="voucher">
  92. <dt>
  93. <select dstype="voucher" name="voucher">
  94. <option value="">{$Think.lang.cart_step1_select_voucher}</option>
  95. {foreach name="store_voucher_list" item="voucher"}
  96. <option value="{$voucher.vouchertemplate_id}|{$store_info.store_id}|{$voucher.voucher_price}">{$voucher.desc}</option>
  97. {/foreach}
  98. </select>
  99. <dd>¥<em id="storeVoucher">-0.00</em></dd>
  100. </dl>
  101. </div></td>
  102. </tr>
  103. {/notempty}
  104. <!-- E voucher list -->
  105. <!-- S mallvoucher list -->
  106. {notempty name="$mall_voucher_list"}
  107. <tr>
  108. <td class="tr" colspan="20"><div class="dsc-store-account">
  109. <dl class="mallvoucher">
  110. <dt>
  111. <select dstype="mallvoucher" name="mallvoucher">
  112. <option value="">{$Think.lang.cart_step1_select_mallvoucher}</option>
  113. {foreach name="$mall_voucher_list" item="mallvoucher" }
  114. <option value="{$mallvoucher.mallvouchertemplate_id}|{$mallvoucher.mallvoucheruser_price}">{$mallvoucher.desc}</option>
  115. {/foreach}
  116. </select>:
  117. </dt>
  118. <dd>¥<em id="mallVoucher">-0.00</em></dd>
  119. </dl>
  120. </div>
  121. </td>
  122. </tr>
  123. {/notempty}
  124. <!-- E mallvoucher list -->
  125. </tbody>
  126. <tfoot>
  127. <tr>
  128. <td colspan="20"><div class="dsc-all-account">{$Think.lang.total_price}<em id="orderTotal">{$goods_info.goods_total}</em>{$Think.lang.ds_yuan}</div></td>
  129. </tr>
  130. </tfoot>
  131. </table>
  132. </div></form>
  133. <div class="dsc-bottom"><a id="submitOrder" href="javascript:void(0)" class="dsc-btn dsc-btn-acidblue fr">{$Think.lang.cart_index_submit_order}</a></div>
  134. <script>
  135. //计算应支付金额计算
  136. function calcOrder() {
  137. var allTotal = parseFloat($('#item_subtotal').html());
  138. if ($('#storeVoucher').length > 0) {
  139. allTotal += parseFloat($('#storeVoucher').html());
  140. }
  141. if ($('#mallVoucher').length > 0) {
  142. allTotal += parseFloat($('#mallVoucher').html());
  143. }
  144. $('#orderTotal').html(number_format(allTotal,2));
  145. }
  146. $(document).ready(function(){
  147. $('select[dstype="voucher"]').on('change',function(){
  148. if ($(this).val() == '') {
  149. $('#storeVoucher').html('-0.00');
  150. } else {
  151. var items = $(this).val().split('|');
  152. $('#storeVoucher').html('-'+number_format(items[2],2));
  153. }
  154. calcOrder();
  155. });
  156. $('select[dstype="mallvoucher"]').on('change',function(){
  157. if ($(this).val() == '') {
  158. $('#mallVoucher').html('-0.00');
  159. } else {
  160. var items = $(this).val().split('|');
  161. $('#mallVoucher').html('-'+number_format(items[1],2));
  162. }
  163. calcOrder();
  164. });
  165. var SUBMIT_FORM = true;
  166. $('#submitOrder').on('click',function(){
  167. if (!$("#form_buy").valid()) return;
  168. if (!SUBMIT_FORM) return;
  169. SUBMIT_FORM = false;
  170. $('#form_buy').submit();
  171. });
  172. $("#form_buy").validate({
  173. onkeyup: false,
  174. rules: {
  175. buyer_phone : {
  176. required : true,
  177. minlength : 11
  178. }
  179. },
  180. messages: {
  181. buyer_phone : {
  182. required : "{$Think.lang.write_mobile_number}",
  183. minlength : "{$Think.lang.write_correct_mobile_number}",
  184. }
  185. }
  186. });
  187. });
  188. function clearMobile(obj){
  189. if($(obj).val()=='{:encrypt_show($member_info.member_mobile,4,4)}'){
  190. $(obj).val('')
  191. }
  192. }
  193. </script>
  194. {include file="default/base/mall_footer" /}