完善功能
This commit is contained in:
@@ -514,6 +514,52 @@ a {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ad-slot {
|
||||
background: var(--surface);
|
||||
border: 1px dashed var(--border);
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
margin: 20px 0 28px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.ad-slot-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.ad-list {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.ad-item {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
background: var(--surface-muted);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.ad-item img {
|
||||
width: 72px;
|
||||
height: 48px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.ad-item-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.ad-item-desc {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: auto;
|
||||
padding: 20px 40px;
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<h1>文章</h1>
|
||||
<p>与 AI 工具相关的最新内容。</p>
|
||||
<p>AI 工具资讯、评测与实用教程。</p>
|
||||
</div>
|
||||
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'list', 'title' => '推广位'])
|
||||
|
||||
<div class="article-list">
|
||||
@forelse($articles as $article)
|
||||
<a class="article-item" href="{{ route('articles.show', $article->slug) }}">
|
||||
<div class="article-title">{{ $article->title }}</div>
|
||||
<div class="article-meta">
|
||||
<span>{{ $article->author ?? '编辑部' }}</span>
|
||||
<span>{{ $article->author ?? '官方' }}</span>
|
||||
<span>{{ optional($article->published_at)->format('Y-m-d') }}</span>
|
||||
</div>
|
||||
<div class="article-summary">{{ $article->summary }}</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="detail-grid">
|
||||
<div class="detail-main">
|
||||
<div class="article-meta">
|
||||
<span>{{ $article->author ?? '编辑部' }}</span>
|
||||
<span>{{ $article->author ?? '官方' }}</span>
|
||||
<span>{{ optional($article->published_at)->format('Y-m-d') }}</span>
|
||||
<span>浏览 {{ $article->view_count }}</span>
|
||||
</div>
|
||||
@@ -54,12 +54,13 @@
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'detail', 'title' => '推广位'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h2>相关推荐</h2>
|
||||
<h2>相关文章</h2>
|
||||
</div>
|
||||
<div class="article-list">
|
||||
@foreach($relatedArticles as $item)
|
||||
@@ -100,7 +101,7 @@
|
||||
<input type="hidden" name="target_id" value="{{ $article->id }}">
|
||||
<div class="form-row">
|
||||
<input type="text" name="nickname" placeholder="昵称" required>
|
||||
<input type="email" name="email" placeholder="邮箱(不公开)">
|
||||
<input type="email" name="email" placeholder="邮箱(可选)">
|
||||
</div>
|
||||
<textarea name="content" rows="4" placeholder="写下你的评论" required></textarea>
|
||||
<div class="form-row captcha-row">
|
||||
@@ -121,12 +122,12 @@
|
||||
<div class="comment-actions">
|
||||
<form method="post" action="{{ route('comments.like', $comment->id) }}">
|
||||
@csrf
|
||||
<button type="submit" class="like-button">👍 {{ $comment->like_count }}</button>
|
||||
<button type="submit" class="like-button">点赞 {{ $comment->like_count }}</button>
|
||||
</form>
|
||||
</div>
|
||||
@if($comment->reply_content)
|
||||
<div class="comment-reply">
|
||||
<span>管理员回复:</span>{{ $comment->reply_content }}
|
||||
<span>官方回复:</span>{{ $comment->reply_content }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@@ -1,9 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<h1>分类</h1>
|
||||
<p>浏览全部产品分类。</p>
|
||||
<p>按分类浏览 AI 工具与产品。</p>
|
||||
</div>
|
||||
|
||||
<div class="category-grid">
|
||||
@@ -1,9 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@php
|
||||
$viewMode = request('view', 'grid');
|
||||
$pricingOptions = [
|
||||
'' => '全部收费类型',
|
||||
'' => '全部价格',
|
||||
'free' => '免费',
|
||||
'paid' => '付费',
|
||||
'subscription' => '订阅',
|
||||
@@ -17,6 +17,8 @@
|
||||
<p>{{ $category->description }}</p>
|
||||
</div>
|
||||
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'list', 'title' => '推广位'])
|
||||
|
||||
<form class="filter-bar" method="get">
|
||||
<input type="hidden" name="view" value="{{ $viewMode }}">
|
||||
<select name="tag">
|
||||
@@ -40,8 +42,8 @@
|
||||
|
||||
@if($products->total() > $moreThreshold)
|
||||
<div class="more-panel">
|
||||
<span>该分类内容较多</span>
|
||||
<a href="{{ $products->nextPageUrl() ?? $products->url(1) }}" class="more-link">查看更多</a>
|
||||
<span>当前分类内容较多</span>
|
||||
<a href="{{ $products->nextPageUrl() ?? $products->url(1) }}" class="more-link">查看全部</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -59,7 +61,7 @@
|
||||
@else
|
||||
<div class="product-grid">
|
||||
@forelse($products as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@include('frontend.partials.product-card', ['product' => $product])
|
||||
@empty
|
||||
<div class="empty">暂无产品</div>
|
||||
@endforelse
|
||||
@@ -1,26 +1,27 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@extends('frontend.layouts.app')
|
||||
@section('content')
|
||||
<div class="home-hero">
|
||||
<div class="hero-text">
|
||||
<h1>发现更好的 AI 工具</h1>
|
||||
<p>精选产品与文章,覆盖写作、设计、开发、效率等场景。</p>
|
||||
<h1>发现优质 AI 工具与产品</h1>
|
||||
<p>精选高质量 AI 工具与产品,覆盖写作、设计、编程与办公等场景。</p>
|
||||
</div>
|
||||
<form class="search-bar" action="{{ route('search.index') }}" method="get">
|
||||
<input type="text" name="q" placeholder="搜索 AI 工具名称" aria-label="搜索">
|
||||
<input type="text" name="q" placeholder="搜索 AI 工具、产品、标签" aria-label="搜索">
|
||||
<button type="submit">搜索</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'home', 'title' => '推广位'])
|
||||
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h2>热门推荐</h2>
|
||||
</div>
|
||||
<div class="product-grid">
|
||||
@forelse($featuredProducts as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@include('frontend.partials.product-card', ['product' => $product])
|
||||
@empty
|
||||
<div class="empty">暂无推荐内容</div>
|
||||
<div class="empty">暂无热门推荐</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</section>
|
||||
@@ -31,16 +32,16 @@
|
||||
</div>
|
||||
<div class="product-grid">
|
||||
@forelse($newProducts as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@include('frontend.partials.product-card', ['product' => $product])
|
||||
@empty
|
||||
<div class="empty">暂无新产品</div>
|
||||
<div class="empty">暂无新加产品</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="section-header">
|
||||
<h2>分类精选</h2>
|
||||
<h2>全部分类</h2>
|
||||
</div>
|
||||
<div class="category-blocks">
|
||||
@foreach($categories as $category)
|
||||
@@ -51,7 +52,7 @@
|
||||
</div>
|
||||
<div class="product-grid">
|
||||
@foreach($category->products as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@include('frontend.partials.product-card', ['product' => $product])
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
@@ -39,19 +39,20 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-shell">
|
||||
@include('partials.header')
|
||||
@include('frontend.partials.header')
|
||||
|
||||
<div class="app-body">
|
||||
<aside class="sidebar">
|
||||
@include('partials.sidebar')
|
||||
@include('frontend.partials.sidebar')
|
||||
</aside>
|
||||
<main class="content">
|
||||
@yield('content')
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@include('partials.footer')
|
||||
@include('frontend.partials.footer')
|
||||
</div>
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<h1>关于</h1>
|
||||
<h1>关于我们</h1>
|
||||
</div>
|
||||
|
||||
<div class="rich-text">{!! Str::markdown($content) !!}</div>
|
||||
@@ -1,9 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<h1>联系我们</h1>
|
||||
<p>欢迎提交合作与建议。</p>
|
||||
<p>欢迎提交合作、建议或问题,我们会尽快回复。</p>
|
||||
</div>
|
||||
|
||||
@if(session('success'))
|
||||
@@ -23,7 +23,7 @@
|
||||
<input type="text" name="name" placeholder="姓名" required>
|
||||
<input type="email" name="email" placeholder="邮箱" required>
|
||||
</div>
|
||||
<textarea name="content" rows="5" placeholder="请描述你的需求" required></textarea>
|
||||
<textarea name="content" rows="5" placeholder="请填写你的问题或合作意向" required></textarea>
|
||||
<button type="submit" class="primary-button">提交</button>
|
||||
</form>
|
||||
@endsection
|
||||
31
web10/resources/views/frontend/partials/ad-slot.blade.php
Normal file
31
web10/resources/views/frontend/partials/ad-slot.blade.php
Normal file
@@ -0,0 +1,31 @@
|
||||
@php
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
$ads = \App\Models\AdSlot::getActiveAds($slotKey ?? '');
|
||||
@endphp
|
||||
|
||||
@if($ads->isNotEmpty())
|
||||
<div class="ad-slot">
|
||||
@if(!empty($title))
|
||||
<div class="ad-slot-title">{{ $title }}</div>
|
||||
@endif
|
||||
<div class="ad-list">
|
||||
@foreach($ads as $ad)
|
||||
@php
|
||||
$url = route('ads.redirect', $ad->id);
|
||||
$target = $ad->link_target ?: '_blank';
|
||||
@endphp
|
||||
<a class="ad-item" href="{{ $url }}" target="{{ $target }}" rel="noopener">
|
||||
@if($ad->image)
|
||||
<img src="{{ Storage::url($ad->image) }}" alt="{{ $ad->title }}">
|
||||
@endif
|
||||
<div class="ad-item-body">
|
||||
<div class="ad-item-title">{{ $ad->title }}</div>
|
||||
@if($ad->description)
|
||||
<div class="ad-item-desc">{{ $ad->description }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@@ -1,4 +1,4 @@
|
||||
<footer class="footer">
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<span>© {{ date('Y') }} {{ $siteTitle }}</span>
|
||||
@if($siteFooter)
|
||||
@@ -1,4 +1,4 @@
|
||||
<header class="topbar">
|
||||
<header class="topbar">
|
||||
<div class="brand">
|
||||
<a href="{{ route('home') }}" class="brand-link">
|
||||
@if($siteLogo)
|
||||
@@ -16,7 +16,7 @@
|
||||
</nav>
|
||||
<div class="topbar-actions">
|
||||
<button type="button" class="theme-toggle" id="theme-toggle" aria-label="切换主题">
|
||||
<span class="theme-icon">☾</span>
|
||||
<span class="theme-icon">暗/亮</span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
@@ -1,4 +1,4 @@
|
||||
@if ($paginator->hasPages())
|
||||
@if ($paginator->hasPages())
|
||||
<nav class="pagination">
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="page disabled">上一页</span>
|
||||
@@ -1,4 +1,4 @@
|
||||
@php
|
||||
@php
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@endphp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="sidebar-block">
|
||||
<div class="sidebar-title">产品分类</div>
|
||||
<div class="sidebar-block">
|
||||
<div class="sidebar-title">分类导航</div>
|
||||
<div class="category-list">
|
||||
@foreach($sidebarCategories as $category)
|
||||
<details class="category-group" @if($loop->first) open @endif>
|
||||
@@ -1,4 +1,4 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@php
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="meta-item"><span>分类</span><strong>{{ $product->category?->name }}</strong></div>
|
||||
<div class="meta-item"><span>浏览</span><strong>{{ $product->view_count }}</strong></div>
|
||||
<div class="meta-item"><span>点击</span><strong>{{ $product->click_count }}</strong></div>
|
||||
<div class="meta-item"><span>收费</span><strong>{{ $product->pricing_type ?? '未设置' }}</strong></div>
|
||||
<div class="meta-item"><span>收费</span><strong>{{ $product->pricing_type ?? '未知' }}</strong></div>
|
||||
</div>
|
||||
<div class="detail-card">
|
||||
<h4>标签</h4>
|
||||
@@ -65,6 +65,7 @@
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'detail', 'title' => '推广位'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,7 +75,7 @@
|
||||
</div>
|
||||
<div class="product-grid">
|
||||
@foreach($relatedProducts as $item)
|
||||
@include('partials.product-card', ['product' => $item])
|
||||
@include('frontend.partials.product-card', ['product' => $item])
|
||||
@endforeach
|
||||
</div>
|
||||
</section>
|
||||
@@ -106,9 +107,9 @@
|
||||
<input type="hidden" name="target_id" value="{{ $product->id }}">
|
||||
<div class="form-row">
|
||||
<input type="text" name="nickname" placeholder="昵称" required>
|
||||
<input type="email" name="email" placeholder="邮箱(不公开)">
|
||||
<input type="email" name="email" placeholder="邮箱(可选)">
|
||||
</div>
|
||||
<textarea name="content" rows="4" placeholder="写下你的评价" required></textarea>
|
||||
<textarea name="content" rows="4" placeholder="写下你的评论" required></textarea>
|
||||
<div class="form-row captcha-row">
|
||||
<input type="text" name="captcha" placeholder="验证码" required>
|
||||
<img src="{{ route('comments.captcha') }}" alt="验证码" onclick="this.src='{{ route('comments.captcha') }}?t=' + Date.now()" class="captcha-image">
|
||||
@@ -127,12 +128,12 @@
|
||||
<div class="comment-actions">
|
||||
<form method="post" action="{{ route('comments.like', $comment->id) }}">
|
||||
@csrf
|
||||
<button type="submit" class="like-button">👍 {{ $comment->like_count }}</button>
|
||||
<button type="submit" class="like-button">点赞 {{ $comment->like_count }}</button>
|
||||
</form>
|
||||
</div>
|
||||
@if($comment->reply_content)
|
||||
<div class="comment-reply">
|
||||
<span>管理员回复:</span>{{ $comment->reply_content }}
|
||||
<span>官方回复:</span>{{ $comment->reply_content }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
@@ -6,11 +6,13 @@
|
||||
<p>关键词:{{ $query ?: '全部' }}</p>
|
||||
</div>
|
||||
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'list', 'title' => '推广位'])
|
||||
|
||||
<div class="product-grid">
|
||||
@forelse($products as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@include('frontend.partials.product-card', ['product' => $product])
|
||||
@empty
|
||||
<div class="empty">暂无匹配结果</div>
|
||||
<div class="empty">暂无搜索结果</div>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<h1>标签</h1>
|
||||
<p>通过标签快速发现工具。</p>
|
||||
<p>浏览全站热门标签,快速定位感兴趣的 AI 工具。</p>
|
||||
</div>
|
||||
|
||||
<form class="filter-bar" method="get" action="{{ route('tags.index') }}">
|
||||
@@ -1,9 +1,9 @@
|
||||
@extends('layouts.app')
|
||||
@extends('frontend.layouts.app')
|
||||
|
||||
@php
|
||||
$viewMode = request('view', 'grid');
|
||||
$pricingOptions = [
|
||||
'' => '全部收费类型',
|
||||
'' => '全部价格',
|
||||
'free' => '免费',
|
||||
'paid' => '付费',
|
||||
'subscription' => '订阅',
|
||||
@@ -16,6 +16,8 @@
|
||||
<h1>标签:{{ $tag->name }}</h1>
|
||||
</div>
|
||||
|
||||
@include('frontend.partials.ad-slot', ['slotKey' => 'list', 'title' => '推广位'])
|
||||
|
||||
<form class="filter-bar" method="get">
|
||||
<input type="hidden" name="view" value="{{ $viewMode }}">
|
||||
<select name="pricing">
|
||||
@@ -33,8 +35,8 @@
|
||||
|
||||
@if($products->total() > $moreThreshold)
|
||||
<div class="more-panel">
|
||||
<span>该标签内容较多</span>
|
||||
<a href="{{ $products->nextPageUrl() ?? $products->url(1) }}" class="more-link">查看更多</a>
|
||||
<span>当前标签内容较多</span>
|
||||
<a href="{{ $products->nextPageUrl() ?? $products->url(1) }}" class="more-link">查看全部</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -52,7 +54,7 @@
|
||||
@else
|
||||
<div class="product-grid">
|
||||
@forelse($products as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@include('frontend.partials.product-card', ['product' => $product])
|
||||
@empty
|
||||
<div class="empty">暂无产品</div>
|
||||
@endforelse
|
||||
@@ -131,3 +131,4 @@
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user