open_recharge.blade.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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.包名:') }}{{$ChannelPackageName}}</h4>
  25. <form class="forms-sample" id="form">
  26. <table class="table table-bordered">
  27. @foreach($list as $k=>$v)
  28. <tr>
  29. <input type="hidden" name="id[{{$k}}]" value="{{$v->id}}">
  30. <td>{{$v->name}}</td>
  31. <td>
  32. <input type="radio" name="Status[{{$k}}]" value="1" @if ($v->Status == 1)
  33. checked
  34. @endif> {{ __('auto.开启') }}
  35. <input type="radio" name="Status[{{$k}}]" value="2" @if ($v->Status == 2)
  36. checked
  37. @endif> {{ __('auto.关闭') }}
  38. </td>
  39. <td>{{ __('auto.排序:') }}<input type="number" name="Sort[{{$k}}]" class="form-control" value="{{$v->Sort}}"></td>
  40. </tr>
  41. @endforeach
  42. </tbody>
  43. </table>
  44. <button type="button" onclick="commit('{{$Channel}}')"
  45. class="btn btn-sm btn-gradient-primary btn-icon-text">
  46. <i class="mdi mdi-file-check btn-icon-prepend"></i>
  47. {{ __('auto.提交') }}
  48. </button>
  49. <button type="button" onclick="cancel()"
  50. class="btn btn-sm btn-gradient-warning btn-icon-text">
  51. <i class="mdi mdi-reload btn-icon-prepend"></i>
  52. {{ __('auto.取消') }}
  53. </button>
  54. </form>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <script>
  62. function commit(Channel) {
  63. if (!checkForm()) {
  64. return false;
  65. }
  66. params = ($("#form").serializeObject());
  67. console.log(params)
  68. myRequest("/admin/channel/open_recharge/"+Channel,"post", params,function(res){
  69. if(res.code == '200'){
  70. layer.msg(res.msg)
  71. setTimeout(function(){
  72. parent.location.reload();
  73. },1500)
  74. }else{
  75. layer.msg(res.msg)
  76. }
  77. });
  78. }
  79. function cancel() {
  80. parent.location.reload();
  81. }
  82. function add() {
  83. layer.open({
  84. type: 2,
  85. title: '{{ __('auto.添加咖啡档位') }}',
  86. shadeClose: true,
  87. shade: 0.8,
  88. area: ['50%', '50%'],
  89. content: '/admin/recharge/add'
  90. });
  91. }
  92. function update() {
  93. layer.open({
  94. type: 2,
  95. title: '{{ __('auto.渠道修改') }}',
  96. shadeClose: true,
  97. shade: 0.8,
  98. area: ['50%', '50%'],
  99. content: '/admin/recharge/update'
  100. });
  101. }
  102. function switch_control(id, config_id, type) {
  103. console.log(id)
  104. myConfirm("{{ __('auto.操作不可逆,是否继续') }}?", function () {
  105. myRequest("/admin/recharge/gear_switch/" + id, "post", {config_id, type}, function (res) {
  106. layer.msg(res.msg)
  107. setTimeout(function () {
  108. parent.location.reload();
  109. }, 1500)
  110. });
  111. });
  112. }
  113. </script>
  114. @endsection