shop_goods.blade.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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/shop_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/shop_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. <!-- <i class="mdi mdi-plus btn-icon-prepend"></i> -->
  44. {{ __('auto.新增') }}
  45. </button>
  46. </p>
  47. </form>
  48. <table class="table table-bordered">
  49. <thead>
  50. <tr>
  51. <th width="6%">{{ __('auto.商品种类') }}</th>
  52. <th width="4%">{{ __('auto.商品') }}ID</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. <th width="6%">{{ __('auto.库存') }}</th>
  60. <th width="6%">{{ __('auto.每日限额') }}</th>
  61. <th width="6%">{{ __('auto.详情') }}</th>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. @foreach($list as $k=>$v)
  66. <tr>
  67. <td>{{ $v->Type }}</td>
  68. <td>{{ $v->ID }}</td>
  69. <td>{{ $v->GoodsTitle }}</td>
  70. <td>{{ $v->GoodsShowIndex }}</td>
  71. <td>{{ $v->Money}}</td>
  72. <td>{{ $v->Ratio}}</td>
  73. <td>{{ $v->UsedAmount}}</td>
  74. <td>{{ $v->TotalAmount-$v->UsedAmount}}</td>
  75. <td>{{ $v->TotalAmount}}</td>
  76. <td>{{ $v->DayLimit}}</td>
  77. <td>
  78. <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text" onclick="update({{ $v->ID }})">
  79. {{ __('auto.修改') }}
  80. </button>
  81. </td>
  82. </tr>
  83. @endforeach
  84. </tbody>
  85. </table>
  86. <div class="box-footer clearfix">
  87. {{ __('auto.总共') }} <b>{{ $list->appends(['type'=>$type])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
  88. {!! $list->links() !!}
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <script>
  97. function add(){
  98. var page = layer.open({
  99. type: 2,
  100. title: '{{ __('auto.添加商品') }}',
  101. shadeClose: true,
  102. shade: 0.8,
  103. area: ['70%', '90%'],
  104. content: '/admin/shop_goods/add'
  105. });
  106. }
  107. function update(id){
  108. var page = layer.open({
  109. type: 2,
  110. title: '{{ __('auto.修改商品') }}',
  111. shadeClose: true,
  112. shade: 0.8,
  113. area: ['70%', '90%'],
  114. content: '/admin/shop_goods/update/'+id
  115. });
  116. }
  117. $('.menu-switch').click(function(){
  118. id = $(this).attr('id');
  119. state = $(this).attr('state');
  120. console.log(id)
  121. console.log(state)
  122. if(state == "on"){
  123. $('.pid-'+id).hide();
  124. $(this).attr("state","off")
  125. $(this).removeClass('mdi-menu-down').addClass('mdi-menu-right');
  126. }else{
  127. $('.pid-'+id).show();
  128. $(this).attr("state","on")
  129. $(this).removeClass('mdi-menu-right').addClass('mdi-menu-down');
  130. }
  131. })
  132. </script>
  133. @endsection