update.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <div class="main-panel">
  5. <div class="content-wrapper">
  6. <div class="page-header">
  7. <h3 class="page-title">
  8. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  9. <i class="mdi mdi-settings"></i>
  10. </span>
  11. {{ __('auto.咖啡档位修改') }}
  12. </h3>
  13. <nav aria-label="breadcrumb">
  14. <ol class="breadcrumb">
  15. <li class="breadcrumb-item"><a href="#">{{ __('auto.咖啡管理') }}</a></li>
  16. <li class="breadcrumb-item active" aria-current="page">{{ __('auto.咖啡档位修改') }}</li>
  17. </ol>
  18. </nav>
  19. </div>
  20. <div class="row">
  21. <div class="col-lg-12 grid-margin stretch-card">
  22. <div class="card">
  23. <div class="card-body">
  24. <h4 class="card-title">{{ __('auto.档位:') }}{{$info->money}}{{ __('auto.卢币') }}</h4>
  25. <table class="table table-bordered">
  26. <thead>
  27. <tr>
  28. <th width="5%">{{ __('auto.渠道名称') }}</th>
  29. <th width="8%">{{ __('auto.档位显示开关') }}</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. @foreach($names as $k=>$v)
  34. <tr>
  35. <td>{{ $v }}</td>
  36. <td>
  37. @if (exist_array($k,$info->gear))
  38. <button type="button" class="btn btn-sm btn-danger"
  39. onclick="switch_control({{$info->id}},{{$k}},'off')">{{ __('auto.关闭') }}
  40. </button>
  41. @else
  42. <button type="button" class="btn btn-sm btn-primary"
  43. onclick="switch_control({{$info->id}},{{$k}},'on')">{{ __('auto.开启') }}
  44. </button>
  45. @endif
  46. </td>
  47. </tr>
  48. @endforeach
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <script>
  58. function add() {
  59. layer.open({
  60. type: 2,
  61. title: '{{ __('auto.添加咖啡档位') }}',
  62. shadeClose: true,
  63. shade: 0.8,
  64. area: ['50%', '50%'],
  65. content: '/admin/recharge/add'
  66. });
  67. }
  68. function update() {
  69. layer.open({
  70. type: 2,
  71. title: '{{ __('auto.渠道修改') }}',
  72. shadeClose: true,
  73. shade: 0.8,
  74. area: ['50%', '50%'],
  75. content: '/admin/recharge/update'
  76. });
  77. }
  78. function switch_control(id, config_id, type) {
  79. console.log(id)
  80. myConfirm("{{ __('auto.操作不可逆,是否继续') }}?", function () {
  81. myRequest("/admin/recharge/gear_switch/" + id, "post", {config_id, type}, function (res) {
  82. layer.msg(res.msg)
  83. setTimeout(function () {
  84. parent.location.reload();
  85. }, 1500)
  86. });
  87. });
  88. }
  89. </script>
  90. @endsection