04a2034975
- storefront 全站改为极简黑白配色:直角、细线分隔、卡片 hover 浅底、深色模式(跟随系统+手动切换) - 抽出 storefront/partials/card 复用卡片 - 一并提交此前暂存的客户端注册 API、站点设置、后台页面与测试 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
145 lines
8.0 KiB
PHP
145 lines
8.0 KiB
PHP
@extends('storefront.layout', ['title' => (config('app.name', 'Tstore')) . ' · ' . $package->name])
|
|
|
|
@php
|
|
$typeLabel = $package->type === 'plugin' ? '插件' : '主题';
|
|
$listRoute = $package->type === 'plugin' ? 'storefront.plugins' : 'storefront.themes';
|
|
$latestVersion = collect($detail['versions'])->firstWhere('is_latest', true)
|
|
?: collect($detail['versions'])->firstWhere('is_stable', true)
|
|
?: ($detail['versions'][0] ?? null);
|
|
@endphp
|
|
|
|
@section('hero')
|
|
<section class="hero">
|
|
<div class="container">
|
|
<span class="eyebrow">{{ $typeLabel }}</span>
|
|
<div class="detail-head" style="margin-top:16px">
|
|
@if($detail['icon_url'])
|
|
<img class="detail-icon" src="{{ $detail['icon_url'] }}" alt="{{ $detail['name'] }}">
|
|
@else
|
|
<div class="detail-icon detail-placeholder">{{ $package->type === 'plugin' ? 'P' : 'T' }}</div>
|
|
@endif
|
|
<div>
|
|
<h1 class="headline" style="margin:0;font-size:30px">{{ $detail['name'] }}</h1>
|
|
<p class="lede" style="margin-top:10px">{{ $detail['summary'] ?: '这个' . $typeLabel . '当前还没有摘要,详情页会继续保留版本、兼容性和截图信息。' }}</p>
|
|
<div class="tags">
|
|
@foreach($package->categories as $category)
|
|
<span class="tag">{{ $category->name }}</span>
|
|
@endforeach
|
|
@if($detail['is_featured'])
|
|
<span class="tag solid">推荐</span>
|
|
@endif
|
|
<span class="tag">{{ $detail['author'] ?: '未知作者' }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="hero-actions">
|
|
<a class="btn ghost" href="{{ route($listRoute) }}">返回{{ $typeLabel }}目录</a>
|
|
@if($detail['homepage'])
|
|
<a class="btn" href="{{ $detail['homepage'] }}" target="_blank" rel="noreferrer">访问主页</a>
|
|
@endif
|
|
</div>
|
|
<div class="stats">
|
|
<div class="stat"><strong>{{ strtoupper($detail['type']) }}</strong><span>扩展类型</span></div>
|
|
<div class="stat"><strong>{{ $detail['download_count'] }}</strong><span>累计下载</span></div>
|
|
<div class="stat"><strong>{{ count($detail['versions']) }}</strong><span>版本记录</span></div>
|
|
<div class="stat"><strong>{{ $latestVersion['version'] ?? '-' }}</strong><span>当前主版本</span></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|
|
|
|
@section('content')
|
|
@php
|
|
$screenshots = $detail['screenshots'];
|
|
$featuredScreenshot = $screenshots[0] ?? null;
|
|
$secondaryScreenshots = array_slice($screenshots, 1);
|
|
@endphp
|
|
<section class="section">
|
|
<div class="container">
|
|
<div class="detail-layout">
|
|
<div class="stack">
|
|
<article class="info-card">
|
|
<span class="section-kicker">Preview</span>
|
|
<h3>预览截图</h3>
|
|
@if($featuredScreenshot)
|
|
<div class="shots">
|
|
<figure class="shot-feature">
|
|
<img src="{{ $featuredScreenshot['url'] }}" alt="{{ $featuredScreenshot['caption'] ?: $detail['name'] }}">
|
|
<figcaption>
|
|
<strong>{{ $featuredScreenshot['caption'] ?: $detail['name'] . ' 主预览图' }}</strong>
|
|
<span>第一张截图作为主视觉展示,后台可继续追加更多截图并调整排序。</span>
|
|
</figcaption>
|
|
</figure>
|
|
@if(count($secondaryScreenshots))
|
|
<div class="shot-grid">
|
|
@foreach($secondaryScreenshots as $shot)
|
|
<figure class="shot-card">
|
|
<img src="{{ $shot['url'] }}" alt="{{ $shot['caption'] ?: $detail['name'] }}">
|
|
<figcaption>{{ $shot['caption'] ?: $detail['name'] . ' 截图' }}</figcaption>
|
|
</figure>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@else
|
|
<div class="empty">当前还没有预览截图。</div>
|
|
@endif
|
|
</article>
|
|
</div>
|
|
|
|
<aside class="stack">
|
|
<article class="info-card">
|
|
<h3>{{ $typeLabel }}说明</h3>
|
|
<div class="rich-text">{{ $detail['description'] ?: '当前还没有更详细的介绍。' }}</div>
|
|
</article>
|
|
|
|
<article class="info-card">
|
|
<h3>资料与兼容性</h3>
|
|
<div class="info-list">
|
|
<div class="info-item"><strong>作者与协议</strong><span>{{ $detail['author'] ?: '未知作者' }} · {{ $detail['license'] ?: '未声明 License' }}</span></div>
|
|
<div class="info-item"><strong>最近更新</strong><span>{{ optional($package->updated_at)->format('Y-m-d H:i') ?: '未记录' }}</span></div>
|
|
@if($detail['homepage'])
|
|
<div class="info-item"><strong>主页</strong><a href="{{ $detail['homepage'] }}" target="_blank" rel="noreferrer">{{ $detail['homepage'] }}</a></div>
|
|
@endif
|
|
</div>
|
|
</article>
|
|
|
|
<article class="info-card">
|
|
<h3>版本记录</h3>
|
|
<div class="version-list">
|
|
@forelse($detail['versions'] as $version)
|
|
<div class="version-item">
|
|
<div class="version-head">
|
|
<div>
|
|
<div class="version-title">v{{ $version['version'] }}</div>
|
|
<div class="version-meta">发布于 {{ $version['published_at'] ? \Illuminate\Support\Carbon::parse($version['published_at'])->format('Y-m-d H:i') : '未标记时间' }}</div>
|
|
</div>
|
|
<div class="tags" style="margin-top:0">
|
|
<span class="tag {{ $version['is_stable'] ? 'solid' : '' }}">{{ $version['is_stable'] ? '稳定版' : '预发布' }}</span>
|
|
@if($version['is_latest'])
|
|
<span class="tag">最新</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<div class="tags">
|
|
<span class="tag">Typecho {{ $version['compatibility']['typecho_min'] ?: '-' }} ~ {{ $version['compatibility']['typecho_max'] ?: '-' }}</span>
|
|
<span class="tag">PHP {{ $version['compatibility']['php_min'] ?: '-' }} ~ {{ $version['compatibility']['php_max'] ?: '-' }}</span>
|
|
@if(!empty($version['compatibility']['php_extensions']))
|
|
<span class="tag">扩展 {{ collect($version['compatibility']['php_extensions'])->join(', ') }}</span>
|
|
@endif
|
|
</div>
|
|
@if(!empty($version['changelog']))
|
|
<div class="rich-text" style="margin-top:12px;font-size:14px">{{ $version['changelog'] }}</div>
|
|
@endif
|
|
</div>
|
|
@empty
|
|
<div class="empty">当前没有版本记录。</div>
|
|
@endforelse
|
|
</div>
|
|
</article>
|
|
</aside>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|