quota_add.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. <form id="add_form" action="{:url('Sellervoucher/quotaadd')}" method="post">
  5. <dl>
  6. <dt><i class="required">*</i>{$Think.lang.voucher_apply_addnum}{$Think.lang.ds_colon}</dt>
  7. <dd><input id="quota_quantity" name="quota_quantity" type="text" class="text w50"/><em class="add-on">{$Think.lang.ds_month}</em><span></span>
  8. <p class="hint">{$Think.lang.voucher_apply_add_tip1}</p>
  9. <p class="hint">{php}printf(lang('voucher_apply_add_tip2'), config('ds_config.promotion_voucher_price')){/php},{php}printf(lang('voucher_apply_add_tip3'), config('ds_config.voucher_storetimes_limit')){/php}</p>
  10. <p class="hint"><strong style="color: red">{$Think.lang.deduction_settlement_payment_days}</strong></p>
  11. </dd>
  12. </dl>
  13. <div class="bottom">
  14. <input id="submit_button" type="submit" value="{$Think.lang.ds_submit}" class="submit">
  15. </div>
  16. </form>
  17. </div>
  18. <script>
  19. $(document).ready(function(){
  20. //页面输入内容验证
  21. $("#add_form").validate({
  22. errorPlacement: function(error, element){
  23. var error_td = element.parent('dd').children('span');
  24. error_td.append(error);
  25. },
  26. submitHandler:function(form){
  27. var unit_price = parseInt('{$Think.config.ds_config.promotion_voucher_price}');
  28. var quantity = parseInt($("#quota_quantity").val());
  29. var price = unit_price * quantity;
  30. layer.confirm('{$Think.lang.voucher_apply_add_confirm1}'+price+'{$Think.lang.voucher_apply_add_confirm2}', {
  31. btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
  32. title: false,
  33. }, function () {
  34. ds_ajaxpost('add_form','url',"{:url('Sellervoucher/templatelist')}");
  35. });
  36. },
  37. rules : {
  38. quota_quantity : {
  39. required : true,
  40. digits : true,
  41. min : 1,
  42. max : 12
  43. }
  44. },
  45. messages : {
  46. quota_quantity : {
  47. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.voucher_apply_num_error}',
  48. digits : '<i class="iconfont">&#xe64c;</i>{$Think.lang.voucher_apply_num_error}',
  49. min : '<i class="iconfont">&#xe64c;</i>{$Think.lang.voucher_apply_num_error}',
  50. max : '<i class="iconfont">&#xe64c;</i>{$Think.lang.voucher_apply_num_error}'
  51. }
  52. }
  53. });
  54. });
  55. </script>
  56. {/block}