123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- @extends('admin/layout')
- @section('content')
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- {{--<div class="ibox-title"></div>--}}
- <div class="ibox-content">
- {{-- <div class="input-group">
- <button type="button" class="btn btn-md btn-primary"
- style="margin-left: 10px"
- onclick="units.add(0)"> <span
- class="glyphicon glyphicon-plus"></span> 添加
- </button>
- </div>--}}
- <hr>
- <div class="table-responsive">
- <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script>
- var units = {
- search: function () {
- tips.selectPage();
- },
- add: function () {
- layer.open({
- type: 2,
- content: ['/admin/message/addOrUpdate/0'],
- area: ['60%', '100%'],
- title: '添加'
- });
- },
- push: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/message/push/' + id],
- area: ['40%', '60%'],
- title: '编辑推送'
- });
- },
- update: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/message/addOrUpdate/' + id],
- area: ['60%', '100%'],
- title: '编辑'
- });
- },
- details: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/message/details/' + id],
- area: ['60%', '100%'],
- title: '详情'
- });
- },
- /* del: function (id) {
- tips.ajax({
- url: ['/admin/message/delete/' + id],
- type: 'get'
- });
- window.location.reload();
- },*/
- };
- var config = {};
- config.url = '/admin/message/index';
- config.columns = [ //字段
- {
- title: '序号', align: 'center', formatter: function (value, item, index) {
- return index + 1;
- },
- width: '20px'
- },
- {title: '标题', field: 'title', align: 'center', width: '200px'},
- {title: '内容', field: 'message', align: 'center', width: '300px'},
- {title: '链接', field: 'url', align: 'center', width: '100px'},
- {
- title: 'banner', field: 'img', align: 'center', formatter: function (value, item) {
- return '<img src="' + value + '" style="width:80px">';
- }
- },
- {title: '消息类型', field: 'messageType', align: 'center', width: '100px'},
- {title: '创建时间', field: 'push_time', align: 'center', width: '100px'},
- {
- title: '操作', field: 'id', align: 'center',
- formatter: function (value, rows) {
- var str = '<button onclick="units.push(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>推送</button> ';
- str += '<button onclick="units.update(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button> ';
- str += '<button onclick="units.details(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>详情</button> ';
- /*str += '<button onclick="units.del(' + rows.id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>删除</button> ';*/
- return str;
- }
- }
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|