buy_amount.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <div class="dsc-bottom" id='submitOrder'> <a href="javascript:void(0)" class="dsc-btn dsc-btn-acidblue fr">{$Think.lang.cart_index_submit_order}</a> </div>
  2. <script>
  3. function submitNext() {
  4. if (!SUBMIT_FORM)
  5. return;
  6. if ($('input[name="cart_id[]"]').size() == 0) {
  7. layer.msg('{$Think.lang.commodity_is_invalid}');
  8. return;
  9. }
  10. if ($('#address_id').val() == '') {
  11. layer.msg('{$Think.lang.cart_step1_please_set_address}');
  12. return;
  13. }
  14. if ($('#buy_city_id').val() == '') {
  15. layer.msg('{$Think.lang.reselect_the_item}');
  16. return;
  17. }
  18. if ($('input[name="fcode"]').size() == 1 && $('#fcode_callback').val() != '1') {
  19. layer.alert('{$Think.lang.enter_f_code}');
  20. return;
  21. }
  22. SUBMIT_FORM = false;
  23. $('#order_form').submit();
  24. }
  25. $(function() {
  26. $(document).keydown(function(e) {
  27. if (e.keyCode == 13) {
  28. submitNext();
  29. return false;
  30. }
  31. });
  32. $('#submitOrder').on('click', function() {
  33. submitNext()
  34. });
  35. calcOrder();
  36. });
  37. </script>