edit.blade.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. @extends('admin.public.base')
  2. @section('body_class')
  3. style="margin: 0 auto;width: 96%;padding: 30px 0px;"
  4. @endsection
  5. @section('content')
  6. <form class="post-form" action="" method="post">
  7. <div class="form-group col-sm-12">
  8. <label class="control-label">优惠券名称 <span class="text-red">*</span></label>
  9. <input class="form-control" required="required" type="text" placeholder="优惠券名称" maxlength="20" name="name" value="{{$oldData['name']}}" />
  10. </div>
  11. <div class="form-group col-sm-12">
  12. <label class="control-label">优惠券类型 <span class="text-red">*</span></label>
  13. <select class="form-control" required="required" name="rebate_type" id="rebate_type">
  14. <option value="1" @if ( $oldData['rebate_type'] == '1' ) selected="selected" @endif>满减券</option>
  15. <option value="2" @if ( $oldData['rebate_type'] == '2' ) selected="selected" @endif>折扣券</option>
  16. <option value="3" @if ( $oldData['rebate_type'] == '3' ) selected="selected" @endif>赠品券</option>
  17. </select>
  18. </div>
  19. <div class="form-group col-sm-12">
  20. <label class="control-label">优惠力度 <span class="text-red">*</span></label>
  21. <div class="form-group col-sm-12">
  22. <label class="control-label"> </label>
  23. <div class="form-group col-sm-2">
  24. <input required="required" class="form-control" type="text" placeholder="满多少元" name="std_pay" value="{{$oldData['std_pay']}}" />
  25. </div>
  26. <div class="form-group col-sm-2">
  27. <input required="required" class="form-control" id="rebate" type="text" placeholder="减多少元" name="rebate" value="{{$oldData['rebate']}}" />
  28. </div>
  29. </div>
  30. </div>
  31. <div class="form-group col-sm-12">
  32. <label class="control-label">优惠券有效期 <span class="text-red">*</span></label>
  33. <div class="form-group col-sm-12">
  34. <div class="form-group col-sm-2">
  35. <label class="control-label"><input type="radio" checked name="exp_type" value="1" @if ( $oldData['exp_type'] == 1 ) checked="" @endif > 领取后X天有效 </label>
  36. <input class="form-control" type="number" placeholder="天数" name="exp_days" @if ( $oldData['exp_type'] == 1 ) value="{{intval($oldData['exp_time'])}}" @endif />
  37. </div>
  38. <div class="form-group col-sm-2">
  39. <label class="control-label"><input type="radio" name="exp_type" value="2" @if ( $oldData['exp_type'] == 2 ) checked="" @endif > 固定有效期</label>
  40. <input class="form-control" id="rebate" type="date" placeholder="开始时间" name="start_time" @if ( $oldData['exp_type'] == 2 ) value="{{date('Y-m-d',$oldData['start_time'])}}" @endif />
  41. <input class="form-control" id="rebate" type="date" placeholder="结束时间" name="end_time" @if ( $oldData['exp_type'] == 2 ) value="{{date('Y-m-d',$oldData['end_time'])}}" @endif />
  42. </div>
  43. </div>
  44. </div>
  45. <div class="form-group col-sm-12">
  46. <label class="control-label">发行数量 <span class="text-red">*</span> </label>
  47. <input class="form-control" required="required" type="number" placeholder="发行数量" min="0" max="999999" name="issue_total" value="{{$oldData['issue_total']}}" />
  48. </div>
  49. <div class="form-group col-sm-12">
  50. <label class="control-label">适用商品</label>
  51. <div class="form-group col-sm-12">
  52. <div class="form-group col-sm-2">
  53. <label class="control-label"><input type="radio" name="type_id" value="2" @if ( $oldData['type_id'] == 2 ) checked="" @endif> 全部商品范围</label>
  54. </div>
  55. <div class="form-group col-sm-2">
  56. <label class="control-label"><input type="radio" name="type_id" value="1" @if ( $oldData['type_id'] == 1 ) checked="" @endif > 指定商品范围</label>
  57. <input class="form-control" type="file" placeholder="适用商品范围" maxlength="20" name="product_file" value="" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
  58. </div>
  59. </div>
  60. </div>
  61. <div class="form-group col-sm-12">
  62. <label class="control-label">适用客户</label>
  63. <div class="form-group col-sm-12">
  64. <div class="form-group col-sm-2">
  65. <label class="control-label"><input type="radio" name="is_appt" value="0" @if ( $oldData['is_appt'] == 0 ) checked="" @endif> 全部客户</label>
  66. </div>
  67. <div class="form-group col-sm-2">
  68. <label class="control-label"><input type="radio" name="is_appt" value="1" @if ( $oldData['is_appt'] == 1 ) checked="" @endif> 指定客户范围</label>
  69. <input class="form-control" type="file" placeholder="适用客户范围" name="custom_file" value="" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
  70. </div>
  71. </div>
  72. </div>
  73. <div class="form-group col-sm-12">
  74. @csrf
  75. <input type="hidden" name="id" value="{{$oldData['id']}}" />
  76. <input id="send" type="submit" value="提交" class="btn btn-primary btn-block" />
  77. </div>
  78. </form>
  79. @endsection
  80. @section('javascript')
  81. <script>
  82. $(function(){
  83. // 类型变更
  84. $('#rebate_type').change(function(){
  85. // 获取值
  86. var rebateType = $(this).val();
  87. // 如果是满减
  88. if( rebateType == 1 ) $('#rebate').attr('placeholder','减多少元');
  89. // 如果是折扣
  90. if( rebateType == 2 ) $('#rebate').attr('placeholder','打几折');
  91. // 如果是赠品
  92. if( rebateType == 3 ) $('#rebate').attr('placeholder','产品编码');
  93. })
  94. })
  95. </script>
  96. @endsection