结构
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
zhongjy001
2026-03-10 10:15:14 +08:00
parent e30c6a9f14
commit 20670f45e1
3 changed files with 33 additions and 74 deletions

View File

@@ -90,51 +90,7 @@ $bannerItems = collect(data_get($bannerModule, 'items', []))->take((int) data_ge
</nav>
</section>
@if(data_get($channelModule, 'enabled', true) === true)
<section id="section-channel" class="tool-section" aria-label="频道卡片">
<header class="tool-section-head">
<h2><i class="bi bi-grid text-primary"></i> {{ data_get($channelModule, 'title', '频道卡片') }}</h2>
</header>
<div class="tool-channel">
<div class="tool-channel-mini">
<a href="{{ route('home') }}"><i class="bi bi-house"></i><br>首页</a>
<a href="{{ route('tools.list') }}"><i class="bi bi-tools"></i><br>工具</a>
<a href="{{ route('models.index') }}"><i class="bi bi-cpu"></i><br>模型</a>
<a href="{{ route('news.index') }}"><i class="bi bi-newspaper"></i><br>资讯</a>
<a href="{{ route('guides.index') }}"><i class="bi bi-journal-code"></i><br>教程</a>
</div>
@forelse($channelItems as $channel)
<a class="tool-channel-card" href="{{ $channel['url'] ?: 'javascript:void(0)' }}" @if(!empty($channel['image_path'])) style="background-image:url('{{ $channel['image_path'] }}');" @endif>
<span>{{ $channel['title'] ?: '频道入口' }}</span>
</a>
@empty
<div class="tool-channel-card"><span>频道入口</span></div>
@endforelse
</div>
</section>
@endif
@foreach($moduleOrder as $moduleKey)
@if($moduleKey === 'promo_banners' && data_get($bannerModule, 'enabled', true) === true)
<section id="section-banner" class="tool-section" aria-label="横幅推荐">
<header class="tool-section-head">
<h2><i class="bi bi-megaphone text-primary"></i> {{ data_get($bannerModule, 'title', '横幅推荐') }}</h2>
<a href="{{ route('tools.list') }}">查看更多</a>
</header>
<div class="tool-banner-row">
@forelse($bannerItems as $banner)
<a class="tool-banner @if($loop->index % 2 === 1) alt @endif" href="{{ $banner['url'] ?: 'javascript:void(0)' }}" @if(!empty($banner['image_path'])) style="background-image:url('{{ $banner['image_path'] }}'); background-size:cover;" @endif>
<b>{{ $banner['title'] ?: '精选推荐' }}</b>
<small>{{ $banner['subtitle'] ?: '查看详情' }}</small>
</a>
@empty
<article class="tool-banner"><b>暂无横幅推荐</b><small>请在后台配置</small></article>
@endforelse
</div>
</section>
@endif
@if($moduleKey === 'hot_tools' && data_get($hotModule, 'enabled', true) === true)
<section id="section-hot" class="tool-section" aria-label="热门工具">
@@ -143,7 +99,7 @@ $bannerItems = collect(data_get($bannerModule, 'items', []))->take((int) data_ge
@php($hotMore = data_get($hotModule, 'more_url') ?: route('tools.list', ['tab' => 'recommended']))
<a href="{{ $hotMore }}">查看更多</a>
</header>
<x-portal.tool-grid :tools="$hotTools" />
<x-portal.tool-grid :tools="$hotTools" :show-meta="false" :show-footer="false" />
</section>
@endif
@@ -154,7 +110,7 @@ $bannerItems = collect(data_get($bannerModule, 'items', []))->take((int) data_ge
@php($latestMore = data_get($latestModule, 'more_url') ?: route('tools.list', ['tab' => 'latest']))
<a href="{{ $latestMore }}">查看更多</a>
</header>
<x-portal.tool-grid :tools="$latestTools" />
<x-portal.tool-grid :tools="$latestTools" :show-meta="false" :show-footer="false" />
</section>
@endif
@@ -167,7 +123,7 @@ $bannerItems = collect(data_get($bannerModule, 'items', []))->take((int) data_ge
</header>
@if($section['tools']->isNotEmpty())
<x-portal.tool-grid :tools="$section['tools']" />
<x-portal.tool-grid :tools="$section['tools']" :show-meta="false" :show-footer="false" />
@else
<p class="text-muted-soft mb-0">该分类暂未收录工具</p>
@endif