index.blade.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. @extends('base.base')
  2. @section('base')
  3. <div class="main-panel">
  4. <div class="content-wrapper">
  5. <div class="page-header">
  6. <h3 class="page-title">{{ __('VIP 配置') }}</h3>
  7. </div>
  8. <div class="card">
  9. <div class="card-body">
  10. <!-- VIP配置表单 -->
  11. <form id="configForm">
  12. <div class="form-row">
  13. <div class="form-group col-md-2">
  14. <label for="downDays">{{ __('VIP降级天数') }}</label>
  15. <input type="number" class="form-control" id="downDays" name="down_days"
  16. value="{{ $downDays ?? 0 }}" min="1" required>
  17. <small class="form-text text-muted">{{ __('必须为正整数') }}</small>
  18. </div>
  19. <div class="form-group col-md-2">
  20. <label for="expireDays">{{ __('VIP过期天数') }}</label>
  21. <input type="number" class="form-control" id="expireDays" name="expire_days"
  22. value="{{ $expireDays ?? 0 }}" min="1" required>
  23. <small class="form-text text-muted">{{ __('必须为正整数') }}</small>
  24. </div>
  25. <div class="form-group col-md-2 d-flex align-items-center">
  26. <button type="button" class="btn btn-sm btn-primary" onclick="saveConfig()">{{ __('保存') }}</button>
  27. </div>
  28. </div>
  29. </form>
  30. <button class="btn btn-sm btn-success mb-2" onclick="add()">新增等级</button>
  31. <table class="table table-bordered">
  32. <thead>
  33. <tr>
  34. <th>ID</th>
  35. <th>充值金额</th>
  36. <th>VIP等级</th>
  37. <th>最小充值</th>
  38. <th>提现限额</th>
  39. <th>茶叶次数</th>
  40. <th>提现费率百分比</th>
  41. <th>Alpha (签到、救济金系数)</th>
  42. <th>客服类型 1 普通 2 一对一</th>
  43. <th>商城充值额外赠送百分比</th>
  44. <th>Superball每日赠送球数</th>
  45. <th>生日礼价值</th>
  46. <th>操作</th>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. @foreach($list as $row)
  51. <tr>
  52. <td>{{ $row->ID }}</td>
  53. <td>{{ $row->Recharge }}</td>
  54. <td>{{ $row->VIP }}</td>
  55. <td>{{ $row->MinRecharge }}</td>
  56. <td>{{ $row->WithdrawLimit }}</td>
  57. <td>{{ $row->DailyWithdraws }}</td>
  58. <td>{{ $row->WithdrawFeeRate }} %</td>
  59. <td>{{ $row->Alpha }}</td>
  60. <td>{{ $row->CustomServiceType }}</td>
  61. <td>{{ $row->RechargeExtraSendRate }} %</td>
  62. <td>{{ $row->SuperballNum }}</td>
  63. <td>{{ intval($row->BirthdayValue/100) }}</td>
  64. <td>
  65. <button class="btn btn-sm btn-primary" onclick="edit({{ $row->ID }})">{{ __('修改') }}</button>
  66. <button class="btn btn-sm btn-danger" onclick="del({{ $row->ID }})">{{ __('删除') }}</button>
  67. </td>
  68. </tr>
  69. @endforeach
  70. </tbody>
  71. </table>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <script>
  77. function add(){
  78. layer.open({
  79. type:2,shade:0.8,area:['50%','70%'],
  80. content:'/admin/protect-level/add'
  81. });
  82. }
  83. function edit(id){
  84. layer.open({
  85. type:2,shade:0.8,area:['50%','70%'],
  86. content:'/admin/protect-level/edit/'+id
  87. });
  88. }
  89. function del(id){
  90. myConfirm('确认删除?', function(){
  91. myRequest('/admin/protect-level/delete/'+id,'post',{},function(){
  92. layer.msg('已删除'); location.reload();
  93. });
  94. });
  95. }
  96. function saveConfig(){
  97. var downDays = document.getElementById('downDays').value;
  98. var expireDays = document.getElementById('expireDays').value;
  99. // 验证输入
  100. if (!downDays || downDays <= 0 || isNaN(downDays)) {
  101. layer.msg('VIP降级时间必须为正整数');
  102. return;
  103. }
  104. if (!expireDays || expireDays <= 0 || isNaN(expireDays)) {
  105. layer.msg('VIP过期时间必须为正整数');
  106. return;
  107. }
  108. myRequest('/admin/protect-level/save-config','post',{
  109. down_days: downDays,
  110. expire_days: expireDays
  111. },function(){
  112. layer.msg('配置已保存');
  113. });
  114. }
  115. </script>
  116. @endsection