goodsList.blade.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. @extends('user.layouts')
  2. @section('css')
  3. <link href="/assets/global/plugins/fancybox/source/jquery.fancybox.css" rel="stylesheet" type="text/css" />
  4. <style>
  5. .fancybox > img {
  6. width: 75px;
  7. height: 75px;
  8. }
  9. </style>
  10. @endsection
  11. @section('title', '控制面板')
  12. @section('content')
  13. <!-- BEGIN CONTENT BODY -->
  14. <div class="page-content">
  15. <!-- BEGIN PAGE BREADCRUMB -->
  16. <ul class="page-breadcrumb breadcrumb">
  17. <li>
  18. <a href="{{url('user/goodsList')}}">流量包</a>
  19. <i class="fa fa-circle"></i>
  20. </li>
  21. </ul>
  22. <!-- END PAGE BREADCRUMB -->
  23. <!-- BEGIN PAGE BASE CONTENT -->
  24. <div class="row">
  25. <div class="col-md-12">
  26. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  27. <div class="portlet light bordered">
  28. <div class="portlet-title">
  29. <div class="caption font-dark">
  30. <i class="icon-basket font-dark"></i>
  31. <span class="caption-subject bold uppercase"> 流量包列表 </span>
  32. </div>
  33. </div>
  34. <div class="portlet-body">
  35. <div class="table-scrollable">
  36. <table class="table table-striped table-bordered table-hover table-checkable order-column" id="sample_1">
  37. <thead>
  38. <tr>
  39. <th> ID </th>
  40. <th> 名称 </th>
  41. <th> 图片 </th>
  42. <th> 内含流量 </th>
  43. <th> 售价 </th>
  44. <!--<th> 所需积分 </th>-->
  45. <th> </th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. @if($goodsList->isEmpty())
  50. <tr>
  51. <td colspan="7">暂无数据</td>
  52. </tr>
  53. @else
  54. @foreach($goodsList as $key => $goods)
  55. <tr class="odd gradeX">
  56. <td> {{$key + 1}} </td>
  57. <td> {{$goods->name}} </td>
  58. <td> @if($goods->logo) <a href="{{$goods->logo}}" class="fancybox"><img src="{{$goods->logo}}"/></a> @endif </td>
  59. <td> {{$goods->traffic}} </td>
  60. <td> {{$goods->price}} </td>
  61. <!--<td> {{$goods->score}} </td>-->
  62. <td>
  63. <button type="button" class="btn btn-sm red btn-outline" onclick="buy('{{$goods->id}}')">购买</button>
  64. <!--<button type="button" class="btn btn-sm blue btn-outline" onclick="exchange('{{$goods->id}}')">兑换</button>-->
  65. </td>
  66. </tr>
  67. @endforeach
  68. @endif
  69. </tbody>
  70. </table>
  71. </div>
  72. <div class="row">
  73. <div class="col-md-4 col-sm-4">
  74. <div class="dataTables_info" role="status" aria-live="polite">共 {{$goodsList->total()}} 个流量包</div>
  75. </div>
  76. <div class="col-md-8 col-sm-8">
  77. <div class="dataTables_paginate paging_bootstrap_full_number pull-right">
  78. {{ $goodsList->links() }}
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <!-- END EXAMPLE TABLE PORTLET-->
  85. </div>
  86. </div>
  87. <!-- END PAGE BASE CONTENT -->
  88. </div>
  89. <!-- END CONTENT BODY -->
  90. @endsection
  91. @section('script')
  92. <script src="/assets/global/plugins/fancybox/source/jquery.fancybox.js" type="text/javascript"></script>
  93. <script src="/assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
  94. <script type="text/javascript">
  95. function buy(goods_id) {
  96. window.location.href = '{{url('user/addOrder?goods_id=')}}' + goods_id;
  97. }
  98. // 编辑商品
  99. function exchange(id) {
  100. //
  101. }
  102. // 查看商品图片
  103. $(document).ready(function () {
  104. $('.fancybox').fancybox({
  105. openEffect: 'elastic',
  106. closeEffect: 'elastic'
  107. })
  108. })
  109. </script>
  110. @endsection