quota_add.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {extend name="default/base/base_seller" /}
  2. {block name="seller_main"}
  3. <div class="dssc-form-default">
  4. {if $Request.action == 'bundling_quota_add'}
  5. <form id="add_form" action="{:url('Sellerpromotionbundling/bundling_quota_add')}" method="post">
  6. {else /}
  7. <form id="add_form" action="{:url('Sellerpromotionbundling/bundling_renew')}" method="post">
  8. {/if}
  9. <dl>
  10. <dt><i class="required">*</i>{$Think.lang.bundling_quota_add_quantity}{$Think.lang.ds_colon}</dt>
  11. <dd>
  12. <input id="bundling_quota_quantity" name="bundling_quota_quantity" type="text" class="text w50"/><em class="add-on">{$Think.lang.ds_month}</em><span></span>
  13. <p class="hint">{$Think.lang.bundling_price_explain1}</p>
  14. <p class="hint">{php}printf(lang('bundling_price_explain2'), intval(config('ds_config.promotion_bundling_price'))){/php}</p>
  15. <p class="hint"><strong style="color: red">{$Think.lang.notice_package_renewal6}</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_bundling_price});
  33. var quantity = parseInt($("#bundling_quota_quantity").val());
  34. var price = unit_price * quantity;
  35. layer.confirm('{$Think.lang.bundling_quota_add_confirm}' + 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('Sellerpromotionbundling/index')}");
  40. });
  41. },
  42. rules: {
  43. bundling_quota_quantity: {
  44. required: true,
  45. digits: true,
  46. min: 1,
  47. max: 12
  48. }
  49. },
  50. messages: {
  51. bundling_quota_quantity: {
  52. required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.bundling_quota_quantity_error}',
  53. digits: '<i class="iconfont">&#xe64c;</i>{$Think.lang.bundling_quota_quantity_error}',
  54. min: '<i class="iconfont">&#xe64c;</i>{$Think.lang.bundling_quota_quantity_error}',
  55. max: '<i class="iconfont">&#xe64c;</i>{$Think.lang.bundling_quota_quantity_error}'
  56. }
  57. }
  58. });
  59. });
  60. </script>
  61. {/block}