feat(front): 新增售后申请图片上传功能

- 支持最多上传3张售后凭证图片
- 提供图片预览和删除功能
- 上传图片随售后申请一起提交
这个提交包含在:
2026-11-20 17:30:27 +08:00
父节点 f4f0c5513e
当前提交 8a35d93a15
共有 15 个文件被更改,包括 90 次插入 和 34 次删除

查看文件

@@ -26,9 +26,11 @@ class RechargeRefund extends Backend
if (!$pay) $this->error('充值订单不存在');
if ($this->request->isPost()) {
$this->token();
try { RechargeRefundService::create((int)$ids, $this->request->post('amount', ''), $this->request->post('reason', ''), $this->auth->id); }
try { $refund = RechargeRefundService::create((int)$ids, $this->request->post('amount', ''), $this->request->post('reason', ''), $this->auth->id); }
catch (\Throwable $e) { $this->error($e->getMessage()); }
$this->success('退款申请已提交,余额已占用,等待审核');
try { $result = RechargeRefundService::submit((int)$refund['id'], $this->auth->id); }
catch (\Throwable $e) { $this->error('退款记录已创建,余额保持占用;请到充值退款记录核实处理:' . $e->getMessage()); }
$this->success('退款已发起,当前状态:' . $result['status']);
}
$this->view->assign('pay', $pay);
$this->view->assign('balance', Db::name('user')->where('id', (int)$pay['user_id'])->value('money'));
@@ -45,15 +47,13 @@ class RechargeRefund extends Backend
try {
if ($action === 'reject') {
RechargeRefundService::reject((int)$ids, $this->auth->id, $this->request->post('note', ''));
$this->success('已驳回并释放余额');
$this->success('已取消并释放余额');
}
if ($action !== 'approve') throw new \InvalidArgumentException('无效操作');
RechargeRefundService::begin((int)$ids, $this->auth->id, $this->request->post('note', ''));
RechargeRefundService::submit((int)$ids, $this->auth->id);
} catch (\think\exception\HttpResponseException $e) { throw $e; }
catch (\Throwable $e) { $this->error($e->getMessage()); }
try { RechargeRefundService::send((int)$ids); }
catch (\Throwable $e) { $this->error('申请已审核,微信结果待核实,余额保持占用:' . $e->getMessage()); }
$this->success('退款请求已处理,请查看退款状态');
catch (\Throwable $e) { $this->error('处理未完成,请查看退款记录及余额占用状态:' . $e->getMessage()); }
$this->success('退款已发起,请查看退款状态');
}
$this->view->assign('row', $row);
return $this->view->fetch();

查看文件

@@ -187,7 +187,7 @@
</div>
<div class="po-guide-body">
<strong>操作指引:</strong>
{if $rechargeOnly}可对已支付的充值订单申请原路退款,提交后占用余额,审核通过后向微信退款。{else /}展示全站微信支付与原路退款记录。充值退款请使用充值订单中的专用入口。{/if}
{if $rechargeOnly}可对已支付的充值订单发起原路退款,确认后占用余额并向微信提交退款。{else /}展示全站微信支付与原路退款记录。充值退款请使用充值订单中的专用入口。{/if}
</div>
</div>

查看文件

@@ -4,5 +4,5 @@
<div class="form-group"><label class="control-label col-sm-3">充值 / 已退</label><div class="col-sm-8"><p class="form-control-static">¥{$pay.amount|htmlentities} / ¥{$pay.refund_amount|htmlentities},当前可用余额 ¥{$balance|htmlentities}</p></div></div>
<div class="form-group"><label class="control-label col-sm-3">退款金额</label><div class="col-sm-8"><input class="form-control" name="amount" data-rule="required" placeholder="最多两位小数"></div></div>
<div class="form-group"><label class="control-label col-sm-3">退款原因</label><div class="col-sm-8"><textarea class="form-control" name="reason" maxlength="255" data-rule="required"></textarea></div></div>
<div class="form-group"><div class="col-sm-offset-3 col-sm-8"><p>提交后将立即占用余额,审核通过后向微信发起退款。</p><button type="submit" class="btn btn-primary">提交申请</button></div></div>
<div class="form-group"><div class="col-sm-offset-3 col-sm-8"><p>确认后立即占用余额并向微信发起原路退款。</p><button type="submit" class="btn btn-primary">确认退款</button></div></div>
</form>

查看文件

@@ -1,11 +1,11 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading"><h4>充值退款申请</h4><p>退款处理中、状态未知及异常时,余额保持占用;请核实微信状态。</p></div>
<div class="panel-heading"><h4>充值退款记录</h4><p>退款处理中、状态未知及异常时,余额保持占用;请核实微信状态。</p></div>
<div class="panel-body">
<form class="form-inline" method="get"><label>状态 <select name="status" class="form-control"><option value="">全部</option><option value="pending">待审核</option><option value="submitting">提交中</option><option value="processing">退款处理中</option><option value="unknown">结果未知</option><option value="abnormal">异常待处理</option><option value="success">退款成功</option><option value="closed">微信关闭</option><option value="rejected">已驳回</option></select></label> <button class="btn btn-default">查询</button></form>
<div class="table-responsive"><table class="table table-striped table-bordered"><thead><tr><th>申请单号</th><th>充值支付单号</th><th>用户</th><th>金额</th><th>状态</th><th>申请原因 / 审核备注</th><th>操作人 / 审核人 ID</th><th>申请时间</th><th>操作</th></tr></thead><tbody>
<form class="form-inline" method="get"><label>状态 <select name="status" class="form-control"><option value="">全部</option><option value="pending">待提交</option><option value="submitting">提交中</option><option value="processing">退款处理中</option><option value="unknown">结果未知</option><option value="abnormal">异常待处理</option><option value="success">退款成功</option><option value="closed">微信关闭</option><option value="rejected">已取消</option></select></label> <button class="btn btn-default">查询</button></form>
<div class="table-responsive"><table class="table table-striped table-bordered"><thead><tr><th>退款单号</th><th>充值支付单号</th><th>用户</th><th>金额</th><th>状态</th><th>退款原因 / 处理备注</th><th>操作人 / 处理人 ID</th><th>创建时间</th><th>操作</th></tr></thead><tbody>
{volist name="list" id="row"}
<tr><td>{$row.refund_no|htmlentities}</td><td>{$row.out_trade_no|htmlentities}</td><td>{$row.nickname|htmlentities} {$row.mobile|htmlentities}</td><td>¥{$row.amount|htmlentities}</td><td>{$row.status|htmlentities}</td><td>{$row.reason|htmlentities}<br>{$row.audit_note|htmlentities}<br>{$row.error|htmlentities}</td><td>{$row.operator_id|htmlentities} / {$row.reviewer_id|htmlentities}</td><td>{$row.createtime|date='Y-m-d H:i:s',###}</td><td>
{if $row.status == 'pending' && $auth->check('recharge_refund/review')}<a href="{:url('recharge_refund/review', ['ids'=>$row.id])}" class="btn btn-xs btn-primary btn-dialog" title="审核退款">审核</a>{/if}
{if $row.status == 'pending' && $auth->check('recharge_refund/review')}<a href="{:url('recharge_refund/review', ['ids'=>$row.id])}" class="btn btn-xs btn-primary btn-dialog" title="处理未提交退款">处理</a>{/if}
{if in_array($row.status, ['submitting','unknown','processing','abnormal']) && $auth->check('recharge_refund/resolve')}<a href="{:url('recharge_refund/resolve', ['ids'=>$row.id])}" class="btn btn-xs btn-warning btn-dialog" title="处理退款">处理</a>{/if}
</td></tr>
{/volist}

查看文件

@@ -2,8 +2,8 @@
{:token()}
<div class="form-group"><label class="control-label col-sm-3">退款单号</label><div class="col-sm-8"><p class="form-control-static">{$row.refund_no|htmlentities}</p></div></div>
<div class="form-group"><label class="control-label col-sm-3">退款金额</label><div class="col-sm-8"><p class="form-control-static">¥{$row.amount|htmlentities}</p></div></div>
<div class="form-group"><label class="control-label col-sm-3">申请原因</label><div class="col-sm-8"><p class="form-control-static">{$row.reason|htmlentities}</p></div></div>
<div class="form-group"><label class="control-label col-sm-3">审核结果</label><div class="col-sm-8"><select name="action" class="form-control"><option value="approve">通过并发起微信退款</option><option value="reject">驳回并释放余额</option></select></div></div>
<div class="form-group"><label class="control-label col-sm-3">审核备注</label><div class="col-sm-8"><textarea class="form-control" name="note" maxlength="255" placeholder="驳回时必填"></textarea></div></div>
<div class="form-group"><div class="col-sm-offset-3 col-sm-8"><button type="submit" class="btn btn-primary">确认审核</button></div></div>
<div class="form-group"><label class="control-label col-sm-3">退款原因</label><div class="col-sm-8"><p class="form-control-static">{$row.reason|htmlentities}</p></div></div>
<div class="form-group"><label class="control-label col-sm-3">处理方式</label><div class="col-sm-8"><select name="action" class="form-control"><option value="approve">继续发起微信退款</option><option value="reject">取消并释放余额</option></select></div></div>
<div class="form-group"><label class="control-label col-sm-3">处理备注</label><div class="col-sm-8"><textarea class="form-control" name="note" maxlength="255" placeholder="取消时必填"></textarea></div></div>
<div class="form-group"><div class="col-sm-offset-3 col-sm-8"><button type="submit" class="btn btn-primary">确认处理</button></div></div>
</form>