feat: H5充值对齐PC、品牌logo刷新与无图占位BCDship
All checks were successful
Build and Deploy Front / deploy (push) Successful in 17m20s

同步支付宝支付前端能力与支付相关页面体验;登录/顶栏/官网进入时重新核对品牌资源。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-12-04 15:47:07 +08:00
parent 6a070be3fc
commit b453f0a47c
31 changed files with 3222 additions and 995 deletions

View File

@ -259,9 +259,9 @@
}
#app-boot .boot-text-logo {
display: block;
font-size: 36px;
font-size: 28px;
font-weight: 700;
letter-spacing: 0.12em;
letter-spacing: 0.04em;
line-height: 1;
color: #86909c;
animation: app-boot-bounce 1.4s ease-in-out infinite;
@ -401,7 +401,7 @@
fetchpriority="high"
hidden
/>
<span class="boot-text-logo" aria-hidden="true">LOGO</span>
<span class="boot-text-logo" aria-hidden="true">BCDship</span>
</div>
</div>
<div class="boot-status">

View File

@ -27,7 +27,7 @@
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
import type { RouteLocationNormalizedLoaded } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
@ -40,6 +40,7 @@
PORTAL_IRIS_SETTLED_CLASS,
shouldPortalIris,
} from '@/utils/page-transition-flag';
import { ensureBrandAssetsOnVisible } from '@/utils/brandLogo';
import GlobalSetting from '@/components/global-setting/index.vue';
import AppMascotState from '@/components/AppMascotState/index.vue';
@ -292,6 +293,18 @@
return enUS;
}
});
function onDocumentVisibilityChange() {
ensureBrandAssetsOnVisible();
}
onMounted(() => {
document.addEventListener('visibilitychange', onDocumentVisibilityChange);
});
onBeforeUnmount(() => {
document.removeEventListener('visibilitychange', onDocumentVisibilityChange);
});
</script>
<style>

View File

@ -0,0 +1,206 @@
import { axiosInstance } from '@/api/rbac'
import { assertBusinessOk, omsUrl, unwrapData } from '@/api/oms/common'
export type AlipayPayScene = 'precreate' | 'wap'
export interface CreateAlipayPayResult {
outTradeNo: string
rechargeRecordId: number
channel: string
status: string
codeUrl?: string
payUrl?: string
payFormHtml?: string
expireTime?: string
}
export interface AlipayPayStatusResult {
outTradeNo: string
status: string
statusCode: number
amount: number
transactionId?: string
paidTime?: string
rechargeRecordId: number
codeUrl?: string
}
function mapCreate(raw: any): CreateAlipayPayResult {
return {
outTradeNo: String(raw?.outTradeNo ?? raw?.OutTradeNo ?? ''),
rechargeRecordId: Number(raw?.rechargeRecordId ?? raw?.RechargeRecordId ?? 0),
channel: String(raw?.channel ?? raw?.Channel ?? ''),
status: String(raw?.status ?? raw?.Status ?? ''),
codeUrl: (raw?.codeUrl ?? raw?.CodeUrl) || undefined,
payUrl: (raw?.payUrl ?? raw?.PayUrl) || undefined,
payFormHtml: (raw?.payFormHtml ?? raw?.PayFormHtml) || undefined,
expireTime: (raw?.expireTime ?? raw?.ExpireTime) || undefined,
}
}
function mapStatus(raw: any): AlipayPayStatusResult {
return {
outTradeNo: String(raw?.outTradeNo ?? raw?.OutTradeNo ?? ''),
status: String(raw?.status ?? raw?.Status ?? ''),
statusCode: Number(raw?.statusCode ?? raw?.StatusCode ?? 0),
amount: Number(raw?.amount ?? raw?.Amount ?? 0),
transactionId: (raw?.transactionId ?? raw?.TransactionId) || undefined,
paidTime: (raw?.paidTime ?? raw?.PaidTime) || undefined,
rechargeRecordId: Number(raw?.rechargeRecordId ?? raw?.RechargeRecordId ?? 0),
codeUrl: (raw?.codeUrl ?? raw?.CodeUrl) || undefined,
}
}
/** POST /recharge/pay/alipay/create */
export async function createAlipayPay(params: {
rechargeAmount: number
scene: AlipayPayScene
customerId?: number
returnUrl?: string
}) {
const res = await axiosInstance.post(omsUrl('/recharge/pay/alipay/create'), {
rechargeAmount: params.rechargeAmount,
scene: params.scene,
customerId: params.customerId,
returnUrl: params.returnUrl,
})
return mapCreate(unwrapData(res.data) ?? res.data)
}
/** GET /recharge/pay/alipay/status */
export async function getAlipayPayStatus(outTradeNo: string) {
const res = await axiosInstance.get(omsUrl('/recharge/pay/alipay/status'), {
params: { outTradeNo },
})
return mapStatus(unwrapData(res.data) ?? res.data)
}
/** POST /recharge/pay/alipay/close */
export async function closeAlipayPay(outTradeNo: string) {
const res = await axiosInstance.post(omsUrl('/recharge/pay/alipay/close'), { outTradeNo })
assertBusinessOk(res.data)
}
export interface CreateOrderAlipayPayLine {
orderId: number
serviceNo?: string
payableAmount: number
balanceAmount: number
alipayAmount: number
couponInstanceId?: number
}
export interface CreateOrderAlipayPayResult {
payableTotal: number
balanceAmount: number
alipayAmount: number
customerBalance: number
paidImmediately: boolean
outTradeNo?: string
channel?: string
status?: string
codeUrl?: string
payUrl?: string
payFormHtml?: string
expireTime?: string
lines: CreateOrderAlipayPayLine[]
}
/** POST /order/pay/alipay/create — 余额优先,差额支付宝 */
export async function createOrderAlipayPay(params: {
orderIds: number[]
couponByOrderId?: Record<number, number | null>
scene: AlipayPayScene
returnUrl?: string
}) {
const res = await axiosInstance.post(omsUrl('/order/pay/alipay/create'), {
orderIds: params.orderIds,
couponByOrderId: params.couponByOrderId,
scene: params.scene,
returnUrl: params.returnUrl,
})
const raw = unwrapData(res.data) ?? res.data
const linesRaw = raw?.lines ?? raw?.Lines ?? []
return {
payableTotal: Number(raw?.payableTotal ?? raw?.PayableTotal ?? 0),
balanceAmount: Number(raw?.balanceAmount ?? raw?.BalanceAmount ?? 0),
alipayAmount: Number(raw?.alipayAmount ?? raw?.AlipayAmount ?? 0),
customerBalance: Number(raw?.customerBalance ?? raw?.CustomerBalance ?? 0),
paidImmediately: Boolean(raw?.paidImmediately ?? raw?.PaidImmediately),
outTradeNo: (raw?.outTradeNo ?? raw?.OutTradeNo) || undefined,
channel: (raw?.channel ?? raw?.Channel) || undefined,
status: (raw?.status ?? raw?.Status) || undefined,
codeUrl: (raw?.codeUrl ?? raw?.CodeUrl) || undefined,
payUrl: (raw?.payUrl ?? raw?.PayUrl) || undefined,
payFormHtml: (raw?.payFormHtml ?? raw?.PayFormHtml) || undefined,
expireTime: (raw?.expireTime ?? raw?.ExpireTime) || undefined,
lines: (Array.isArray(linesRaw) ? linesRaw : []).map((row: any) => ({
orderId: Number(row?.orderId ?? row?.OrderId ?? 0),
serviceNo: (row?.serviceNo ?? row?.ServiceNo) || undefined,
payableAmount: Number(row?.payableAmount ?? row?.PayableAmount ?? 0),
balanceAmount: Number(row?.balanceAmount ?? row?.BalanceAmount ?? 0),
alipayAmount: Number(row?.alipayAmount ?? row?.AlipayAmount ?? 0),
couponInstanceId: row?.couponInstanceId ?? row?.CouponInstanceId ?? undefined,
})),
} as CreateOrderAlipayPayResult
}
export interface AlipayPayMerchantConfig {
configured: boolean
enabled: boolean
appId: string
notifyUrl: string
returnUrl: string
hasPrivateKey: boolean
hasAlipayPublicKey: boolean
}
export async function getAlipayPayMerchantConfig(): Promise<AlipayPayMerchantConfig> {
const res = await axiosInstance.get(omsUrl('/system/other-config/alipay-pay-merchant'))
const data = unwrapData(res.data) as any
return {
configured: Boolean(data?.configured ?? data?.Configured),
enabled: Boolean(data?.enabled ?? data?.Enabled),
appId: String(data?.appId ?? data?.AppId ?? ''),
notifyUrl: String(data?.notifyUrl ?? data?.NotifyUrl ?? ''),
returnUrl: String(data?.returnUrl ?? data?.ReturnUrl ?? ''),
hasPrivateKey: Boolean(data?.hasPrivateKey ?? data?.HasPrivateKey),
hasAlipayPublicKey: Boolean(data?.hasAlipayPublicKey ?? data?.HasAlipayPublicKey),
}
}
export async function saveAlipayPayMerchantConfig(payload: {
enabled: boolean
appId: string
notifyUrl?: string
returnUrl?: string
privateKeyPem?: string
alipayPublicKey?: string
}) {
const res = await axiosInstance.post(
omsUrl('/system/other-config/alipay-pay-merchant/save'),
payload,
)
assertBusinessOk(res.data)
return getAlipayPayMerchantConfig()
}
/** 跳转支付宝收银台(优先 payUrl,否则渲染 payFormHtml) */
export function redirectAlipayPay(payload: { payUrl?: string; payFormHtml?: string }) {
if (payload.payUrl) {
window.location.href = payload.payUrl
return
}
if (payload.payFormHtml) {
const wrap = document.createElement('div')
wrap.style.display = 'none'
wrap.innerHTML = payload.payFormHtml
document.body.appendChild(wrap)
const form = wrap.querySelector('form')
if (form) {
form.submit()
return
}
}
throw new Error('no_alipay_redirect')
}

View File

@ -133,7 +133,7 @@ export async function uploadBrandLogo(channel: BrandLogoChannel, file: File) {
return unwrapData<BrandLogoDto>(res.data)
}
/** 清除指定渠道品牌 Logo(前端回退文字 LOGO) */
/** 清除指定渠道品牌 Logo(前端回退文字 BCDship) */
export async function clearBrandLogo(channel: BrandLogoChannel) {
const res = await axiosInstance.post(
omsUrl(`/system/other-config/brand-logo/clear?channel=${encodeURIComponent(channel)}`),

View File

@ -452,16 +452,13 @@
:class="`post-method--${String(getNodeData(key)?.method || methodLabel || 'POST').toLowerCase()}`"
>{{ getNodeData(key)?.method || methodLabel }}</span>
<span class="node-title" :title="title">{{ title }}</span>
<span v-if="getNodeData(key)?.isLeaf && showMapCount" class="map-count">
{{ getNodeData(key)?.mapCount ?? 0 }}
</span>
</div>
</td>
<td
v-if="getNodeData(key)?.isLeaf && showNodeActions"
v-if="getNodeData(key)?.isLeaf && (showNodeActions || showMapCount)"
class="node-actions-cell"
>
<!-- 有扩展槽(开关等):放到上行;三点菜单改到下行 -->
<!-- map-count 与下行三点同列竖向对齐;扩展槽(开关等)仍可占上行 -->
<span
v-if="$slots['node-second-row-extra']"
class="node-second-row-extra-slot node-second-row-extra-slot--top"
@ -469,39 +466,12 @@
>
<slot name="node-second-row-extra" :node-data="getNodeData(key)" :node-key="key"></slot>
</span>
<a-dropdown
v-else
trigger="click"
:popup-max-height="false"
@select="handleActionSelect"
<span
v-else-if="showMapCount"
class="map-count"
>
<a-button
type="text"
size="small"
shape="circle"
class="action-btn vertical-dots"
:title="actionsTitle"
@click.stop
>
<div class="vertical-dots-icon">
<span></span>
<span></span>
<span></span>
</div>
</a-button>
<template #content>
<slot name="node-menu" :node-data="getNodeData(key)" :node-key="key">
<a-doption
value="delete"
:data="getNodeData(key)"
@click="handleDeleteNode(getNodeData(key))"
>
<icon-delete />
{{ deleteLabel }}
</a-doption>
</slot>
</template>
</a-dropdown>
{{ getNodeData(key)?.mapCount ?? 0 }}
</span>
</td>
<td
v-else-if="showBranchNodeActions && getNodeData(key)?.isLeaf !== true"
@ -564,14 +534,9 @@
</slot>
</td>
</template>
<template
v-else-if="
getNodeData(key)?.isLeaf &&
((showNodeCode && getNodeData(key)?.code) || !!$slots['node-second-row-extra'])
"
>
<!-- 开关在上行时:下行左侧时间/编码,右侧三点 -->
<template v-if="showNodeActions && $slots['node-second-row-extra']">
<template v-else-if="getNodeData(key)?.isLeaf">
<!-- 下行:左编码/时间;右三点(对齐 map-count 下方) -->
<template v-if="showNodeActions">
<td class="node-code-cell">
<span v-if="showNodeCode && getNodeData(key)?.code" class="interface-code">
{{ getNodeData(key)?.code }}
@ -612,28 +577,14 @@
</a-dropdown>
</td>
</template>
<!-- 无操作菜单:扩展槽仍在下行(兼容旧用法) -->
<template v-else-if="$slots['node-second-row-extra']">
<td
v-if="showNodeCode && getNodeData(key)?.code"
class="node-code-cell"
>
<span class="interface-code">{{ getNodeData(key)?.code }}</span>
</td>
<td
class="node-actions-cell node-second-row-extra-cell"
:colspan="showNodeCode && getNodeData(key)?.code ? 1 : 2"
>
<span class="node-second-row-extra-slot">
<slot name="node-second-row-extra" :node-data="getNodeData(key)" :node-key="key"></slot>
</span>
</td>
</template>
<template v-else>
<template v-else-if="showNodeCode && getNodeData(key)?.code">
<td colspan="2" class="node-code-cell">
<span class="interface-code">{{ getNodeData(key)?.code }}</span>
</td>
</template>
<template v-else>
<td colspan="2" class="node-second-row-spacer-cell" aria-hidden="true" />
</template>
</template>
<template v-else>
<td colspan="2" class="node-second-row-spacer-cell" aria-hidden="true" />
@ -1303,13 +1254,13 @@
min-height: var(--clm-node-height);
}
/* 分组头:轻量、矮一些,和可点击实体卡片拉开层级 */
/* 分组头:更紧凑,少占竖向空位 */
&.tree-node--branch {
height: auto;
min-height: 34px;
min-height: 24px;
max-height: none;
margin: calc(var(--clm-node-gap) + 4px) 0 calc(var(--clm-node-gap) / 2);
padding: 6px 8px;
margin: 4px 0 2px;
padding: 2px 8px;
border-color: transparent;
background: transparent;
cursor: default;
@ -1320,17 +1271,18 @@
font-weight: 600;
color: var(--clm-muted);
letter-spacing: 0.02em;
line-height: 18px;
}
.node-title::before {
content: '';
display: inline-block;
width: 3px;
height: 12px;
height: 10px;
margin-right: 8px;
border-radius: 2px;
background: color-mix(in srgb, var(--app-primary-color) 55%, var(--clm-faint));
vertical-align: -2px;
vertical-align: -1px;
}
.node-subtitle {
@ -1372,11 +1324,14 @@
}
}
/* 实体叶子:固定高度,内容块垂直居中避免贴底 */
/* 实体叶子:略增高;上边留白,主行不要贴顶 */
&.tree-node--leaf {
--clm-node-height: 64px;
background: var(--color-fill-1);
border-color: rgba(15, 16, 17, 0.07);
align-items: center;
align-items: flex-start;
padding-top: 10px;
padding-bottom: 6px;
}
&:hover {
@ -1443,7 +1398,7 @@
}
.node-second-row > td {
padding-top: 6px;
padding-top: 4px;
padding-bottom: 0;
vertical-align: middle;
height: 24px;
@ -1476,21 +1431,24 @@
}
.node-actions-cell {
text-align: right;
text-align: center;
padding: 0;
width: 28px;
vertical-align: middle;
}
.branch-node-actions-cell {
width: auto;
min-width: 52px;
width: 28px;
min-width: 28px;
max-width: 28px;
text-align: right;
white-space: nowrap;
.branch-node-actions-row {
display: inline-flex;
align-items: center;
justify-content: flex-end;
width: 100%;
gap: 2px;
}
@ -1498,6 +1456,12 @@
display: inline-flex;
align-items: center;
}
&:has(.branch-node-inline-before) {
width: auto;
min-width: 52px;
max-width: none;
}
}
.branch-node-extra-cell {
@ -1526,7 +1490,7 @@
}
.node-second-row-extra-cell {
text-align: right;
text-align: center;
min-width: 28px;
width: 28px;
}
@ -1560,11 +1524,15 @@
}
.map-count {
display: inline-flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 10px;
font-weight: 500;
color: var(--clm-muted);
min-width: 16px;
min-width: 24px;
height: 16px;
padding: 0 5px;
border-radius: 999px;

View File

@ -926,46 +926,38 @@
}
function applyLiquidFieldStyle(el: HTMLElement, focused = false) {
// 与工作台卡片同款磨砂玻璃 token(内联 !important 压过 UA / HOT 默认边框)
// 软胶囊:白底细边(内联 !important 压过 UA / HOT 默认边框)
el.style.setProperty('width', '100%', 'important');
el.style.setProperty('min-width', '0', 'important');
el.style.setProperty('max-width', '100%', 'important');
el.style.setProperty('height', '26px', 'important');
el.style.setProperty('padding', '0 10px', 'important');
el.style.setProperty('height', '28px', 'important');
el.style.setProperty('padding', '0 12px', 'important');
el.style.setProperty('margin', '0', 'important');
el.style.setProperty('border-width', '1px', 'important');
el.style.setProperty('border-style', 'solid', 'important');
el.style.setProperty(
'border-color',
focused
? 'color-mix(in srgb, var(--app-primary-color) 22%, var(--app-acrylic-border-strong, rgba(255,255,255,0.92)))'
: 'var(--app-acrylic-border, rgba(255, 255, 255, 0.72))',
? 'color-mix(in srgb, var(--app-primary-color) 32%, rgba(26, 46, 56, 0.1))'
: 'rgba(26, 46, 56, 0.07)',
'important'
);
el.style.setProperty('border-radius', '12px', 'important');
el.style.setProperty('border-radius', '999px', 'important');
el.style.setProperty('outline', 'none', 'important');
el.style.setProperty('box-sizing', 'border-box', 'important');
el.style.setProperty(
'background',
focused
? 'var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44))'
: 'var(--app-acrylic-bg, rgba(255, 255, 255, 0.32))',
'important'
);
el.style.setProperty(
'backdrop-filter',
'var(--app-acrylic-blur, blur(28px) saturate(160%))',
'important'
);
el.style.setProperty(
'-webkit-backdrop-filter',
'var(--app-acrylic-blur, blur(28px) saturate(160%))',
? 'color-mix(in srgb, #fff 55%, var(--color-fill-2, #f2f3f5))'
: 'color-mix(in srgb, #fff 28%, var(--color-fill-2, #f2f3f5))',
'important'
);
el.style.setProperty('backdrop-filter', 'none', 'important');
el.style.setProperty('-webkit-backdrop-filter', 'none', 'important');
el.style.setProperty(
'box-shadow',
focused
? '0 0 0 2px color-mix(in srgb, var(--app-primary-color) 16%, transparent)'
? '0 0 0 3px color-mix(in srgb, var(--app-primary-color) 12%, transparent)'
: 'none',
'important'
);
@ -975,13 +967,14 @@
'important'
);
el.style.setProperty('font-size', '12px', 'important');
el.style.setProperty('font-weight', '500', 'important');
el.style.setProperty('line-height', '24px', 'important');
el.style.setProperty('font-weight', '450', 'important');
el.style.setProperty('letter-spacing', '-0.01em', 'important');
el.style.setProperty('line-height', '26px', 'important');
el.style.setProperty('font-family', 'inherit', 'important');
el.style.setProperty('caret-color', 'var(--app-primary-color, #054f74)', 'important');
el.style.setProperty('caret-color', 'var(--app-primary-color, #1d7281)', 'important');
el.style.setProperty('-webkit-appearance', 'none', 'important');
el.style.setProperty('appearance', 'none', 'important');
el.style.setProperty('transition', 'border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease', 'important');
el.style.setProperty('transition', 'border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease', 'important');
if (el.tagName === 'BUTTON') {
el.style.setProperty('cursor', 'pointer', 'important');
el.style.setProperty('text-align', 'left', 'important');
@ -3460,7 +3453,7 @@
display: flex;
align-items: center;
gap: 0;
min-height: 28px;
min-height: 30px;
width: 100%;
max-width: 100%;
min-width: 0;
@ -3486,38 +3479,37 @@
width: 100% !important;
min-width: 0 !important;
max-width: 100%;
height: 26px !important;
padding: 0 10px !important;
/* 工作台卡片同款:磨砂玻璃 + 亮边 */
border-radius: 12px !important;
border-width: 1px !important;
border-style: solid !important;
border-color: var(--app-acrylic-border, rgba(255, 255, 255, 0.72)) !important;
background: var(--app-acrylic-bg, rgba(255, 255, 255, 0.32)) !important;
backdrop-filter: var(--app-acrylic-blur, blur(28px) saturate(160%));
-webkit-backdrop-filter: var(--app-acrylic-blur, blur(28px) saturate(160%));
height: 28px !important;
padding: 0 12px !important;
/* 软胶囊:白底细边,比表头毛玻璃更干净 */
border-radius: 999px !important;
border: 1px solid rgba(26, 46, 56, 0.07) !important;
background: color-mix(in srgb, #fff 28%, var(--color-fill-2, #f2f3f5)) !important;
backdrop-filter: none;
-webkit-backdrop-filter: none;
box-shadow: none !important;
font-size: 12px !important;
font-weight: 500 !important;
line-height: 24px !important;
font-weight: 450 !important;
letter-spacing: -0.01em;
line-height: 26px !important;
color: var(--color-text-2) !important;
outline: none !important;
box-sizing: border-box !important;
text-align: left;
caret-color: var(--app-primary-color, #054f74);
caret-color: var(--app-primary-color, #1d7281);
-webkit-appearance: none !important;
appearance: none !important;
transition:
border-color 0.2s ease,
background 0.2s ease,
color 0.2s ease,
box-shadow 0.2s ease;
border-color 0.15s ease,
background 0.15s ease,
color 0.15s ease,
box-shadow 0.15s ease;
}
:deep(.ht-header-hybrid-input) {
&:hover {
border-color: var(--app-acrylic-border-strong, rgba(255, 255, 255, 0.92)) !important;
background: var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44)) !important;
border-color: rgba(26, 46, 56, 0.12) !important;
background: color-mix(in srgb, #fff 42%, var(--color-fill-2, #f2f3f5)) !important;
box-shadow: none !important;
}
@ -3526,16 +3518,16 @@
color: var(--color-text-1) !important;
border-color: color-mix(
in srgb,
var(--app-primary-color) 22%,
var(--app-acrylic-border-strong, rgba(255, 255, 255, 0.92))
var(--app-primary-color) 32%,
rgba(26, 46, 56, 0.1)
) !important;
background: var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44)) !important;
box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary-color) 16%, transparent) !important;
background: color-mix(in srgb, #fff 55%, var(--color-fill-2, #f2f3f5)) !important;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary-color) 12%, transparent) !important;
}
&::placeholder {
color: var(--color-text-3) !important;
font-weight: 500;
color: rgba(26, 46, 56, 0.38) !important;
font-weight: 450;
opacity: 1;
}
}
@ -3545,7 +3537,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--color-text-3) !important;
color: rgba(26, 46, 56, 0.42) !important;
&.has-value {
color: var(--color-text-2) !important;
@ -3553,8 +3545,9 @@
&:hover {
color: var(--color-text-2) !important;
border-color: var(--app-acrylic-border-strong, rgba(255, 255, 255, 0.92)) !important;
background: var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44)) !important;
border-color: rgba(26, 46, 56, 0.12) !important;
background: color-mix(in srgb, #fff 42%, var(--color-fill-2, #f2f3f5)) !important;
box-shadow: none !important;
}
}

View File

@ -166,11 +166,11 @@
let requestSortable: any = null;
let mappingBodySortable: any = null;
/** Body / Mapping Body 参数树共用列(排序、参数名、必填、类型、描述、操作) */
/** Body / Mapping Body 参数树共用列(No、参数名、必填、类型、描述、操作) */
const bodyParamTreeColumns = [
{
field: 'asdsad',
title: '排序',
title: 'No',
className: 'sort',
width: 50,
slots: { default: 'asdsad' },
@ -1484,7 +1484,7 @@
columns: [
{
field: 'asdsad',
title: '排序',
title: 'No',
className: 'sort',
width: 50,
slots: {
@ -5378,21 +5378,30 @@
flex-shrink: 0;
}
.detail-settings-btn {
padding: 0 8px !important;
color: var(--color-text-2);
:deep(.arco-icon) {
font-size: 16px;
}
}
.detail-settings-btn,
.section-icon-btn {
padding: 0 8px !important;
min-width: 32px;
display: inline-flex !important;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 30px !important;
min-width: 30px !important;
height: 30px !important;
min-height: 30px !important;
padding: 0 !important;
border-radius: 50% !important;
color: var(--color-text-2);
background: rgba(26, 46, 56, 0.05) !important;
border-color: transparent !important;
box-shadow: none !important;
&:hover {
color: var(--color-text-1);
background: rgba(26, 46, 56, 0.09) !important;
}
:deep(.arco-icon) {
font-size: 16px;
font-size: 15px;
}
}
@ -5526,10 +5535,6 @@
.content-type-copy-btn {
margin-left: auto;
flex-shrink: 0;
width: 24px;
height: 24px;
padding: 0;
border-radius: 4px;
}
}

View File

@ -117,7 +117,7 @@ import {
CUSTOMER_SIDE_RAIL_COLLAPSED_WIDTH,
CUSTOMER_SIDE_RAIL_EXPANDED_WIDTH,
} from '@/utils/customer-portal-nav'
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo'
import { BRAND_TEXT_LOGO, brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo'
import { brandCopy } from '@/utils/brandCopy'
const AGENT_SIDE_RAIL_COLLAPSED_WIDTH = CUSTOMER_SIDE_RAIL_COLLAPSED_WIDTH
@ -135,6 +135,7 @@ const { t } = useI18n()
const route = useRoute()
const router = useRouter()
const navLogoSrc = computed(() => brandLogoImages.portal)
ensureBrandAssetsFresh()
const collapsed = ref(readCollapsed())
const compactLayout = ref(collapsed.value)

View File

@ -153,7 +153,7 @@ import { useRbacUserStore } from '@/store/modules/rbac-user'
import { getSubMenuIcon } from '@/utils/menu-icon'
import { MENU_NAME_TO_LOCALE_KEY, translateMenuTitle } from '@/utils/menu-i18n'
import { openWindow, regexUrl } from '@/utils'
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo'
import { BRAND_TEXT_LOGO, brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo'
import { brandCopy } from '@/utils/brandCopy'
import {
buildCustomerFlatNavMenus,
@ -188,6 +188,7 @@ const tabBarStore = useTabBarStore()
const RAIL_ANIM_MS = 300
const navLogoSrc = computed(() => brandLogoImages.portal)
ensureBrandAssetsFresh()
const collapsed = ref(readCustomerSideRailCollapsed(false))
/** 布局紧凑态:动画结束后再切,避免收起中途图标跳动 */

View File

@ -309,7 +309,7 @@ import { Message } from '@arco-design/web-vue';
import { openWindow, regexUrl } from '@/utils';
import { MenuService, AuthService } from '@/api/rbac';
import type { MenuTreeDto } from '@/api/rbac';
import { brandLogoImages } from '@/utils/brandLogo';
import { brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo';
import { brandCopy } from '@/utils/brandCopy';
import {
initHiprintClientState,
@ -342,6 +342,7 @@ const tabBarStore = useTabBarStore();
const rbacUserStore = useRbacUserStore();
const navLogoSrc = computed(() => brandLogoImages.portal);
ensureBrandAssetsFresh();
const topMenuCon = ref<HTMLElement | null>(null);
const topNavEnable = computed(() => true); // 启用顶部导航

View File

@ -58,7 +58,7 @@ export function useSystemConfig() {
};
/**
* 获取系统Logo(空字符串表示未配置,由品牌图 / 文字 LOGO 承接)
* 获取系统Logo(空字符串表示未配置,由品牌图 / 文字 BCDship 承接)
*/
const getSysLogo = () => {
return logoUrl.value || sysInfo.value.SYS_LOGO || '';

View File

@ -2153,7 +2153,14 @@ export default {
'order.myOrders.modal.payMethodHybrid': 'Payment method: balance + WeChat shortfall',
'order.myOrders.modal.paySplitBalance': 'Balance {amount}',
'order.myOrders.modal.paySplitWechat': 'WeChat {amount}',
'order.myOrders.modal.payHybridHint': 'Shortfall will be paid via WeChat QR: {amount}',
'order.myOrders.modal.paySplitAlipay': 'Alipay {amount}',
'order.myOrders.modal.payOnlineChannel': 'Top-up method',
'order.myOrders.modal.payChannelWechat': 'WeChat',
'order.myOrders.modal.payChannelAlipay': 'Alipay',
'order.myOrders.modal.payAlipayTitle': 'Alipay QR top-up',
'order.myOrders.modal.payAlipayTip': 'Scan with Alipay to finish payment',
'order.myOrders.modal.payAlipayCreateFailed': 'Failed to create Alipay top-up',
'order.myOrders.modal.payHybridHint': 'Shortfall will be paid via online QR: {amount}',
'order.myOrders.modal.payMultiCustomerWxHint': 'Multi-customer batch supports balance only. Split by customer to use WeChat.',
'order.myOrders.modal.payWxTitle': 'WeChat QR shortfall',
'order.myOrders.modal.payWxTip': 'Scan with WeChat to finish payment. This dialog closes on success.',
@ -4344,7 +4351,7 @@ export default {
'system.otherConfig.brandLogo.dropReplace': 'Click or drag to replace',
'system.otherConfig.brandLogo.invalidFile': 'Please upload an image (PNG / JPG / WEBP, etc.)',
'system.otherConfig.brandLogo.clear': 'Clear',
'system.otherConfig.brandLogo.clearSuccess': 'Cleared; text LOGO will show',
'system.otherConfig.brandLogo.clearSuccess': 'Cleared; text BCDship will show',
'system.otherConfig.brandLogo.clearFailed': 'Failed to clear',
'system.otherConfig.brandLogo.uploading': 'Uploading…',
'system.otherConfig.brandLogo.uploadSuccess': 'Brand logo updated',
@ -4413,6 +4420,52 @@ export default {
'system.otherConfig.paymentQr.tab.qr': 'QR codes',
'system.otherConfig.paymentQr.tab.bank': 'Bank accounts',
'system.otherConfig.paymentQr.tab.wechatPay': 'WeChat Pay merchant',
'system.otherConfig.paymentQr.tab.alipayPay': 'Alipay online pay',
'system.otherConfig.paymentQr.alipayPay.panelTitle': 'Alipay merchant (key mode)',
'system.otherConfig.paymentQr.alipayPay.enabled': 'Enable online pay',
'system.otherConfig.paymentQr.alipayPay.enabledOn': 'Precreate / WAP available',
'system.otherConfig.paymentQr.alipayPay.enabledOff': 'Online pay disabled when off',
'system.otherConfig.paymentQr.alipayPay.statusReady': 'Ready',
'system.otherConfig.paymentQr.alipayPay.statusPending': 'Incomplete',
'system.otherConfig.paymentQr.alipayPay.checkAppId': 'AppId',
'system.otherConfig.paymentQr.alipayPay.checkNotify': 'Notify URL',
'system.otherConfig.paymentQr.alipayPay.checkSecret': 'Keys',
'system.otherConfig.paymentQr.alipayPay.sectionBasic': 'App basics',
'system.otherConfig.paymentQr.alipayPay.sectionBasicHint': 'AppId, notify URL, H5 return URL',
'system.otherConfig.paymentQr.alipayPay.sectionSecret': 'Keys',
'system.otherConfig.paymentQr.alipayPay.sectionSecretHint': 'Server-side only; never echoed',
'system.otherConfig.paymentQr.alipayPay.appId': 'App Id',
'system.otherConfig.paymentQr.alipayPay.appIdPlaceholder': 'Open platform AppId',
'system.otherConfig.paymentQr.alipayPay.notifyUrl': 'Notify URL',
'system.otherConfig.paymentQr.alipayPay.fillNotify': 'Use suggested URL',
'system.otherConfig.paymentQr.alipayPay.returnUrl': 'H5 return URL base',
'system.otherConfig.paymentQr.alipayPay.returnUrlPlaceholder': 'e.g. https://your-host/h5/recharge',
'system.otherConfig.paymentQr.alipayPay.privateKeyPem': 'App private key',
'system.otherConfig.paymentQr.alipayPay.privateKeyPlaceholder': 'Leave blank to keep',
'system.otherConfig.paymentQr.alipayPay.privateKeyRequired': 'Required on first save',
'system.otherConfig.paymentQr.alipayPay.alipayPublicKey': 'Alipay public key',
'system.otherConfig.paymentQr.alipayPay.publicKeyPlaceholder': 'Leave blank to keep',
'system.otherConfig.paymentQr.alipayPay.publicKeyRequired': 'Required on first save',
'system.otherConfig.paymentQr.alipayPay.importPem': 'Import key file',
'system.otherConfig.paymentQr.alipayPay.clearPem': 'Clear draft',
'system.otherConfig.paymentQr.alipayPay.pemImported': 'Private key imported',
'system.otherConfig.paymentQr.alipayPay.pemReadFailed': 'Failed to read file',
'system.otherConfig.paymentQr.alipayPay.hasKey': 'Configured',
'system.otherConfig.paymentQr.alipayPay.missingKey': 'Missing',
'system.otherConfig.paymentQr.alipayPay.dirtyHint': 'Unsaved changes',
'system.otherConfig.paymentQr.alipayPay.cleanHint': 'Synced with server',
'system.otherConfig.paymentQr.alipayPay.reset': 'Reset',
'system.otherConfig.paymentQr.alipayPay.save': 'Save',
'system.otherConfig.paymentQr.alipayPay.needAppId': 'AppId is required',
'system.otherConfig.paymentQr.alipayPay.needNotify': 'Notify URL is required',
'system.otherConfig.paymentQr.alipayPay.needHttps': 'NotifyUrl must start with https://',
'system.otherConfig.paymentQr.alipayPay.needPrivateKey': 'Private key required on first save',
'system.otherConfig.paymentQr.alipayPay.needPublicKey': 'Alipay public key required on first save',
'system.otherConfig.paymentQr.alipayPay.loadFailed': 'Failed to load Alipay merchant config',
'system.otherConfig.paymentQr.alipayPay.saveSuccess': 'Alipay merchant config saved',
'system.otherConfig.paymentQr.alipayPay.saveFailed': 'Save failed',
'system.otherConfig.paymentQr.alipayPay.tip':
'Key mode RSA2. Enable face-to-face precreate and mobile website pay. NotifyUrl must be public HTTPS.',
'system.otherConfig.paymentQr.alipay': 'Alipay',
'system.otherConfig.paymentQr.wechat': 'WeChat',
'system.otherConfig.paymentQr.replace': 'Replace',
@ -5261,6 +5314,23 @@ export default {
'user.recharge.deposit.payment.wechatDesc': 'Recommended for fast arrival',
'user.recharge.deposit.payment.wechatOnline': 'WeChat Online Pay',
'user.recharge.deposit.payment.wechatOnlineDesc': 'Dynamic QR · instant credit',
'user.recharge.deposit.payment.alipayOnline': 'Alipay online pay',
'user.recharge.deposit.payment.alipayOnlineDesc': 'Dynamic QR · instant credit',
'user.recharge.deposit.guide.alipayOnlineTitle': 'Next: create Alipay QR',
'user.recharge.deposit.guide.alipayOnlineBody':
'Tap “Create payment QR”, scan with Alipay, and balance credits automatically.',
'user.recharge.deposit.form.zfbOnlineHint': 'No screenshot needed—auto credit after payment',
'user.recharge.deposit.form.zfbOnlinePanelTitle': 'Alipay online pay steps',
'user.recharge.deposit.form.zfbOnlineStep1': 'Tap “Create payment QR”',
'user.recharge.deposit.form.zfbOnlineStep2': 'Scan with Alipay and pay',
'user.recharge.deposit.form.zfbOnlineStep3': 'This page confirms and credits automatically',
'user.recharge.deposit.form.zfbOnlineScan': 'Scan with Alipay to pay',
'user.recharge.deposit.form.zfbOnlineWaiting': 'Balance credits automatically after payment. Keep this page open.',
'user.recharge.deposit.form.zfbOnlineOrderNo': 'Merchant order: {no}',
'user.recharge.deposit.message.zfbOnlinePaid': 'Alipay payment succeeded. Balance updated.',
'user.recharge.deposit.message.zfbOnlineClosed': 'Payment closed or failed. Please try again.',
'user.recharge.deposit.message.zfbOnlineNoCode': 'No payment QR returned',
'user.recharge.deposit.message.zfbOnlineCreateFailed': 'Failed to create Alipay payment',
'user.recharge.deposit.payment.wechatVoucher': 'WeChat Transfer Voucher',
'user.recharge.deposit.payment.wechatVoucherDesc': 'Scan static QR, then upload screenshot',
'user.recharge.deposit.payment.bank': 'Bank Transfer',

View File

@ -1921,7 +1921,14 @@ export default {
'order.myOrders.modal.payMethodHybrid': '支付方式:余额 + 微信补差',
'order.myOrders.modal.paySplitBalance': '余额 {amount}',
'order.myOrders.modal.paySplitWechat': '微信 {amount}',
'order.myOrders.modal.payHybridHint': '余额不足部分将通过微信扫码补差 {amount}',
'order.myOrders.modal.paySplitAlipay': '支付宝 {amount}',
'order.myOrders.modal.payHybridHint': '余额不足部分将通过在线扫码补差 {amount}',
'order.myOrders.modal.payOnlineChannel': '补差方式',
'order.myOrders.modal.payChannelWechat': '微信',
'order.myOrders.modal.payChannelAlipay': '支付宝',
'order.myOrders.modal.payAlipayTitle': '支付宝扫码补差',
'order.myOrders.modal.payAlipayTip': '请使用支付宝扫一扫完成支付',
'order.myOrders.modal.payAlipayCreateFailed': '创建支付宝补差失败',
'order.myOrders.modal.payMultiCustomerWxHint': '跨客户批量仅支持账户余额,请按客户拆分后再用微信补差。',
'order.myOrders.modal.payWxTitle': '微信扫码补差',
'order.myOrders.modal.payWxTip': '请使用微信扫一扫完成支付,成功后自动关闭',
@ -4356,7 +4363,7 @@ export default {
'system.otherConfig.brandLogo.dropReplace': '点击或拖拽更换',
'system.otherConfig.brandLogo.invalidFile': '请上传图片文件(PNG / JPG / WEBP 等)',
'system.otherConfig.brandLogo.clear': '清除',
'system.otherConfig.brandLogo.clearSuccess': '已清除,将显示文字 LOGO',
'system.otherConfig.brandLogo.clearSuccess': '已清除,将显示文字 BCDship',
'system.otherConfig.brandLogo.clearFailed': '清除失败',
'system.otherConfig.brandLogo.uploading': '上传中…',
'system.otherConfig.brandLogo.uploadSuccess': '品牌 Logo 已更新',
@ -4425,6 +4432,7 @@ export default {
'system.otherConfig.paymentQr.tab.qr': '收款码',
'system.otherConfig.paymentQr.tab.bank': '银行账户',
'system.otherConfig.paymentQr.tab.wechatPay': '微信支付商户',
'system.otherConfig.paymentQr.tab.alipayPay': '支付宝在线支付',
'system.otherConfig.paymentQr.alipay': '支付宝',
'system.otherConfig.paymentQr.wechat': '微信',
'system.otherConfig.paymentQr.replace': '更换图片',
@ -5237,7 +5245,7 @@ export default {
'user.recharge.deposit.tips.item1': '充值与余额 1:1 到账',
'user.recharge.deposit.tips.item2': '上传清晰完整的支付截图',
'user.recharge.deposit.tips.item3': '资金到账后会短信/站内信提醒',
'user.recharge.deposit.tips.online': '微信扫码支付成功后余额自动到账,无需上传截图、无需等待审核',
'user.recharge.deposit.tips.online': '在线扫码支付成功后余额自动到账,无需上传截图、无需等待审核',
'user.recharge.deposit.tips.voucher': '扫码/转账后请上传清晰截图,财务审核通过后到账',
'user.recharge.deposit.tips.bank': '请核对对公账户信息,填写付款户名与流水号并上传转账回单',
'user.recharge.deposit.form.currentAmount': '当前充值金额',
@ -5278,12 +5286,16 @@ export default {
'user.recharge.deposit.payment.wechatDesc': '推荐快速到账',
'user.recharge.deposit.payment.wechatOnline': '微信在线支付',
'user.recharge.deposit.payment.wechatOnlineDesc': '扫动态码 · 秒级到账',
'user.recharge.deposit.payment.alipayOnline': '支付宝在线支付',
'user.recharge.deposit.payment.alipayOnlineDesc': '扫动态码 · 秒级到账',
'user.recharge.deposit.payment.wechatVoucher': '微信转账凭证',
'user.recharge.deposit.payment.wechatVoucherDesc': '扫静态码后上传截图审核',
'user.recharge.deposit.payment.bank': '银行转账',
'user.recharge.deposit.payment.bankDesc': '对公转账 · 填写流水后审核',
'user.recharge.deposit.guide.onlineTitle': '下一步:生成微信支付码',
'user.recharge.deposit.guide.onlineBody': '点击下方「生成支付码」,用微信扫一扫完成支付,成功后余额自动到账。',
'user.recharge.deposit.guide.alipayOnlineTitle': '下一步:生成支付宝支付码',
'user.recharge.deposit.guide.alipayOnlineBody': '点击下方「生成支付码」,用支付宝扫一扫完成支付,成功后余额自动到账。',
'user.recharge.deposit.guide.voucherTitle': '下一步:上传转账截图',
'user.recharge.deposit.guide.alipayBody': '请先扫右侧支付宝收款码完成转账,再上传清晰支付截图提交审核。',
'user.recharge.deposit.guide.wechatVoucherBody': '请先扫右侧微信收款码完成转账,再上传清晰支付截图提交审核。',
@ -5297,6 +5309,14 @@ export default {
'user.recharge.deposit.form.wxOnlineScan': '请使用微信扫码支付',
'user.recharge.deposit.form.wxOnlineWaiting': '支付完成后将自动到账,请勿关闭页面',
'user.recharge.deposit.form.wxOnlineOrderNo': '商户单号:{no}',
'user.recharge.deposit.form.zfbOnlineHint': '无需上传截图,支付成功后自动入账',
'user.recharge.deposit.form.zfbOnlinePanelTitle': '支付宝在线支付流程',
'user.recharge.deposit.form.zfbOnlineStep1': '点击「生成支付码」',
'user.recharge.deposit.form.zfbOnlineStep2': '打开支付宝扫一扫完成支付',
'user.recharge.deposit.form.zfbOnlineStep3': '本页自动确认并到账',
'user.recharge.deposit.form.zfbOnlineScan': '请使用支付宝扫码支付',
'user.recharge.deposit.form.zfbOnlineWaiting': '支付完成后将自动到账,请勿关闭页面',
'user.recharge.deposit.form.zfbOnlineOrderNo': '商户单号:{no}',
'user.recharge.deposit.form.bankPanelTitle': '对公收款账户',
'user.recharge.deposit.form.alipayPanelTitle': '支付宝收款码',
'user.recharge.deposit.form.wechatVoucherPanelTitle': '微信收款码(转账凭证)',
@ -5307,6 +5327,55 @@ export default {
'user.recharge.deposit.message.wxOnlineClosed': '支付已关闭或失败,请重新发起',
'user.recharge.deposit.message.wxOnlineNoCode': '未返回支付二维码',
'user.recharge.deposit.message.wxOnlineCreateFailed': '创建微信支付失败',
'user.recharge.deposit.message.zfbOnlinePaid': '支付宝支付成功,余额已到账',
'user.recharge.deposit.message.zfbOnlineClosed': '支付已关闭或失败,请重新发起',
'user.recharge.deposit.message.zfbOnlineNoCode': '未返回支付二维码',
'user.recharge.deposit.message.zfbOnlineCreateFailed': '创建支付宝支付失败',
'system.otherConfig.paymentQr.alipayPay.panelTitle': '支付宝在线支付商户(密钥模式)',
'system.otherConfig.paymentQr.alipayPay.enabled': '启用在线支付',
'system.otherConfig.paymentQr.alipayPay.enabledOn': '当面付 / 手机网站可用',
'system.otherConfig.paymentQr.alipayPay.enabledOff': '关闭后无法发起在线支付',
'system.otherConfig.paymentQr.alipayPay.statusReady': '配置完整',
'system.otherConfig.paymentQr.alipayPay.statusPending': '待完善',
'system.otherConfig.paymentQr.alipayPay.checkAppId': 'AppId',
'system.otherConfig.paymentQr.alipayPay.checkNotify': '回调地址',
'system.otherConfig.paymentQr.alipayPay.checkSecret': '密钥',
'system.otherConfig.paymentQr.alipayPay.sectionBasic': '应用基础',
'system.otherConfig.paymentQr.alipayPay.sectionBasicHint': 'AppId、异步通知、H5 回跳',
'system.otherConfig.paymentQr.alipayPay.sectionSecret': '密钥',
'system.otherConfig.paymentQr.alipayPay.sectionSecretHint': '仅服务端保存,前端不回显明文',
'system.otherConfig.paymentQr.alipayPay.appId': '应用 AppId',
'system.otherConfig.paymentQr.alipayPay.appIdPlaceholder': '开放平台应用 AppId',
'system.otherConfig.paymentQr.alipayPay.notifyUrl': '异步通知 URL',
'system.otherConfig.paymentQr.alipayPay.fillNotify': '填入建议地址',
'system.otherConfig.paymentQr.alipayPay.returnUrl': 'H5 同步回跳基址',
'system.otherConfig.paymentQr.alipayPay.returnUrlPlaceholder': '如 https://your-host/h5/recharge(可选)',
'system.otherConfig.paymentQr.alipayPay.privateKeyPem': '应用私钥',
'system.otherConfig.paymentQr.alipayPay.privateKeyPlaceholder': '留空表示不修改',
'system.otherConfig.paymentQr.alipayPay.privateKeyRequired': '首次保存须粘贴应用私钥',
'system.otherConfig.paymentQr.alipayPay.alipayPublicKey': '支付宝公钥',
'system.otherConfig.paymentQr.alipayPay.publicKeyPlaceholder': '留空表示不修改',
'system.otherConfig.paymentQr.alipayPay.publicKeyRequired': '首次保存须粘贴支付宝公钥',
'system.otherConfig.paymentQr.alipayPay.importPem': '导入私钥文件',
'system.otherConfig.paymentQr.alipayPay.clearPem': '清空草稿',
'system.otherConfig.paymentQr.alipayPay.pemImported': '私钥已导入',
'system.otherConfig.paymentQr.alipayPay.pemReadFailed': '读取文件失败',
'system.otherConfig.paymentQr.alipayPay.hasKey': '已配置',
'system.otherConfig.paymentQr.alipayPay.missingKey': '未配置',
'system.otherConfig.paymentQr.alipayPay.dirtyHint': '有未保存修改',
'system.otherConfig.paymentQr.alipayPay.cleanHint': '配置已与服务器同步',
'system.otherConfig.paymentQr.alipayPay.reset': '还原',
'system.otherConfig.paymentQr.alipayPay.save': '保存',
'system.otherConfig.paymentQr.alipayPay.needAppId': '请填写 AppId',
'system.otherConfig.paymentQr.alipayPay.needNotify': '请填写异步通知地址',
'system.otherConfig.paymentQr.alipayPay.needHttps': 'NotifyUrl 须为 https:// 开头的公网地址',
'system.otherConfig.paymentQr.alipayPay.needPrivateKey': '首次保存须填写应用私钥',
'system.otherConfig.paymentQr.alipayPay.needPublicKey': '首次保存须填写支付宝公钥',
'system.otherConfig.paymentQr.alipayPay.loadFailed': '加载支付宝商户配置失败',
'system.otherConfig.paymentQr.alipayPay.saveSuccess': '支付宝商户配置已保存',
'system.otherConfig.paymentQr.alipayPay.saveFailed': '保存失败',
'system.otherConfig.paymentQr.alipayPay.tip':
'密钥模式 RSA2:应用私钥与支付宝公钥仅服务端保存。需开通当面付与手机网站支付;NotifyUrl 须公网 HTTPS。',
'system.otherConfig.paymentQr.wechatPay.panelTitle': '微信支付商户(APIv3)',
'system.otherConfig.paymentQr.wechatPay.enabled': '启用在线支付',
'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI 可用',

View File

@ -12,11 +12,11 @@ export type BrandLogoUrls = {
mascot: string
}
/** 未配置图片时的文字占位(启动页 / 空态) */
export const BRAND_TEXT_LOGO = 'LOGO'
/** @deprecated 已改为文字 LOGO */
/** 未配置图片时的文字占位(启动页 / 空态 / 登录) */
export const BRAND_TEXT_LOGO = 'BCDship'
/** @deprecated 已改为文字 BCDship */
export const EMPTY_PLACEHOLDER = ''
/** @deprecated 已改为文字 LOGO */
/** @deprecated 已改为文字 BCDship */
export const MASCOT_FALLBACK = ''
/** 启动页在 Vue 挂载前读取,须与 index.html 一致。只存 data URL,避免签名地址过期。 */
export const MASCOT_CACHE_KEY = 'oms_brand_mascot_url'
@ -404,6 +404,27 @@ export async function fetchBrandLogoUrlsPublic(): Promise<BrandLogoUrls> {
return snapshotBrandImages()
}
/**
* PC/H5 登录、官网、顶栏等展示 logo 的入口调用。
* 立即用本地缓存;后台再核对远端(并发会合并;失败不清已有图)。
*/
export function ensureBrandAssetsFresh(): void {
void refreshBrandImages()
void refreshBrandCopy()
}
let lastVisibilityEnsureAt = 0
const VISIBILITY_ENSURE_MIN_MS = 60_000
/** 切回前台时节流再拉一次,避免长驻 SPA 一直用过期缓存 */
export function ensureBrandAssetsOnVisible(): void {
if (typeof document !== 'undefined' && document.visibilityState !== 'visible') return
const now = Date.now()
if (now - lastVisibilityEnsureAt < VISIBILITY_ENSURE_MIN_MS) return
lastVisibilityEnsureAt = now
ensureBrandAssetsFresh()
}
function hasLocalBrandImage(): boolean {
return BRAND_CHANNELS.some((channel) => brandLogoImages[channel].startsWith('data:'))
}

View File

@ -118,7 +118,7 @@ import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
import { useLoginCaptchaGate } from '@/composables/useLoginCaptchaGate';
import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue';
import { ADMIN_H5_HOME_PATH, isAdminH5Path } from '@/utils/login-portal';
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo';
import { BRAND_TEXT_LOGO, brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo';
import { brandCopy } from '@/utils/brandCopy';
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
@ -130,6 +130,7 @@ const route = useRoute();
const router = useRouter();
const rbacUserStore = useRbacUserStore();
const logoSrc = computed(() => brandLogoImages.site);
ensureBrandAssetsFresh();
const {
requireCaptcha,
captchaId,
@ -338,9 +339,9 @@ onMounted(() => {
.h5-login-card__logo-mark {
display: block;
font-size: 28px;
font-size: 22px;
font-weight: 700;
letter-spacing: 0.12em;
letter-spacing: 0.04em;
line-height: 1;
color: #86909c;
user-select: none;

View File

@ -177,7 +177,13 @@
<div class="h5-pay__settle-row">
<span class="h5-pay__settle-title">{{ t('h5.pay.settleTitle') }}</span>
<span class="h5-pay__settle-mode">
{{ needsWechatPay ? t('h5.pay.methodHybrid') : t('h5.pay.methodBalance') }}
{{
needsWechatPay
? onlinePayChannel === 'alipay'
? t('h5.pay.methodHybridAlipay')
: t('h5.pay.methodHybrid')
: t('h5.pay.methodBalance')
}}
</span>
</div>
@ -187,14 +193,41 @@
<b>{{ formatPayMoney(needsWechatPay ? hybridBalanceUse : payableTotal) }}</b>
</span>
<span v-if="needsWechatPay" class="h5-pay__split-pill is-wechat">
{{ t('h5.pay.splitWechat') }}
{{
onlinePayChannel === 'alipay' ? t('h5.pay.splitAlipay') : t('h5.pay.splitWechat')
}}
<b>{{ formatPayMoney(hybridWechatAmount) }}</b>
</span>
</div>
<p v-if="needsWechatPay && !inWeChat" class="h5-pay__settle-hint is-warn">
<div v-if="needsWechatPay" class="h5-pay__channel">
<button
type="button"
class="h5-pay__channel-btn"
:class="{ 'is-active': onlinePayChannel === 'wechat' }"
@click="onlinePayChannel = 'wechat'"
>
{{ t('h5.pay.channelWechat') }}
</button>
<button
type="button"
class="h5-pay__channel-btn"
:class="{ 'is-active': onlinePayChannel === 'alipay' }"
@click="onlinePayChannel = 'alipay'"
>
{{ t('h5.pay.channelAlipay') }}
</button>
</div>
<p
v-if="needsWechatPay && onlinePayChannel === 'wechat' && !inWeChat"
class="h5-pay__settle-hint is-warn"
>
{{ t('h5.pay.needWechatShort') }}
</p>
<p v-else-if="needsWechatPay && onlinePayChannel === 'alipay'" class="h5-pay__settle-hint">
{{ t('h5.pay.hybridAlipayTip') }}
</p>
<p v-else-if="needsWechatPay" class="h5-pay__settle-hint">
{{ t('h5.pay.hybridWechatTip') }}
</p>
@ -217,8 +250,15 @@
</a-spin>
<footer class="h5-pay__foot">
<div v-if="needsWechatPay && inWeChat" class="h5-pay__foot-summary">
<span>{{ t('h5.pay.footWxDue') }}</span>
<div
v-if="needsWechatPay && (onlinePayChannel === 'alipay' || inWeChat)"
class="h5-pay__foot-summary"
>
<span>
{{
onlinePayChannel === 'alipay' ? t('h5.pay.footAlipayDue') : t('h5.pay.footWxDue')
}}
</span>
<strong>{{ formatPayMoney(hybridWechatAmount) }}</strong>
</div>
<div class="h5-pay__foot-actions">
@ -226,7 +266,7 @@
{{ t('h5.pay.cancel') }}
</button>
<button
v-if="needsWechatPay && !inWeChat"
v-if="needsWechatPay && onlinePayChannel === 'wechat' && !inWeChat"
type="button"
class="h5-pay__confirm"
:disabled="submitting"
@ -273,6 +313,12 @@ import {
invokeWeChatJsapiPay,
isWeChatBrowser,
} from '@/api/recharge/wechatPay';
import {
closeAlipayPay,
createOrderAlipayPay,
getAlipayPayStatus,
redirectAlipayPay,
} from '@/api/recharge/alipayPay';
import {
formatCouponBenefit,
formatPayMoney,
@ -403,6 +449,7 @@ const hybridWechatAmount = computed(() => {
return Math.max(0, payableTotal.value - hybridBalanceUse.value);
});
const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6);
const onlinePayChannel = ref<'wechat' | 'alipay'>('wechat');
const canConfirm = computed(
() =>
@ -411,11 +458,16 @@ const canConfirm = computed(
!payConfirming.value &&
couponPricing.allReady.value &&
previews.value.every((item) => !item.error && item.totalAmount > 0) &&
(!needsWechatPay.value || inWeChat.value),
(!needsWechatPay.value ||
onlinePayChannel.value === 'alipay' ||
inWeChat.value),
);
const confirmLabel = computed(() => {
if (needsWechatPay.value) {
if (onlinePayChannel.value === 'alipay') {
return t('h5.pay.confirmAlipayAmount', { amount: formatPayMoney(hybridWechatAmount.value) });
}
return t('h5.pay.confirmHybridAmount', { amount: formatPayMoney(hybridWechatAmount.value) });
}
return t('h5.pay.confirmAmount', { amount: formatPayMoney(payableTotal.value) });
@ -451,9 +503,13 @@ function stopStatusPoll() {
}
}
async function bestEffortClosePay(outTradeNo: string | null) {
async function bestEffortClosePay(outTradeNo: string | null, channel: 'wx' | 'zfb' = 'wx') {
if (!outTradeNo) return;
await closeWeChatPay(outTradeNo).catch(() => undefined);
if (channel === 'zfb') {
await closeAlipayPay(outTradeNo).catch(() => undefined);
} else {
await closeWeChatPay(outTradeNo).catch(() => undefined);
}
}
async function redirectWechatOauth() {
@ -474,14 +530,17 @@ async function redirectWechatOauth() {
`&redirect_uri=${encodeURIComponent(redirectUri)}&response_type=code&scope=snsapi_base&state=${state}#wechat_redirect`;
}
function pollUntilPaid(outTradeNo: string) {
function pollUntilPaid(outTradeNo: string, channel: 'wx' | 'zfb' = 'wx') {
stopStatusPoll();
return new Promise<boolean>((resolve) => {
let tries = 0;
const tick = async () => {
tries += 1;
try {
const status = await getWeChatPayStatus(outTradeNo);
const status =
channel === 'zfb'
? await getAlipayPayStatus(outTradeNo)
: await getWeChatPayStatus(outTradeNo);
if (status.status === 'Success' || status.statusCode === 3) {
stopStatusPoll();
resolve(true);
@ -783,7 +842,7 @@ async function payWithWechatHybrid(oauthCode?: string) {
return;
}
const paid = await pollUntilPaid(created.outTradeNo);
const paid = await pollUntilPaid(created.outTradeNo, 'wx');
if (paid) {
payConfirming.value = false;
activeOutTradeNo = null;
@ -798,17 +857,62 @@ async function payWithWechatHybrid(oauthCode?: string) {
Message.warning(t('h5.pay.payConfirming'));
}
async function payWithAlipayHybrid() {
const couponByOrderId: Record<number, number | null> = {};
for (const preview of previews.value) {
if (preview.error) continue;
couponByOrderId[Number(preview.id)] = couponEntry(preview.id)?.selectedCouponId ?? 0;
}
const returnUrl = `${window.location.origin}/h5/orders?omsOrderPay=1`;
const created = await createOrderAlipayPay({
orderIds: props.orders.map((o) => Number(o.id)).filter((id) => id > 0),
couponByOrderId,
scene: 'wap',
returnUrl,
});
if (created.paidImmediately) {
Message.success(t('h5.pay.success'));
emit('success');
emit('update:visible', false);
return;
}
if ((!created.payUrl && !created.payFormHtml) || !created.outTradeNo) {
throw new Error(t('h5.pay.alipayRedirectFailed'));
}
try {
sessionStorage.setItem('oms_zfb_order_pay_out_trade_no', created.outTradeNo);
} catch {
/* ignore */
}
activeOutTradeNo = created.outTradeNo;
redirectAlipayPay({
payUrl: created.payUrl,
payFormHtml: created.payFormHtml,
});
}
async function handleConfirm(oauthCode?: string) {
if (!canConfirm.value || submitting.value) return;
submitting.value = true;
try {
if (needsWechatPay.value) {
await payWithWechatHybrid(oauthCode);
if (onlinePayChannel.value === 'alipay') {
await payWithAlipayHybrid();
} else {
await payWithWechatHybrid(oauthCode);
}
} else {
await payWithBalanceOnly();
}
} catch (e: any) {
await bestEffortClosePay(activeOutTradeNo);
await bestEffortClosePay(
activeOutTradeNo,
onlinePayChannel.value === 'alipay' ? 'zfb' : 'wx',
);
activeOutTradeNo = null;
Message.error(e?.message || t('h5.pay.failed'));
emit('fail', e);
@ -1415,6 +1519,29 @@ watch(
}
}
.h5-pay__channel {
display: flex;
gap: 8px;
margin-top: 10px;
}
.h5-pay__channel-btn {
flex: 1;
height: 34px;
border-radius: 8px;
border: 1px solid rgba(26, 46, 56, 0.12);
background: #fff;
color: rgba(26, 46, 56, 0.72);
font-size: 13px;
font-weight: 600;
&.is-active {
border-color: var(--app-primary-color, #1d7281);
color: var(--app-primary-color, #1d7281);
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
}
}
.h5-pay__settle-hint {
margin: 8px 0 0;
font-size: 11px;

File diff suppressed because it is too large Load Diff

View File

@ -362,17 +362,63 @@ export default {
'h5.login.switchToCustomer': 'Switch to customer login',
'h5.recharge.title': 'Recharge',
'h5.recharge.amount': 'Amount',
'h5.recharge.currentAmount': 'Amount to recharge',
'h5.recharge.amount': 'Select amount',
'h5.recharge.custom': 'Custom',
'h5.recharge.customPlaceholder': 'Enter amount',
'h5.recharge.customPlaceholder': 'Min 0.01',
'h5.recharge.payType': 'Payment method',
'h5.recharge.payTypeHint':
'Prefer online pay; transfer methods need a voucher and finance review',
'h5.recharge.groupInstant': 'Instant credit',
'h5.recharge.groupInstantDesc': 'Credits on success—no screenshot',
'h5.recharge.groupReview': 'Transfer voucher (review)',
'h5.recharge.groupReviewDesc': 'Upload a screenshot after transfer; credits after approval',
'h5.recharge.recommend': 'Recommended',
'h5.recharge.wechat': 'WeChat Pay',
'h5.recharge.wechatOnline': 'WeChat online pay',
'h5.recharge.wechatOnlineDesc': 'In-WeChat checkout · instant',
'h5.recharge.alipayOnline': 'Alipay online pay',
'h5.recharge.alipayOnlineDesc': 'Redirect to Alipay · instant',
'h5.recharge.alipayWapTip': 'You will be redirected to Alipay; return here to confirm credit',
'h5.recharge.alipayRedirectFailed': 'Failed to open Alipay',
'h5.recharge.wechatVoucher': 'WeChat transfer voucher',
'h5.recharge.alipay': 'Alipay',
'h5.recharge.wechatVoucherDesc': 'Scan static QR, then upload screenshot',
'h5.recharge.alipay': 'Alipay transfer',
'h5.recharge.alipayDesc': 'Scan static QR, then upload screenshot',
'h5.recharge.bank': 'Bank transfer',
'h5.recharge.bankDesc': 'Corporate transfer · serial + review',
'h5.recharge.bankEmpty': 'Receiving account is not configured. Contact support.',
'h5.recharge.bankAccountName': 'Account name',
'h5.recharge.bankName': 'Bank',
'h5.recharge.bankAccountNo': 'Account No.',
'h5.recharge.bankCurrency': 'Currency',
'h5.recharge.copy': 'Copy',
'h5.recharge.copied': 'Copied',
'h5.recharge.copyFailed': 'Copy failed',
'h5.recharge.payerName': 'Payer name',
'h5.recharge.payerNamePlaceholder': 'Enter the payer account name',
'h5.recharge.transferSerial': 'Bank serial No.',
'h5.recharge.transferSerialPlaceholder': 'Enter transfer serial / reference No.',
'h5.recharge.needBankRemark': 'Enter payer name and bank serial No.',
'h5.recharge.guide.wxOnlineTitle': 'Next: pay now',
'h5.recharge.guide.wxOnlineBody':
'Tap Pay now, complete checkout in WeChat; balance credits automatically.',
'h5.recharge.guide.zfbOnlineTitle': 'Next: open Alipay',
'h5.recharge.guide.zfbOnlineBody':
'Tap Pay now to open Alipay; return here to confirm credit.',
'h5.recharge.guide.alipayTitle': 'Next: transfer and upload',
'h5.recharge.guide.alipayBody':
'Scan the Alipay QR below, then upload a clear payment screenshot for review.',
'h5.recharge.guide.wxVoucherTitle': 'Next: transfer and upload',
'h5.recharge.guide.wxVoucherBody':
'Scan the WeChat QR below, then upload a clear payment screenshot for review.',
'h5.recharge.guide.bankTitle': 'Next: fill transfer info and upload receipt',
'h5.recharge.guide.bankBody':
'Transfer to the corporate account, fill payer name and serial, and upload the bank receipt.',
'h5.recharge.qrTip': 'Scan to transfer, then upload the voucher',
'h5.recharge.qrEmpty': 'Payment QR is not configured. Please contact support.',
'h5.recharge.voucher': 'Transfer voucher (optional)',
'h5.recharge.voucherBank': 'Bank receipt (optional)',
'h5.recharge.upload': 'Upload',
'h5.recharge.submit': 'Submit for review',
'h5.recharge.payNow': 'Pay now',
@ -386,7 +432,7 @@ export default {
'h5.recharge.payConfirmingTitle': 'Confirming payment',
'h5.recharge.payConfirmingHint':
'If charged, balance usually updates within seconds. Check recharge records later—do not pay twice.',
'h5.recharge.needAmount': 'Please select or enter an amount',
'h5.recharge.needAmount': 'Please select or enter an amount (min 0.01)',
'h5.recharge.success': 'Submitted. Pending review.',
'h5.recharge.paidSuccess': 'Paid. Balance updated.',
'h5.recharge.failed': 'Submit failed',
@ -1051,6 +1097,14 @@ export default {
'h5.pay.settleTitle': 'Payment',
'h5.pay.splitBalance': 'Account balance',
'h5.pay.splitWechat': 'WeChat shortfall',
'h5.pay.methodHybridAlipay': 'Balance first · Alipay shortfall',
'h5.pay.splitAlipay': 'Alipay shortfall',
'h5.pay.channelWechat': 'WeChat',
'h5.pay.channelAlipay': 'Alipay',
'h5.pay.hybridAlipayTip': 'Confirm to open Alipay for the shortfall only',
'h5.pay.confirmAlipayAmount': 'Pay with Alipay {amount}',
'h5.pay.footAlipayDue': 'Alipay due now',
'h5.pay.alipayRedirectFailed': 'Failed to open Alipay',
'h5.pay.hybridWechatTip': 'WeChat checkout will only charge the shortfall',
'h5.pay.availableBalance': 'Available {amount}',
'h5.pay.orderCount': '{count} orders',

View File

@ -361,17 +361,57 @@ export default {
'h5.login.switchToCustomer': '切换至客户登录',
'h5.recharge.title': '账户充值',
'h5.recharge.amount': '充值金额',
'h5.recharge.currentAmount': '当前充值金额',
'h5.recharge.amount': '选择金额',
'h5.recharge.custom': '自定义',
'h5.recharge.customPlaceholder': '请输入金额',
'h5.recharge.customPlaceholder': '最低 0.01',
'h5.recharge.payType': '支付方式',
'h5.recharge.payTypeHint': '推荐优先使用在线支付;转账类方式需上传凭证并由财务审核',
'h5.recharge.groupInstant': '即时到账',
'h5.recharge.groupInstantDesc': '支付成功即入账,无需截图',
'h5.recharge.groupReview': '转账凭证(需审核)',
'h5.recharge.groupReviewDesc': '完成转账后上传截图,审核通过后到账',
'h5.recharge.recommend': '推荐',
'h5.recharge.wechat': '微信支付',
'h5.recharge.wechatOnline': '微信在线支付',
'h5.recharge.wechatOnlineDesc': '微信内调起 · 秒级到账',
'h5.recharge.alipayOnline': '支付宝在线支付',
'h5.recharge.alipayOnlineDesc': '跳转支付宝 · 秒级到账',
'h5.recharge.alipayWapTip': '将跳转支付宝完成支付,支付后自动返回本页确认到账',
'h5.recharge.alipayRedirectFailed': '跳转支付宝失败',
'h5.recharge.wechatVoucher': '微信转账凭证',
'h5.recharge.alipay': '支付宝',
'h5.recharge.wechatVoucherDesc': '扫静态码后上传截图审核',
'h5.recharge.alipay': '支付宝转账',
'h5.recharge.alipayDesc': '扫静态码后上传截图审核',
'h5.recharge.bank': '银行转账',
'h5.recharge.bankDesc': '对公转账 · 填写流水后审核',
'h5.recharge.bankEmpty': '暂未配置收款账户,请联系客服',
'h5.recharge.bankAccountName': '收款户名',
'h5.recharge.bankName': '开户行',
'h5.recharge.bankAccountNo': '银行账号',
'h5.recharge.bankCurrency': '币种',
'h5.recharge.copy': '复制',
'h5.recharge.copied': '已复制',
'h5.recharge.copyFailed': '复制失败',
'h5.recharge.payerName': '付款户名',
'h5.recharge.payerNamePlaceholder': '请填写付款账户户名',
'h5.recharge.transferSerial': '银行流水号',
'h5.recharge.transferSerialPlaceholder': '请填写转账流水号/交易参考号',
'h5.recharge.needBankRemark': '请填写付款户名与银行流水号',
'h5.recharge.guide.wxOnlineTitle': '下一步:立即支付',
'h5.recharge.guide.wxOnlineBody': '点击下方「立即支付」,在微信收银台完成付款,成功后余额自动到账。',
'h5.recharge.guide.zfbOnlineTitle': '下一步:跳转支付宝',
'h5.recharge.guide.zfbOnlineBody': '点击下方「立即支付」跳转支付宝完成付款,返回本页后自动确认到账。',
'h5.recharge.guide.alipayTitle': '下一步:扫码转账并上传截图',
'h5.recharge.guide.alipayBody': '请先扫下方支付宝收款码完成转账,再上传清晰支付截图提交审核。',
'h5.recharge.guide.wxVoucherTitle': '下一步:扫码转账并上传截图',
'h5.recharge.guide.wxVoucherBody': '请先扫下方微信收款码完成转账,再上传清晰支付截图提交审核。',
'h5.recharge.guide.bankTitle': '下一步:填写转账信息并上传回单',
'h5.recharge.guide.bankBody': '请按对公账户转账,填写付款户名与流水号,并上传银行回单截图。',
'h5.recharge.qrTip': '扫码转账后请上传凭证',
'h5.recharge.qrEmpty': '暂未配置收款码,请联系客服',
'h5.recharge.voucher': '转账凭证(可选)',
'h5.recharge.voucherBank': '银行回单(可选)',
'h5.recharge.upload': '上传',
'h5.recharge.submit': '提交审核',
'h5.recharge.payNow': '立即支付',
@ -384,7 +424,7 @@ export default {
'h5.recharge.payConfirming': '支付结果确认中,稍后可在充值记录查看',
'h5.recharge.payConfirmingTitle': '支付确认中',
'h5.recharge.payConfirmingHint': '若已扣款,余额通常数秒内到账;也可稍后在充值记录核对。勿重复支付。',
'h5.recharge.needAmount': '请选择或输入充值金额',
'h5.recharge.needAmount': '请选择或输入充值金额(最低 0.01)',
'h5.recharge.success': '已提交,等待审核',
'h5.recharge.paidSuccess': '支付成功,余额已到账',
'h5.recharge.failed': '提交失败',
@ -1033,11 +1073,19 @@ export default {
'h5.pay.methodBalance': '账户余额支付',
'h5.pay.methodHint': '支付成功后将从账户余额扣款',
'h5.pay.methodHybrid': '余额优先 · 微信补差',
'h5.pay.methodHybridHint': '本次用余额 {balance},微信补差 {wechat}',
'h5.pay.methodHybridAlipay': '余额优先 · 支付宝补差',
'h5.pay.methodHybridHint': '本次用余额 {balance},在线补差 {wechat}',
'h5.pay.settleTitle': '支付方式',
'h5.pay.splitBalance': '账户余额',
'h5.pay.splitWechat': '微信补差',
'h5.pay.splitAlipay': '支付宝补差',
'h5.pay.channelWechat': '微信',
'h5.pay.channelAlipay': '支付宝',
'h5.pay.hybridWechatTip': '确认后将调起微信支付,仅支付补差部分',
'h5.pay.hybridAlipayTip': '确认后将跳转支付宝,仅支付补差部分',
'h5.pay.confirmAlipayAmount': '支付宝支付 {amount}',
'h5.pay.footAlipayDue': '本次支付宝应付',
'h5.pay.alipayRedirectFailed': '跳转支付宝失败',
'h5.pay.availableBalance': '可用余额 {amount}',
'h5.pay.orderCount': '{count} 笔订单',
'h5.pay.feeDetails': '费用明细',

View File

@ -186,7 +186,7 @@ import { isWeChatBrowser } from '@/utils/device';
import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
import { useLoginCaptchaGate } from '@/composables/useLoginCaptchaGate';
import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue';
import { BRAND_TEXT_LOGO, brandLogoImages } from '@/utils/brandLogo';
import { BRAND_TEXT_LOGO, brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo';
import { brandCopy } from '@/utils/brandCopy';
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
@ -205,6 +205,8 @@ const route = useRoute();
const router = useRouter();
const rbacUserStore = useRbacUserStore();
const logoSrc = computed(() => brandLogoImages.site);
/** 进入时再核对远端 logo/文案,避免只靠启动缓存空白或过期 */
ensureBrandAssetsFresh();
const {
requireCaptcha,
captchaId,
@ -613,9 +615,9 @@ onMounted(async () => {
.h5-login-card__logo-mark {
display: block;
font-size: 28px;
font-size: 22px;
font-weight: 700;
letter-spacing: 0.12em;
letter-spacing: 0.04em;
line-height: 1;
color: #86909c;
user-select: none;

View File

@ -502,6 +502,7 @@ import {
} from '@/composables/useAskAdvisor';
import { addPickupOrderOrders, getPickupOrderDetail } from '@/api/order/pickupOrder';
import { consumeOrderPayOauthResume } from '../utils/orderPayOauth';
import { getAlipayPayStatus } from '@/api/recharge/alipayPay';
import H5OrderPaySheet from '../components/H5OrderPaySheet.vue';
const H5OrderDetailSheet = defineAsyncComponent(
@ -1500,7 +1501,69 @@ function resumeOrderPayOauthIfNeeded() {
payVisible.value = true;
}
async function resumeAlipayOrderPayIfNeeded() {
const url = new URL(window.location.href);
const flag = url.searchParams.get('omsOrderPay');
let outTradeNo =
url.searchParams.get('outTradeNo') || url.searchParams.get('out_trade_no') || '';
if (!outTradeNo) {
try {
outTradeNo = sessionStorage.getItem('oms_zfb_order_pay_out_trade_no') || '';
} catch {
outTradeNo = '';
}
}
if (!outTradeNo) return;
if (flag && flag !== '1') return;
if (!flag && !outTradeNo.startsWith('ZFB')) return;
url.searchParams.delete('omsOrderPay');
url.searchParams.delete('outTradeNo');
url.searchParams.delete('out_trade_no');
for (const key of [
'trade_no',
'total_amount',
'seller_id',
'app_id',
'sign',
'sign_type',
'charset',
'method',
'auth_app_id',
'version',
'timestamp',
]) {
url.searchParams.delete(key);
}
window.history.replaceState({}, '', url.toString());
try {
sessionStorage.removeItem('oms_zfb_order_pay_out_trade_no');
} catch {
/* ignore */
}
for (let i = 0; i < 20; i += 1) {
try {
const st = await getAlipayPayStatus(outTradeNo);
if (st.status === 'Success' || st.statusCode === 3) {
Message.success(t('h5.pay.success'));
void reload();
return;
}
if (st.status === 'Closed' || st.status === 'Failed') {
Message.warning(t('h5.pay.payConfirming'));
return;
}
} catch {
/* ignore */
}
await new Promise((r) => setTimeout(r, 1500));
}
Message.warning(t('h5.pay.payConfirming'));
}
resumeOrderPayOauthIfNeeded();
void resumeAlipayOrderPayIfNeeded();
function onPaySuccess() {
payOauthCode.value = undefined;

View File

@ -240,14 +240,12 @@
</div>
<div class="lane-panel__hist">
<span>日均时效走势</span>
<div class="lane-panel__hist-bars">
<i
v-for="(d, i) in active.dailyAvg"
:key="`d-${i}`"
:style="{ height: `${histHeight(d)}%`, background: latencyColor(d) }"
:title="formatDays(d)"
/>
</div>
<Chart
class="lane-panel__trend-chart"
width="100%"
height="108px"
:options="latencyTrendOption"
/>
</div>
</article>
@ -298,15 +296,12 @@
</div>
<div class="lane-panel__hist">
<span>日毛利走势</span>
<div class="lane-panel__hist-bars">
<i
v-for="(p, i) in active.dailyProfit"
:key="`p-${i}`"
class="is-profit-bar"
:style="{ height: `${profitHeight(p)}%` }"
:title="formatMoney(p)"
/>
</div>
<Chart
class="lane-panel__trend-chart"
width="100%"
height="108px"
:options="profitTrendOption"
/>
</div>
</article>
</div>
@ -319,6 +314,7 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import Chart from '@/components/chart/index.vue'
import {
formatCount,
formatDays,
@ -482,15 +478,6 @@ function latency(lane: LaneStat) {
return props.latencyMode === 'success' ? lane.avgSuccessDays : lane.avgFailDays
}
function histHeight(days: number) {
return Math.min(100, Math.max(8, (days / 18) * 100))
}
function profitHeight(v: number) {
const max = Math.max(...(active.value?.dailyProfit || [1]), 1)
return Math.min(100, Math.max(6, (v / max) * 100))
}
function growthClass(v?: number | null) {
if (v == null || Number.isNaN(Number(v))) return ''
const n = Number(v)
@ -498,6 +485,180 @@ function growthClass(v?: number | null) {
if (n < 0) return 'is-down'
return ''
}
function dayLabels(len: number) {
if (len <= 0) return []
if (len === 1) return ['D1']
return Array.from({ length: len }, (_, i) => {
if (i === 0) return 'D1'
if (i === len - 1) return `D${len}`
if (len > 14 && i % Math.ceil(len / 6) !== 0) return ''
return `D${i + 1}`
})
}
/** 暂无独立失败日序列时,按均时比从日均推一条对照走势 */
function deriveFailDaily(lane: LaneStat) {
const src = lane.dailyAvg || []
if (!src.length) return []
const ok = Math.max(lane.avgSuccessDays || 0, 0.01)
const fail = Math.max(lane.avgFailDays || 0, 0)
const ratio = fail / ok
return src.map((d) => Math.round(Math.max(0, d * ratio) * 10) / 10)
}
function miniAreaOption(opts: {
labels: string[]
series: Array<{
name: string
data: number[]
color: string
areaFrom: string
areaTo: string
}>
yName?: string
valueFormatter?: (v: number) => string
}) {
const empty = !opts.series.some((s) => s.data.length)
return {
animationDuration: 240,
grid: {
left: 2,
right: 4,
top: 18,
bottom: 2,
containLabel: true,
},
legend: {
top: 0,
right: 0,
icon: 'circle',
itemWidth: 7,
itemHeight: 7,
itemGap: 10,
textStyle: {
color: 'rgba(26, 46, 56, 0.55)',
fontSize: 10,
},
},
tooltip: {
trigger: 'axis' as const,
confine: true,
axisPointer: { type: 'line' as const },
valueFormatter: opts.valueFormatter
? (v: unknown) => opts.valueFormatter!(Number(v) || 0)
: undefined,
},
xAxis: {
type: 'category' as const,
boundaryGap: false,
data: empty ? ['—'] : opts.labels,
axisLine: { show: false },
axisTick: { show: false },
axisLabel: {
color: 'rgba(26, 46, 56, 0.38)',
fontSize: 10,
interval: 0,
hideOverlap: true,
},
},
yAxis: {
type: 'value' as const,
name: opts.yName,
nameTextStyle: {
color: 'rgba(26, 46, 56, 0.35)',
fontSize: 10,
padding: [0, 0, 0, 0],
},
min: 0,
scale: true,
axisLine: { show: false },
axisTick: { show: false },
axisLabel: {
color: 'rgba(26, 46, 56, 0.38)',
fontSize: 10,
formatter: (v: number) => {
if (opts.valueFormatter && opts.yName === '¥') {
if (Math.abs(v) >= 1000) return `${Math.round(v / 1000)}k`
return String(Math.round(v))
}
return String(v)
},
},
splitLine: {
lineStyle: { color: 'rgba(26, 46, 56, 0.06)' },
},
},
series: empty
? []
: opts.series.map((s) => ({
name: s.name,
type: 'line' as const,
smooth: true,
showSymbol: false,
data: s.data,
lineStyle: { width: 2, color: s.color },
itemStyle: { color: s.color },
areaStyle: {
color: {
type: 'linear' as const,
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{ offset: 0, color: s.areaFrom },
{ offset: 1, color: s.areaTo },
],
},
},
})),
}
}
const latencyTrendOption = computed(() => {
const lane = active.value
const success = lane?.dailyAvg || []
const fail = lane ? deriveFailDaily(lane) : []
return miniAreaOption({
labels: dayLabels(success.length),
valueFormatter: (v) => formatDays(v),
series: [
{
name: '成功',
data: success,
color: '#1d7281',
areaFrom: 'rgba(29, 114, 129, 0.28)',
areaTo: 'rgba(29, 114, 129, 0.02)',
},
{
name: '失败',
data: fail,
color: '#c45c4a',
areaFrom: 'rgba(196, 92, 74, 0.22)',
areaTo: 'rgba(196, 92, 74, 0.02)',
},
],
})
})
const profitTrendOption = computed(() => {
const profit = active.value?.dailyProfit || []
return miniAreaOption({
labels: dayLabels(profit.length),
yName: '¥',
valueFormatter: (v) => formatMoney(v),
series: [
{
name: '毛利',
data: profit,
color: '#1d7281',
areaFrom: 'rgba(29, 114, 129, 0.3)',
areaTo: 'rgba(29, 114, 129, 0.02)',
},
],
})
})
</script>
<style scoped lang="less">
@ -1153,27 +1314,13 @@ function growthClass(v?: number | null) {
display: block;
font-size: 11px;
color: rgba(26, 46, 56, 0.42);
margin-bottom: 6px;
margin-bottom: 4px;
}
}
.lane-panel__hist-bars {
display: flex;
align-items: flex-end;
gap: 2px;
height: 40px;
i {
flex: 1;
min-width: 0;
border-radius: 1px 1px 0 0;
opacity: 0.9;
&.is-profit-bar {
background: var(--app-primary-color, #1d7281);
opacity: 0.75;
}
}
.lane-panel__trend-chart {
width: 100%;
min-height: 108px;
}
@media (max-width: 1100px) {

View File

@ -6,11 +6,12 @@
<script lang="ts" setup>
import { computed } from 'vue';
import { brandLogoImages } from '@/utils/brandLogo';
import { brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo';
defineOptions({ name: 'LoginLockLogo' });
const logoSrc = computed(() => brandLogoImages.site);
ensureBrandAssetsFresh();
</script>
<style lang="less" scoped>

View File

@ -12,6 +12,11 @@ import {
createOrderWeChatPay,
getWeChatPayStatus,
} from '@/api/recharge/wechatPay'
import {
closeAlipayPay,
createOrderAlipayPay,
getAlipayPayStatus,
} from '@/api/recharge/alipayPay'
import {
formatCouponBenefit,
formatPayMoney,
@ -177,6 +182,8 @@ const hybridWechatAmount = computed(() => {
return Math.max(0, totals.value.payable - hybridBalanceUse.value)
})
const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6)
/** 在线补差渠道:微信扫码 / 支付宝扫码 */
const onlinePayChannel = ref<'wechat' | 'alipay'>('wechat')
const wxQrVisible = ref(false)
const wxQrDataUrl = ref('')
@ -193,10 +200,16 @@ function stopWxPoll() {
async function cancelWxPay() {
stopWxPoll()
const no = wxOutTradeNo.value
const channel = onlinePayChannel.value
wxQrVisible.value = false
wxQrDataUrl.value = ''
wxOutTradeNo.value = ''
if (no) await closeWeChatPay(no).catch(() => undefined)
if (!no) return
if (channel === 'alipay') {
await closeAlipayPay(no).catch(() => undefined)
} else {
await closeWeChatPay(no).catch(() => undefined)
}
}
const canConfirm = computed(
@ -446,7 +459,7 @@ async function handleConfirm() {
const queue = [...payableOrders.value]
if (!queue.length) return
// 单客户且需微信补差:一笔混合支付
// 单客户且需在线补差:一笔混合支付(微信 / 支付宝)
if (!isMultiCustomer.value && needsWechatPay.value) {
submitting.value = true
try {
@ -454,11 +467,18 @@ async function handleConfirm() {
for (const p of queue) {
couponByOrderId[Number(p.id)] = couponEntry(p)?.selectedCouponId ?? 0
}
const created = await createOrderWeChatPay({
orderIds: queue.map((p) => Number(p.id)),
couponByOrderId,
scene: 'native',
})
const useAlipay = onlinePayChannel.value === 'alipay'
const created = useAlipay
? await createOrderAlipayPay({
orderIds: queue.map((p) => Number(p.id)),
couponByOrderId,
scene: 'precreate',
})
: await createOrderWeChatPay({
orderIds: queue.map((p) => Number(p.id)),
couponByOrderId,
scene: 'native',
})
if (created.paidImmediately) {
for (const p of queue) {
payStatus.value = { ...payStatus.value, [p.key]: 'success' }
@ -473,7 +493,11 @@ async function handleConfirm() {
return
}
if (!created.codeUrl || !created.outTradeNo) {
throw new Error(t('order.myOrders.modal.payWxCreateFailed'))
throw new Error(
useAlipay
? t('order.myOrders.modal.payAlipayCreateFailed')
: t('order.myOrders.modal.payWxCreateFailed'),
)
}
wxOutTradeNo.value = created.outTradeNo
wxQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
@ -484,7 +508,9 @@ async function handleConfirm() {
stopWxPoll()
wxPollTimer = setInterval(async () => {
try {
const st = await getWeChatPayStatus(created.outTradeNo!)
const st = useAlipay
? await getAlipayPayStatus(created.outTradeNo!)
: await getWeChatPayStatus(created.outTradeNo!)
if (st.status === 'Success' || st.statusCode === 3) {
stopWxPoll()
wxQrVisible.value = false
@ -639,6 +665,13 @@ watch(
class="pay-alert"
>
{{ t('order.myOrders.modal.payHybridHint', { amount: formatPayMoney(hybridWechatAmount) }) }}
<div class="pay-online-channel">
<span>{{ t('order.myOrders.modal.payOnlineChannel') }}</span>
<a-radio-group v-model="onlinePayChannel" type="button" size="small" :disabled="submitting">
<a-radio value="wechat">{{ t('order.myOrders.modal.payChannelWechat') }}</a-radio>
<a-radio value="alipay">{{ t('order.myOrders.modal.payChannelAlipay') }}</a-radio>
</a-radio-group>
</div>
</a-alert>
<a-alert v-if="isMulti && blockedOrders.length" type="info" show-icon class="pay-alert">
{{ t('order.myOrders.modal.paySkipHint', { count: blockedOrders.length }) }}
@ -778,9 +811,25 @@ watch(
<div v-if="wxQrVisible" class="pay-wx-layer">
<div class="pay-wx-card">
<h4>{{ t('order.myOrders.modal.payWxTitle') }}</h4>
<p class="pay-wx-card__tip">{{ t('order.myOrders.modal.payWxTip') }}</p>
<img v-if="wxQrDataUrl" :src="wxQrDataUrl" alt="wx-pay-qr" />
<h4>
{{
onlinePayChannel === 'alipay'
? t('order.myOrders.modal.payAlipayTitle')
: t('order.myOrders.modal.payWxTitle')
}}
</h4>
<p class="pay-wx-card__tip">
{{
onlinePayChannel === 'alipay'
? t('order.myOrders.modal.payAlipayTip')
: t('order.myOrders.modal.payWxTip')
}}
</p>
<img
v-if="wxQrDataUrl"
:src="wxQrDataUrl"
:alt="onlinePayChannel === 'alipay' ? 'alipay-pay-qr' : 'wx-pay-qr'"
/>
<p class="pay-wx-card__amt">
{{ t('order.myOrders.modal.payWxAmount', { amount: formatPayMoney(hybridWechatAmount) }) }}
</p>
@ -800,7 +849,11 @@ watch(
<span class="pay-footer__split">
{{ t('order.myOrders.modal.paySplitBalance', { amount: formatPayMoney(hybridBalanceUse) }) }}
·
{{ t('order.myOrders.modal.paySplitWechat', { amount: formatPayMoney(hybridWechatAmount) }) }}
{{
onlinePayChannel === 'alipay'
? t('order.myOrders.modal.paySplitAlipay', { amount: formatPayMoney(hybridWechatAmount) })
: t('order.myOrders.modal.paySplitWechat', { amount: formatPayMoney(hybridWechatAmount) })
}}
</span>
</template>
<template v-else>
@ -908,6 +961,14 @@ watch(
margin: 0;
}
.pay-online-channel {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin-top: 8px;
}
.pay-list-head {
display: flex;
align-items: center;

View File

@ -71,18 +71,20 @@
@focus="$emit('warm-login')"
>
<span>{{ copy.heroCta }}</span>
<svg
class="ai-welcome-cta__arrow"
viewBox="0 0 16 16"
width="14"
height="14"
aria-hidden="true"
>
<path
fill="currentColor"
d="M2.5 8a.75.75 0 0 1 .75-.75h7.69L8.22 4.53a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06l2.72-2.72H3.25A.75.75 0 0 1 2.5 8"
/>
</svg>
<span class="ai-welcome-cta__orb" aria-hidden="true">
<svg
class="ai-welcome-cta__arrow"
viewBox="0 0 16 16"
width="12"
height="12"
aria-hidden="true"
>
<path
fill="currentColor"
d="M2.5 8a.75.75 0 0 1 .75-.75h7.69L8.22 4.53a.75.75 0 0 1 1.06-1.06l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06l2.72-2.72H3.25A.75.75 0 0 1 2.5 8"
/>
</svg>
</span>
</a>
</div>
</template>

View File

@ -46,8 +46,9 @@
const influence = isNarrow ? 96 : 120;
const strength = isNarrow ? 14 : 18;
const dprCap = 1.1;
/** 上下各约 18% 渐隐,中间才有点阵 */
const edgePad = 0.18;
/** 上下都不收边:顶栏/底栏已是浮层,点阵铺满视口 */
const topEdgePad = 0;
const botEdgePad = 0;
const cold = 'rgba(15, 23, 42, 1)';
const warm = 'rgba(2, 62, 138, 1)';
@ -118,18 +119,18 @@
const pushK = strength * influenceAmt;
const live = influenceAmt > 0.02;
const total = cols * rows;
const topBand = height * edgePad;
const botBand = height * (1 - edgePad);
const topBand = height * topEdgePad;
const botBand = height * (1 - botEdgePad);
for (let i = 0; i < total; i++) {
const ix = i * 2;
const by = bases[ix + 1];
// 上下留白:边缘外不画,边缘内渐隐
// 顶部满铺;底部边缘内渐隐
let edge = 1;
if (by < topBand) edge = by / topBand;
if (topBand > 0 && by < topBand) edge = by / topBand;
else if (by > botBand) edge = (height - by) / (height - botBand);
if (edge < 0.06) continue;
edge = edge * edge; // 更利落地收掉上下
edge = edge * edge;
let x = bases[ix];
let y = by;

View File

@ -1,147 +1,146 @@
<template>
<header id="header" class="header d-flex align-items-center fixed-top">
<div class="container-fluid container-xl d-flex align-items-center justify-content-between">
<a
href="/"
class="site-nav-wordmark"
:class="{
active: nav === 'home',
'is-active': nav === 'home',
}"
:aria-current="nav === 'home' ? 'page' : undefined"
aria-label="BCDship"
@click.prevent="onNavClick('home')"
<!-- 无整条顶栏外壳:品牌 / 导航 / 工具各自独立浮层 -->
<header id="header" class="header site-chrome fixed-top">
<a
href="/"
class="site-nav-wordmark"
:class="{
active: nav === 'home',
'is-active': nav === 'home',
}"
:aria-current="nav === 'home' ? 'page' : undefined"
aria-label="BCDship"
@click.prevent="onNavClick('home')"
>
<span
v-if="siteLogoSrc"
class="site-nav-wordmark__logo"
aria-hidden="true"
>
<span
v-if="siteLogoSrc"
class="site-nav-wordmark__logo"
aria-hidden="true"
<img
:src="siteLogoSrc"
alt=""
width="44"
height="44"
/>
</span>
<span class="site-nav-wordmark__copy">
<span class="site-nav-wordmark__text">BCDship</span>
<span class="site-nav-wordmark__tag">{{ brandCopy.navFullName }}</span>
</span>
</a>
<button
type="button"
class="mobile-nav-toggle mobile-nav-show"
:aria-label="isZh ? '打开菜单' : 'Open menu'"
@click="$emit('open-nav')"
>
<i class="si si-list" aria-hidden="true"></i>
</button>
<button
type="button"
class="mobile-nav-toggle mobile-nav-hide d-none"
:aria-label="isZh ? '关闭菜单' : 'Close menu'"
@click="$emit('close-nav')"
>
<i class="si si-x" aria-hidden="true"></i>
</button>
<nav id="navbar" class="navbar">
<ul>
<li
ref="dockRef"
class="site-nav-dock"
:class="{ 'is-panel-open': !!panel }"
role="menubar"
:aria-label="isZh ? '主导航' : 'Primary'"
@keydown="onDockKeydown"
>
<img
:src="siteLogoSrc"
alt=""
width="36"
height="36"
/>
</span>
<span class="site-nav-wordmark__copy">
<span class="site-nav-wordmark__text">BCDship</span>
<span class="site-nav-wordmark__tag">{{ brandCopy.navFullName }}</span>
</span>
</a>
<button
type="button"
class="mobile-nav-toggle mobile-nav-show"
:aria-label="isZh ? '打开菜单' : 'Open menu'"
@click="$emit('open-nav')"
>
<i class="si si-list" aria-hidden="true"></i>
</button>
<button
type="button"
class="mobile-nav-toggle mobile-nav-hide d-none"
:aria-label="isZh ? '关闭菜单' : 'Close menu'"
@click="$emit('close-nav')"
>
<i class="si si-x" aria-hidden="true"></i>
</button>
<nav id="navbar" class="navbar">
<ul>
<li
ref="dockRef"
class="site-nav-dock"
:class="{ 'is-panel-open': !!panel }"
role="menubar"
:aria-label="isZh ? '主导航' : 'Primary'"
@keydown="onDockKeydown"
<span class="site-nav-dock__glass" aria-hidden="true"></span>
<span ref="sliderRef" class="site-nav-dock__slider" aria-hidden="true"></span>
<a
v-for="item in items"
:key="item.id"
:href="item.href"
role="menuitem"
class="site-nav-dock__item"
:class="{
active: nav === item.id,
'is-active': nav === item.id,
'is-panel': isPanelItem(item.id) && panel === item.id,
}"
:aria-current="nav === item.id ? 'page' : undefined"
:aria-expanded="isPanelItem(item.id) ? panel === item.id : undefined"
:aria-haspopup="isPanelItem(item.id) ? 'dialog' : undefined"
@click.prevent="onNavClick(item.id)"
>
<span class="site-nav-dock__glass" aria-hidden="true"></span>
<span ref="sliderRef" class="site-nav-dock__slider" aria-hidden="true"></span>
<a
v-for="item in items"
:key="item.id"
:href="item.href"
role="menuitem"
class="site-nav-dock__item"
:class="{
active: nav === item.id,
'is-active': nav === item.id,
'is-panel': isPanelItem(item.id) && panel === item.id,
}"
:aria-current="nav === item.id ? 'page' : undefined"
:aria-expanded="isPanelItem(item.id) ? panel === item.id : undefined"
:aria-haspopup="isPanelItem(item.id) ? 'dialog' : undefined"
@click.prevent="onNavClick(item.id)"
<span
class="site-nav-dock__icon"
aria-hidden="true"
v-html="item.icon"
></span>
<span class="site-nav-dock__label">{{ isZh ? item.zh : item.en }}</span>
</a>
</li>
<li class="site-nav-tools">
<span class="site-nav-tools__glass" aria-hidden="true"></span>
<a
v-if="!signedIn"
class="site-nav-login"
:href="loginUrl"
@pointerenter="$emit('warm-login')"
@focus="$emit('warm-login')"
@click="onLoginClick"
>{{ isZh ? '登录' : 'Log in' }}</a>
<a
v-else
class="site-nav-avatar"
:href="homeUrl"
:title="displayName"
:aria-label="displayName"
>
<svg
class="site-nav-avatar__icon"
width="22"
height="22"
viewBox="0 0 24 24"
fill="none"
aria-hidden="true"
>
<span
class="site-nav-dock__icon"
aria-hidden="true"
v-html="item.icon"
></span>
<span class="site-nav-dock__label">{{ isZh ? item.zh : item.en }}</span>
</a>
</li>
<li class="site-nav-tools">
<span class="site-nav-tools__glass" aria-hidden="true"></span>
<a
v-if="!signedIn"
class="site-nav-login"
:href="loginUrl"
@pointerenter="$emit('warm-login')"
@focus="$emit('warm-login')"
@click="onLoginClick"
>{{ isZh ? '登录' : 'Log in' }}</a>
<a
v-else
class="site-nav-avatar"
:href="homeUrl"
:title="displayName"
:aria-label="displayName"
>
<svg
class="site-nav-avatar__icon"
width="22"
height="22"
viewBox="0 0 24 24"
fill="none"
aria-hidden="true"
>
<circle
cx="12"
cy="8.2"
r="3.4"
stroke="currentColor"
stroke-width="1.8"
/>
<path
d="M5.2 19.2c.7-3.2 3.2-5 6.8-5s6.1 1.8 6.8 5"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
/>
</svg>
</a>
<button
type="button"
id="language-toggle-btn"
class="language-toggle-link"
:aria-label="isZh ? 'Switch language' : '切换语言'"
@click="$emit('toggle-lang')"
>
<i class="si si-translate language-toggle-icon" aria-hidden="true"></i>
<span class="language-toggle__next">{{ isZh ? 'EN' : '中' }}</span>
</button>
</li>
</ul>
</nav>
</div>
<circle
cx="12"
cy="8.2"
r="3.4"
stroke="currentColor"
stroke-width="1.8"
/>
<path
d="M5.2 19.2c.7-3.2 3.2-5 6.8-5s6.1 1.8 6.8 5"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
/>
</svg>
</a>
<button
type="button"
id="language-toggle-btn"
class="language-toggle-link"
:aria-label="isZh ? 'Switch language' : '切换语言'"
@click="$emit('toggle-lang')"
>
<i class="si si-translate language-toggle-icon" aria-hidden="true"></i>
<span class="language-toggle__next">{{ isZh ? 'EN' : '中' }}</span>
</button>
</li>
</ul>
</nav>
</header>
</template>
<script lang="ts" setup>
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { brandLogoImages } from '@/utils/brandLogo';
import { brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo';
import { brandCopy } from '@/utils/brandCopy';
import { useUserStore } from '@/store';
import { useRbacUserStore } from '@/store/modules/rbac-user';
@ -182,6 +181,7 @@
const signedIn = computed(() => rbacUserStore.isLoggedIn);
const homeUrl = officialAppHomeUrl();
const siteLogoSrc = computed(() => brandLogoImages.site);
ensureBrandAssetsFresh();
function onLoginClick(e: MouseEvent) {
goOfficialLogin(router, undefined, e);

View File

@ -146,17 +146,25 @@ body.command-home {
color: var(--ai-ink);
}
/* Slim header ? transparent so stage bg reads as one surface */
/* 无整条顶栏外壳:#header 只做定位层,品牌 / 导航 / 工具各自独立 */
body.command-home #header.header {
display: flex !important;
display: block !important;
z-index: 20;
padding: 20px 0 12px;
top: 0;
right: 0;
left: 0;
width: 100%;
height: 0;
padding: 0;
margin: 0;
overflow: visible;
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
border: none;
box-shadow: none;
pointer-events: none;
}
/* 面板打开时顶栏压过 backdrop,便于同项再点关闭 */
@ -165,19 +173,6 @@ body.command-home.site-panel-open #header.header {
z-index: 998;
}
body.command-home #header .container-xl {
position: relative;
/* 与 .ai-advisor-layout 同列宽,品牌 / 登录贴内容区两侧 */
width: 100%;
max-width: var(--ai-content-max, 1200px);
margin-left: auto;
margin-right: auto;
padding-left: 20px;
padding-right: 20px;
box-sizing: border-box;
overflow: visible;
}
body.command-home #navbar > ul > li.site-nav-tools {
position: relative;
display: flex;
@ -203,17 +198,24 @@ body.command-home #navbar .site-nav-dock a {
}
body.command-home #header .site-nav-wordmark {
position: relative;
position: fixed;
top: calc(16px + env(safe-area-inset-top, 0px));
left: max(16px, env(safe-area-inset-left, 0px));
z-index: 4;
flex-shrink: 0;
align-items: center;
gap: 8px;
margin-right: auto;
margin: 0;
color: var(--ai-brand);
font-weight: 750;
letter-spacing: 0.01em;
text-decoration: none;
white-space: nowrap;
pointer-events: auto;
}
body.command-home #header .mobile-nav-toggle {
pointer-events: auto;
}
body.command-home .site-nav-wordmark__copy {
@ -237,7 +239,7 @@ body.command-home .site-nav-wordmark__tag {
overflow: hidden;
text-overflow: ellipsis;
color: var(--ai-text-3, rgba(26, 46, 56, 0.52));
font-size: 0.62rem;
font-size: 0.52rem;
font-weight: 400;
letter-spacing: 0.02em;
line-height: 1.15;
@ -249,23 +251,38 @@ body.command-home .site-nav-wordmark__logo {
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
width: 44px;
height: 44px;
}
body.command-home .site-nav-wordmark__logo img {
display: block;
width: 36px;
height: 36px;
width: 44px;
height: 44px;
object-fit: contain;
}
@media (max-width: 1279px) {
/* 手机/平板抽屉:纵向列表,浅色底保证对比度 */
/* 手机/平板:品牌 + 汉堡各自浮点,抽屉仍从右侧滑出 */
body.command-home #header .site-nav-wordmark {
top: calc(12px + env(safe-area-inset-top, 0px));
left: max(14px, env(safe-area-inset-left, 0px));
min-height: 44px;
height: auto;
padding: 0;
font-size: 1rem;
}
body.command-home #header .mobile-nav-show {
position: fixed;
top: calc(12px + env(safe-area-inset-top, 0px));
right: max(14px, env(safe-area-inset-right, 0px));
z-index: 4;
}
body.command-home #navbar,
body.command-home #navbar.navbar {
width: min(100%, 380px);
max-width: 100%;
pointer-events: auto;
}
body.command-home #navbar > ul {
display: flex;
@ -280,15 +297,6 @@ body.command-home .site-nav-wordmark__logo img {
border-bottom-left-radius: 24px;
box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
}
body.command-home #header .site-nav-wordmark {
position: relative;
z-index: 4;
min-height: 44px;
height: auto;
margin-right: auto;
padding: 0;
font-size: 1rem;
}
body.command-home .site-nav-dock {
display: contents;
}
@ -395,26 +403,25 @@ body.command-home .site-nav-wordmark__logo img {
body.command-home #navbar,
body.command-home #navbar.navbar {
position: static;
display: flex;
align-items: center;
margin-left: auto;
display: contents;
margin: 0;
}
body.command-home #navbar > ul {
position: static;
display: flex;
align-items: center;
display: contents;
margin: 0;
padding: 0;
list-style: none;
}
body.command-home #header .site-nav-wordmark,
body.command-home #header .site-nav-wordmark:focus {
position: relative;
top: 20px;
left: max(20px, calc(50% - var(--ai-content-max, 1200px) / 2 + 20px));
z-index: 4;
flex-shrink: 0;
gap: 8px;
height: 46px;
margin-right: auto;
margin: 0;
padding: 0 2px;
border: none;
border-radius: 0;
@ -428,12 +435,12 @@ body.command-home .site-nav-wordmark__logo img {
transition: color 0.18s ease, opacity 0.18s ease;
}
body.command-home .site-nav-wordmark__logo {
width: 36px;
height: 36px;
width: 44px;
height: 44px;
}
body.command-home .site-nav-wordmark__logo img {
width: 36px;
height: 36px;
width: 44px;
height: 44px;
}
body.command-home #header .site-nav-wordmark:hover,
body.command-home #header .site-nav-wordmark:focus-visible {
@ -443,13 +450,13 @@ body.command-home .site-nav-wordmark__logo img {
body.command-home #header .site-nav-wordmark.is-active:focus {
color: var(--ai-brand);
}
/* 桌面主导航:轻量文字轨 + 淡色滑块(大厂式,不做毛玻璃胶囊) */
/* 桌面主导航:独立浮层,轻量文字轨 + 淡色滑块 */
body.command-home .site-nav-dock {
position: absolute;
position: fixed;
left: 50%;
top: 50%;
top: 26px;
z-index: 3;
transform: translate(-50%, -50%);
transform: translateX(-50%);
flex-direction: row;
align-items: stretch;
justify-content: center;
@ -464,6 +471,7 @@ body.command-home .site-nav-wordmark__logo img {
border-radius: 999px;
background: transparent;
box-shadow: none;
pointer-events: auto;
}
body.command-home .site-nav-dock__glass {
display: none;
@ -479,14 +487,14 @@ body.command-home .site-nav-wordmark__logo img {
opacity: 0;
transform: translate3d(0, 0, 0);
will-change: transform;
background: color-mix(in srgb, var(--ai-brand, #023e8a) 8%, transparent);
background: color-mix(in srgb, var(--ai-accent, #f56668) 12%, transparent);
box-shadow: none;
}
body.command-home.site-panel-open .site-nav-dock {
box-shadow: none;
}
body.command-home.site-panel-open .site-nav-dock__slider {
background: color-mix(in srgb, var(--ai-brand, #023e8a) 12%, transparent);
background: color-mix(in srgb, var(--ai-accent, #f56668) 16%, transparent);
box-shadow: none;
}
body.command-home #navbar .site-nav-dock a.is-panel,
@ -537,14 +545,14 @@ body.command-home .site-nav-wordmark__logo img {
body.command-home #navbar .site-nav-dock a.active:focus,
body.command-home #navbar .site-nav-dock a.is-active,
body.command-home #navbar .site-nav-dock a.is-active:focus {
color: var(--ai-brand, #023e8a);
color: var(--ai-accent, #f56668);
border-color: transparent;
background: transparent;
box-shadow: none;
}
body.command-home #navbar .site-nav-dock a.active:hover,
body.command-home #navbar .site-nav-dock a.is-active:hover {
color: var(--ai-brand-hover, #012a74);
color: var(--ai-accent-hover, #e25557);
border-color: transparent;
background: transparent;
}
@ -565,6 +573,10 @@ body.command-home .site-nav-wordmark__logo img {
font-weight: 500;
}
body.command-home #navbar > ul > li.site-nav-tools {
position: fixed;
top: 24px;
right: max(20px, calc(50% - var(--ai-content-max, 1200px) / 2 + 20px));
z-index: 4;
height: 32px;
gap: 6px;
padding: 0;
@ -574,6 +586,7 @@ body.command-home .site-nav-wordmark__logo img {
background: transparent;
opacity: 1;
box-shadow: none;
pointer-events: auto;
}
body.command-home #navbar > ul > li.site-nav-tools:hover,
body.command-home #navbar > ul > li.site-nav-tools:focus-within {
@ -705,7 +718,7 @@ body.command-home #navbar .site-nav-dock a.active,
body.command-home #navbar .site-nav-dock a.active:focus,
body.command-home #navbar .site-nav-dock a.is-active,
body.command-home #navbar .site-nav-dock a.is-active:focus {
color: var(--ai-brand, #023e8a);
color: var(--ai-accent, #f56668);
}
body.command-home #navbar .site-nav-login,
@ -2516,84 +2529,85 @@ body.command-home #navbar .site-nav-avatar:hover {
display: none;
}
/* Stripe / Linear 式主 CTA:放在输入台右下角原发送位(压过 .ai-ask__cta--solid 黑底) */
/* 开始寄件:描边胶囊,和实心珊瑚提问钮区分 */
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta {
position: static;
flex-shrink: 0;
gap: 7px;
min-height: 34px;
margin: 0;
padding: 0 14px 0 16px;
border: 1px solid color-mix(in srgb, var(--ai-accent, #f56668) 78%, #fff);
padding: 0 4px 0 14px;
border: 1.5px solid var(--ai-accent, #f56668);
border-radius: 999px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 48%),
var(--ai-accent, #f56668);
color: #fff;
background: #fff;
color: var(--ai-accent, #f56668);
font-size: 0.86rem;
font-weight: 700;
letter-spacing: 0.01em;
opacity: 1;
box-shadow:
0 1px 0 rgba(255, 255, 255, 0.22) inset,
0 1px 2px rgba(15, 23, 42, 0.06),
0 8px 20px rgba(var(--ai-accent-rgb, 245, 102, 104), 0.28);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
transform: translateY(0);
transition:
background 0.18s var(--ai-ease),
border-color 0.18s var(--ai-ease),
color 0.18s var(--ai-ease),
box-shadow 0.18s var(--ai-ease),
transform 0.18s var(--ai-ease);
}
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:hover,
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:focus-visible {
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 50%),
var(--ai-accent-hover, #e25557);
border-color: color-mix(in srgb, var(--ai-accent-hover, #e25557) 82%, #fff);
color: #fff;
background: color-mix(in srgb, var(--ai-accent, #f56668) 8%, #fff);
border-color: var(--ai-accent-hover, #e25557);
color: var(--ai-accent-hover, #e25557);
text-decoration: none;
box-shadow:
0 1px 0 rgba(255, 255, 255, 0.26) inset,
0 2px 4px rgba(15, 23, 42, 0.08),
0 12px 28px rgba(var(--ai-accent-rgb, 245, 102, 104), 0.36);
box-shadow: 0 2px 8px rgba(var(--ai-accent-rgb, 245, 102, 104), 0.16);
transform: translateY(-1px);
}
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:active {
transform: translateY(0);
box-shadow:
0 1px 0 rgba(255, 255, 255, 0.16) inset,
0 4px 12px rgba(var(--ai-accent-rgb, 245, 102, 104), 0.24);
background: color-mix(in srgb, var(--ai-accent, #f56668) 12%, #fff);
box-shadow: none;
}
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:focus-visible {
outline: none;
box-shadow:
0 1px 0 rgba(255, 255, 255, 0.26) inset,
0 0 0 3px color-mix(in srgb, var(--ai-accent, #f56668) 28%, transparent),
0 12px 28px rgba(var(--ai-accent-rgb, 245, 102, 104), 0.36);
0 0 0 3px color-mix(in srgb, var(--ai-accent, #f56668) 22%, transparent),
0 2px 8px rgba(var(--ai-accent-rgb, 245, 102, 104), 0.16);
}
.ai-welcome-cta__orb {
display: inline-flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: 50%;
background: var(--ai-accent, #f56668);
color: #fff;
transition:
transform 0.18s var(--ai-ease),
background 0.18s var(--ai-ease);
}
.ai-welcome-cta__arrow {
display: block;
flex-shrink: 0;
width: 15px;
height: 15px;
opacity: 0.92;
transition: transform 0.18s var(--ai-ease), opacity 0.18s var(--ai-ease);
width: 12px;
height: 12px;
}
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:hover .ai-welcome-cta__arrow,
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:focus-visible .ai-welcome-cta__arrow {
transform: translateX(3px);
opacity: 1;
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:hover .ai-welcome-cta__orb,
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:focus-visible .ai-welcome-cta__orb {
background: var(--ai-accent-hover, #e25557);
transform: translateX(2px);
}
@media (prefers-reduced-motion: reduce) {
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta,
.ai-welcome-cta__arrow {
.ai-welcome-cta__orb {
transition: none;
}
@ -2603,8 +2617,8 @@ body.command-home #navbar .site-nav-avatar:hover {
transform: none;
}
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:hover .ai-welcome-cta__arrow,
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:focus-visible .ai-welcome-cta__arrow {
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:hover .ai-welcome-cta__orb,
.ai-ask__cta.ai-ask__cta--solid.ai-welcome-cta:focus-visible .ai-welcome-cta__orb {
transform: none;
}
}
@ -5216,7 +5230,7 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
--ai-title-h: clamp(44px, min(8vw, 6vh), 52px);
}
body.command-home #header {
padding-top: env(safe-area-inset-top, 0px);
padding: 0;
}
body.command-home .ai-advisor-layout {
padding: calc(var(--ai-header-h) + env(safe-area-inset-top, 0px) + 4px)
@ -5321,7 +5335,7 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
}
body.command-home .site-nav-wordmark__tag {
max-width: 160px;
font-size: 0.58rem;
font-size: 0.48rem;
}
.ai-trust-bar__inner {
gap: 10px;

View File

@ -15,7 +15,8 @@
paymentQrLoading ||
brandLogoLoading ||
wechatNotifyLoading ||
wechatPayLoading
wechatPayLoading ||
alipayPayLoading
"
@click="refreshCurrent"
>
@ -522,6 +523,215 @@
</a-spin>
</div>
</a-tab-pane>
<a-tab-pane key="alipayPay" :title="t('system.otherConfig.paymentQr.tab.alipayPay')">
<div class="wx-pay-pane">
<a-spin :loading="alipayPayLoading">
<div class="wx-pay-pane__inner">
<header class="wx-pay-hero">
<div class="wx-pay-hero__main">
<div class="wx-pay-hero__title-row">
<h4 class="wx-pay-hero__title">
{{ t('system.otherConfig.paymentQr.alipayPay.panelTitle') }}
</h4>
<span
class="wx-pay-badge"
:class="alipayPayReady ? 'is-ready' : 'is-pending'"
>
{{
alipayPayReady
? t('system.otherConfig.paymentQr.alipayPay.statusReady')
: t('system.otherConfig.paymentQr.alipayPay.statusPending')
}}
</span>
</div>
<p class="wx-pay-hero__tip">
{{ t('system.otherConfig.paymentQr.alipayPay.tip') }}
</p>
<div class="wx-pay-checklist" aria-label="readiness">
<span
v-for="item in alipayPayChecklist"
:key="item.key"
class="wx-pay-check"
:class="item.ok ? 'is-ok' : 'is-miss'"
>
<i class="wx-pay-check__dot" aria-hidden="true" />
{{ item.label }}
</span>
</div>
</div>
<label class="wx-pay-enable">
<span class="wx-pay-enable__text">
<strong>{{ t('system.otherConfig.paymentQr.alipayPay.enabled') }}</strong>
<small>{{
alipayPayForm.enabled
? t('system.otherConfig.paymentQr.alipayPay.enabledOn')
: t('system.otherConfig.paymentQr.alipayPay.enabledOff')
}}</small>
</span>
<a-switch v-model="alipayPayForm.enabled" />
</label>
</header>
<div class="wx-pay-grid">
<section class="wx-pay-card">
<header class="wx-pay-card__head">
<strong>{{ t('system.otherConfig.paymentQr.alipayPay.sectionBasic') }}</strong>
<span>{{ t('system.otherConfig.paymentQr.alipayPay.sectionBasicHint') }}</span>
</header>
<a-form :model="alipayPayForm" layout="vertical" class="wx-pay-form">
<a-form-item
:label="t('system.otherConfig.paymentQr.alipayPay.appId')"
required
:validate-status="alipayPayErrors.appId ? 'error' : undefined"
:help="alipayPayErrors.appId"
>
<a-input
v-model="alipayPayForm.appId"
allow-clear
:placeholder="t('system.otherConfig.paymentQr.alipayPay.appIdPlaceholder')"
@input="alipayPayErrors.appId = ''"
/>
</a-form-item>
<a-form-item
:label="t('system.otherConfig.paymentQr.alipayPay.notifyUrl')"
required
:validate-status="alipayPayErrors.notifyUrl ? 'error' : undefined"
:help="alipayPayErrors.notifyUrl"
>
<div class="wx-pay-field-row">
<a-input
v-model="alipayPayForm.notifyUrl"
allow-clear
:placeholder="suggestedAlipayPayNotifyUrl"
@input="alipayPayErrors.notifyUrl = ''"
/>
<a-button class="wx-pay-field-row__btn" @click="fillAlipayPayNotifyUrl">
{{ t('system.otherConfig.paymentQr.alipayPay.fillNotify') }}
</a-button>
</div>
</a-form-item>
<a-form-item :label="t('system.otherConfig.paymentQr.alipayPay.returnUrl')">
<a-input
v-model="alipayPayForm.returnUrl"
allow-clear
:placeholder="t('system.otherConfig.paymentQr.alipayPay.returnUrlPlaceholder')"
/>
</a-form-item>
</a-form>
</section>
<section class="wx-pay-card">
<header class="wx-pay-card__head">
<strong>{{ t('system.otherConfig.paymentQr.alipayPay.sectionSecret') }}</strong>
<span>{{ t('system.otherConfig.paymentQr.alipayPay.sectionSecretHint') }}</span>
</header>
<a-form :model="alipayPayForm" layout="vertical" class="wx-pay-form">
<a-form-item>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.alipayPay.privateKeyPem') }}
<span
class="wx-pay-tag"
:class="alipayPayMeta.hasPrivateKey ? 'is-ok' : 'is-miss'"
>
{{
alipayPayMeta.hasPrivateKey
? t('system.otherConfig.paymentQr.alipayPay.hasKey')
: t('system.otherConfig.paymentQr.alipayPay.missingKey')
}}
</span>
</span>
</template>
<div class="wx-pay-pem-block">
<a-textarea
v-model="alipayPayForm.privateKeyPem"
class="wx-pay-pem"
:auto-size="{ minRows: 5, maxRows: 12 }"
:placeholder="
alipayPayMeta.hasPrivateKey
? t('system.otherConfig.paymentQr.alipayPay.privateKeyPlaceholder')
: t('system.otherConfig.paymentQr.alipayPay.privateKeyRequired')
"
/>
<div class="wx-pay-pem-actions">
<label class="wx-pay-file">
<input
type="file"
accept=".pem,.key,text/plain"
@change="onAlipayPayPrivateKeyFile"
/>
{{ t('system.otherConfig.paymentQr.alipayPay.importPem') }}
</label>
<button
v-if="alipayPayForm.privateKeyPem"
type="button"
class="wx-pay-link-btn"
@click="alipayPayForm.privateKeyPem = ''"
>
{{ t('system.otherConfig.paymentQr.alipayPay.clearPem') }}
</button>
</div>
</div>
</a-form-item>
<a-form-item>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.alipayPay.alipayPublicKey') }}
<span
class="wx-pay-tag"
:class="alipayPayMeta.hasAlipayPublicKey ? 'is-ok' : 'is-miss'"
>
{{
alipayPayMeta.hasAlipayPublicKey
? t('system.otherConfig.paymentQr.alipayPay.hasKey')
: t('system.otherConfig.paymentQr.alipayPay.missingKey')
}}
</span>
</span>
</template>
<a-textarea
v-model="alipayPayForm.alipayPublicKey"
class="wx-pay-pem"
:auto-size="{ minRows: 4, maxRows: 10 }"
:placeholder="
alipayPayMeta.hasAlipayPublicKey
? t('system.otherConfig.paymentQr.alipayPay.publicKeyPlaceholder')
: t('system.otherConfig.paymentQr.alipayPay.publicKeyRequired')
"
/>
</a-form-item>
</a-form>
</section>
</div>
<footer class="wx-pay-footer">
<div class="wx-pay-footer__hint">
<template v-if="alipayPayDirty">
{{ t('system.otherConfig.paymentQr.alipayPay.dirtyHint') }}
</template>
<template v-else>
{{ t('system.otherConfig.paymentQr.alipayPay.cleanHint') }}
</template>
</div>
<div class="wx-pay-footer__actions">
<a-button :disabled="!alipayPayDirty || alipayPaySaving" @click="resetAlipayPayForm">
{{ t('system.otherConfig.paymentQr.alipayPay.reset') }}
</a-button>
<a-button
type="primary"
class="app-btn-primary-soft"
:loading="alipayPaySaving"
:disabled="!alipayPayDirty"
@click="handleAlipayPaySave"
>
{{ t('system.otherConfig.paymentQr.alipayPay.save') }}
</a-button>
</div>
</footer>
</div>
</a-spin>
</div>
</a-tab-pane>
</a-tabs>
<a-modal
v-model:visible="bankAccountFormVisible"
@ -721,7 +931,7 @@
</span>
</template>
<template v-else>
<span class="brand-logo-card__mark">LOGO</span>
<span class="brand-logo-card__mark">BCDship</span>
<span class="brand-logo-card__hint">
{{ t('system.otherConfig.brandLogo.dropUpload') }}
</span>
@ -1371,6 +1581,10 @@ import {
getWeChatPayMerchantConfig,
saveWeChatPayMerchantConfig,
} from '@/api/recharge/wechatPay'
import {
getAlipayPayMerchantConfig,
saveAlipayPayMerchantConfig,
} from '@/api/recharge/alipayPay'
import {
brandLogoImages,
clearCachedBrandImage,
@ -1831,7 +2045,12 @@ async function selectOpsPanel(key: OpsPanelKey) {
editingId.value = undefined
if (key === 'paymentQr') {
paymentQrTab.value = 'qr'
await Promise.all([loadPaymentQr(), loadBankAccounts(), loadWechatPayMerchant()])
await Promise.all([
loadPaymentQr(),
loadBankAccounts(),
loadWechatPayMerchant(),
loadAlipayPayMerchant(),
])
return
}
if (key === 'brandLogo') {
@ -1878,7 +2097,16 @@ async function refreshCurrent() {
await loadWechatPayMerchant()
return
}
await Promise.all([loadPaymentQr(), loadBankAccounts(), loadWechatPayMerchant()])
if (paymentQrTab.value === 'alipayPay') {
await loadAlipayPayMerchant()
return
}
await Promise.all([
loadPaymentQr(),
loadBankAccounts(),
loadWechatPayMerchant(),
loadAlipayPayMerchant(),
])
return
}
if (activePanel.value === 'brandLogo') {
@ -1974,9 +2202,36 @@ async function loadPaymentQr() {
}
}
const paymentQrTab = ref<'qr' | 'bank' | 'wechatPay'>('qr')
const paymentQrTab = ref<'qr' | 'bank' | 'wechatPay' | 'alipayPay'>('qr')
const wechatPayLoading = ref(false)
const wechatPaySaving = ref(false)
const alipayPayLoading = ref(false)
const alipayPaySaving = ref(false)
const alipayPayMeta = reactive({
configured: false,
hasPrivateKey: false,
hasAlipayPublicKey: false,
})
const alipayPayForm = reactive({
enabled: false,
appId: '',
notifyUrl: '',
returnUrl: '',
privateKeyPem: '',
alipayPublicKey: '',
})
const alipayPaySnapshot = reactive({
enabled: false,
appId: '',
notifyUrl: '',
returnUrl: '',
privateKeyPem: '',
alipayPublicKey: '',
})
const alipayPayErrors = reactive({
appId: '',
notifyUrl: '',
})
const wechatPayMeta = reactive({
configured: false,
hasApiV3Key: false,
@ -2226,12 +2481,178 @@ async function handleWechatPaySave() {
}
}
const suggestedAlipayPayNotifyUrl = computed(() => {
const origin = String(prodApiOrigin() || '').replace(/\/$/, '')
return origin ? `${origin}/pay/alipay/notify` : 'https://api.example.com/pay/alipay/notify'
})
const alipayPayDirty = computed(() => {
return (
alipayPayForm.enabled !== alipayPaySnapshot.enabled ||
alipayPayForm.appId !== alipayPaySnapshot.appId ||
alipayPayForm.notifyUrl !== alipayPaySnapshot.notifyUrl ||
alipayPayForm.returnUrl !== alipayPaySnapshot.returnUrl ||
alipayPayForm.privateKeyPem !== alipayPaySnapshot.privateKeyPem ||
alipayPayForm.alipayPublicKey !== alipayPaySnapshot.alipayPublicKey
)
})
const alipayPayReady = computed(() => {
return (
alipayPayForm.enabled &&
!!alipayPayForm.appId.trim() &&
!!alipayPayForm.notifyUrl.trim() &&
(alipayPayMeta.hasPrivateKey || !!alipayPayForm.privateKeyPem.trim()) &&
(alipayPayMeta.hasAlipayPublicKey || !!alipayPayForm.alipayPublicKey.trim())
)
})
const alipayPayChecklist = computed(() => [
{
key: 'appId',
ok: !!alipayPayForm.appId.trim(),
label: t('system.otherConfig.paymentQr.alipayPay.checkAppId'),
},
{
key: 'notify',
ok: !!alipayPayForm.notifyUrl.trim(),
label: t('system.otherConfig.paymentQr.alipayPay.checkNotify'),
},
{
key: 'secret',
ok:
(alipayPayMeta.hasPrivateKey || !!alipayPayForm.privateKeyPem.trim()) &&
(alipayPayMeta.hasAlipayPublicKey || !!alipayPayForm.alipayPublicKey.trim()),
label: t('system.otherConfig.paymentQr.alipayPay.checkSecret'),
},
])
function applyAlipayPaySnapshot() {
alipayPaySnapshot.enabled = alipayPayForm.enabled
alipayPaySnapshot.appId = alipayPayForm.appId
alipayPaySnapshot.notifyUrl = alipayPayForm.notifyUrl
alipayPaySnapshot.returnUrl = alipayPayForm.returnUrl
alipayPaySnapshot.privateKeyPem = alipayPayForm.privateKeyPem
alipayPaySnapshot.alipayPublicKey = alipayPayForm.alipayPublicKey
}
function fillAlipayPayNotifyUrl() {
alipayPayForm.notifyUrl = suggestedAlipayPayNotifyUrl.value
alipayPayErrors.notifyUrl = ''
}
function resetAlipayPayForm() {
alipayPayForm.enabled = alipayPaySnapshot.enabled
alipayPayForm.appId = alipayPaySnapshot.appId
alipayPayForm.notifyUrl = alipayPaySnapshot.notifyUrl
alipayPayForm.returnUrl = alipayPaySnapshot.returnUrl
alipayPayForm.privateKeyPem = alipayPaySnapshot.privateKeyPem
alipayPayForm.alipayPublicKey = alipayPaySnapshot.alipayPublicKey
alipayPayErrors.appId = ''
alipayPayErrors.notifyUrl = ''
}
async function onAlipayPayPrivateKeyFile(ev: Event) {
const input = ev.target as HTMLInputElement
const file = input.files?.[0]
input.value = ''
if (!file) return
try {
const text = await file.text()
alipayPayForm.privateKeyPem = text.trim()
Message.success(t('system.otherConfig.paymentQr.alipayPay.pemImported'))
} catch {
Message.error(t('system.otherConfig.paymentQr.alipayPay.pemReadFailed'))
}
}
async function loadAlipayPayMerchant() {
alipayPayLoading.value = true
try {
const cfg = await getAlipayPayMerchantConfig()
alipayPayForm.enabled = cfg.enabled
alipayPayForm.appId = cfg.appId
alipayPayForm.notifyUrl = cfg.notifyUrl
alipayPayForm.returnUrl = cfg.returnUrl
alipayPayForm.privateKeyPem = ''
alipayPayForm.alipayPublicKey = ''
alipayPayMeta.configured = cfg.configured
alipayPayMeta.hasPrivateKey = cfg.hasPrivateKey
alipayPayMeta.hasAlipayPublicKey = cfg.hasAlipayPublicKey
alipayPayErrors.appId = ''
alipayPayErrors.notifyUrl = ''
applyAlipayPaySnapshot()
} catch (e) {
Message.error(extractOmsRequestError(e) || t('system.otherConfig.paymentQr.alipayPay.loadFailed'))
} finally {
alipayPayLoading.value = false
}
}
function validateAlipayPayForm(): boolean {
let ok = true
alipayPayErrors.appId = ''
alipayPayErrors.notifyUrl = ''
if (!alipayPayForm.appId.trim()) {
alipayPayErrors.appId = t('system.otherConfig.paymentQr.alipayPay.needAppId')
ok = false
}
if (!alipayPayForm.notifyUrl.trim()) {
alipayPayErrors.notifyUrl = t('system.otherConfig.paymentQr.alipayPay.needNotify')
ok = false
} else if (!/^https:\/\//i.test(alipayPayForm.notifyUrl.trim())) {
alipayPayErrors.notifyUrl = t('system.otherConfig.paymentQr.alipayPay.needHttps')
ok = false
}
if (!alipayPayMeta.hasPrivateKey && !alipayPayForm.privateKeyPem.trim()) {
Message.warning(t('system.otherConfig.paymentQr.alipayPay.needPrivateKey'))
ok = false
}
if (!alipayPayMeta.hasAlipayPublicKey && !alipayPayForm.alipayPublicKey.trim()) {
Message.warning(t('system.otherConfig.paymentQr.alipayPay.needPublicKey'))
ok = false
}
return ok
}
async function handleAlipayPaySave() {
if (!validateAlipayPayForm()) return
alipayPaySaving.value = true
try {
const cfg = await saveAlipayPayMerchantConfig({
enabled: alipayPayForm.enabled,
appId: alipayPayForm.appId.trim(),
notifyUrl: alipayPayForm.notifyUrl.trim() || undefined,
returnUrl: alipayPayForm.returnUrl.trim() || undefined,
privateKeyPem: alipayPayForm.privateKeyPem.trim() || undefined,
alipayPublicKey: alipayPayForm.alipayPublicKey.trim() || undefined,
})
alipayPayForm.privateKeyPem = ''
alipayPayForm.alipayPublicKey = ''
alipayPayForm.enabled = cfg.enabled
alipayPayForm.appId = cfg.appId
alipayPayForm.notifyUrl = cfg.notifyUrl
alipayPayForm.returnUrl = cfg.returnUrl
alipayPayMeta.configured = cfg.configured
alipayPayMeta.hasPrivateKey = cfg.hasPrivateKey
alipayPayMeta.hasAlipayPublicKey = cfg.hasAlipayPublicKey
applyAlipayPaySnapshot()
Message.success(t('system.otherConfig.paymentQr.alipayPay.saveSuccess'))
} catch (e) {
Message.error(extractOmsRequestError(e) || t('system.otherConfig.paymentQr.alipayPay.saveFailed'))
} finally {
alipayPaySaving.value = false
}
}
async function onPaymentQrTabChange(key: string | number) {
const k = String(key)
if (k === 'bank') {
await loadBankAccounts()
} else if (k === 'wechatPay') {
await loadWechatPayMerchant()
} else if (k === 'alipayPay') {
await loadAlipayPayMerchant()
}
}

View File

@ -102,6 +102,18 @@
<p class="pay-desc">{{ $t('user.recharge.deposit.payment.wechatOnlineDesc') }}</p>
</div>
</button>
<button
type="button"
class="pay-card pay-card--featured"
:class="{ active: payType === 'zfbOnline' }"
@click="payType = 'zfbOnline'"
>
<img :src="zfbIcon" :alt="$t('user.recharge.deposit.payment.alipayOnline')" />
<div class="pay-card__text">
<p class="pay-name">{{ $t('user.recharge.deposit.payment.alipayOnline') }}</p>
<p class="pay-desc">{{ $t('user.recharge.deposit.payment.alipayOnlineDesc') }}</p>
</div>
</button>
</div>
</div>
@ -154,7 +166,10 @@
</div>
</div>
<div class="pay-guide" :class="payType === 'wxOnline' ? 'is-instant' : 'is-review'">
<div
class="pay-guide"
:class="isOnlinePayType ? 'is-instant' : 'is-review'"
>
<strong>{{ selectedPayGuideTitle }}</strong>
<p>{{ selectedPayGuideBody }}</p>
</div>
@ -225,6 +240,18 @@
</ol>
<p class="online-guide-card__foot">{{ $t('user.recharge.deposit.form.wxOnlineHint') }}</p>
</div>
<div v-else-if="payType === 'zfbOnline'" class="online-guide-card">
<div class="online-guide-card__icon" aria-hidden="true">
<img :src="zfbIcon" alt="" />
</div>
<p class="online-guide-card__title">{{ $t('user.recharge.deposit.form.zfbOnlinePanelTitle') }}</p>
<ol class="online-guide-card__steps">
<li>{{ $t('user.recharge.deposit.form.zfbOnlineStep1') }}</li>
<li>{{ $t('user.recharge.deposit.form.zfbOnlineStep2') }}</li>
<li>{{ $t('user.recharge.deposit.form.zfbOnlineStep3') }}</li>
</ol>
<p class="online-guide-card__foot">{{ $t('user.recharge.deposit.form.zfbOnlineHint') }}</p>
</div>
<div v-else class="voucher-qr-panel">
<p class="side-panel-caption">
{{
@ -249,16 +276,35 @@
</div>
</div>
<div v-if="current === 1 && payType === 'wxOnline'" class="form-block form-block--wx-online">
<p class="block-title">{{ $t('user.recharge.deposit.form.wxOnlineScan') }}</p>
<div
v-if="current === 1 && isOnlinePayType"
class="form-block form-block--wx-online"
>
<p class="block-title">
{{
payType === 'zfbOnline'
? $t('user.recharge.deposit.form.zfbOnlineScan')
: $t('user.recharge.deposit.form.wxOnlineScan')
}}
</p>
<div class="wx-online-panel">
<div v-if="wxOnlineQrDataUrl" class="wx-online-qr">
<img :src="wxOnlineQrDataUrl" alt="wechat-pay-qr" />
<div v-if="onlineQrDataUrl" class="wx-online-qr">
<img :src="onlineQrDataUrl" :alt="payType === 'zfbOnline' ? 'alipay-pay-qr' : 'wechat-pay-qr'" />
</div>
<a-spin v-else :loading="wxOnlineCreating" />
<p class="wx-online-tip">{{ $t('user.recharge.deposit.form.wxOnlineWaiting') }}</p>
<p v-if="wxOnlineOutTradeNo" class="wx-online-no">
{{ $t('user.recharge.deposit.form.wxOnlineOrderNo', { no: wxOnlineOutTradeNo }) }}
<a-spin v-else :loading="onlineCreating" />
<p class="wx-online-tip">
{{
payType === 'zfbOnline'
? $t('user.recharge.deposit.form.zfbOnlineWaiting')
: $t('user.recharge.deposit.form.wxOnlineWaiting')
}}
</p>
<p v-if="onlineOutTradeNo" class="wx-online-no">
{{
payType === 'zfbOnline'
? $t('user.recharge.deposit.form.zfbOnlineOrderNo', { no: onlineOutTradeNo })
: $t('user.recharge.deposit.form.wxOnlineOrderNo', { no: onlineOutTradeNo })
}}
</p>
</div>
</div>
@ -300,14 +346,14 @@
</div>
<div v-if="current < 2" class="action-row">
<a-button v-if="current === 1 && payType === 'wxOnline'" :loading="wxOnlineClosing" @click="cancelWxOnlinePay">
<a-button v-if="current === 1 && isOnlinePayType" :loading="onlineClosing" @click="cancelOnlinePay">
{{ $t('user.recharge.deposit.actions.cancelPay') }}
</a-button>
<a-button v-else-if="current === 1" @click="current--">
{{ $t('user.recharge.deposit.actions.prevStep') }}
</a-button>
<a-button
v-if="current === 1 && payType !== 'wxOnline'"
v-if="current === 1 && !isOnlinePayType"
type="primary"
:loading="submitting"
@click="submit"
@ -317,11 +363,11 @@
<a-button
v-if="current === 0"
type="primary"
:loading="wxOnlineCreating"
:loading="onlineCreating"
@click="handleNext"
>
{{
payType === 'wxOnline'
isOnlinePayType
? $t('user.recharge.deposit.actions.createPay')
: $t('user.recharge.deposit.actions.nextStep')
}}
@ -356,7 +402,12 @@ import {
closeWeChatPay,
createWeChatPay,
getWeChatPayStatus,
} from '@/api/recharge/wechatPay';
} from '@/api/recharge/wechatPay'
import {
closeAlipayPay,
createAlipayPay,
getAlipayPayStatus,
} from '@/api/recharge/alipayPay'
import { loadPaymentReceiveQrUrls } from '@/utils/paymentReceiveQr';
const { t } = useI18n();
@ -385,18 +436,21 @@ const draftCustomAmount = ref<number | undefined>(undefined);
const customAmountVisible = ref(false);
const customAmountInputRef = ref<{ focus?: () => void } | null>(null);
const lastPresetAmount = ref(500);
const payType = ref<'wxOnline' | 'zfb' | 'wx' | 'bank'>('wxOnline');
const payType = ref<'wxOnline' | 'zfbOnline' | 'zfb' | 'wx' | 'bank'>('wxOnline');
const payerName = ref('');
const transferSerial = ref('');
const fileList = ref<any[]>([]);
const screenshotFile = ref<File | null>(null);
const previewUrl = ref('');
const submitting = ref(false);
const wxOnlineCreating = ref(false);
const wxOnlineClosing = ref(false);
const wxOnlineOutTradeNo = ref('');
const wxOnlineQrDataUrl = ref('');
let wxOnlinePollTimer: ReturnType<typeof setInterval> | null = null;
const onlineCreating = ref(false);
const onlineClosing = ref(false);
const onlineOutTradeNo = ref('');
const onlineQrDataUrl = ref('');
let onlinePollTimer: ReturnType<typeof setInterval> | null = null;
const isOnlinePayType = computed(
() => payType.value === 'wxOnline' || payType.value === 'zfbOnline',
);
function payTypeCode(): 1 | 2 | 3 {
if (payType.value === 'zfb') return 2;
@ -449,19 +503,21 @@ const customAmountLabel = computed(() => {
const selectedPayGuideTitle = computed(() => {
if (payType.value === 'wxOnline') return t('user.recharge.deposit.guide.onlineTitle');
if (payType.value === 'zfbOnline') return t('user.recharge.deposit.guide.alipayOnlineTitle');
if (payType.value === 'bank') return t('user.recharge.deposit.guide.bankTitle');
return t('user.recharge.deposit.guide.voucherTitle');
});
const selectedPayGuideBody = computed(() => {
if (payType.value === 'wxOnline') return t('user.recharge.deposit.guide.onlineBody');
if (payType.value === 'zfbOnline') return t('user.recharge.deposit.guide.alipayOnlineBody');
if (payType.value === 'bank') return t('user.recharge.deposit.guide.bankBody');
if (payType.value === 'zfb') return t('user.recharge.deposit.guide.alipayBody');
return t('user.recharge.deposit.guide.wechatVoucherBody');
});
const tipsStripText = computed(() => {
if (payType.value === 'wxOnline') return t('user.recharge.deposit.tips.online');
if (isOnlinePayType.value) return t('user.recharge.deposit.tips.online');
if (payType.value === 'bank') return t('user.recharge.deposit.tips.bank');
return t('user.recharge.deposit.tips.voucher');
});
@ -506,36 +562,51 @@ function cancelCustomAmount() {
}
}
function stopWxOnlinePoll() {
if (wxOnlinePollTimer) {
clearInterval(wxOnlinePollTimer);
wxOnlinePollTimer = null;
function stopOnlinePoll() {
if (onlinePollTimer) {
clearInterval(onlinePollTimer);
onlinePollTimer = null;
}
}
async function startWxOnlinePoll(outTradeNo: string) {
stopWxOnlinePoll();
async function startOnlinePoll(outTradeNo: string, channel: 'wx' | 'zfb') {
stopOnlinePoll();
const tick = async () => {
try {
const status = await getWeChatPayStatus(outTradeNo);
const status =
channel === 'zfb'
? await getAlipayPayStatus(outTradeNo)
: await getWeChatPayStatus(outTradeNo);
if (status.status === 'Success' || status.statusCode === 3) {
stopWxOnlinePoll();
Message.success(t('user.recharge.deposit.message.wxOnlinePaid'));
stopOnlinePoll();
Message.success(
t(
channel === 'zfb'
? 'user.recharge.deposit.message.zfbOnlinePaid'
: 'user.recharge.deposit.message.wxOnlinePaid',
),
);
current.value = 2;
} else if (status.status === 'Closed' || status.status === 'Failed') {
stopWxOnlinePoll();
Message.warning(t('user.recharge.deposit.message.wxOnlineClosed'));
stopOnlinePoll();
Message.warning(
t(
channel === 'zfb'
? 'user.recharge.deposit.message.zfbOnlineClosed'
: 'user.recharge.deposit.message.wxOnlineClosed',
),
);
}
} catch {
/* 轮询失败忽略,下一轮重试 */
}
};
await tick();
wxOnlinePollTimer = setInterval(tick, 2000);
onlinePollTimer = setInterval(tick, 2000);
}
async function startWxOnlinePay() {
wxOnlineCreating.value = true;
onlineCreating.value = true;
try {
const created = await createWeChatPay({
rechargeAmount: Number(finalAmount.value),
@ -544,32 +615,61 @@ async function startWxOnlinePay() {
if (!created.codeUrl) {
throw new Error(t('user.recharge.deposit.message.wxOnlineNoCode'));
}
wxOnlineOutTradeNo.value = created.outTradeNo;
wxOnlineQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
onlineOutTradeNo.value = created.outTradeNo;
onlineQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
width: 220,
margin: 1,
});
current.value = 1;
await startWxOnlinePoll(created.outTradeNo);
await startOnlinePoll(created.outTradeNo, 'wx');
} catch (error: any) {
Message.error(error?.message || t('user.recharge.deposit.message.wxOnlineCreateFailed'));
} finally {
wxOnlineCreating.value = false;
onlineCreating.value = false;
}
}
async function cancelWxOnlinePay() {
stopWxOnlinePoll();
const outTradeNo = wxOnlineOutTradeNo.value;
wxOnlineClosing.value = true;
async function startZfbOnlinePay() {
onlineCreating.value = true;
try {
const created = await createAlipayPay({
rechargeAmount: Number(finalAmount.value),
scene: 'precreate',
});
if (!created.codeUrl) {
throw new Error(t('user.recharge.deposit.message.zfbOnlineNoCode'));
}
onlineOutTradeNo.value = created.outTradeNo;
onlineQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
width: 220,
margin: 1,
});
current.value = 1;
await startOnlinePoll(created.outTradeNo, 'zfb');
} catch (error: any) {
Message.error(error?.message || t('user.recharge.deposit.message.zfbOnlineCreateFailed'));
} finally {
onlineCreating.value = false;
}
}
async function cancelOnlinePay() {
stopOnlinePoll();
const outTradeNo = onlineOutTradeNo.value;
const channel = payType.value === 'zfbOnline' ? 'zfb' : 'wx';
onlineClosing.value = true;
try {
if (outTradeNo) {
await closeWeChatPay(outTradeNo).catch(() => undefined);
if (channel === 'zfb') {
await closeAlipayPay(outTradeNo).catch(() => undefined);
} else {
await closeWeChatPay(outTradeNo).catch(() => undefined);
}
}
} finally {
wxOnlineClosing.value = false;
wxOnlineOutTradeNo.value = '';
wxOnlineQrDataUrl.value = '';
onlineClosing.value = false;
onlineOutTradeNo.value = '';
onlineQrDataUrl.value = '';
current.value = 0;
}
}
@ -590,6 +690,10 @@ const handleNext = async () => {
await startWxOnlinePay();
return;
}
if (payType.value === 'zfbOnline') {
await startZfbOnlinePay();
return;
}
current.value++;
};
@ -663,7 +767,7 @@ const submit = async () => {
};
const reset = () => {
stopWxOnlinePoll();
stopOnlinePoll();
current.value = 0;
rechargeAmount.value = 500;
lastPresetAmount.value = 500;
@ -675,8 +779,8 @@ const reset = () => {
transferSerial.value = '';
fileList.value = [];
screenshotFile.value = null;
wxOnlineOutTradeNo.value = '';
wxOnlineQrDataUrl.value = '';
onlineOutTradeNo.value = '';
onlineQrDataUrl.value = '';
if (previewUrl.value.startsWith('blob:')) {
URL.revokeObjectURL(previewUrl.value);
}
@ -700,7 +804,7 @@ onMounted(async () => {
});
onBeforeUnmount(() => {
stopWxOnlinePoll();
stopOnlinePoll();
});
</script>