| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 | @extends('admin/layout')@section('header')    <link rel="stylesheet"          href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">    <style>        .btn-danger, .btn-primary, .btn-info {            background: #009688 !important;            border-color: #009688 !important;        }        .table-striped > tbody > tr:nth-of-type(odd) {            background: #f8f8f8 !important;        }        .table-striped > tbody > tr .btn {            background: none !important;        }        .table-striped > tbody > tr td {            font-size: 14px !important;        }        .table-striped > tbody > tr:hover {            background: #ffebd8 !important;        }        .table-striped > tbody > tr:hover .btn {            background: #009688 !important;            color: #fff !important;        }        .table-striped > tbody > tr:hover .btn .glyphicon {            color: #fff !important;        }    </style>@endsection@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-content">                        <form class="row" id="searchForm" onsubmit="units.search();return false;">                            <div class="col-md-4">                                <div class="input-group">                                   <span class="input-group-btn">                                       <button type="button" class="btn btn-md btn-info" onclick="units.toAuth()">hootsuite授权</button>                                   </span>                                </div>                            </div>                            <div class="col-md-6 pull-right">                                <div class="input-group">                                    <input type="text" placeholder="请输入邮箱或站点" class="input-md form-control"                                           name="keyword"                                           id="keyWord" style="width: 300px;float: right">                                    <span class="input-group-btn">                                    <button type="button" class="btn btn-md btn-primary"                                            onclick="units.search()"> 搜索</button>                                    <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"                                            name="resetBtn"> 重置</button> </span>                                </div>                            </div>                        </form>                        <hr>                        <div class="table-responsive">                            <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>                        </div>                    </div>                </div>            </div>        </div>        {{--<div id="bindSiteHtml" style="display: none">--}}        {{--<div style="padding: 12px">--}}        {{--<select class="my-select"--}}        {{--id="site_ids" name="site_ids" data-live-search="true"--}}        {{--title="请选择站点" autocomplete="off">--}}        {{--<option value="">请选择站点</option>--}}        {{--@foreach ($sites as $item)--}}        {{--<option value="{{$item->id}}"--}}        {{--@if(in_array($item->id,[])) selected @endif>{{$item->cn_title}}</option>--}}        {{--@endforeach--}}        {{--</select>--}}        {{--</div>--}}        {{--</div>--}}    </div>    </body>@endsection@section('footer')    <!-- Latest compiled and minified JavaScript -->    <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>    <!-- (Optional) Latest compiled and minified JavaScript translation files -->    {{--<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/i18n/defaults-*.min.js"></script>--}}    <script>        var units = {            toAuth: function () {                window.open('/admin/socials/hootsuite-auth')            },            search: function () {                tips.selectPage();            },            bindSite: function (hootsuiteId) {                var str = '            <div style="padding: 12px">\n' +                    '                <select class="my-select form-control" style="z-index:999;"' +                    '                        name="site_id" data-live-search="true"\n' +                    '                        title="请选择站点" autocomplete="off">\n' +                    '                    <option value="">请选择站点</option>\n' +                    '                    @foreach ($sites as $item)' +                    '                        <option value="{{$item->id}}"\n' +                    '                                @if(in_array($item->id,[])) selected @endif>{{$item->cn_title}}</option>\n' +                    '                    @endforeach' +                    '                </select>\n' +                    '            </div>';                layer.open({                    title: "站点绑定",                    type: 1,                    content: str,                    area: ['500px', '500px'],                    zIndex: 99,                    success: function () {                        $('.my-select').selectpicker();                    },                    btn: ['确认', '取消'],                    yes: function (index, layero) {                        var siteId = layero.find("[name=site_id]").val();                        if (!siteId) {                            layer.alert('请选择要绑定的站点', {icon: 5});                            return                        }                        var ajaxConfig = {                            url: '/admin/hootsuite/bind-site',                            type: 'put',                            data: {hootsuiteId: hootsuiteId, siteId: siteId},                            success:function () {                                layer.close(index)                                $('#table').bootstrapTable('refresh');                            }                        };                        tips.ajax(ajaxConfig);                    }                });            }        };        var config = {};        config.url = '/admin/socials';        config.columns = [ //字段            {checkbox: true},            {                title: '序号', align: 'center', formatter: function (value, item, index) {                    return index + 1;                }            },            {title: '站点', field: 'site_title', align: 'center'},            {title: '用户名', field: 'full_name', align: 'center'},            {title: '邮箱', field: 'email', align: 'center'},            {title: '创建时间', field: 'created_at', align: 'center'},            {                title: '操作', field: 'id', align: 'center',                formatter: function (value, rows) {                    return '<button onclick="units.bindSite(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>站点绑定</button> ';                }            }        ];        tips.bootstrapTable(config);    </script>@endsection
 |