feat(platform-orders): 支持总台手工创建平台订单并进入闭环

This commit is contained in:
萝卜
2026-03-10 14:35:31 +00:00
parent 826c58085b
commit 3f809c8150
5 changed files with 304 additions and 1 deletions

View File

@@ -0,0 +1,74 @@
@extends('admin.layouts.app')
@section('title', '新建平台订单')
@section('page_title', '新建平台订单')
@section('content')
<div class="card mb-20">
<p class="muted muted-tight">用于总台运营手工创建一笔平台订单(演示/补单/线下收款录入)。</p>
<p class="muted">创建后可在「平台订单」列表中继续推进:标记支付并生效 同步订阅(形成最小收费闭环)。</p>
</div>
<form method="post" action="/admin/platform-orders" class="card form-grid">
@csrf
<label>
<span>站点</span>
<select name="merchant_id" required>
<option value="">请选择站点</option>
@foreach(($merchants ?? []) as $m)
<option value="{{ $m->id }}" @selected((string)old('merchant_id') === (string)$m->id)>{{ $m->name }}</option>
@endforeach
</select>
</label>
<label>
<span>套餐</span>
<select name="plan_id" required>
<option value="">请选择套餐</option>
@foreach(($plans ?? []) as $p)
<option value="{{ $p->id }}" @selected((string)old('plan_id') === (string)$p->id)>
{{ $p->name }}{{ $billingCycleLabels[$p->billing_cycle] ?? $p->billing_cycle }} / ¥{{ number_format((float)$p->price, 2) }}
</option>
@endforeach
</select>
<small class="muted">订单会写入套餐快照plan_name / billing_cycle / plan_snapshot便于后续套餐变更时追溯。</small>
</label>
<label>
<span>订单类型</span>
<select name="order_type" required>
@foreach(($orderTypeLabels ?? []) as $value => $label)
<option value="{{ $value }}" @selected(old('order_type', 'new_purchase') === $value)>{{ $label }}</option>
@endforeach
</select>
</label>
<label>
<span>购买数量(周期数)</span>
<input type="number" min="1" max="120" name="quantity" value="{{ old('quantity', 1) }}" required>
<small class="muted">例如:月付套餐 quantity=3 表示购买 3 个月;年付套餐 quantity=2 表示购买 2 年。</small>
</label>
<label>
<span>优惠金额(可选)</span>
<input type="number" step="0.01" min="0" name="discount_amount" value="{{ old('discount_amount', 0) }}">
</label>
<label>
<span>支付渠道(可选)</span>
<input name="payment_channel" value="{{ old('payment_channel') }}" placeholder="例如offline / wechat / alipay">
<small class="muted">当前阶段仅用于记录口径,支付回执/对账后续再补。</small>
</label>
<label class="full">
<span>备注(可选)</span>
<textarea name="remark" rows="3" placeholder="可记录线下收款说明、对账备注等">{{ old('remark') }}</textarea>
</label>
<div class="form-actions">
<a href="/admin/platform-orders" class="btn-secondary">返回</a>
<button type="submit">创建订单</button>
</div>
</form>
@endsection

View File

@@ -211,7 +211,10 @@
</div>
<div class="card">
<h3>平台订单列表</h3>
<div class="flex-between">
<h3>平台订单列表</h3>
<a href="/admin/platform-orders/create" class="btn">新建平台订单</a>
</div>
<table>
<thead>
<tr>