quota_add.html 2.7 KB

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