diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index f6f711b..8e5466a 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -66,7 +66,7 @@ class HomeController extends CommonController // 各产品占比 $lies = []; $product = Product::where('project_id', $project_id)->first(); - if($product){ + if ($product) { $productItem = ProductItems::where('product_id', $product->id)->get(); $factor = FactorItems::where('factor_id', $product->statistic_factor_id)->get(); $order_total = OrderItems::whereIn('product_item_id', $productItem->pluck('id'))->sum('total'); @@ -113,8 +113,15 @@ class HomeController extends CommonController $roleId = Role::where('name', 'like', '%首页统计%')->where('guard_name', 'admin')->value('id'); $tongji = DB::table('model_has_roles')->where('role_id', $roleId) ->where('model_type', 'App\Admin')->where('model_id', $userId)->count(); + // 判断是否有大屏幕权限 + $roleIdBydp = Role::where('name', 'like', '%大屏统计%')->where('guard_name', 'admin')->value('id'); + $dp = DB::table('model_has_roles')->where('role_id', $roleIdBydp) + ->where('model_type', 'App\Admin')->where('model_id', $userId)->count(); + if (is_mobile() || empty($tongji)) { - return view($this->bladePath . ".mobile_home"); + $jumpDp = 0; + if ($dp) $jumpDp = 1; + return view($this->bladePath . ".mobile_home", ['jump_dp' => $jumpDp]); } else { return view($this->bladePath . ".home", compact('project_id', 'projects', 'counts', 'lies', 'saleList', 'orderList')); } diff --git a/resources/views/admin/home.blade.php b/resources/views/admin/home.blade.php index 8e8340a..76642ef 100644 --- a/resources/views/admin/home.blade.php +++ b/resources/views/admin/home.blade.php @@ -11,46 +11,57 @@ padding-bottom: 62px; overflow-y: scroll; } + .footer { background: #fff; } + .toll-free-box i { transform: none !important; left: 1rem; bottom: .4rem; } + .static-container { display: flex; flex-wrap: wrap; } + .static-container > .card1 { margin-bottom: 20px; } + .static-container > .card1 + .card1 { margin-left: 20px; } + .static-container > .card1:nth-child(1) { flex-basis: 36%; } + .static-container > .card1:nth-child(2) { flex-basis: calc(64% - 20px); } + .static-container > .card1:nth-child(3) { flex-basis: 68%; height: 300px; margin-left: 0 !important; } + .static-container > .card1:nth-child(3) .card1-title > div::before { display: none; } + .card1 { background: #fff; border-radius: 4px; font-size: 14px; - box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); + box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1); overflow: hidden; position: relative; } + .card1::before { content: ""; height: 28px; @@ -62,6 +73,7 @@ bottom: -14px; right: 12px; } + .card1::after { content: ""; height: 42px; @@ -73,6 +85,7 @@ bottom: -4px; right: -14px; } + .card1-title { display: flex; justify-content: space-between; @@ -81,26 +94,30 @@ padding: 12px 14px; line-height: 1; } + .card1-title > div:nth-child(1) { color: #333; position: relative; } + .card1-title > div:nth-child(1)::before { content: ''; height: 14px; width: 140px; - background: radial-gradient(12px 9px at 10px 40%,#7ed3b155 20%,#0000 70%) 0 0/12px 12px no-repeat, - radial-gradient(120px 9px at 10px 40%,#7ed3b155 20%,#0000 70%) 12px 0/130px 12px no-repeat; + background: radial-gradient(12px 9px at 10px 40%, #7ed3b155 20%, #0000 70%) 0 0/12px 12px no-repeat, + radial-gradient(120px 9px at 10px 40%, #7ed3b155 20%, #0000 70%) 12px 0/130px 12px no-repeat; position: absolute; bottom: -6px; left: -6px; } + .card1-title__arrow { padding-right: 20px; cursor: pointer; position: relative; } + .card1-title__arrow::before { content: "\F142"; display: inline-block; @@ -114,25 +131,30 @@ bottom: 0; right: 0; } + .card1-body { padding: 7px; } - .card1-body .static1, .card1-body .static2{ + + .card1-body .static1, .card1-body .static2 { display: flex; flex-wrap: wrap; align-items: center; margin-top: 20px; } - .static1 .static1__item, .static2 .static2__item{ + + .static1 .static1__item, .static2 .static2__item { margin: 14px; padding-left: 20px; font-size: 14px; } - .static1 .static1__item .static1__item--label,.static2 .static2__item .static2__item--label { + + .static1 .static1__item .static1__item--label, .static2 .static2__item .static2__item--label { color: #666; position: relative; } + .static1 .static1__item .static1__item--label::before { content: ""; width: 4px; @@ -145,9 +167,11 @@ left: -10px; top: 0; } + .static2 .static2__item--label { padding-left: 4px; } + .static2 .static2__item .static2__item--label::before { content: ""; width: 8px; @@ -160,28 +184,35 @@ left: -10px; top: 50%; } + .static2 .static2__item:nth-child(2) .static2__item--label::before { background: #548fee; } + .static2 .static2__item:nth-child(3) .static2__item--label::before { background: #78d3a9; } - .static1 .static1__item .static1__item--value,.static2 .static2__item .static2__item--value { + + .static1 .static1__item .static1__item--value, .static2 .static2__item .static2__item--value { font-weight: 600; color: #333; line-height: 2; font-size: 15px; } + .static2 .static2__item .static2__item--value { text-align: center; } + .card1-body:has(#pie-chart) { height: calc(100% - 39px); } + #pie-chart { height: 100%; width: 100%; } + #bar-chart { height: 100%; width: 100%; @@ -190,10 +221,12 @@ .type-switch { display: flex; } + .type-switch .type-switch__item { padding: 0 20px; position: relative; } + .type-switch .type-switch__item > input { opacity: 0; position: absolute; @@ -202,10 +235,12 @@ right: 0; bottom: 0; } + .type-switch .type-switch__item:has(input:checked) .text { color: #609ff9; position: relative; } + .type-switch .type-switch__item:has(input:checked) .text::after { content: ""; width: 100%; @@ -215,9 +250,11 @@ left: 0; bottom: -12px; } + .hospital-select:focus { outline: none; } + .card1-body:has(#bar-chart) { height: calc(100% - 39px); } @@ -240,7 +277,8 @@ @@ -249,7 +287,7 @@