页面优化,功能修复
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
@props([
|
||||
'title' => '',
|
||||
'moreUrl' => null,
|
||||
'moreText' => '查看全部',
|
||||
'items' => [],
|
||||
'itemUrl' => '#',
|
||||
'itemTitle' => null,
|
||||
'itemMeta' => null,
|
||||
'emptyText' => '暂无数据',
|
||||
])
|
||||
|
||||
<section class="channel-panel">
|
||||
<header class="channel-panel-head">
|
||||
<h3 class="channel-panel-title">{{ $title }}</h3>
|
||||
@if($moreUrl)
|
||||
<a class="tiny-link" href="{{ $moreUrl }}">{{ $moreText }}</a>
|
||||
@endif
|
||||
</header>
|
||||
|
||||
@forelse($items as $item)
|
||||
<article class="side-list-item">
|
||||
<a href="{{ value($itemUrl, $item) }}">{{ value($itemTitle, $item) }}</a>
|
||||
<small>{{ value($itemMeta, $item) }}</small>
|
||||
</article>
|
||||
@empty
|
||||
<p class="text-muted-soft small mb-0">{{ $emptyText }}</p>
|
||||
@endforelse
|
||||
</section>
|
||||
|
||||
15
resources/views/components/portal/stat-grid.blade.php
Normal file
15
resources/views/components/portal/stat-grid.blade.php
Normal file
@@ -0,0 +1,15 @@
|
||||
@props([
|
||||
'stats' => [],
|
||||
'gridClass' => 'channel-kpis',
|
||||
'itemClass' => 'channel-kpi',
|
||||
])
|
||||
|
||||
<section class="{{ $gridClass }}">
|
||||
@foreach($stats as $stat)
|
||||
<article class="{{ $itemClass }}">
|
||||
<span>{{ $stat['label'] }}</span>
|
||||
<b>{{ $stat['value'] }}</b>
|
||||
</article>
|
||||
@endforeach
|
||||
</section>
|
||||
|
||||
18
resources/views/components/portal/tool-grid.blade.php
Normal file
18
resources/views/components/portal/tool-grid.blade.php
Normal file
@@ -0,0 +1,18 @@
|
||||
@props([
|
||||
'tools' => [],
|
||||
'cardClass' => 'tool-card',
|
||||
'nameClass' => 'tool-card-name',
|
||||
'metaClass' => 'tool-card-meta',
|
||||
'tagClass' => 'tool-card-tag',
|
||||
])
|
||||
|
||||
<div class="tool-grid">
|
||||
@foreach($tools as $tool)
|
||||
<a class="{{ $cardClass }}" href="{{ route('tools.show', $tool->slug) }}">
|
||||
<div class="{{ $nameClass }}">{{ $tool->name }}</div>
|
||||
<div class="{{ $metaClass }}">{{ $tool->category?->name ?? '未分类' }} · {{ $tool->pricing_type }}</div>
|
||||
<span class="{{ $tagClass }}">{{ $tool->has_api ? '支持 API' : '无 API' }}</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
27
resources/views/components/portal/top-nav.blade.php
Normal file
27
resources/views/components/portal/top-nav.blade.php
Normal file
@@ -0,0 +1,27 @@
|
||||
@props([
|
||||
'active' => 'tools',
|
||||
'statusLabel' => '数据总量',
|
||||
'statusValue' => 0,
|
||||
'wrapperClass' => 'channel-head',
|
||||
'tabsClass' => 'channel-tabs',
|
||||
'statusClass' => 'channel-status',
|
||||
])
|
||||
|
||||
@php
|
||||
$tabs = [
|
||||
['key' => 'tools', 'label' => 'AI工具集', 'url' => route('tools.index')],
|
||||
['key' => 'models', 'label' => 'AI应用集', 'url' => route('models.index')],
|
||||
['key' => 'news', 'label' => '每日AI资讯', 'url' => route('news.index')],
|
||||
['key' => 'guides', 'label' => 'AI教程资源', 'url' => route('guides.index')],
|
||||
['key' => 'tool-list', 'label' => '工具列表', 'url' => route('tools.list')],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<header class="{{ $wrapperClass }}">
|
||||
<nav class="{{ $tabsClass }}" aria-label="频道导航">
|
||||
@foreach($tabs as $tab)
|
||||
<a class="channel-tab @if($active === $tab['key']) active @endif" href="{{ $tab['url'] }}">{{ $tab['label'] }}</a>
|
||||
@endforeach
|
||||
</nav>
|
||||
<div class="{{ $statusClass }}">{{ $statusLabel }} <b>{{ $statusValue }}</b></div>
|
||||
</header>
|
||||
Reference in New Issue
Block a user