feat(subscriptions): 订阅详情支持一键创建续费订单

This commit is contained in:
萝卜
2026-03-10 14:46:16 +00:00
parent 3f809c8150
commit 6ebd3510db
4 changed files with 23 additions and 8 deletions

View File

@@ -17,7 +17,7 @@
<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>
<option value="{{ $m->id }}" @selected((string)old('merchant_id', $defaults['merchant_id'] ?? '') === (string)$m->id)>{{ $m->name }}</option>
@endforeach
</select>
</label>
@@ -27,7 +27,7 @@
<select name="plan_id" required>
<option value="">请选择套餐</option>
@foreach(($plans ?? []) as $p)
<option value="{{ $p->id }}" @selected((string)old('plan_id') === (string)$p->id)>
<option value="{{ $p->id }}" @selected((string)old('plan_id', $defaults['plan_id'] ?? '') === (string)$p->id)>
{{ $p->name }}{{ $billingCycleLabels[$p->billing_cycle] ?? $p->billing_cycle }} / ¥{{ number_format((float)$p->price, 2) }}
</option>
@endforeach
@@ -39,31 +39,31 @@
<span>订单类型</span>
<select name="order_type" required>
@foreach(($orderTypeLabels ?? []) as $value => $label)
<option value="{{ $value }}" @selected(old('order_type', 'new_purchase') === $value)>{{ $label }}</option>
<option value="{{ $value }}" @selected(old('order_type', $defaults['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>
<input type="number" min="1" max="120" name="quantity" value="{{ old('quantity', $defaults['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) }}">
<input type="number" step="0.01" min="0" name="discount_amount" value="{{ old('discount_amount', $defaults['discount_amount'] ?? 0) }}">
</label>
<label>
<span>支付渠道(可选)</span>
<input name="payment_channel" value="{{ old('payment_channel') }}" placeholder="例如offline / wechat / alipay">
<input name="payment_channel" value="{{ old('payment_channel', $defaults['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>
<textarea name="remark" rows="3" placeholder="可记录线下收款说明、对账备注等">{{ old('remark', $defaults['remark'] ?? '') }}</textarea>
</label>
<div class="form-actions">