Files
ai-web/resources/views/public/guides/index.blade.php

90 lines
4.7 KiB
PHP
Raw Normal View History

2026-02-11 17:28:36 +08:00
@extends('layouts.site')
@section('page_class', 'page-guides')
@section('title', 'AI 教程 - AIWeb')
@section('meta_description', '从入门到实战的 AI 教程集合,按难度分层学习并落地工作流。')
@section('canonical', route('guides.index'))
@section('content')
<section class="module-hero">
<div class="position-relative">
<span class="hero-chip"><i class="bi bi-journal-code"></i> 学习路径</span>
<h1 class="h2 fw-bold mt-2">AI 教程与实战路径</h1>
<p class="hero-subtext">按难度分层组织教程,帮助你从零搭建可复用的 AI 工作流。</p>
</div>
</section>
<div class="module-grid">
<div>
<section class="block-card p-3 p-lg-4 mb-3">
<form method="get" action="{{ route('guides.index') }}" class="row g-2 align-items-end">
<div class="col-md-8">
<label class="form-label" for="guideSearchKeyword">关键词</label>
<input id="guideSearchKeyword" class="form-control" type="search" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="例如:提示词、自动化、数据分析…" aria-label="按关键词搜索教程" autocomplete="off" spellcheck="false">
</div>
<div class="col-md-3">
<label class="form-label" for="guideDifficultySelect">难度</label>
<select id="guideDifficultySelect" class="form-select" name="difficulty">
<option value="">全部难度</option>
@foreach(['beginner' => '入门', 'intermediate' => '进阶', 'advanced' => '高级'] as $value => $label)
<option value="{{ $value }}" @selected(($filters['difficulty'] ?? '') === $value)>{{ $label }}</option>
@endforeach
</select>
</div>
<div class="col-md-1 d-grid">
<button class="btn btn-primary" type="submit" aria-label="筛选教程"><i class="bi bi-search me-1" aria-hidden="true"></i>筛选</button>
</div>
</form>
</section>
<section class="row g-3">
@forelse($items as $guide)
<div class="col-lg-6">
<article class="entry-item h-100 d-flex flex-column">
<div class="d-flex justify-content-between align-items-start gap-2 mb-2">
<a class="h5 text-decoration-none mb-0" href="{{ route('guides.show', $guide->slug) }}">{{ $guide->title }}</a>
<span class="chip">{{ $guide->difficulty }}</span>
</div>
<p class="text-muted-soft mb-3 line-clamp-2">{{ $guide->excerpt }}</p>
<div class="mt-auto d-flex justify-content-between align-items-center">
<small class="text-muted-soft">更新于 {{ $guide->updated_at?->format('Y-m-d') }}</small>
<a class="btn btn-sm btn-outline-primary" href="{{ route('guides.show', $guide->slug) }}">阅读</a>
</div>
</article>
</div>
@empty
<div class="col-12"><div class="block-card p-4 text-center text-muted-soft">暂无教程数据</div></div>
@endforelse
</section>
<div class="mt-3">{{ $items->links() }}</div>
</div>
<aside>
<section class="block-card p-3 mb-3">
<h3 class="section-title mb-3">相关工具</h3>
@forelse($sidebarTools as $tool)
<article class="pb-2 mb-2 border-bottom" style="border-color:var(--line)!important;">
<a class="fw-semibold text-decoration-none" href="{{ route('tools.show', $tool->slug) }}">{{ $tool->name }}</a>
<div class="small text-muted-soft">{{ $tool->pricing_type }}</div>
</article>
@empty
<p class="text-muted-soft small mb-0">暂无工具</p>
@endforelse
</section>
<section class="block-card p-3">
<h3 class="section-title mb-3">模型推荐</h3>
@forelse($sidebarModels as $model)
<article class="pb-2 mb-2 border-bottom" style="border-color:var(--line)!important;">
<a class="fw-semibold text-decoration-none" href="{{ route('models.show', $model->slug) }}">{{ $model->name }}</a>
<div class="small text-muted-soft">综合 {{ $model->total_score }} </div>
</article>
@empty
<p class="text-muted-soft small mb-0">暂无模型</p>
@endforelse
</section>
</aside>
</div>
@endsection