treasure_goods.blade.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. @extends('base.base')
  2. @section('base')
  3. <!-- 内容区域 -->
  4. <style type="text/css">
  5. .table th{
  6. padding: 0.8375rem;
  7. vertical-align: top;
  8. border-top: 1px solid #ebedf2;
  9. }
  10. </style>
  11. <div class="main-panel">
  12. <div class="content-wrapper">
  13. <div class="page-header">
  14. <h3 class="page-title">
  15. <span class="page-title-icon bg-gradient-primary text-white mr-2">
  16. <i class="mdi mdi-settings"></i>
  17. </span>
  18. {{ __('auto.幸运兑换管理') }}
  19. </h3>
  20. <nav aria-label="breadcrumb">
  21. <ol class="breadcrumb">
  22. <li class="breadcrumb-item"><a href="#">{{ __('auto.兑换管理') }}</a></li>
  23. <li class="breadcrumb-item active" aria-current="page">{{ __('auto.幸运兑换管理') }}</li>
  24. </ol>
  25. </nav>
  26. </div>
  27. <div class="row">
  28. <div class="col-lg-12 grid-margin stretch-card">
  29. <div class="card">
  30. <div class="card-body">
  31. <h4 class="card-title">{{ __('auto.幸运兑换管理') }}</h4>
  32. <form class="well form-inline margin-top-20" method="get" action='/admin/exchange/treasure_goods'>
  33. <span style="padding-left: 5px" >{{ __('auto.种类:') }}</span >
  34. <select class="form-control" name="type" value="{{$type}}" style="color: black">
  35. <option value="">{{ __('auto.请选择种类') }}</option>
  36. @foreach($goods_type as $k=>$v)
  37. <option value="{{$k}}" @if($k===$type) selected @endif>{{$v}}</option>
  38. @endforeach
  39. </select>
  40. <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
  41. <a href="/admin/exchange/treasure_goods" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
  42. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="add()">
  43. {{ __('auto.新增') }}
  44. </button>
  45. </p>
  46. </form>
  47. <table class="table table-bordered">
  48. <thead>
  49. <tr>
  50. <th width="6%">{{ __('auto.商品名称') }}</th>
  51. <th width="4%">{{ __('auto.种类') }}</th>
  52. <th width="6%">{{ __('auto.结束时间') }}</th>
  53. <th width="6%">{{ __('auto.总份数') }}</th>
  54. <th width="6%">{{ __('auto.兑换比例') }}</th>
  55. <th width="6%">{{ __('auto.兑换限额') }}</th>
  56. <th width="6%">{{ __('auto.状态') }}</th>
  57. <th width="6%">{{ __('auto.开奖次数') }}</th>
  58. <th width="6%">{{ __('auto.操作') }}</th>
  59. </tr>
  60. </thead>
  61. <tbody>
  62. @foreach($list as $k=>$v)
  63. <tr>
  64. <td>{{ $v->BonusName }}</td>
  65. <td>{{ $v->Type }}</td>
  66. <td>{{ $v->EndTime }}</td>
  67. <td>{{ $v->TotalAmount }}</td>
  68. <td>{{ $v->Ratio}}</td>
  69. <td>{{ $v->LimitCount}}</td>
  70. <td>{{ $v->overdue}}</td>
  71. <td>{{ $v->UsedAmount}}</td>
  72. <td>
  73. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="update({{ $v->ID }})">
  74. {{ __('auto.修改') }}
  75. </button>
  76. </td>
  77. </tr>
  78. @endforeach
  79. </tbody>
  80. </table>
  81. <div class="box-footer clearfix">
  82. {{ __('auto.总共') }} <b>{{ $list->appends(['type'=>$type])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
  83. {!! $list->links() !!}
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <script>
  92. function add(){
  93. var page = layer.open({
  94. type: 2,
  95. title: '{{ __('auto.添加商品') }}',
  96. shadeClose: true,
  97. shade: 0.8,
  98. area: ['70%', '90%'],
  99. content: '/admin/treasure_goods/add'
  100. });
  101. }
  102. function update(id){
  103. var page = layer.open({
  104. type: 2,
  105. title: '{{ __('auto.修改商品') }}',
  106. shadeClose: true,
  107. shade: 0.8,
  108. area: ['70%', '90%'],
  109. content: '/admin/treasure_goods/update/'+id
  110. });
  111. }
  112. $('.menu-switch').click(function(){
  113. id = $(this).attr('id');
  114. state = $(this).attr('state');
  115. console.log(id)
  116. console.log(state)
  117. if(state == "on"){
  118. $('.pid-'+id).hide();
  119. $(this).attr("state","off")
  120. $(this).removeClass('mdi-menu-down').addClass('mdi-menu-right');
  121. }else{
  122. $('.pid-'+id).show();
  123. $(this).attr("state","on")
  124. $(this).removeClass('mdi-menu-right').addClass('mdi-menu-down');
  125. }
  126. })
  127. </script>
  128. @endsection