index.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. @extends('admin/layout')
  2. @section('content')
  3. <body class="gray-bg">
  4. <div class="wrapper wrapper-content animated fadeInRight">
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <div class="ibox float-e-margins">
  8. {{--<div class="ibox-title"></div>--}}
  9. <div class="ibox-content">
  10. {{-- <div class="input-group">
  11. <button type="button" class="btn btn-md btn-primary"
  12. style="margin-left: 10px"
  13. onclick="units.add(0)"> <span
  14. class="glyphicon glyphicon-plus"></span> 添加
  15. </button>
  16. </div>--}}
  17. <hr>
  18. <div class="table-responsive">
  19. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </body>
  27. @endsection
  28. @section('footer')
  29. <script>
  30. var units = {
  31. search: function () {
  32. tips.selectPage();
  33. },
  34. add: function () {
  35. layer.open({
  36. type: 2,
  37. content: ['/admin/message/addOrUpdate/0'],
  38. area: ['60%', '100%'],
  39. title: '添加'
  40. });
  41. },
  42. push: function (id) {
  43. layer.open({
  44. type: 2,
  45. content: ['/admin/message/push/' + id],
  46. area: ['40%', '60%'],
  47. title: '编辑推送'
  48. });
  49. },
  50. update: function (id) {
  51. layer.open({
  52. type: 2,
  53. content: ['/admin/message/addOrUpdate/' + id],
  54. area: ['60%', '100%'],
  55. title: '编辑'
  56. });
  57. },
  58. details: function (id) {
  59. layer.open({
  60. type: 2,
  61. content: ['/admin/message/details/' + id],
  62. area: ['60%', '100%'],
  63. title: '详情'
  64. });
  65. },
  66. /* del: function (id) {
  67. tips.ajax({
  68. url: ['/admin/message/delete/' + id],
  69. type: 'get'
  70. });
  71. window.location.reload();
  72. },*/
  73. };
  74. var config = {};
  75. config.url = '/admin/message/index';
  76. config.columns = [ //字段
  77. {
  78. title: '序号', align: 'center', formatter: function (value, item, index) {
  79. return index + 1;
  80. },
  81. width: '20px'
  82. },
  83. {title: '标题', field: 'title', align: 'center', width: '200px'},
  84. {title: '内容', field: 'message', align: 'center', width: '300px'},
  85. {title: '链接', field: 'url', align: 'center', width: '100px'},
  86. {
  87. title: 'banner', field: 'img', align: 'center', formatter: function (value, item) {
  88. return '<img src="' + value + '" style="width:80px">';
  89. }
  90. },
  91. {title: '消息类型', field: 'messageType', align: 'center', width: '100px'},
  92. {title: '创建时间', field: 'push_time', align: 'center', width: '100px'},
  93. {
  94. title: '操作', field: 'id', align: 'center',
  95. formatter: function (value, rows) {
  96. var str = '<button onclick="units.push(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>推送</button>&nbsp;';
  97. str += '<button onclick="units.update(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>&nbsp;';
  98. str += '<button onclick="units.details(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>详情</button>&nbsp;';
  99. /*str += '<button onclick="units.del(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>删除</button>&nbsp;';*/
  100. return str;
  101. }
  102. }
  103. ];
  104. tips.bootstrapTable(config);
  105. </script>
  106. @endsection