groupbuy_quota_add.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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('Sellergroupbuy/groupbuy_quota_add_save')}" method="post">
  5. <dl>
  6. <dt><i class="required">*</i>{$Think.lang.text_buy_count}</dt>
  7. <dd>
  8. <input id="groupbuy_quota_quantity" name="groupbuy_quota_quantity" type="text" class="text w30" /><em class="add-on">{$Think.lang.ds_month}</em><span></span>
  9. <p class="hint">{$Think.lang.purchase_unit_month}</p>
  10. <p class="hint">{$Think.lang.need_pay_monthly}{$Think.config.ds_config.groupbuy_price}{$Think.lang.ds_yuan}; </p>
  11. <p class="hint"><strong style="color: red">{$Think.lang.deduction_settlement_payment_days}</strong></p>
  12. </dd>
  13. </dl>
  14. <div class="bottom">
  15. <input id="submit_button" type="submit" class="submit" value="{$Think.lang.ds_submit}">
  16. </div>
  17. </form>
  18. </div>
  19. <script type="text/javascript">
  20. $(document).ready(function () {
  21. //页面输入内容验证
  22. $("#add_form").validate({
  23. errorPlacement: function (error, element) {
  24. var error_td = element.parent('dd').children('span');
  25. error_td.append(error);
  26. },
  27. submitHandler: function (form) {
  28. var unit_price = "{$Think.config.ds_config.groupbuy_price}";
  29. var quantity = $("#groupbuy_quota_quantity").val();
  30. var price = unit_price * quantity;
  31. layer.confirm('{$Think.lang.need_pay_total}' + price + '{$Think.lang.ds_yuan}', {
  32. btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
  33. title: false,
  34. }, function () {
  35. ds_ajaxpost('add_form', 'url', "{:url('Sellergroupbuy/index')}");
  36. });
  37. },
  38. rules: {
  39. groupbuy_quota_quantity: {
  40. required: true,
  41. digits: true,
  42. min: 1
  43. }
  44. },
  45. messages: {
  46. groupbuy_quota_quantity: {
  47. required: "<i class='iconfont'>&#xe64c;</i>{$Think.lang.quantity_cannot_empty}",
  48. digits: "<i class='iconfont'>&#xe64c;</i>{$Think.lang.quantity_cannot_empty}",
  49. min: "<i class='iconfont'>&#xe64c;</i>{$Think.lang.quantity_cannot_empty}"
  50. }
  51. }
  52. });
  53. });
  54. </script>
  55. {/block}