
<style>
    .dashboard-title .links {
        text-align: center;
        margin-bottom: 2.5rem;
    }
    .dashboard-title .links > a {
        width: 25%;
        padding: 0 1rem;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .1rem;
        text-decoration: none;
        text-transform: uppercase;
        color: #fff;
    }
    .dashboard-title h1 {
        font-weight: 200;
        font-size: 2.5rem;
    }
    .dashboard-title .avatar {
        background: #fff;
        border: 2px solid #fff;
        width: 70px;
        height: 70px;
    }
    .dashboard-title {
        transition: all 0.3s;
        cursor: pointer;
    }
    .dashboard-title:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    /* 隐藏头部 */
    .content-header {
        display: none !important;
    }
    /* 隐藏底部 */
    .main-footer{
        display: none !important;
    }
    /* 隐藏图标 */
    /* .navbar-brand {
        display: none !important;
    } */
</style>
<a href="{{$dhUrl}}">
<div class="dashboard-title card bg-primary" style="margin-top: 10%;text-align: center">
    <h1 class="mb-3 mt-2 text-white">订货要货</h1>
</div>
</a>
@if($username=='admin')
<div class="dashboard-title card bg-primary" style="margin-top: 10%;text-align: center; cursor: pointer;" onclick="syncJiancheng()">
    <h1 class="mb-3 mt-2 text-white">简称同步</h1>
</div>
@endif
<div class="cs card">
</div>
<script type="text/javascript" src="{{URL::asset('js/quagga.min.js')}}"></script>
<script>
function syncJiancheng() {
    if(confirm('确定要同步简称数据吗？')) {
        $.ajax({
            url: 'admin/syncJiancheng',
            type: 'POST',
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            success: function(response) {
                if(response.status === 'success') {
                    alert('同步成功！');
                } else {
                    alert('同步失败：' + response.message);
                }
            },
            error: function(xhr) {
                alert('同步失败：' + xhr.responseJSON.message);
            }
        });
    }
}
</script>
