feat: 新增后台人工充值功能及支付结果页
- 新增后台人工充值模块,支持上传支付凭证 - 新增支付结果查询接口及页面 - 新增订单支付成功跳转结果页逻辑 - 更新钱包流水类型标签区分充值方式 - 新增插件路由 PHP 8 兼容错误报告设置
这个提交包含在:
@@ -0,0 +1,16 @@
|
||||
-- 后台人工充值凭证及独立操作权限。先部署此脚本,再部署代码。
|
||||
CREATE TABLE IF NOT EXISTS `fa_admin_recharge` (
|
||||
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`wallet_log_id` int unsigned NOT NULL,
|
||||
`admin_id` int unsigned NOT NULL,
|
||||
`voucher` varchar(255) NOT NULL,
|
||||
`request_id` char(32) NOT NULL,
|
||||
`createtime` bigint DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_wallet_log` (`wallet_log_id`),
|
||||
UNIQUE KEY `uk_request_id` (`request_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='后台人工充值凭证';
|
||||
|
||||
INSERT INTO `fa_auth_rule` (`type`,`pid`,`name`,`title`,`icon`,`ismenu`,`createtime`,`updatetime`,`weigh`,`status`)
|
||||
SELECT 'file', `id`, 'user/user/recharge', '用户余额充值', 'fa fa-circle-o', 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'
|
||||
FROM `fa_auth_rule` WHERE `name` = 'user/user' AND NOT EXISTS (SELECT 1 FROM (SELECT `name` FROM `fa_auth_rule`) existing WHERE existing.`name` = 'user/user/recharge');
|
||||
@@ -21,6 +21,9 @@ class Index extends Controller
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
// 插件路由不经过后台模块的 PHP 8 兼容设置;保留真实错误,避免 SDK 弃用提示中断上传。
|
||||
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_NOTICE);
|
||||
|
||||
//跨域检测
|
||||
check_cors_request();
|
||||
|
||||
|
||||
@@ -134,12 +134,14 @@ class WalletLog extends Backend
|
||||
|
||||
$order = (int)$row['order_id'] > 0 ? Db::name('order')->where('id', (int)$row['order_id'])->find() : null;
|
||||
$settle = (int)$row['order_id'] > 0 ? Db::name('settle')->where('order_id', (int)$row['order_id'])->find() : null;
|
||||
$recharge = Db::name('admin_recharge')->alias('r')->join('admin a', 'a.id = r.admin_id', 'LEFT')->where('r.wallet_log_id', (int)$row['id'])->field('r.*, a.username as admin_name')->find();
|
||||
|
||||
$this->view->assign([
|
||||
'row' => $row,
|
||||
'owner' => $owner,
|
||||
'order' => $order ?: [],
|
||||
'settle' => $settle ?: [],
|
||||
'recharge' => $recharge ?: [],
|
||||
]);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace app\admin\controller\user;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\Auth;
|
||||
use app\common\library\AdminRechargeService;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
@@ -189,6 +190,12 @@ class User extends Backend
|
||||
->order('id desc')
|
||||
->limit(6)
|
||||
->select();
|
||||
$logIds = array_column($recentWalletLogs, 'id');
|
||||
$rechargeMap = $logIds ? Db::name('admin_recharge')->where('wallet_log_id', 'in', $logIds)->column('voucher', 'wallet_log_id') : [];
|
||||
foreach ($recentWalletLogs as &$walletLog) {
|
||||
$walletLog['voucher'] = $rechargeMap[$walletLog['id']] ?? '';
|
||||
}
|
||||
unset($walletLog);
|
||||
|
||||
$this->view->assign([
|
||||
'row' => $row,
|
||||
@@ -205,6 +212,28 @@ class User extends Backend
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/** 后台凭支付凭证为用户充值。 */
|
||||
public function recharge($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$this->token();
|
||||
$params = $this->request->post('row/a', []);
|
||||
try {
|
||||
AdminRechargeService::credit((int)$row['id'], (int)$this->auth->id, $params['amount'] ?? '', $params['voucher'] ?? '', $params['request_id'] ?? '');
|
||||
} catch (\Throwable $e) {
|
||||
$this->error($e instanceof \RuntimeException ? $e->getMessage() : '充值失败,请联系管理员检查服务日志');
|
||||
}
|
||||
$this->success('充值成功');
|
||||
}
|
||||
$this->view->assign('row', $row);
|
||||
$this->view->assign('requestId', bin2hex(random_bytes(16)));
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ class WalletLog extends Model
|
||||
public function getTypeList()
|
||||
{
|
||||
return [
|
||||
'recharge' => '微信充值',
|
||||
'recharge' => '账户充值',
|
||||
'consume' => '余额消费',
|
||||
'refund' => '退回/退款',
|
||||
'settle' => '佣金结算',
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<tr>
|
||||
<td><code>#WL{$wl.id}</code></td>
|
||||
<td>
|
||||
{if $wl.type=='recharge'}<span class="label label-success">微信充值</span>
|
||||
{if $wl.type=='recharge'}<span class="label label-success">{if !empty($wl.voucher)}后台充值{else/}微信充值{/if}</span>
|
||||
{elseif $wl.type=='consume'/}<span class="label label-warning">余额消费</span>
|
||||
{elseif $wl.type=='refund'/}<span class="label label-info">原路退款</span>
|
||||
{else/}<span class="label label-default">{$wl.type}</span>{/if}
|
||||
@@ -161,7 +161,7 @@
|
||||
</td>
|
||||
<td class="text-muted">¥{:number_format($wl.balance, 2)}</td>
|
||||
<td>{if $wl.order_id > 0}<code>#{$wl.order_id}</code>{else/}-{/if}</td>
|
||||
<td>{$wl.remark|htmlentities}</td>
|
||||
<td>{$wl.remark|htmlentities} {if !empty($wl.voucher)}<a href="{:htmlentities(cdnurl($wl.voucher, true))}" target="_blank" rel="noopener noreferrer">查看凭证</a>{/if}</td>
|
||||
<td>{$wl.createtime|datetime}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-detail="{:$auth->check('user/user/detail')}"
|
||||
data-operate-recharge="{:$auth->check('user/user/recharge')}"
|
||||
data-operate-edit="{:$auth->check('user/user/edit')}"
|
||||
data-operate-del=""
|
||||
width="100%">
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<form id="recharge-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
{:token()}
|
||||
<input type="hidden" name="row[request_id]" value="{$requestId|htmlentities}">
|
||||
<div class="panel panel-default panel-form-section">
|
||||
<div class="panel-heading"><h4 class="panel-title">用户余额充值</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group"><label class="control-label col-sm-3">充值用户:</label><div class="col-sm-8"><p class="form-control-static">{$row.nickname|htmlentities}(ID:{$row.id},账号:{$row.username|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.money|htmlentities}</p></div></div>
|
||||
<div class="form-group"><label class="control-label col-sm-3" for="c-amount">充值金额:</label><div class="col-sm-8"><input id="c-amount" name="row[amount]" class="form-control" type="number" min="0.01" max="99999999.99" step="0.01" data-rule="required" placeholder="请输入充值金额(元)"></div></div>
|
||||
<div class="form-group"><label class="control-label col-sm-3" for="c-voucher">支付凭证:</label><div class="col-sm-8">
|
||||
<div class="input-group"><input id="c-voucher" name="row[voucher]" class="form-control" type="text" readonly data-rule="required" placeholder="请上传支付凭证图片"><div class="input-group-addon no-border no-padding"><button type="button" id="faupload-voucher" class="btn btn-danger faupload" data-category="recharge" data-input-id="c-voucher" data-mimetype="image/jpeg,image/png,image/gif,image/bmp,image/webp" data-multiple="false" data-preview-id="p-voucher">上传凭证</button></div></div>
|
||||
<ul class="row list-inline faupload-preview" id="p-voucher"></ul>
|
||||
<p class="help-block">请核实实际收款后上传凭证;提交成功后余额立即到账。</p>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="panel-footer normal-footer text-center"><button type="submit" class="btn btn-primary btn-embossed disabled">确认充值</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="wl-card">
|
||||
<div class="wl-card-hd">
|
||||
<i class="fa fa-exchange text-primary"></i> 资金流水审计凭证 #WL{$row.id}
|
||||
<span class="pull-right label label-info">{$typeList[$row.type]|default=$row.type}</span>
|
||||
<span class="pull-right label label-info">{if !empty($recharge)}后台充值{else/}{$typeList[$row.type]|default=$row.type}{/if}</span>
|
||||
</div>
|
||||
<div class="wl-card-bd">
|
||||
<div class="row">
|
||||
@@ -33,6 +33,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if !empty($recharge)}
|
||||
<div class="wl-card"><div class="wl-card-hd">后台充值支付凭证</div><div class="wl-card-bd"><div class="wl-kv"><span class="k">操作管理员:</span>{$recharge.admin_name|default='已删除'|htmlentities}(ID:{$recharge.admin_id})</div><a href="{:htmlentities(cdnurl($recharge.voucher, true))}" target="_blank" rel="noopener noreferrer">查看支付凭证</a></div></div>
|
||||
{/if}
|
||||
<div class="wl-card" style="{if empty($order)}margin-bottom:0;{/if}">
|
||||
<div class="wl-card-hd"><i class="fa fa-user-o text-info"></i> 变动账户主体信息</div>
|
||||
<div class="wl-card-bd">
|
||||
|
||||
@@ -6,6 +6,7 @@ use app\common\library\CommissionService;
|
||||
use app\common\library\FinanceConfigService;
|
||||
use app\common\library\OrderStatus;
|
||||
use app\common\library\OrderServiceSnapshot;
|
||||
use app\common\library\OrderPaymentResultService;
|
||||
use app\common\library\PaymentService;
|
||||
use app\common\library\TiandituService;
|
||||
use think\Db;
|
||||
@@ -658,6 +659,19 @@ class Order extends Base
|
||||
$this->success($msg, $res);
|
||||
}
|
||||
|
||||
/** 查询已确认的单笔订单支付结果。 */
|
||||
public function paymentResult()
|
||||
{
|
||||
$order = $this->ownOrder((int)$this->request->get('order_id'), 'user');
|
||||
try {
|
||||
$result = OrderPaymentResultService::getResult($order, $this->request->get('out_trade_no', ''));
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage());
|
||||
return;
|
||||
}
|
||||
$this->success('', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序端完成 wx.requestPayment 后主动查单幂等核销(与异步回调双保险闭环)
|
||||
* @ApiMethod (POST)
|
||||
|
||||
@@ -318,16 +318,19 @@ class User extends Api
|
||||
$page = max(1, (int)$this->request->get('page', 1));
|
||||
$limit = min(50, max(1, (int)$this->request->get('limit', 20)));
|
||||
|
||||
$query = Db::name('wallet_log')
|
||||
->where('user_type', 'user')
|
||||
->where('user_id', $uid);
|
||||
// count() 会清空查询条件,因此统计和列表必须分别创建查询。
|
||||
$makeQuery = function () use ($uid, $type) {
|
||||
$query = Db::name('wallet_log')
|
||||
->where('user_type', 'user')
|
||||
->where('user_id', $uid);
|
||||
if (in_array($type, ['recharge', 'consume', 'refund'], true)) {
|
||||
$query->where('type', $type);
|
||||
}
|
||||
return $query;
|
||||
};
|
||||
|
||||
if (in_array($type, ['recharge', 'consume', 'refund'], true)) {
|
||||
$query->where('type', $type);
|
||||
}
|
||||
|
||||
$total = $query->count();
|
||||
$rows = $query->order('id desc')->page($page, $limit)->select();
|
||||
$total = $makeQuery()->count();
|
||||
$rows = $makeQuery()->order('id desc')->page($page, $limit)->select();
|
||||
|
||||
$orderIds = [];
|
||||
foreach ($rows as $r) {
|
||||
@@ -350,7 +353,7 @@ class User extends Api
|
||||
$list[] = [
|
||||
'id' => (int)$r['id'],
|
||||
'type' => $r['type'],
|
||||
'type_label' => $this->formatWalletTypeLabel($r['type']),
|
||||
'type_label' => $r['type'] === 'recharge' && $r['remark'] === '后台人工充值' ? '后台人工充值' : $this->formatWalletTypeLabel($r['type']),
|
||||
'amount' => (float)$r['amount'],
|
||||
'balance' => (float)$r['balance'],
|
||||
'order_id' => $oid,
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace app\common\library;
|
||||
|
||||
use think\Db;
|
||||
|
||||
class AdminRechargeService
|
||||
{
|
||||
public static function credit($userId, $adminId, $amount, $voucher, $requestId)
|
||||
{
|
||||
$amount = trim((string)$amount);
|
||||
$voucher = trim((string)$voucher);
|
||||
if (!preg_match('/^(?:0|[1-9]\d{0,7})(?:\.\d{1,2})?$/D', $amount) || bccomp($amount, '0', 2) <= 0) {
|
||||
throw new \RuntimeException('请输入大于零且最多两位小数的充值金额');
|
||||
}
|
||||
if (!preg_match('/^[a-f0-9]{32}$/D', (string)$requestId)) {
|
||||
throw new \RuntimeException('充值请求无效,请重新打开页面');
|
||||
}
|
||||
if (!$voucher || strlen($voucher) > 255 || !Db::name('attachment')->where('url', $voucher)->where('admin_id', (int)$adminId)->where('category', 'recharge')->where('mimetype', 'in', ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/bmp'])->find()) {
|
||||
throw new \RuntimeException('请上传本次支付凭证图片');
|
||||
}
|
||||
$amount = bcadd($amount, '0', 2);
|
||||
Db::startTrans();
|
||||
try {
|
||||
$user = Db::name('user')->where('id', (int)$userId)->lock(true)->find();
|
||||
if (!$user) {
|
||||
throw new \RuntimeException('充值用户不存在');
|
||||
}
|
||||
if (Db::name('admin_recharge')->where('request_id', $requestId)->find()) {
|
||||
throw new \RuntimeException('该充值请求已提交,请勿重复充值');
|
||||
}
|
||||
$balance = bcadd((string)$user['money'], $amount, 2);
|
||||
if (bccomp($balance, '99999999.99', 2) > 0) {
|
||||
throw new \RuntimeException('充值后余额超出允许范围');
|
||||
}
|
||||
$now = time();
|
||||
Db::name('user')->where('id', (int)$userId)->update(['money' => $balance, 'updatetime' => $now]);
|
||||
$logId = Db::name('wallet_log')->insertGetId([
|
||||
'user_type' => 'user', 'user_id' => (int)$userId, 'type' => 'recharge',
|
||||
'amount' => $amount, 'balance' => $balance, 'order_id' => 0,
|
||||
'remark' => '后台人工充值', 'createtime' => $now,
|
||||
]);
|
||||
Db::name('admin_recharge')->insert([
|
||||
'wallet_log_id' => $logId, 'admin_id' => (int)$adminId,
|
||||
'voucher' => $voucher, 'request_id' => $requestId, 'createtime' => $now,
|
||||
]);
|
||||
Db::commit();
|
||||
return ['wallet_log_id' => $logId, 'balance' => $balance];
|
||||
} catch (\Throwable $e) {
|
||||
Db::rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\library;
|
||||
|
||||
use think\Db;
|
||||
|
||||
/** 读取已确认的单笔订单支付结果。订单访问权限由调用方校验。 */
|
||||
class OrderPaymentResultService
|
||||
{
|
||||
public static function getResult(array $order, $outTradeNo)
|
||||
{
|
||||
$outTradeNo = trim((string)$outTradeNo);
|
||||
if ($outTradeNo === '') {
|
||||
if ((int)$order['pay_status'] !== 1 || $order['pay_type'] !== 'coupon' || (float)$order['pay_amount'] !== 0.0) {
|
||||
throw new \InvalidArgumentException('未找到已确认的支付记录');
|
||||
}
|
||||
return self::format($order, '0.00', 'coupon', 'order', (int)$order['pay_time']);
|
||||
}
|
||||
$payment = Db::name('pay_order')->where('order_id', (int)$order['id'])
|
||||
->where('out_trade_no', $outTradeNo)->where('status', 'paid')
|
||||
->where('scene', 'in', ['order', 'quote', 'diff'])->find();
|
||||
if (!$payment) {
|
||||
throw new \InvalidArgumentException('未找到已确认的支付记录');
|
||||
}
|
||||
return self::format($order, (string)$payment['amount'], $payment['openid'] === 'BALANCE' ? 'balance' : 'wechat', $payment['scene'], (int)$payment['pay_time']);
|
||||
}
|
||||
|
||||
private static function format(array $order, $amount, $payType, $scene, $payTime)
|
||||
{
|
||||
return [
|
||||
'order_id' => (int)$order['id'],
|
||||
'order_no' => (string)$order['order_no'],
|
||||
'service_name' => (string)$order['service_name'],
|
||||
'amount' => number_format((float)$amount, 2, '.', ''),
|
||||
'pay_type' => $payType,
|
||||
'scene' => $scene,
|
||||
'pay_time' => $payTime,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ return array (
|
||||
'name' => '优匠优服',
|
||||
'beian' => '',
|
||||
'cdnurl' => '',
|
||||
'version' => '1.0.89',
|
||||
'version' => '1.0.90',
|
||||
'timezone' => 'Asia/Shanghai',
|
||||
'forbiddenip' => '',
|
||||
'languages' =>
|
||||
|
||||
@@ -55,6 +55,7 @@ return [
|
||||
'category_map' => [
|
||||
'order' => 'user', // 订单相关凭证(用户端)
|
||||
'cert' => 'user', // 入驻/资质证书(用户端)
|
||||
'recharge' => 'user', // 后台充值支付凭证
|
||||
'dispute' => 'user', // 争议/投诉凭证(用户端)
|
||||
'avatar' => 'user', // 头像(用户端与后台共用分类,后台无token自动落公共目录)
|
||||
'icon' => 'common', // 图标(后台)
|
||||
|
||||
@@ -19,6 +19,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'backend/admin-table-layout',
|
||||
table.on('post-body.bs.table', function () {
|
||||
$(".btn-detail-usr", this).data("area", ["1020px", "86%"]);
|
||||
$(".btn-editone", this).data("area", ["820px", "78%"]);
|
||||
$(".btn-recharge-usr", this).data("area", ["650px", "620px"]);
|
||||
});
|
||||
$(".btn-edit").data("area", ["820px", "78%"]);
|
||||
|
||||
@@ -88,6 +89,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'backend/admin-table-layout',
|
||||
events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'recharge',
|
||||
text: '充值',
|
||||
title: '用户余额充值',
|
||||
classname: 'btn btn-xs btn-success btn-dialog btn-recharge-usr',
|
||||
url: 'user/user/recharge',
|
||||
visible: function () { return !!table.data('operate-recharge'); }
|
||||
},
|
||||
{
|
||||
name: 'detail',
|
||||
text: '详情',
|
||||
@@ -114,6 +123,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'backend/admin-table-layout',
|
||||
},
|
||||
detail: function () {
|
||||
},
|
||||
recharge: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
|
||||
35
tests/admin_recharge_test.php
普通文件
35
tests/admin_recharge_test.php
普通文件
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../server/application/');
|
||||
require __DIR__ . '/../server/thinkphp/base.php';
|
||||
\think\App::initCommon();
|
||||
|
||||
use app\common\library\AdminRechargeService;
|
||||
use think\Db;
|
||||
|
||||
function check($condition, $message) { if (!$condition) { throw new RuntimeException($message); } }
|
||||
function rejected($fn, $message) { try { $fn(); } catch (RuntimeException $e) { return; } throw new RuntimeException($message); }
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
$uid = Db::name('user')->insertGetId(['username' => 'recharge_test_' . time(), 'money' => '10.10']);
|
||||
$url = '/uploads/test-recharge-' . time() . '.png';
|
||||
Db::name('attachment')->insert(['admin_id' => 1, 'url' => $url, 'category' => 'recharge', 'mimetype' => 'image/png']);
|
||||
$nonce = bin2hex(random_bytes(16));
|
||||
rejected(function () use ($uid, $nonce) { AdminRechargeService::credit($uid, 1, '2.00', '', $nonce); }, 'Missing receipt accepted');
|
||||
rejected(function () use ($uid, $url, $nonce) { AdminRechargeService::credit($uid, 1, '0.001', $url, $nonce); }, 'Invalid amount accepted');
|
||||
rejected(function () use ($uid, $url, $nonce) { AdminRechargeService::credit($uid, 1, '0', $url, $nonce); }, 'Zero amount accepted');
|
||||
rejected(function () use ($uid, $url, $nonce) { AdminRechargeService::credit($uid, 1, '99999999.99', $url, $nonce); }, 'Balance overflow accepted');
|
||||
rejected(function () use ($uid, $url, $nonce) { AdminRechargeService::credit($uid, 2, '2.00', $url, $nonce); }, 'Another administrator receipt accepted');
|
||||
$result = AdminRechargeService::credit($uid, 1, '2.20', $url, $nonce);
|
||||
check($result['balance'] === '12.30', 'Balance incorrect');
|
||||
check(Db::name('user')->where('id', $uid)->value('money') === '12.30', 'User balance not saved');
|
||||
$log = Db::name('wallet_log')->where('id', $result['wallet_log_id'])->find();
|
||||
check($log && $log['type'] === 'recharge' && $log['amount'] === '2.20' && $log['balance'] === '12.30', 'Wallet log incorrect');
|
||||
$audit = Db::name('admin_recharge')->where('wallet_log_id', $result['wallet_log_id'])->find();
|
||||
check($audit && $audit['voucher'] === $url && (int)$audit['admin_id'] === 1, 'Receipt or operator not saved');
|
||||
rejected(function () use ($uid, $url, $nonce) { AdminRechargeService::credit($uid, 1, '2.20', $url, $nonce); }, 'Duplicate request accepted');
|
||||
check(Db::name('user')->where('id', $uid)->value('money') === '12.30', 'Duplicate changed balance');
|
||||
echo "Admin recharge integration checks passed\n";
|
||||
} finally {
|
||||
Db::rollback();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../server/application/');
|
||||
require __DIR__ . '/../server/thinkphp/base.php';
|
||||
\think\App::initCommon();
|
||||
|
||||
use app\common\library\OrderPaymentResultService;
|
||||
use think\Db;
|
||||
|
||||
function verifyResult($condition, $message) { if (!$condition) throw new RuntimeException($message); }
|
||||
function mustReject($fn, $message) { try { $fn(); } catch (InvalidArgumentException $e) { return; } throw new RuntimeException($message); }
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
$order = ['id' => 2147483000, 'order_no' => 'RESULT-TEST', 'service_name' => '测试服务', 'pay_status' => 1, 'pay_type' => 'balance', 'pay_amount' => '120.00', 'pay_time' => time()];
|
||||
$trade = 'RESULT' . bin2hex(random_bytes(10));
|
||||
Db::name('pay_order')->insert(['out_trade_no' => $trade, 'order_id' => $order['id'], 'order_no' => $order['order_no'], 'user_id' => 1, 'scene' => 'diff', 'openid' => 'BALANCE', 'amount' => '12.34', 'status' => 'paid', 'pay_time' => time()]);
|
||||
$result = OrderPaymentResultService::getResult($order, $trade);
|
||||
verifyResult($result['amount'] === '12.34' && $result['pay_type'] === 'balance' && $result['scene'] === 'diff', 'Must use the actual payment transaction');
|
||||
Db::name('pay_order')->where('out_trade_no', $trade)->update(['openid' => 'WX_TEST_OPENID', 'scene' => 'quote']);
|
||||
$wechat = OrderPaymentResultService::getResult($order, $trade);
|
||||
verifyResult($wechat['pay_type'] === 'wechat' && $wechat['scene'] === 'quote' && $wechat['amount'] === '12.34', 'WeChat payment result incorrect');
|
||||
mustReject(function () use ($order, $trade) { $other = $order; $other['id']--; OrderPaymentResultService::getResult($other, $trade); }, 'Another order transaction accepted');
|
||||
Db::name('pay_order')->where('out_trade_no', $trade)->update(['status' => 'pending']);
|
||||
mustReject(function () use ($order, $trade) { OrderPaymentResultService::getResult($order, $trade); }, 'Unpaid transaction accepted');
|
||||
Db::name('pay_order')->where('out_trade_no', $trade)->update(['status' => 'refunded']);
|
||||
mustReject(function () use ($order, $trade) { OrderPaymentResultService::getResult($order, $trade); }, 'Refunded transaction shown as successful');
|
||||
mustReject(function () use ($order) { OrderPaymentResultService::getResult($order, ''); }, 'Missing transaction accepted for nonzero payment');
|
||||
$order['pay_type'] = 'coupon'; $order['pay_amount'] = '0.00';
|
||||
$zero = OrderPaymentResultService::getResult($order, '');
|
||||
verifyResult($zero['amount'] === '0.00' && $zero['pay_type'] === 'coupon', 'Zero payment not recognized');
|
||||
$order['pay_status'] = 0;
|
||||
mustReject(function () use ($order) { OrderPaymentResultService::getResult($order, ''); }, 'Unpaid zero order accepted');
|
||||
echo "Order payment result checks passed\n";
|
||||
} finally {
|
||||
Db::rollback();
|
||||
}
|
||||
38
tests/wallet_bills_api_test.js
普通文件
38
tests/wallet_bills_api_test.js
普通文件
@@ -0,0 +1,38 @@
|
||||
const assert = require('assert');
|
||||
const { execFileSync } = require('child_process');
|
||||
const http = require('http');
|
||||
const mysql = process.env.MYSQL_BIN;
|
||||
const base = process.env.API_BASE || 'http://yjyf:9560/api';
|
||||
function sql(query) {
|
||||
return execFileSync(mysql, ['-h127.0.0.1', '-u' + process.env.DB_USER, '-D' + process.env.DB_NAME, '-N', '-B', '-e', query], { encoding: 'utf8' }).trim();
|
||||
}
|
||||
function request(path, data, token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const body = data && new URLSearchParams(data).toString();
|
||||
const url = new URL(base + path);
|
||||
const req = http.request(url, { method: body ? 'POST' : 'GET', headers: { ...(body ? {'content-type': 'application/x-www-form-urlencoded', 'content-length': Buffer.byteLength(body)} : {}), ...(token ? {token} : {}) } }, res => {
|
||||
let text = ''; res.on('data', chunk => text += chunk); res.on('end', () => { try { resolve(JSON.parse(text)); } catch (e) { reject(e); } });
|
||||
});
|
||||
req.on('error', reject); if (body) req.write(body); req.end();
|
||||
});
|
||||
}
|
||||
(async () => {
|
||||
const login = await request('/auth/login', {mobile: process.env.TEST_MOBILE, password: process.env.TEST_PASSWORD});
|
||||
assert.strictEqual(login.code, 1, 'login failed');
|
||||
const {token, userinfo} = login.data;
|
||||
const uid = Number(userinfo.id);
|
||||
assert(Number.isInteger(uid) && uid > 0);
|
||||
for (const type of ['all', 'recharge', 'consume', 'refund']) {
|
||||
const filter = type === 'all' ? '' : ` AND type='${type}'`;
|
||||
const expected = sql(`SELECT id FROM fa_wallet_log WHERE user_type='user' AND user_id=${uid}${filter} ORDER BY id DESC`);
|
||||
const ids = expected ? expected.split(/\s+/).map(Number) : [];
|
||||
for (const page of [1, 2]) {
|
||||
const res = await request(`/user/walletLogs?type=${type}&page=${page}&limit=3`, null, token);
|
||||
assert.strictEqual(res.code, 1, `${type} page ${page} request failed`);
|
||||
assert.strictEqual(res.data.total, ids.length, `${type} total`);
|
||||
assert.deepStrictEqual(res.data.list.map(row => row.id), ids.slice((page - 1) * 3, page * 3), `${type} page ${page} must contain only matching user records`);
|
||||
assert.strictEqual(res.data.has_more, page * 3 < ids.length, `${type} has_more`);
|
||||
}
|
||||
}
|
||||
console.log('Wallet bill user, type, count and pagination checks passed');
|
||||
})().catch(err => { console.error(err); process.exitCode = 1; });
|
||||
@@ -269,7 +269,7 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { formatOrderServiceItems } from '@/utils/order-service-items.mjs';
|
||||
import api from '@/utils/api.js';
|
||||
import { executeOrderWxPay } from '@/utils/pay.js';
|
||||
import { executeOrderWxPay, openOrderPaymentResult } from '@/utils/pay.js';
|
||||
import { isLogin, toLogin } from '@/utils/request.js';
|
||||
import { getNavBarMetrics } from '@/utils/system.js';
|
||||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||||
@@ -518,9 +518,8 @@
|
||||
if (!o || actingOrderId.value) return;
|
||||
actingOrderId.value = o.id;
|
||||
try {
|
||||
await executeOrderWxPay(api.orderPay, { order_id: o.id });
|
||||
uni.showToast({ title: '支付成功', icon: 'success' });
|
||||
await load();
|
||||
const payment = await executeOrderWxPay(api.orderPay, { order_id: o.id });
|
||||
openOrderPaymentResult(o.id, payment);
|
||||
} catch (e) {
|
||||
if (e && e.code === undefined && !e.handledToast && !e.unsupportedEnv && e.message) {
|
||||
uni.showToast({ title: e.message, icon: 'none' });
|
||||
|
||||
@@ -74,6 +74,10 @@
|
||||
"path": "pages/order/detail",
|
||||
"style": { "navigationStyle": "custom", "backgroundColor": "#F5F6F8" }
|
||||
},
|
||||
{
|
||||
"path": "pages/order/payment-success",
|
||||
"style": { "navigationStyle": "custom", "backgroundColor": "#F5F6F8" }
|
||||
},
|
||||
{
|
||||
"path": "pages/order/case",
|
||||
"style": { "navigationStyle": "custom", "backgroundColor": "#F5F6F8" }
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
import { ref, reactive, watch, computed } from 'vue';
|
||||
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import api from '@/utils/api.js';
|
||||
import { executeOrderWxPay } from '@/utils/pay.js';
|
||||
import { executeOrderWxPay, openOrderPaymentResult } from '@/utils/pay.js';
|
||||
import { isLogin, toLogin } from '@/utils/request.js';
|
||||
import RegionPickerDrawer from '@/components/RegionPickerDrawer.vue';
|
||||
|
||||
@@ -546,12 +546,8 @@
|
||||
} catch (pe) {}
|
||||
|
||||
// 一口价或自主定价调起支付
|
||||
await executeOrderWxPay(api.orderPay, { order_id: createdOrderId, pay_type: payType });
|
||||
uni.showToast({ title: '下单并支付成功' });
|
||||
setTimeout(() => {
|
||||
submitting.value = false;
|
||||
uni.redirectTo({ url: `/pages/order/detail?id=${createdOrderId}` });
|
||||
}, 600);
|
||||
const payment = await executeOrderWxPay(api.orderPay, { order_id: createdOrderId, pay_type: payType });
|
||||
openOrderPaymentResult(createdOrderId, payment, true);
|
||||
} catch (e) {
|
||||
if (createdOrderId) {
|
||||
if (!e || !e.unsupportedEnv) {
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||||
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
|
||||
import api from '@/utils/api.js';
|
||||
import { executeOrderWxPay } from '@/utils/pay.js';
|
||||
import { executeOrderWxPay, openOrderPaymentResult } from '@/utils/pay.js';
|
||||
|
||||
const order = ref(null);
|
||||
const loading = ref(true);
|
||||
@@ -636,9 +636,13 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
await executeOrderWxPay(api.orderChooseQuote, { order_id: orderId, quote_id: q.id, pay_type: payType });
|
||||
uni.showToast({ title: '已选定师傅' });
|
||||
await load();
|
||||
const payment = await executeOrderWxPay(api.orderChooseQuote, { order_id: orderId, quote_id: q.id, pay_type: payType });
|
||||
if (payment.out_trade_no) {
|
||||
openOrderPaymentResult(orderId, payment, true);
|
||||
} else {
|
||||
uni.showToast({ title: '已选定师傅' });
|
||||
await load();
|
||||
}
|
||||
} catch (e) {
|
||||
if (e && e.code === undefined && !e.handledToast && !e.unsupportedEnv && e.message) {
|
||||
uni.showToast({ title: e.message, icon: 'none' });
|
||||
@@ -665,9 +669,8 @@
|
||||
actionBusy.value = false;
|
||||
return;
|
||||
}
|
||||
await executeOrderWxPay(api.orderPayDiff, { order_id: orderId, pay_type: payType });
|
||||
uni.showToast({ title: '支付成功' });
|
||||
await load();
|
||||
const payment = await executeOrderWxPay(api.orderPayDiff, { order_id: orderId, pay_type: payType });
|
||||
openOrderPaymentResult(orderId, payment, true);
|
||||
} catch (e) {
|
||||
if (e && e.code === undefined && !e.handledToast && !e.unsupportedEnv && e.message) {
|
||||
uni.showToast({ title: e.message, icon: 'none' });
|
||||
@@ -710,9 +713,8 @@
|
||||
|
||||
actionBusy.value = true;
|
||||
try {
|
||||
await executeOrderWxPay(api.orderPay, { order_id: orderId, pay_type: payType });
|
||||
uni.showToast({ title: '支付成功', icon: 'success' });
|
||||
await load();
|
||||
const payment = await executeOrderWxPay(api.orderPay, { order_id: orderId, pay_type: payType });
|
||||
openOrderPaymentResult(orderId, payment, true);
|
||||
} catch (e) {
|
||||
if (e && e.code === undefined && !e.handledToast && !e.unsupportedEnv && e.message) {
|
||||
uni.showToast({ title: e.message, icon: 'none' });
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<view class="payment-page">
|
||||
<YjyfNavBar theme="white" title="支付结果" :border="true" :customBack="true" @back="goDetail" />
|
||||
<view class="content">
|
||||
<view v-if="loading" class="state-card"><text class="state-text">正在确认支付结果...</text></view>
|
||||
<view v-else-if="result" class="result-card">
|
||||
<image class="success-icon" src="/static/icons/order-payment-success.svg" mode="aspectFit" />
|
||||
<text class="result-title">支付成功</text>
|
||||
<text class="result-description">{{ sceneDescription }}</text>
|
||||
<view class="amount-block">
|
||||
<text class="amount-label">本次支付金额</text>
|
||||
<view class="amount-value"><text class="currency">¥</text><text>{{ result.amount }}</text></view>
|
||||
</view>
|
||||
<view class="details">
|
||||
<view class="detail-row"><text class="detail-label">支付方式</text><text class="detail-value">{{ paymentLabel }}</text></view>
|
||||
<view class="detail-row" v-if="result.service_name"><text class="detail-label">服务项目</text><text class="detail-value">{{ result.service_name }}</text></view>
|
||||
<view class="detail-row"><text class="detail-label">订单编号</text><text class="detail-value">{{ result.order_no }}</text></view>
|
||||
<view class="detail-row" v-if="result.pay_time"><text class="detail-label">支付时间</text><text class="detail-value">{{ paymentTime }}</text></view>
|
||||
</view>
|
||||
<button class="primary-action" @tap="goDetail">查看订单详情</button>
|
||||
<button class="secondary-action" @tap="goOrders">返回订单列表</button>
|
||||
</view>
|
||||
<view v-else class="state-card">
|
||||
<text class="state-title">暂时无法确认支付结果</text>
|
||||
<text class="state-text">{{ errorMessage }}</text>
|
||||
<button class="primary-action" @tap="loadResult">重新查询</button>
|
||||
<button class="secondary-action" @tap="goDetail">查看订单详情</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||||
import api from '@/utils/api.js';
|
||||
|
||||
const orderId = ref(0);
|
||||
const tradeNo = ref('');
|
||||
const result = ref(null);
|
||||
const loading = ref(true);
|
||||
const errorMessage = ref('');
|
||||
const paymentLabel = computed(() => ({ balance: '账户余额', wechat: '微信支付', coupon: '优惠抵扣' })[result.value.pay_type] || '');
|
||||
const sceneDescription = computed(() => ({ order: '订单支付已完成', quote: '报价补款已完成', diff: '增项补款已完成' })[result.value.scene] || '');
|
||||
const paymentTime = computed(() => {
|
||||
const date = new Date(Number(result.value.pay_time) * 1000);
|
||||
const pad = (value) => String(value).padStart(2, '0');
|
||||
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
orderId.value = Number(options && options.order_id) || 0;
|
||||
tradeNo.value = (options && options.out_trade_no) || '';
|
||||
loadResult();
|
||||
});
|
||||
|
||||
async function loadResult() {
|
||||
if (!orderId.value) {
|
||||
loading.value = false;
|
||||
errorMessage.value = '订单信息不完整,请前往订单列表查看。';
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
result.value = null;
|
||||
try {
|
||||
result.value = await api.orderPaymentResult({ order_id: orderId.value, out_trade_no: tradeNo.value });
|
||||
} catch (e) {
|
||||
errorMessage.value = (e && e.message) || '请稍后重新查询,或前往订单详情查看。';
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function goDetail() {
|
||||
if (orderId.value) uni.redirectTo({ url: `/pages/order/detail?id=${orderId.value}` });
|
||||
else goOrders();
|
||||
}
|
||||
function goOrders() {
|
||||
uni.reLaunch({ url: '/pages/index/index?tab=1' });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/uni.scss';
|
||||
.payment-page { min-height: 100vh; background: $yjyf-bg-page; }
|
||||
.content { padding: $yjyf-space-lg $yjyf-space-lg calc(48rpx + env(safe-area-inset-bottom)); }
|
||||
.result-card, .state-card { background: $yjyf-bg-card; border-radius: $yjyf-radius-lg; padding: 48rpx 36rpx 36rpx; display: flex; flex-direction: column; align-items: center; box-sizing: border-box; box-shadow: $yjyf-shadow-card; }
|
||||
.success-icon { width: 144rpx; height: 144rpx; }
|
||||
.result-title { margin-top: 20rpx; font-size: $yjyf-font-hero; font-weight: 700; color: $yjyf-text-main; }
|
||||
.result-description { margin-top: 12rpx; color: $yjyf-text-secondary; font-size: $yjyf-font-body; }
|
||||
.amount-block { width: 100%; margin-top: 40rpx; padding: 32rpx 0; border-radius: $yjyf-radius-md; background: $yjyf-primary-bg; display: flex; flex-direction: column; align-items: center; }
|
||||
.amount-label { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
|
||||
.amount-value { margin-top: 10rpx; color: $yjyf-text-main; font-size: 56rpx; line-height: 1.2; font-weight: 700; }
|
||||
.currency { font-size: $yjyf-font-title; margin-right: 6rpx; }
|
||||
.details { width: 100%; margin: 20rpx 0 32rpx; }
|
||||
.detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24rpx; padding: 18rpx 0; border-bottom: 1rpx solid $yjyf-border-color; font-size: $yjyf-font-sub; }
|
||||
.detail-label { color: $yjyf-text-secondary; flex-shrink: 0; }
|
||||
.detail-value { color: $yjyf-text-main; text-align: right; word-break: break-all; }
|
||||
.primary-action, .secondary-action { width: 100%; height: 88rpx; line-height: 88rpx; border-radius: $yjyf-radius-pill; font-size: $yjyf-font-body; font-weight: 600; padding: 0; }
|
||||
.primary-action { background: $yjyf-gradient-primary; color: $yjyf-text-inverse; }
|
||||
.secondary-action { margin-top: 16rpx; background: $yjyf-bg-card; color: $yjyf-text-regular; border: 1rpx solid $yjyf-border-color; }
|
||||
.primary-action::after, .secondary-action::after { border: 0; }
|
||||
.state-title { font-size: $yjyf-font-title; font-weight: 700; color: $yjyf-text-main; }
|
||||
.state-text { margin: 20rpx 0 36rpx; color: $yjyf-text-secondary; font-size: $yjyf-font-body; line-height: 1.6; text-align: center; }
|
||||
</style>
|
||||
@@ -1092,7 +1092,7 @@
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import api from '@/utils/api.js';
|
||||
import { executeOrderWxPay } from '@/utils/pay.js';
|
||||
import { executeOrderWxPay, openOrderPaymentResult } from '@/utils/pay.js';
|
||||
import { isLogin, toLogin } from '@/utils/request.js';
|
||||
|
||||
// 支付方式状态管理(优先默认勾选微信支付)
|
||||
@@ -2586,15 +2586,15 @@
|
||||
createdOrderId = createRes.order_id;
|
||||
if (priceType.value === 'quote') {
|
||||
uni.showToast({ title: '报价单发布成功,等待师傅报价' });
|
||||
setTimeout(() => {
|
||||
submitting.value = false;
|
||||
uni.redirectTo({ url: `/pages/order/detail?id=${createdOrderId}` });
|
||||
}, 600);
|
||||
} else {
|
||||
const payType = (selectedPayType.value === 'balance' && isBalanceSufficient.value) ? 'balance' : 'wechat';
|
||||
await executeOrderWxPay(api.orderPay, { order_id: createdOrderId, pay_type: payType });
|
||||
uni.showToast({ title: payType === 'balance' ? '余额支付成功,正在匹配师傅' : '下单成功,正在匹配师傅' });
|
||||
const payment = await executeOrderWxPay(api.orderPay, { order_id: createdOrderId, pay_type: payType });
|
||||
openOrderPaymentResult(createdOrderId, payment, true);
|
||||
}
|
||||
setTimeout(() => {
|
||||
submitting.value = false;
|
||||
uni.redirectTo({ url: `/pages/order/detail?id=${createdOrderId}` });
|
||||
}, 600);
|
||||
} catch (e) {
|
||||
if (createdOrderId) {
|
||||
if (!e || !e.unsupportedEnv) {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><circle cx="60" cy="60" r="56" fill="#FFF7F0"/><circle cx="60" cy="60" r="42" fill="#2FA84F"/><path d="M40 60.5 54 74l27-30" fill="none" stroke="#fff" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
|
之后 宽度: | 高度: | 大小: 285 B |
@@ -50,6 +50,7 @@ export default {
|
||||
detectExpress: (data) => get('/order/detectExpress', data),
|
||||
orderPay: (data) => post('/order/pay', data),
|
||||
orderConfirmPay: (data) => post('/order/confirmPay', data, { silent: true, allowConcurrent: true }),
|
||||
orderPaymentResult: (data) => get('/order/paymentResult', data, { silent: true }),
|
||||
orderCancel: (data) => post('/order/cancel', data),
|
||||
orderDelete: (data) => post('/order/delete', data),
|
||||
orderVerify: (data) => post('/order/verify', data),
|
||||
|
||||
@@ -160,7 +160,7 @@ export async function executeOrderWxPay(createPayApiFn, params = {}) {
|
||||
throw Object.assign(new Error(msg), { handledToast: true, unconfirmed: true, data: confirmRes });
|
||||
}
|
||||
|
||||
return confirmRes;
|
||||
return Object.assign({}, confirmRes, { out_trade_no: res.out_trade_no });
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
@@ -174,6 +174,17 @@ export async function executeOrderWxPay(createPayApiFn, params = {}) {
|
||||
// #endif
|
||||
}
|
||||
|
||||
/** 支付确认后打开结果页,订单和支付详情由结果页重新向服务端核实。 */
|
||||
export function openOrderPaymentResult(orderId, result, replace = false) {
|
||||
const url = `/pages/order/payment-success?order_id=${encodeURIComponent(orderId)}&out_trade_no=${encodeURIComponent((result && result.out_trade_no) || '')}`;
|
||||
const options = {
|
||||
url,
|
||||
fail: () => uni.redirectTo({ url: `/pages/order/detail?id=${encodeURIComponent(orderId)}` })
|
||||
};
|
||||
if (replace) uni.redirectTo(options);
|
||||
else uni.navigateTo(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 师傅端调起微信官方「商家转账」确认收款页(wx.requestMerchantTransfer)并在返回后同步真实入账状态
|
||||
*
|
||||
|
||||
在新工单中引用
屏蔽一个用户