mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-30 16:23:31 +00:00
feat(payment): 支持强制移动端统一使用二维码支付
This commit is contained in:
@@ -5843,6 +5843,38 @@
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="input-label">{{
|
||||
t("admin.settings.payment.alipayForceQRCode")
|
||||
}}</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
:class="[
|
||||
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2',
|
||||
form.payment_alipay_force_qrcode
|
||||
? 'bg-primary-500'
|
||||
: 'bg-gray-300 dark:bg-dark-600',
|
||||
]"
|
||||
@click="
|
||||
form.payment_alipay_force_qrcode =
|
||||
!form.payment_alipay_force_qrcode
|
||||
"
|
||||
>
|
||||
<span
|
||||
:class="[
|
||||
'pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out',
|
||||
form.payment_alipay_force_qrcode
|
||||
? 'translate-x-5'
|
||||
: 'translate-x-0',
|
||||
]"
|
||||
/>
|
||||
</button>
|
||||
<span class="text-sm text-gray-500 dark:text-gray-400">{{
|
||||
t("admin.settings.payment.alipayForceQRCodeHint")
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Row 4: Enabled payment types (provider badges like sub2apipay) -->
|
||||
<div>
|
||||
@@ -6772,6 +6804,7 @@ const form = reactive<SettingsForm>({
|
||||
payment_cancel_rate_limit_window: 1,
|
||||
payment_cancel_rate_limit_unit: "day",
|
||||
payment_cancel_rate_limit_window_mode: "rolling",
|
||||
payment_alipay_force_qrcode: false,
|
||||
table_default_page_size: tablePageSizeDefault,
|
||||
table_page_size_options: [10, 20, 50, 100],
|
||||
custom_menu_items: [] as Array<{
|
||||
@@ -8036,6 +8069,7 @@ async function saveSettings() {
|
||||
payment_cancel_rate_limit_unit: form.payment_cancel_rate_limit_unit,
|
||||
payment_cancel_rate_limit_window_mode:
|
||||
form.payment_cancel_rate_limit_window_mode,
|
||||
payment_alipay_force_qrcode: form.payment_alipay_force_qrcode,
|
||||
openai_advanced_scheduler_enabled: form.openai_advanced_scheduler_enabled,
|
||||
// Balance & quota notification
|
||||
balance_low_notify_enabled: form.balance_low_notify_enabled,
|
||||
|
||||
@@ -698,6 +698,7 @@ async function createOrder(orderAmount: number, orderType: OrderType, planId?: n
|
||||
origin: typeof window !== 'undefined' ? window.location.origin : '',
|
||||
isMobile: isMobileDevice(),
|
||||
isWechatBrowser: typeof window !== 'undefined' && /MicroMessenger/i.test(window.navigator.userAgent),
|
||||
forceQRCode: !!(checkout.value.alipay_force_qrcode && normalizeVisibleMethod(requestType) === 'alipay'),
|
||||
})
|
||||
if (options.openid) {
|
||||
payload.openid = options.openid
|
||||
@@ -745,6 +746,7 @@ async function createOrder(orderAmount: number, orderType: OrderType, planId?: n
|
||||
orderType,
|
||||
isMobile: isMobileDevice(),
|
||||
isWechatBrowser: typeof window !== 'undefined' && /MicroMessenger/i.test(window.navigator.userAgent),
|
||||
forceQRCode: !!(checkout.value.alipay_force_qrcode && visibleMethod === 'alipay'),
|
||||
stripePopupUrl: stripeRouteUrl,
|
||||
stripeRouteUrl,
|
||||
airwallexRouteUrl,
|
||||
|
||||
Reference in New Issue
Block a user