buy_fcode.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!-- S fcode -->
  2. {if isset($store_cart_list[key($store_cart_list)][0]['is_goodsfcode'])&&$store_cart_list[key($store_cart_list)][0]['is_goodsfcode'] == 1}
  3. <div class="dsc-main">
  4. <div class="dsc-title">
  5. <h3>{$Think.lang.f_code_goods_purchase}</h3>
  6. <h5>{$Think.lang.verify_pre_emption_rights}</h5>
  7. </div>
  8. <div class="dsc-receipt-info">
  9. <div class="fcode-form ">
  10. <input name="fcode" type="text" class="text" id="fcode" placeholder="{$Think.lang.please_enter_f_code}" autocomplete="off" maxlength="20" />
  11. <input type="button" value="{$Think.lang.using_f_code}" id="fcode_submit" class="button" />
  12. <input value="" type="hidden" name="fcode_callback" id="fcode_callback">
  13. <input type="hidden" id="goods_commonid" name="goods_commonid" value="{php}echo $store_cart_list[key($store_cart_list)][0]['goods_commonid'];{/php}">
  14. </div>
  15. <div class="fcode-hint" id="fcode_showmsg"></div>
  16. </div>
  17. </div>
  18. <!-- E fcode -->
  19. <script>
  20. $(function(){
  21. $('#fcode_submit').on('click',function(){
  22. if ($('#fcode').val() == '') {
  23. layer.alert('{$Think.lang.using_f_code}');return false;
  24. }
  25. $('#fcode_callback').val('');
  26. $.get("{:url('Buy/check_fcode')}", {'fcode':$('#fcode').val(),'goods_commonid':$('#goods_commonid').val()}, function(data){
  27. if (data == '1') {
  28. $('#fcode_callback').val('1');
  29. $('#fcode_submit').hide();
  30. $('#fcode').hide();
  31. $('#fcode_showmsg').append('<i class="icon-ok-circle"></i>'+$('#fcode').val()+'{$Think.lang.complete_the_purchase_order}');
  32. } else {
  33. layer.alert('{$Think.lang.f_code_error}');
  34. }
  35. });
  36. });
  37. });
  38. </script>
  39. {/if}