index.blade.php
3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.spot.management'))
@section('after-styles')
{{ Html::style("https://cdn.datatables.net/v/bs/dt-1.10.15/datatables.min.css") }}
@endsection
@section('page-header')
<h1>
{{ trans('labels.backend.spot.management') }}
<small>{{ trans('labels.backend.spot.active') }}</small>
</h1>
@endsection
@section('content')
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.spot.active') }}</h3>
<div class="box-tools pull-right">
@include('backend.spot.includes.partials.spot-header-button')
</div><!--box-tools pull-right-->
</div><!-- /.box-header -->
<div class="box-body">
<div class="table-responsive">
<table id="users-table" class="table table-condensed table-hover">
<thead>
<tr>
<th>{{ trans('labels.backend.spot.table.spotname') }}</th>
<th>{{ trans('labels.backend.spot.table.business_name') }}</th>
<th>{{ trans('labels.backend.spot.table.main_title') }}</th>
<th>{{ trans('labels.backend.spot.table.vic_title') }}</th>
<th>{{ trans('labels.backend.spot.table.go_url') }}</th>
<th>{{ trans('labels.backend.spot.table.wx_logo') }} </th>
<th>{{ trans('labels.backend.spot.table.detail_img') }} </th>
<th>{{ trans('labels.backend.spot.table.listen_img') }} </th>
</tr>
</thead>
</table>
</div><!--table-responsive-->
</div><!-- /.box-body -->
</div><!--box-->
@endsection
@section('after-scripts')
{{ Html::script("https://cdn.datatables.net/v/bs/dt-1.10.15/datatables.min.js") }}
{{ Html::script("js/backend/plugin/datatables/dataTables-extend.js") }}
<script>
$(function () {
$('#users-table').DataTable({
dom: 'lfrtip',
processing: false,
serverSide: true,
autoWidth: false,
ajax: {
url: '{{ route("admin.spot.get") }}',
type: 'get',
data: {status: 1, trashed: false},
error: function (xhr, err) {
if (err === 'parsererror')
location.reload();
}
},
columns: [
{data: 'spotname', name: 'spotname'},
{data: 'business_name', name: 'business_name'},
{data: 'main_title', name: 'main_title'},
{data: 'vic_title', name: 'vic_title'},
{data: 'go_url', name: 'go_url'},
{data: 'wx_logo', name: 'wx_logo', render: function (data, type, row, meta) {
return "<img width='80px', heigth='80px' src='" + data + "' />";
}},
{data: 'detail_img', name: 'detail_img', render: function (data, type, row, meta) {
return "<img width='120', heigth='45' src='" +'https://dev-1255927177.cos.ap-shanghai.myqcloud.com'+ data + "' />";
}},
{data: 'listen_img', name: 'listen_img', render: function (data, type, row, meta) {
if(data){
return "<img width='120', heigth='45' src='" +'https://dev-1255927177.cos.ap-shanghai.myqcloud.com'+ data + "' />";
}else{
return '暂无设置';
}
}},
{data: 'actions', name: 'actions', searchable: false, sortable: false}
],
order: [[0, "asc"]],
searchDelay: 500
});
});
</script>
@endsection