M5: Workerman 常驻服务 + AI 审核/润色插件 + 支付插件(支付宝/微信/沙箱)+ 会员插件(套餐/订阅/付费文章)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<x-filament-panels::page>
|
||||
<form wire:submit="save">
|
||||
{{ $this->form }}
|
||||
<div class="mt-6">
|
||||
<x-filament::button type="submit" color="primary">保存设置</x-filament::button>
|
||||
</div>
|
||||
</form>
|
||||
</x-filament-panels::page>
|
||||
@@ -0,0 +1,44 @@
|
||||
@php $pageTitle = '会员中心 - '.$siteName; @endphp
|
||||
@include('partials.head')
|
||||
<body>
|
||||
@include('partials.header')
|
||||
<div class="container main-layout">
|
||||
<main class="content">
|
||||
<h1 class="list-title">会员中心</h1>
|
||||
@auth
|
||||
@php $member = app(\Plugins\Neatstudio\Membership\Services\MembershipService::class)->isMember(auth()->user()); @endphp
|
||||
@if($member)
|
||||
<div class="alert alert-success">你是会员,可阅读全部会员专享内容。</div>
|
||||
@else
|
||||
<div class="alert alert-error">你还不是会员,开通后可解锁会员专享文章。</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="alert alert-error">请先 <a href="{{ route('login') }}">登录</a> 后购买会员。</div>
|
||||
@endauth
|
||||
|
||||
<div class="plans-grid" style="display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;">
|
||||
@forelse($plans as $plan)
|
||||
<div class="post-card plan-card">
|
||||
<h2 class="post-title">{{ $plan->name }}</h2>
|
||||
<p class="plan-price" style="font-size:26px;font-weight:800;color:#2d6cdf;">¥{{ number_format($plan->price / 100, 2) }}</p>
|
||||
<p style="color:#888;font-size:14px;">有效期 {{ $plan->duration_days }} 天</p>
|
||||
@if($plan->description)<p style="color:#555;font-size:14px;">{{ $plan->description }}</p>@endif
|
||||
@auth
|
||||
<form action="{{ route('membership.subscribe', $plan) }}" method="post" style="margin-top:12px;">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary">立即购买</button>
|
||||
</form>
|
||||
@endauth
|
||||
</div>
|
||||
@empty
|
||||
<div class="empty">暂无上架套餐</div>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
<p style="margin-top:16px;"><a href="{{ route('membership.mine') }}">查看我的订阅</a></p>
|
||||
</main>
|
||||
@include('partials.sidebar')
|
||||
</div>
|
||||
@include('partials.footer')
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
@php $pageTitle = '我的订阅 - '.$siteName; @endphp
|
||||
@include('partials.head')
|
||||
<body>
|
||||
@include('partials.header')
|
||||
<div class="container main-layout">
|
||||
<main class="content">
|
||||
<h1 class="list-title">我的订阅</h1>
|
||||
@forelse($subscriptions as $subscription)
|
||||
<div class="post-card">
|
||||
<h2 class="post-title">{{ $subscription->plan?->name ?? '(已下架)' }}</h2>
|
||||
<div class="post-meta">
|
||||
<span>状态:
|
||||
@if($subscription->isActive())
|
||||
<span class="badge">生效中</span>
|
||||
@else
|
||||
<span style="color:#c00;">{{ $subscription->status === 'expired' ? '已过期' : '已取消' }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span>· 开始:{{ $subscription->starts_at?->format('Y-m-d') }}</span>
|
||||
<span>· 到期:{{ $subscription->ends_at?->format('Y-m-d') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="empty">暂无订阅记录,<a href="{{ route('membership.index') }}">去开通会员</a></div>
|
||||
@endforelse
|
||||
</main>
|
||||
@include('partials.sidebar')
|
||||
</div>
|
||||
@include('partials.footer')
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
@php $pageTitle = '支付结果 - '.$siteName; @endphp
|
||||
@include('partials.head')
|
||||
<body>
|
||||
@include('partials.header')
|
||||
<div class="container auth-layout">
|
||||
<main class="auth-box">
|
||||
<h1 class="list-title">支付结果</h1>
|
||||
@if($payment->status === 'paid')
|
||||
<div class="alert alert-success">支付成功!订单号:{{ $payment->order_no }}</div>
|
||||
@elseif($payment->status === 'pending')
|
||||
<div class="alert alert-error">支付未完成,订单号:{{ $payment->order_no }}</div>
|
||||
@else
|
||||
<div class="alert alert-error">订单状态:{{ $payment->status }}</div>
|
||||
@endif
|
||||
<p><strong>商品:</strong>{{ $payment->subject }}</p>
|
||||
<p><strong>金额:</strong>¥{{ number_format($payment->amount / 100, 2) }}</p>
|
||||
<p class="auth-alt"><a href="{{ route('home') }}">返回首页</a></p>
|
||||
</main>
|
||||
</div>
|
||||
@include('partials.footer')
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
@php $pageTitle = '模拟支付 - '.$siteName; @endphp
|
||||
@include('partials.head')
|
||||
<body>
|
||||
@include('partials.header')
|
||||
<div class="container auth-layout">
|
||||
<main class="auth-box">
|
||||
<h1 class="list-title">模拟支付(沙箱)</h1>
|
||||
<div class="profile-box" style="border:none;padding:0;">
|
||||
<p><strong>订单号:</strong>{{ $payment->order_no }}</p>
|
||||
<p><strong>商品:</strong>{{ $payment->subject }}</p>
|
||||
<p><strong>金额:</strong>¥{{ number_format($payment->amount / 100, 2) }}</p>
|
||||
<p><strong>渠道:</strong>{{ $payment->channel }}</p>
|
||||
<p class="text-muted" style="color:#999;font-size:13px;">沙箱模式:点击下方按钮模拟支付成功</p>
|
||||
</div>
|
||||
<form action="{{ route('pay.sandbox.confirm', $payment->order_no) }}" method="post">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary">确认支付(模拟)</button>
|
||||
</form>
|
||||
<p class="auth-alt"><a href="{{ route('home') }}">取消,返回首页</a></p>
|
||||
</main>
|
||||
</div>
|
||||
@include('partials.footer')
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user