No Description

sourceindex.blade.php 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. @if(session('info'))
  5. <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
  6. {{session('info')}}
  7. </div>
  8. @endif
  9. <div class="page-container">
  10. <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a class="btn btn-primary radius" onclick="templateadd('新增')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增渠道</a></span> </div>
  11. <div class="mt-20">
  12. <table class="table table-border table-bordered table-bg table-hover table-sort">
  13. <thead>
  14. <tr class="text-c">
  15. {{--<th width="25"><input type="checkbox" name="" value=""></th>--}}
  16. <th width="5%">渠道ID</th>
  17. <th width="10%">模板示例图</th>
  18. <th width="10%">销售名称</th>
  19. <th width="8%">渠道备注</th>
  20. <th width="8%">推广链接</th>
  21. <th width="8%">生成时间</th>
  22. <th width="10%">操作</th>
  23. </tr>
  24. </thead>
  25. <tbody>
  26. @if($result)
  27. @foreach($result as $a)
  28. <tr class="text-c">
  29. {{--<td><input name="" type="checkbox" value=""></td>--}}
  30. <td class="text-c">{{$a['id']}}</td>
  31. <td class="text-c"><img style="width:100px;" src="{{$a['img']}}" /></td>
  32. <td class="text-c">
  33. @if($a['salers'])
  34. @foreach($a['salers'] as $k=>$saler)
  35. {{$saler['admin_name']}} @if( $k < $a['salers_k']-1), @endif
  36. @endforeach
  37. @endif
  38. </td>
  39. <td class="text-c">{{$a['note']}}</td>
  40. <td class="text-c">{{$a['url']}}</td>
  41. <td class="text-c">{{$a['create_time']}}</td>
  42. <td class="f-14 product-brand-manage">
  43. <a style="text-decoration:none" onClick='templateedit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>
  44. <a style="text-decoration:none" onClick='assign("分配销售","{{$a['id']}}")' href="javascript:;" title="分配销售"><span class="btn btn-primary radius">分配销售</span></a>
  45. <!--a style="text-decoration:none" class="ml-5" onClick="templatedel(this, '{{$a["id"]}}')" href="javascript:;" title="删除"><span class="btn btn-danger radius">删除</span></a-->
  46. </td>
  47. </tr>
  48. @endforeach
  49. @endif
  50. </tbody>
  51. </table>
  52. </div>
  53. <div id="page" class="page_div"></div>
  54. </div>
  55. <!--_footer 作为公共模版分离出去-->
  56. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  57. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  58. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  59. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  60. <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
  61. <!--/_footer 作为公共模版分离出去-->
  62. <!--/_footer 作为公共模版分离出去-->
  63. <script type="text/javascript">
  64. $(function(){
  65. setTimeout("$('#info').hide()",3000);
  66. });
  67. /*管理员-添加*/
  68. function templateadd(title){
  69. location.href = '/admin/template/sourcecreate';
  70. }
  71. /*管理员-编辑*/
  72. function templateedit(title,id){
  73. location.href = "/admin/template/sourceedit/"+id;
  74. }
  75. function assign(title,id){
  76. layer.open({
  77. type: 2,
  78. shade: false,
  79. area: ['400px', '60%'], //宽高
  80. title: "分配销售", //不显示标题
  81. content: 'getAssigns?id='+id //捕获的元素,注意:最好该指定的元素要存放在body最外层
  82. });
  83. }
  84. /*管理员-删除*/
  85. function templatedel(obj,id){
  86. layer.confirm('确认要删除吗?',function(index){
  87. $.ajax({
  88. type: 'GET',
  89. url: '/admin/template/delete/'+id,
  90. dataType: 'json',
  91. success: function(data){
  92. if(data == 1){
  93. $(obj).parents("tr").remove();
  94. layer.msg('已删除!',{icon:1,time:1000});
  95. }
  96. }
  97. });
  98. });
  99. }
  100. /*分页*/
  101. $("#page").paging({
  102. pageNo:{{$page}},
  103. totalPage: {{$pages}},
  104. totalSize: {{$count}},
  105. callback: function(num) {
  106. location.href='sourceindex?page='+num;
  107. }
  108. })
  109. </script>
  110. </body>
  111. @endsection