list.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('轮播图管理'))
  4. <div class="right-titpos">
  5. <ul class="add-snav">
  6. <li class="active"><a href="#">轮播图管理</a></li>
  7. <a class="btn btn-primary" href="{!! yzWebUrl('plugin.auction.admin.rotation.detail') !!}"><i class="fa fa-plus"></i> 添加轮播图</a>
  8. </ul>
  9. </div>
  10. <div class='panel panel-default'>
  11. <form action="" method="post" class="form-horizontal" id="form1">
  12. <div class="panel panel-info">
  13. <div class="panel-body">
  14. <div class="form-group col-xs-12 col-sm-2">
  15. <input class="form-control" name="title" id="" type="text"
  16. value="{{$title}}" placeholder="标题">
  17. </div>
  18. <div class="form-group col-xs-12 col-sm-2">
  19. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label"></label>
  20. <div class="col-sm-8 col-lg-9 col-xs-12">
  21. <button class="btn btn-success" style="border-radius: 5px;"><i class="fa fa-search"></i> 搜索</button>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </form>
  27. </div>
  28. <div class='panel panel-default'>
  29. <div class='panel-body'>
  30. <table class="table table-hover">
  31. <thead>
  32. <tr>
  33. <th style='width:10%;text-align: center;'>ID</th>
  34. <th style='width:20%;text-align: center;'>标题</th>
  35. <th style='width:40%;text-align: center;'>跳转链接</th>
  36. <th style='width:10%;text-align: center;'>状态</th>
  37. <th style='width:20%;text-align: center;'>操作</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. @foreach($list['data'] as $key=>$row)
  42. <tr style="height: 10em;">
  43. <td style='width:10%;text-align: center;'>{{$row['id']}}</td>
  44. <td style='width:10%;text-align: center;'>{{$row['title']}}</td>
  45. <td style='width:10%;text-align: center;'>{{yz_tomedia($row['url'])}}</td>
  46. <td style='width:10%;text-align: center;'><div class="col-sm-2 col-xs-6">
  47. <input class="mui-switch mui-switch-animbg" id="cate_is_show_{{$key}}" type="checkbox"
  48. @if($row['is_show'] == 1)
  49. checked
  50. @endif
  51. onclick="message_default({{$row['id']}},this.id)"/>
  52. </div></td>
  53. <td style='width:10%;text-align: center;'>
  54. <a class='btn btn-default' href="{{yzWebUrl("plugin.auction.admin.rotation.detail", ['id'=>$row['id']])}}">详情</a>
  55. <a class='btn btn-default' href="{{yzWebUrl("plugin.auction.admin.rotation.delete", ['id'=>$row['id']])}}"
  56. onclick="return confirm('确认删除该轮播图吗?');return false;">删除</a>
  57. </td>
  58. </tr>
  59. @endforeach
  60. </tbody>
  61. </table>
  62. {!! $pager !!}
  63. </div>
  64. </div>
  65. <div style="width:100%;height:150px;"></div>
  66. <script language='javascript'>
  67. $(function () {
  68. $('#search').click(function () {
  69. $('#form1').attr('action', '{!! yzWebUrl('plugin.auction.admin.rotation.index') !!}');
  70. $('#form1').submit();
  71. });
  72. });
  73. function message_default(cid,name) {
  74. var id = "#" + name;
  75. var url = "<?php echo yzWebUrl('plugin.auction.admin.rotation.changeShow'); ?>"
  76. if ($(id).is(':checked')) {
  77. //开
  78. $.post(url,{'status':1,'id':cid},function(data){
  79. if (data.status == 1) {
  80. showPopover($(id),"开启成功");
  81. $(id).attr("checked",true);
  82. } else {
  83. showPopover($(id),"开启失败");
  84. $(id).attr("checked",false);
  85. }
  86. }, "json");
  87. } else {
  88. //关
  89. $.post(url,{'status':0,'id':cid},function(data){
  90. if (data.status == 1) {
  91. showPopover($(id),"关闭成功");
  92. $(id).attr("checked",false);
  93. } else {
  94. showPopover($(id),"关闭失败");
  95. $(id).attr("checked",true);
  96. }
  97. }, "json");
  98. }
  99. }
  100. function showPopover(target, msg) {
  101. target.attr("data-original-title", msg);
  102. $('[data-toggle="tooltip"]').tooltip();
  103. target.tooltip('show');
  104. target.focus();
  105. //2秒后消失提示框
  106. setTimeout(function () {
  107. target.attr("data-original-title", "");
  108. target.tooltip('hide');
  109. }, 2000
  110. );
  111. }
  112. </script>
  113. @endsection