exempt_review_update.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="row">
  7. <div class="col-12 grid-margin stretch-card">
  8. <div class="card">
  9. <div class="card-body">
  10. <h4 class="card-title">{{ __('auto.请填写管理员信息') }}</h4>
  11. <form class="forms-sample" id="form">
  12. <div class="form-group">
  13. <h4>{{ __('auto.菜单名称') }}</h4>
  14. <input type="text" class="form-control required" name="name" placeholder="{{ __('auto.请输入菜单名称') }}" value="{{ $info->name }}">
  15. </div>
  16. <div>
  17. <label for="recharge">
  18. <input type="checkbox" name="recharge_checkbox" id="recharge" @if ($info->recharge_checkbox > 0)
  19. checked
  20. @endif>
  21. {{ __('auto.累计咖啡额度范围设置') }}
  22. </label>
  23. <br>
  24. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  25. <label>* 下限值</label>
  26. <input type="number" class="form-control" name="recharge_min" placeholder="{{ __('auto.下限值') }}" value="{{ $info->recharge_min }}">
  27. </div>
  28. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  29. <label>* 上限值</label>
  30. <input type="number" class="form-control" name="recharge_max" placeholder="{{ __('auto.上限值') }}" value="{{ $info->recharge_max }}">
  31. </div>
  32. </div>
  33. <div>
  34. <label for="draw">
  35. <input type="checkbox" name="draw_checkbox" id="draw" @if ($info->type > 0)
  36. checked
  37. @endif>
  38. {{ __('auto.单个玩家可免审核茶叶额度') }}
  39. </label> <br>
  40. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  41. <label> <input type="radio" name="type" id="optionsRadios2" value="1" @if ($info->type == 1)
  42. checked
  43. @endif>
  44. {{ __('auto.固定额度') }}</label>
  45. <input type="number" class="form-control" name="quota" placeholder="{{ __('auto.固定额度') }}" @if ($info->type == 1)
  46. value="{{ $info->quota }}"
  47. @endif>
  48. </div>
  49. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  50. <label>* <input type="radio" name="type" id="optionsRadios2" value="2" @if ($info->type ==2 )
  51. checked
  52. @endif>
  53. {{ __('auto.固定倍数') }}</label>
  54. <input type="number" class="form-control" name="multiple" placeholder="{{ __('auto.固定倍数') }}" id="multiple" @if ($info->type == 2)
  55. value="{{ $info->quota }}"
  56. @endif>
  57. </div>
  58. </div>
  59. <div>
  60. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  61. <label> <input type="checkbox" name="draw_gt_recharge_checkbox" @if ($info->draw_gt_recharge > 0)
  62. checked
  63. @endif>
  64. {{ __('auto.茶叶大于咖啡,设置超过值:') }}</label>
  65. <input type="number" class="form-control" name="draw_gt_recharge" placeholder="{{ __('auto.茶叶大于咖啡') }}"
  66. id="quota" value="{{ $info->draw_gt_recharge }}">
  67. </div>
  68. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  69. <label>* <input type="checkbox" name="draw_total_checkbox" @if ($info->draw_total >0)
  70. checked
  71. @endif>
  72. {{ __('auto.茶叶总额超过,设置超过值:') }}</label>
  73. <input type="number" class="form-control" name="draw_total" placeholder="{{ __('auto.茶叶总额超过') }}"
  74. id="multiple" value="{{ $info->draw_total }}">
  75. </div>
  76. </div>
  77. <div>
  78. <div class="form-group" style="width: 50%;float: left;margin-left: 5px">
  79. <label> <input type="checkbox" name="draw_bi_checkbox" @if ($info->draw_bi > 0)
  80. checked
  81. @endif>
  82. {{ __('auto.单日茶叶笔数超过,设置超过值:') }}</label>
  83. <input type="number" class="form-control" name="draw_bi" placeholder="{{ __('auto.单日茶叶笔数超过') }}"
  84. id="quota" value="{{ $info->draw_bi }}">
  85. </div>
  86. <div class="form-group" style="width: 48%;float: left;margin-left: 3px">
  87. <label>* <input type="checkbox" name="game_time_checkbox" @if ($info->game_time > 0)
  88. checked
  89. @endif>
  90. {{ __('auto.总游戏时长低于,设置值(小时):') }}</label>
  91. <input type="number" class="form-control" name="game_time" placeholder="{{ __('auto.总游戏时长低于') }}"
  92. id="multiple" value="{{ $info->game_time }}">
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label for=""><h4>{{ __('auto.每日申请总额度设置') }}</h4></label> <br>
  97. <label for="nickname">
  98. {{ __('auto.当前每日累计消耗额度/每日总额度:') }}
  99. </label>
  100. {{ __('auto.添加') }} / {{ __('auto.减少额度') }}<input type="text" class="form-control required" name="total_quota"
  101. placeholder="{{ __('auto.每日总额度设置') }}" value="{{ $info->total_quota }}">
  102. </div>
  103. <div class="form-group">
  104. <label for=""><h4>{{ __('auto.开关设置') }}</h4></label> <br>
  105. <label> <input type="radio" name="status" id="optionsRadios2" value="1" @if ($info->status == 1)
  106. checked
  107. @endif> {{ __('auto.开启') }}</label>
  108. <label> <input type="radio" name="status" id="optionsRadios2" value="2" @if ($info->status == 2)
  109. checked
  110. @endif> {{ __('auto.关闭') }}</label>
  111. </div>
  112. <div style="margin-top: 10px">
  113. <span>{{ __('auto.请选择一个代付方') }}</span>
  114. @foreach($agent as $val)
  115. <div class="radio">
  116. <label>
  117. <input type="radio" value="{{$val->config_value}}" name="agent" @if ($info->agent == $val->config_value)
  118. checked
  119. @endif>
  120. {{$val->name}}
  121. </label>
  122. </div>
  123. @endforeach
  124. </div>
  125. <button type="button" onclick="commit({{ $info->id }})"
  126. class="btn btn-sm btn-gradient-primary btn-icon-text">
  127. <i class="mdi mdi-file-check btn-icon-prepend"></i>
  128. {{ __('auto.提交') }}
  129. </button>
  130. <button type="button" onclick="cancel()"
  131. class="btn btn-sm btn-gradient-warning btn-icon-text">
  132. <i class="mdi mdi-reload btn-icon-prepend"></i>
  133. {{ __('auto.取消') }}
  134. </button>
  135. </form>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <script>
  143. function commit(id) {
  144. if (!checkForm()) {
  145. return false;
  146. }
  147. var data = $("#form").serializeObject();
  148. if (! data.draw_bi_checkbox){
  149. data.draw_bi = 0
  150. }
  151. if (! data.draw_gt_recharge_checkbox){
  152. data.draw_gt_recharge = 0
  153. }
  154. if (! data.draw_total_checkbox){
  155. data.draw_total = 0
  156. }
  157. if (! data.game_time_checkbox){
  158. data.game_time = 0
  159. }
  160. if (! data.recharge_checkbox){
  161. data.recharge_max = 0
  162. data.recharge_min = 0
  163. }
  164. if (! data.draw_checkbox){
  165. data.type = 0
  166. }
  167. let type = data.type
  168. if (type == 1 && data.quota == '') {
  169. layer.msg('{{ __('auto.固定额度不能为空') }}');
  170. return false;
  171. }
  172. if (type == 2 && data.multiple == '') {
  173. layer.msg('{{ __('auto.固定倍数不能为空') }}');
  174. return false;
  175. }
  176. if (parseInt(data.recharge_min) > parseInt(data.recharge_max)) {
  177. layer.msg('{{ __('auto.下限值不能大于上限') }}');
  178. return false;
  179. }
  180. if (data.quota != '' && (data.quota < 0 || data.quota > 1000000)) {
  181. layer.msg('{{ __('auto.固定额度区间为') }}0-1000000');
  182. return false;
  183. }
  184. if (data.multiple != '' && (data.multiple < 1 || data.multiple > 100)) {
  185. layer.msg('{{ __('auto.固定倍数区间为') }}1-100');
  186. return false;
  187. }
  188. if (data.multiple != '' && type == 2) {
  189. data.quota = data.multiple
  190. }
  191. myRequest("/admin/withdrawal/exempt_review_update/"+id, "post", data, function (res) {
  192. if (res.code == '200') {
  193. layer.msg(res.msg)
  194. setTimeout(function () {
  195. parent.location.reload();
  196. }, 1500)
  197. } else {
  198. layer.msg(res.msg)
  199. }
  200. });
  201. }
  202. function cancel() {
  203. parent.location.reload();
  204. }
  205. </script>
  206. @endsection