150 lines
8.0 KiB
PHP
150 lines
8.0 KiB
PHP
@extends('layouts.site')
|
|
|
|
@section('page_class', 'page-guides')
|
|
@section('title', 'AI 教程学习 - AIWeb')
|
|
@section('meta_description', '从入门到实战的 AI 教程集合,按难度分层学习并落地工作流。')
|
|
@section('canonical', route('guides.index'))
|
|
|
|
@section('content')
|
|
@php
|
|
$icons = ['bi-book', 'bi-layers', 'bi-rocket'];
|
|
$resetDifficultyFilters = array_filter([
|
|
'q' => $filters['q'] ?? null,
|
|
], fn ($value) => $value !== null && $value !== '');
|
|
@endphp
|
|
|
|
<div class="channel-layout">
|
|
<aside class="channel-sidebar" aria-label="教程分类">
|
|
<div class="channel-brand"><span class="channel-brand-mark">AI</span>AI教程库</div>
|
|
<nav class="channel-links">
|
|
<a class="channel-link @if(empty($filters['difficulty'])) active @endif" href="{{ route('guides.index', $resetDifficultyFilters) }}">
|
|
<i class="bi bi-stars"></i>
|
|
<span>全部教程</span>
|
|
<small>{{ $guideStats['total'] ?? 0 }}</small>
|
|
</a>
|
|
@foreach($difficultyOptions as $index => $option)
|
|
<a class="channel-link @if(($filters['difficulty'] ?? '') === $option['value']) active @endif" href="{{ route('guides.by-topic', $option['value']) }}">
|
|
<i class="bi {{ $icons[$index % count($icons)] }}"></i>
|
|
<span>{{ $option['label'] }}</span>
|
|
<small>{{ $option['count'] }}</small>
|
|
</a>
|
|
@endforeach
|
|
</nav>
|
|
</aside>
|
|
|
|
<section class="channel-main">
|
|
<header class="channel-head">
|
|
<nav class="channel-tabs" aria-label="频道导航">
|
|
<a class="channel-tab" href="{{ route('tools.index') }}">AI工具集</a>
|
|
<a class="channel-tab" href="{{ route('models.index') }}">模型推荐</a>
|
|
<a class="channel-tab" href="{{ route('news.index') }}">资讯文章</a>
|
|
<a class="channel-tab active" href="{{ route('guides.index') }}">教程学习</a>
|
|
<a class="channel-tab" href="{{ route('home') }}">首页</a>
|
|
</nav>
|
|
<div class="channel-status">教程总量 <b>{{ $guideStats['total'] ?? 0 }}</b></div>
|
|
</header>
|
|
|
|
<nav class="channel-mobile-nav" aria-label="移动分类导航">
|
|
<a class="channel-link @if(empty($filters['difficulty'])) active @endif" href="{{ route('guides.index', $resetDifficultyFilters) }}">
|
|
<i class="bi bi-stars"></i>
|
|
<span>全部教程</span>
|
|
<small>{{ $guideStats['total'] ?? 0 }}</small>
|
|
</a>
|
|
@foreach($difficultyOptions as $index => $option)
|
|
<a class="channel-link @if(($filters['difficulty'] ?? '') === $option['value']) active @endif" href="{{ route('guides.by-topic', $option['value']) }}">
|
|
<i class="bi {{ $icons[$index % count($icons)] }}"></i>
|
|
<span>{{ $option['label'] }}</span>
|
|
<small>{{ $option['count'] }}</small>
|
|
</a>
|
|
@endforeach
|
|
</nav>
|
|
|
|
<section class="channel-hero">
|
|
<span class="channel-chip">AIWEB.CN</span>
|
|
<h1 class="channel-title">AI教程学习</h1>
|
|
<p class="channel-subtitle">按难度分层与场景化路线组织,帮助你稳定构建可复用 AI 工作流。</p>
|
|
|
|
<form class="channel-search" method="get" action="{{ route('guides.index') }}" role="search" aria-label="搜索 AI 教程">
|
|
<input type="search" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="搜索教程标题或关键词,如 提示词 / 自动化 / 数据分析" autocomplete="off" spellcheck="false">
|
|
<select name="difficulty" aria-label="按难度筛选">
|
|
<option value="">全部难度</option>
|
|
@foreach($difficultyOptions as $option)
|
|
<option value="{{ $option['value'] }}" @selected(($filters['difficulty'] ?? '') === $option['value'])>{{ $option['label'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
<input type="text" value="按发布时间排序" readonly aria-label="排序方式">
|
|
<a class="btn btn-outline-secondary" href="{{ route('guides.index') }}">重置</a>
|
|
<button class="btn btn-primary" type="submit"><i class="bi bi-search"></i> 搜索</button>
|
|
</form>
|
|
|
|
<section class="channel-kpis" aria-label="教程统计概览">
|
|
<article class="channel-kpi"><span>教程总量</span><b>{{ $guideStats['total'] ?? 0 }}</b></article>
|
|
<article class="channel-kpi"><span>入门教程</span><b>{{ $guideStats['beginner'] ?? 0 }}</b></article>
|
|
<article class="channel-kpi"><span>进阶教程</span><b>{{ $guideStats['advanced'] ?? 0 }}</b></article>
|
|
<article class="channel-kpi"><span>7天更新</span><b>{{ $guideStats['updated_7d'] ?? 0 }}</b></article>
|
|
</section>
|
|
</section>
|
|
|
|
<section class="channel-body">
|
|
<section class="channel-panel">
|
|
<header class="channel-panel-head">
|
|
<h2 class="channel-panel-title">教程列表</h2>
|
|
</header>
|
|
|
|
@if($items->isNotEmpty())
|
|
<div class="entity-grid">
|
|
@foreach($items as $guide)
|
|
<article class="entity-card">
|
|
<a class="entity-title" href="{{ route('guides.show', $guide->slug) }}">{{ $guide->title }}</a>
|
|
<div class="entity-meta">{{ $guide->difficulty }} · {{ $guide->updated_at?->format('Y-m-d') }}</div>
|
|
<p class="entity-desc line-clamp-2">{{ $guide->excerpt }}</p>
|
|
<div class="d-flex align-items-center justify-content-between gap-2">
|
|
<span class="chip">实战教程</span>
|
|
<a class="btn btn-sm btn-outline-primary" href="{{ route('guides.show', $guide->slug) }}">阅读</a>
|
|
</div>
|
|
</article>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="mt-3">{{ $items->links() }}</div>
|
|
@else
|
|
<p class="text-muted-soft mb-0">暂无教程数据</p>
|
|
@endif
|
|
</section>
|
|
|
|
<aside class="channel-list">
|
|
<section class="channel-panel">
|
|
<header class="channel-panel-head">
|
|
<h3 class="channel-panel-title">相关工具</h3>
|
|
<a class="tiny-link" href="{{ route('tools.index') }}">查看全部</a>
|
|
</header>
|
|
@forelse($sidebarTools as $tool)
|
|
<article class="side-list-item">
|
|
<a href="{{ route('tools.show', $tool->slug) }}">{{ $tool->name }}</a>
|
|
<small>{{ $tool->pricing_type }}</small>
|
|
</article>
|
|
@empty
|
|
<p class="text-muted-soft small mb-0">暂无工具</p>
|
|
@endforelse
|
|
</section>
|
|
|
|
<section class="channel-panel">
|
|
<header class="channel-panel-head">
|
|
<h3 class="channel-panel-title">推荐模型</h3>
|
|
<a class="tiny-link" href="{{ route('models.index') }}">查看全部</a>
|
|
</header>
|
|
@forelse($sidebarModels as $model)
|
|
<article class="side-list-item">
|
|
<a href="{{ route('models.show', $model->slug) }}">{{ $model->name }}</a>
|
|
<small>综合 {{ $model->total_score }} 分</small>
|
|
</article>
|
|
@empty
|
|
<p class="text-muted-soft small mb-0">暂无模型</p>
|
|
@endforelse
|
|
</section>
|
|
</aside>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
@endsection
|