methods.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. <div class="button-group">
  25. <a href="/admin/recharge/clear_cache" class="btn btn-sn btn-primary layer-switch"
  26. data-remind="{{ __('auto.你确定要清除缓存吗?') }}">{{ __('auto.清除缓存') }}</a>
  27. </div>
  28. <table class="table table-bordered">
  29. <thead>
  30. <tr>
  31. <th width="8%">{{ __('auto.排序') }}</th>
  32. <th width="8%">{{ __('auto.图片') }}</th>
  33. <th width="5%">{{ __('auto.渠道名称') }}</th>
  34. <th width="8%">{{ __('auto.最新操作人') }}</th>
  35. <th width="8%">{{ __('auto.日期') }}</th>
  36. <th width="8%">{{ __('auto.当前状态') }}</th>
  37. <th width="8%">{{ __('auto.操作') }}</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. @foreach($methods as $k=>$v)
  42. <tr>
  43. <td contentEditable="true"
  44. onblur="update_sort(this,{{$v->id}})"> {{$v->sort}} </td>
  45. <td><img src="{{ $v->config_value }}" alt="" width="80px"></td>
  46. <td>{{ $v->name }}</td>
  47. <td>{{$v->account}}</td>
  48. <td>{{$v->updated_at}}</td>
  49. <td>
  50. @if ($v->status == 1)
  51. <span style="color: #0bb20c"> {{ __('auto.已开启') }}</span>
  52. @elseif ($v->status == -1)
  53. <span style="color: red">{{ __('auto.已关闭') }}</span>
  54. @endif
  55. </td>
  56. <td>
  57. @if ($v->status == 1)
  58. <button type="button" class="btn btn-sm btn-danger" onclick="switch_control({{$v->id}},'off')">{{ __('auto.关闭') }}</button>
  59. @elseif ($v->status == -1)
  60. <button type="button" class="btn btn-sm btn-primary" onclick="switch_control({{$v->id}},'on')">{{ __('auto.开启') }}</button>
  61. @endif
  62. <button class="btn btn-sm btn-gradient-dark" onclick="updatePic({{ $v->id }})">{{ __('auto.修改图片') }}</button>
  63. <a class="btn btn-sm btn-gradient-dark layer-dialog"
  64. href="/admin/recharge/config/{{$v->config_key}}">{{ __('auto.查看渠道') }}</a>
  65. </td>
  66. </tr>
  67. @endforeach
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <script>
  77. // 修改图片地址
  78. function updatePic(id) {
  79. layer.open({
  80. type: 2,
  81. title: '{{ __('auto.渠道修改') }}',
  82. shadeClose: true,
  83. shade: 0.8,
  84. area: ['50%', '50%'],
  85. content: '/admin/recharge/updatePic/' + id
  86. });
  87. }
  88. function switch_control(id,type){
  89. myConfirm("{{ __('auto.操作不可逆,是否继续') }}?",function(){
  90. myRequest("/admin/recharge/switch/"+id,"post",{type},function(res){
  91. layer.msg(res.msg)
  92. setTimeout(function(){
  93. window.location.reload();
  94. },1500)
  95. });
  96. });
  97. }
  98. function update_sort(obj,id) {
  99. sort = $(obj).html();
  100. if(sort != ''){
  101. myRequest("/admin/recharge/update_sort/" + id, "post", {sort}, function (res) {
  102. layer.msg(res.msg)
  103. setTimeout(function () {
  104. window.location.reload();
  105. }, 1500)
  106. });
  107. }else {
  108. window.location.reload();
  109. }
  110. }
  111. function update(id) {
  112. layer.open({
  113. type: 2,
  114. title: '{{ __('auto.渠道修改') }}',
  115. shadeClose: true,
  116. shade: 0.8,
  117. area: ['50%', '50%'],
  118. content: '/admin/recharge/update/' + id
  119. });
  120. }
  121. </script>
  122. @endsection