feat(pay): 统一收银台四种模式(站内二维码/当前页跳转/表单提交/JSAPI)
- PaymentOrchestrator 统一返回 mode + code_url/payment_url/form_html/jsapi_params
- 支付宝:当面付二维码 / 电脑网站支付 / H5;微信:Native / H5 / JSAPI(WechatOpenid 静默授权)
- 易支付:PC mapi 二维码,移动端自动提交表单
- 删除旧键 alipay_payment_type / wechat_payment_type / epay_device 与 redirect/qr_content 字段
- 新增 pay-cashier.js,移除 window.open,订单状态接口改为 /pay/order/{n}
- 拆分 credits.js(affiliate / withdraw-history)至 1000 行以内
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b340b77d5a
commit
1df2822f01
28 files changed
+1255
-836
No files matched your search
+33
-18
@@ -93,6 +93,24 @@ trait ScriptsPart1b {
|
||||
&& class_exists('\AKSRT\Credits\Signin')
|
||||
&& class_exists('\AKSRT\Settings\Settings')
|
||||
&& !empty(\AKSRT\Settings\Settings::get_signin_reward_settings()['enabled']);
|
||||
// 统一收银台(站内二维码 / 当前页跳转 / 表单提交 / JSAPI):按需作为依赖入队。
|
||||
$qrcode_js_path = get_template_directory() . '/assets/js/vendor/qrcode.min.js';
|
||||
wp_register_script(
|
||||
'aksrt-qrcode',
|
||||
$base_uri . '/assets/js/vendor/qrcode.min.js',
|
||||
[],
|
||||
file_exists($qrcode_js_path) ? (string) filemtime($qrcode_js_path) : $version,
|
||||
true
|
||||
);
|
||||
$pay_cashier_js = get_template_directory() . '/assets/js/pay-cashier.js';
|
||||
wp_register_script(
|
||||
'aksrt-pay-cashier',
|
||||
$base_uri . '/assets/js/pay-cashier.js',
|
||||
['loader_js', 'aksrt-qrcode'],
|
||||
file_exists($pay_cashier_js) ? (string) filemtime($pay_cashier_js) : $version,
|
||||
true
|
||||
);
|
||||
|
||||
$vip_coordinator = get_template_directory() . '/assets/js/vip-purchase-coordinator.js';
|
||||
if ((($vip_on && is_user_logged_in()) || $credits_on || $affiliate_on) && file_exists($vip_coordinator)) {
|
||||
wp_enqueue_script(
|
||||
@@ -120,7 +138,7 @@ trait ScriptsPart1b {
|
||||
wp_enqueue_script(
|
||||
'aksrt-pay-vip',
|
||||
$base_uri . '/assets/js/pay-vip.js',
|
||||
['loader_js', 'aksrt-vip-coordinator'],
|
||||
['loader_js', 'aksrt-vip-coordinator', 'aksrt-pay-cashier'],
|
||||
(string) filemtime($vip_js),
|
||||
true
|
||||
);
|
||||
@@ -407,7 +425,7 @@ trait ScriptsPart1b {
|
||||
wp_enqueue_script(
|
||||
'aksrt-order-center',
|
||||
$base_uri . '/assets/js/order-center.js',
|
||||
['loader_js'],
|
||||
['loader_js', 'aksrt-pay-cashier'],
|
||||
(string) filemtime($order_center_js),
|
||||
true
|
||||
);
|
||||
@@ -667,7 +685,7 @@ trait ScriptsPart1b {
|
||||
wp_enqueue_script(
|
||||
'aksrt-cms-download',
|
||||
$base_uri . '/assets/js/cms-download.js',
|
||||
['loader_js'],
|
||||
['loader_js', 'aksrt-pay-cashier'],
|
||||
file_exists($cms_download_js_path) ? (string) filemtime($cms_download_js_path) : $version,
|
||||
true
|
||||
);
|
||||
@@ -692,28 +710,25 @@ trait ScriptsPart1b {
|
||||
|
||||
// profile 页:加载 credits.js(签到 + 邀请 + 提现交互)
|
||||
if ($is_profile_page) {
|
||||
$affiliate_deps = [];
|
||||
if ($affiliate_on) {
|
||||
// 推广二维码生成库(本地打包,无外部 CDN)。
|
||||
$qrcode_js_path = get_template_directory() . '/assets/js/vendor/qrcode.min.js';
|
||||
wp_enqueue_script(
|
||||
'aksrt-qrcode',
|
||||
$base_uri . '/assets/js/vendor/qrcode.min.js',
|
||||
[],
|
||||
file_exists($qrcode_js_path) ? (string) filemtime($qrcode_js_path) : $version,
|
||||
true
|
||||
);
|
||||
$affiliate_deps[] = 'aksrt-qrcode';
|
||||
}
|
||||
// aksrt-pay-cashier 依赖 aksrt-qrcode(推广海报二维码同用)。
|
||||
$credits_js_path = get_template_directory() . '/assets/js/credits.js';
|
||||
wp_enqueue_script(
|
||||
'aksrt-credits',
|
||||
$base_uri . '/assets/js/credits.js',
|
||||
array_merge(['loader_js', 'aksrt-vip-coordinator'], $affiliate_deps),
|
||||
['loader_js', 'aksrt-vip-coordinator', 'aksrt-pay-cashier'],
|
||||
file_exists($credits_js_path) ? (string) filemtime($credits_js_path) : $version,
|
||||
true
|
||||
);
|
||||
|
||||
foreach (['credits-withdraw-history' => ['loader_js']] + ($affiliate_on ? ['credits-affiliate' => ['loader_js', 'aksrt-qrcode']] : []) as $credits_part => $credits_part_deps) {
|
||||
$credits_part_path = get_template_directory() . '/assets/js/' . $credits_part . '.js';
|
||||
wp_enqueue_script(
|
||||
'aksrt-' . $credits_part,
|
||||
$base_uri . '/assets/js/' . $credits_part . '.js',
|
||||
$credits_part_deps,
|
||||
file_exists($credits_part_path) ? (string) filemtime($credits_part_path) : $version,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user