test #37

Merged
zzh merged 3 commits from test into master 2026-12-04 17:42:36 +08:00
34 changed files with 3751 additions and 1059 deletions

View File

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

View File

@ -13,10 +13,10 @@
"dev": "vite", "dev": "vite",
"dev:test": "vite --mode bcdship-test", "dev:test": "vite --mode bcdship-test",
"dev:nanafa": "vite --mode nanafa", "dev:nanafa": "vite --mode nanafa",
"build": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=8192 node_modules/vite/bin/vite.js build", "build": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=6144 node_modules/vite/bin/vite.js build",
"build:prod": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=8192 node_modules/vite/bin/vite.js build --mode production", "build:prod": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=6144 node_modules/vite/bin/vite.js build --mode production",
"build:test": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=8192 node_modules/vite/bin/vite.js build --mode bcdship-test", "build:test": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=6144 node_modules/vite/bin/vite.js build --mode bcdship-test",
"build:nanafa": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=8192 node_modules/vite/bin/vite.js build --mode nanafa", "build:nanafa": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=6144 node_modules/vite/bin/vite.js build --mode nanafa",
"postbuild": "node scripts/postbuild-cleanup-dist.js", "postbuild": "node scripts/postbuild-cleanup-dist.js",
"report": "cross-env REPORT=true pnpm run build", "report": "cross-env REPORT=true pnpm run build",
"preview": "npm run build && vite preview --host", "preview": "npm run build && vite preview --host",

View File

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

View File

@ -0,0 +1,209 @@
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
/** 是否使用账户余额抵扣,默认 true */
useBalance?: boolean
returnUrl?: string
}) {
const res = await axiosInstance.post(omsUrl('/order/pay/alipay/create'), {
orderIds: params.orderIds,
couponByOrderId: params.couponByOrderId,
scene: params.scene,
useBalance: params.useBalance !== false,
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

@ -135,6 +135,8 @@ export async function createOrderWeChatPay(params: {
orderIds: number[] orderIds: number[]
couponByOrderId?: Record<number, number | null> couponByOrderId?: Record<number, number | null>
scene: WeChatPayScene scene: WeChatPayScene
/** 是否使用账户余额抵扣,默认 true */
useBalance?: boolean
oauthCode?: string oauthCode?: string
}) { }) {
const headers: Record<string, string> = {} const headers: Record<string, string> = {}
@ -147,6 +149,7 @@ export async function createOrderWeChatPay(params: {
orderIds: params.orderIds, orderIds: params.orderIds,
couponByOrderId: params.couponByOrderId, couponByOrderId: params.couponByOrderId,
scene: params.scene, scene: params.scene,
useBalance: params.useBalance !== false,
oauthCode: params.oauthCode, oauthCode: params.oauthCode,
}, },
{ headers }, { headers },
@ -191,9 +194,11 @@ export interface WeChatPayMerchantConfig {
enabled: boolean enabled: boolean
mchId: string mchId: string
mchSerialNo: string mchSerialNo: string
platformPublicKeyId: string
notifyUrl: string notifyUrl: string
hasApiV3Key: boolean hasApiV3Key: boolean
hasPrivateKey: boolean hasPrivateKey: boolean
hasPlatformPublicKey: boolean
appId?: string appId?: string
} }
@ -205,9 +210,11 @@ export async function getWeChatPayMerchantConfig(): Promise<WeChatPayMerchantCon
enabled: Boolean(data?.enabled ?? data?.Enabled), enabled: Boolean(data?.enabled ?? data?.Enabled),
mchId: String(data?.mchId ?? data?.MchId ?? ''), mchId: String(data?.mchId ?? data?.MchId ?? ''),
mchSerialNo: String(data?.mchSerialNo ?? data?.MchSerialNo ?? ''), mchSerialNo: String(data?.mchSerialNo ?? data?.MchSerialNo ?? ''),
platformPublicKeyId: String(data?.platformPublicKeyId ?? data?.PlatformPublicKeyId ?? ''),
notifyUrl: String(data?.notifyUrl ?? data?.NotifyUrl ?? ''), notifyUrl: String(data?.notifyUrl ?? data?.NotifyUrl ?? ''),
hasApiV3Key: Boolean(data?.hasApiV3Key ?? data?.HasApiV3Key), hasApiV3Key: Boolean(data?.hasApiV3Key ?? data?.HasApiV3Key),
hasPrivateKey: Boolean(data?.hasPrivateKey ?? data?.HasPrivateKey), hasPrivateKey: Boolean(data?.hasPrivateKey ?? data?.HasPrivateKey),
hasPlatformPublicKey: Boolean(data?.hasPlatformPublicKey ?? data?.HasPlatformPublicKey),
appId: (data?.appId ?? data?.AppId) || undefined, appId: (data?.appId ?? data?.AppId) || undefined,
} }
} }
@ -216,9 +223,11 @@ export async function saveWeChatPayMerchantConfig(payload: {
enabled: boolean enabled: boolean
mchId: string mchId: string
mchSerialNo: string mchSerialNo: string
platformPublicKeyId: string
notifyUrl?: string notifyUrl?: string
apiV3Key?: string apiV3Key?: string
privateKeyPem?: string privateKeyPem?: string
platformPublicKeyPem?: string
}) { }) {
const res = await axiosInstance.post( const res = await axiosInstance.post(
omsUrl('/system/other-config/wechat-pay-merchant/save'), omsUrl('/system/other-config/wechat-pay-merchant/save'),

View File

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

View File

@ -926,46 +926,38 @@
} }
function applyLiquidFieldStyle(el: HTMLElement, focused = false) { function applyLiquidFieldStyle(el: HTMLElement, focused = false) {
// 与工作台卡片同款磨砂玻璃 token(内联 !important 压过 UA / HOT 默认边框) // 软胶囊:白底细边(内联 !important 压过 UA / HOT 默认边框)
el.style.setProperty('width', '100%', 'important'); el.style.setProperty('width', '100%', 'important');
el.style.setProperty('min-width', '0', 'important'); el.style.setProperty('min-width', '0', 'important');
el.style.setProperty('max-width', '100%', 'important'); el.style.setProperty('max-width', '100%', 'important');
el.style.setProperty('height', '26px', 'important'); el.style.setProperty('height', '28px', 'important');
el.style.setProperty('padding', '0 10px', 'important'); el.style.setProperty('padding', '0 12px', 'important');
el.style.setProperty('margin', '0', 'important'); el.style.setProperty('margin', '0', 'important');
el.style.setProperty('border-width', '1px', 'important'); el.style.setProperty('border-width', '1px', 'important');
el.style.setProperty('border-style', 'solid', 'important'); el.style.setProperty('border-style', 'solid', 'important');
el.style.setProperty( el.style.setProperty(
'border-color', 'border-color',
focused focused
? 'color-mix(in srgb, var(--app-primary-color) 22%, var(--app-acrylic-border-strong, rgba(255,255,255,0.92)))' ? 'color-mix(in srgb, var(--app-primary-color) 32%, rgba(26, 46, 56, 0.1))'
: 'var(--app-acrylic-border, rgba(255, 255, 255, 0.72))', : 'rgba(26, 46, 56, 0.07)',
'important' 'important'
); );
el.style.setProperty('border-radius', '12px', 'important'); el.style.setProperty('border-radius', '999px', 'important');
el.style.setProperty('outline', 'none', 'important'); el.style.setProperty('outline', 'none', 'important');
el.style.setProperty('box-sizing', 'border-box', 'important'); el.style.setProperty('box-sizing', 'border-box', 'important');
el.style.setProperty( el.style.setProperty(
'background', 'background',
focused focused
? 'var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44))' ? 'color-mix(in srgb, #fff 55%, var(--color-fill-2, #f2f3f5))'
: 'var(--app-acrylic-bg, rgba(255, 255, 255, 0.32))', : 'color-mix(in srgb, #fff 28%, var(--color-fill-2, #f2f3f5))',
'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%))',
'important' 'important'
); );
el.style.setProperty('backdrop-filter', 'none', 'important');
el.style.setProperty('-webkit-backdrop-filter', 'none', 'important');
el.style.setProperty( el.style.setProperty(
'box-shadow', 'box-shadow',
focused 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', : 'none',
'important' 'important'
); );
@ -975,13 +967,14 @@
'important' 'important'
); );
el.style.setProperty('font-size', '12px', 'important'); el.style.setProperty('font-size', '12px', 'important');
el.style.setProperty('font-weight', '500', 'important'); el.style.setProperty('font-weight', '450', 'important');
el.style.setProperty('line-height', '24px', '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('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('-webkit-appearance', 'none', 'important');
el.style.setProperty('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') { if (el.tagName === 'BUTTON') {
el.style.setProperty('cursor', 'pointer', 'important'); el.style.setProperty('cursor', 'pointer', 'important');
el.style.setProperty('text-align', 'left', 'important'); el.style.setProperty('text-align', 'left', 'important');
@ -3460,7 +3453,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0; gap: 0;
min-height: 28px; min-height: 30px;
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
min-width: 0; min-width: 0;
@ -3486,38 +3479,37 @@
width: 100% !important; width: 100% !important;
min-width: 0 !important; min-width: 0 !important;
max-width: 100%; max-width: 100%;
height: 26px !important; height: 28px !important;
padding: 0 10px !important; padding: 0 12px !important;
/* 工作台卡片同款:磨砂玻璃 + 亮边 */ /* 软胶囊:白底细边,比表头毛玻璃更干净 */
border-radius: 12px !important; border-radius: 999px !important;
border-width: 1px !important; border: 1px solid rgba(26, 46, 56, 0.07) !important;
border-style: solid !important; background: color-mix(in srgb, #fff 28%, var(--color-fill-2, #f2f3f5)) !important;
border-color: var(--app-acrylic-border, rgba(255, 255, 255, 0.72)) !important; backdrop-filter: none;
background: var(--app-acrylic-bg, rgba(255, 255, 255, 0.32)) !important; -webkit-backdrop-filter: none;
backdrop-filter: var(--app-acrylic-blur, blur(28px) saturate(160%));
-webkit-backdrop-filter: var(--app-acrylic-blur, blur(28px) saturate(160%));
box-shadow: none !important; box-shadow: none !important;
font-size: 12px !important; font-size: 12px !important;
font-weight: 500 !important; font-weight: 450 !important;
line-height: 24px !important; letter-spacing: -0.01em;
line-height: 26px !important;
color: var(--color-text-2) !important; color: var(--color-text-2) !important;
outline: none !important; outline: none !important;
box-sizing: border-box !important; box-sizing: border-box !important;
text-align: left; text-align: left;
caret-color: var(--app-primary-color, #054f74); caret-color: var(--app-primary-color, #1d7281);
-webkit-appearance: none !important; -webkit-appearance: none !important;
appearance: none !important; appearance: none !important;
transition: transition:
border-color 0.2s ease, border-color 0.15s ease,
background 0.2s ease, background 0.15s ease,
color 0.2s ease, color 0.15s ease,
box-shadow 0.2s ease; box-shadow 0.15s ease;
} }
:deep(.ht-header-hybrid-input) { :deep(.ht-header-hybrid-input) {
&:hover { &:hover {
border-color: var(--app-acrylic-border-strong, rgba(255, 255, 255, 0.92)) !important; border-color: rgba(26, 46, 56, 0.12) !important;
background: var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44)) !important; background: color-mix(in srgb, #fff 42%, var(--color-fill-2, #f2f3f5)) !important;
box-shadow: none !important; box-shadow: none !important;
} }
@ -3526,16 +3518,16 @@
color: var(--color-text-1) !important; color: var(--color-text-1) !important;
border-color: color-mix( border-color: color-mix(
in srgb, in srgb,
var(--app-primary-color) 22%, var(--app-primary-color) 32%,
var(--app-acrylic-border-strong, rgba(255, 255, 255, 0.92)) rgba(26, 46, 56, 0.1)
) !important; ) !important;
background: var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44)) !important; background: color-mix(in srgb, #fff 55%, var(--color-fill-2, #f2f3f5)) !important;
box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary-color) 16%, transparent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary-color) 12%, transparent) !important;
} }
&::placeholder { &::placeholder {
color: var(--color-text-3) !important; color: rgba(26, 46, 56, 0.38) !important;
font-weight: 500; font-weight: 450;
opacity: 1; opacity: 1;
} }
} }
@ -3545,7 +3537,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
color: var(--color-text-3) !important; color: rgba(26, 46, 56, 0.42) !important;
&.has-value { &.has-value {
color: var(--color-text-2) !important; color: var(--color-text-2) !important;
@ -3553,8 +3545,9 @@
&:hover { &:hover {
color: var(--color-text-2) !important; color: var(--color-text-2) !important;
border-color: var(--app-acrylic-border-strong, rgba(255, 255, 255, 0.92)) !important; border-color: rgba(26, 46, 56, 0.12) !important;
background: var(--app-acrylic-hover-bg, rgba(255, 255, 255, 0.44)) !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 requestSortable: any = null;
let mappingBodySortable: any = null; let mappingBodySortable: any = null;
/** Body / Mapping Body 参数树共用列(排序、参数名、必填、类型、描述、操作) */ /** Body / Mapping Body 参数树共用列(No、参数名、必填、类型、描述、操作) */
const bodyParamTreeColumns = [ const bodyParamTreeColumns = [
{ {
field: 'asdsad', field: 'asdsad',
title: '排序', title: 'No',
className: 'sort', className: 'sort',
width: 50, width: 50,
slots: { default: 'asdsad' }, slots: { default: 'asdsad' },
@ -1484,7 +1484,7 @@
columns: [ columns: [
{ {
field: 'asdsad', field: 'asdsad',
title: '排序', title: 'No',
className: 'sort', className: 'sort',
width: 50, width: 50,
slots: { slots: {
@ -5378,21 +5378,30 @@
flex-shrink: 0; flex-shrink: 0;
} }
.detail-settings-btn { .detail-settings-btn,
padding: 0 8px !important;
color: var(--color-text-2);
:deep(.arco-icon) {
font-size: 16px;
}
}
.section-icon-btn { .section-icon-btn {
padding: 0 8px !important; display: inline-flex !important;
min-width: 32px; 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) { :deep(.arco-icon) {
font-size: 16px; font-size: 15px;
} }
} }
@ -5526,10 +5535,6 @@
.content-type-copy-btn { .content-type-copy-btn {
margin-left: auto; margin-left: auto;
flex-shrink: 0; 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_COLLAPSED_WIDTH,
CUSTOMER_SIDE_RAIL_EXPANDED_WIDTH, CUSTOMER_SIDE_RAIL_EXPANDED_WIDTH,
} from '@/utils/customer-portal-nav' } 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' import { brandCopy } from '@/utils/brandCopy'
const AGENT_SIDE_RAIL_COLLAPSED_WIDTH = CUSTOMER_SIDE_RAIL_COLLAPSED_WIDTH const AGENT_SIDE_RAIL_COLLAPSED_WIDTH = CUSTOMER_SIDE_RAIL_COLLAPSED_WIDTH
@ -135,6 +135,7 @@ const { t } = useI18n()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const navLogoSrc = computed(() => brandLogoImages.portal) const navLogoSrc = computed(() => brandLogoImages.portal)
ensureBrandAssetsFresh()
const collapsed = ref(readCollapsed()) const collapsed = ref(readCollapsed())
const compactLayout = ref(collapsed.value) 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 { getSubMenuIcon } from '@/utils/menu-icon'
import { MENU_NAME_TO_LOCALE_KEY, translateMenuTitle } from '@/utils/menu-i18n' import { MENU_NAME_TO_LOCALE_KEY, translateMenuTitle } from '@/utils/menu-i18n'
import { openWindow, regexUrl } from '@/utils' 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 { brandCopy } from '@/utils/brandCopy'
import { import {
buildCustomerFlatNavMenus, buildCustomerFlatNavMenus,
@ -188,6 +188,7 @@ const tabBarStore = useTabBarStore()
const RAIL_ANIM_MS = 300 const RAIL_ANIM_MS = 300
const navLogoSrc = computed(() => brandLogoImages.portal) const navLogoSrc = computed(() => brandLogoImages.portal)
ensureBrandAssetsFresh()
const collapsed = ref(readCustomerSideRailCollapsed(false)) const collapsed = ref(readCustomerSideRailCollapsed(false))
/** 布局紧凑态:动画结束后再切,避免收起中途图标跳动 */ /** 布局紧凑态:动画结束后再切,避免收起中途图标跳动 */

View File

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

View File

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

View File

@ -2150,10 +2150,22 @@ export default {
'order.myOrders.modal.payBatchSuccess': '{count} orders paid', 'order.myOrders.modal.payBatchSuccess': '{count} orders paid',
'order.myOrders.modal.payPartialResult': '{success} paid, {failed} failed. Check the reasons and retry.', 'order.myOrders.modal.payPartialResult': '{success} paid, {failed} failed. Check the reasons and retry.',
'order.myOrders.modal.payMethodBalance': 'Payment method: account balance', 'order.myOrders.modal.payMethodBalance': 'Payment method: account balance',
'order.myOrders.modal.payMethodHybrid': 'Payment method: balance + WeChat shortfall', 'order.myOrders.modal.payMethodHybrid': 'Payment method: balance + QR shortfall',
'order.myOrders.modal.paySplitBalance': 'Balance {amount}', 'order.myOrders.modal.paySplitBalance': 'Balance {amount}',
'order.myOrders.modal.paySplitWechat': 'WeChat {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.payUseBalance': 'Use account balance',
'order.myOrders.modal.payOnlineChannel': 'Pay with',
'order.myOrders.modal.payChannelWechat': 'WeChat',
'order.myOrders.modal.payChannelAlipay': 'Alipay',
'order.myOrders.modal.payChannelWechatHint': 'Scan with WeChat',
'order.myOrders.modal.payChannelAlipayHint': 'Scan with 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.payHybridBalanceLabel': 'Balance used',
'order.myOrders.modal.payHybridOnlineLabel': 'Still due',
'order.myOrders.modal.payMultiCustomerWxHint': 'Multi-customer batch supports balance only. Split by customer to use WeChat.', '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.payWxTitle': 'WeChat QR shortfall',
'order.myOrders.modal.payWxTip': 'Scan with WeChat to finish payment. This dialog closes on success.', 'order.myOrders.modal.payWxTip': 'Scan with WeChat to finish payment. This dialog closes on success.',
@ -4344,7 +4356,7 @@ export default {
'system.otherConfig.brandLogo.dropReplace': 'Click or drag to replace', 'system.otherConfig.brandLogo.dropReplace': 'Click or drag to replace',
'system.otherConfig.brandLogo.invalidFile': 'Please upload an image (PNG / JPG / WEBP, etc.)', 'system.otherConfig.brandLogo.invalidFile': 'Please upload an image (PNG / JPG / WEBP, etc.)',
'system.otherConfig.brandLogo.clear': 'Clear', '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.clearFailed': 'Failed to clear',
'system.otherConfig.brandLogo.uploading': 'Uploading…', 'system.otherConfig.brandLogo.uploading': 'Uploading…',
'system.otherConfig.brandLogo.uploadSuccess': 'Brand logo updated', 'system.otherConfig.brandLogo.uploadSuccess': 'Brand logo updated',
@ -4413,6 +4425,62 @@ export default {
'system.otherConfig.paymentQr.tab.qr': 'QR codes', 'system.otherConfig.paymentQr.tab.qr': 'QR codes',
'system.otherConfig.paymentQr.tab.bank': 'Bank accounts', 'system.otherConfig.paymentQr.tab.bank': 'Bank accounts',
'system.otherConfig.paymentQr.tab.wechatPay': 'WeChat Pay merchant', '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.appIdPath':
'open.alipay.com → Console → your app (AppId under the app name)',
'system.otherConfig.paymentQr.alipayPay.notifyUrl': 'Notify URL',
'system.otherConfig.paymentQr.alipayPay.notifyUrlPath':
'Not from Open Platform: use this system public HTTPS callback; click “Use suggested 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.returnUrlPath':
'Not from Open Platform: H5 recharge base, e.g. https://{front}/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.privateKeyPemPath':
'App detail → Dev Settings → Interface signing (key) → RSA2 via key tool; keep private key locally (not shown on portal)',
'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.alipayPublicKeyPath':
'App detail → Dev Settings → Interface signing → Set/View → copy Alipay public key',
'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.alipay': 'Alipay',
'system.otherConfig.paymentQr.wechat': 'WeChat', 'system.otherConfig.paymentQr.wechat': 'WeChat',
'system.otherConfig.paymentQr.replace': 'Replace', 'system.otherConfig.paymentQr.replace': 'Replace',
@ -5261,6 +5329,23 @@ export default {
'user.recharge.deposit.payment.wechatDesc': 'Recommended for fast arrival', 'user.recharge.deposit.payment.wechatDesc': 'Recommended for fast arrival',
'user.recharge.deposit.payment.wechatOnline': 'WeChat Online Pay', 'user.recharge.deposit.payment.wechatOnline': 'WeChat Online Pay',
'user.recharge.deposit.payment.wechatOnlineDesc': 'Dynamic QR · instant credit', '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.wechatVoucher': 'WeChat Transfer Voucher',
'user.recharge.deposit.payment.wechatVoucherDesc': 'Scan static QR, then upload screenshot', 'user.recharge.deposit.payment.wechatVoucherDesc': 'Scan static QR, then upload screenshot',
'user.recharge.deposit.payment.bank': 'Bank Transfer', 'user.recharge.deposit.payment.bank': 'Bank Transfer',
@ -5290,7 +5375,7 @@ export default {
'user.recharge.deposit.message.wxOnlineClosed': 'Payment closed or failed. Please try again.', 'user.recharge.deposit.message.wxOnlineClosed': 'Payment closed or failed. Please try again.',
'user.recharge.deposit.message.wxOnlineNoCode': 'No payment QR returned', 'user.recharge.deposit.message.wxOnlineNoCode': 'No payment QR returned',
'user.recharge.deposit.message.wxOnlineCreateFailed': 'Failed to create WeChat payment', 'user.recharge.deposit.message.wxOnlineCreateFailed': 'Failed to create WeChat payment',
'system.otherConfig.paymentQr.wechatPay.panelTitle': 'WeChat Pay merchant (APIv3)', 'system.otherConfig.paymentQr.wechatPay.panelTitle': 'WeChat Pay merchant (APIv3 public-key verify)',
'system.otherConfig.paymentQr.wechatPay.enabled': 'Enable online pay', 'system.otherConfig.paymentQr.wechatPay.enabled': 'Enable online pay',
'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI available', 'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI available',
'system.otherConfig.paymentQr.wechatPay.enabledOff': 'Online pay disabled when off', 'system.otherConfig.paymentQr.wechatPay.enabledOff': 'Online pay disabled when off',
@ -5301,29 +5386,52 @@ export default {
'system.otherConfig.paymentQr.wechatPay.checkSecret': 'Secrets', 'system.otherConfig.paymentQr.wechatPay.checkSecret': 'Secrets',
'system.otherConfig.paymentQr.wechatPay.checkAppId': 'MP AppId', 'system.otherConfig.paymentQr.wechatPay.checkAppId': 'MP AppId',
'system.otherConfig.paymentQr.wechatPay.sectionBasic': 'Merchant basics', 'system.otherConfig.paymentQr.wechatPay.sectionBasic': 'Merchant basics',
'system.otherConfig.paymentQr.wechatPay.sectionBasicHint': 'MchId, cert serial, public notify URL', 'system.otherConfig.paymentQr.wechatPay.sectionBasicHint': 'MchId, cert serial, public-key ID, notify URL',
'system.otherConfig.paymentQr.wechatPay.sectionSecret': 'Keys & cert', 'system.otherConfig.paymentQr.wechatPay.sectionSecret': 'Keys & cert',
'system.otherConfig.paymentQr.wechatPay.sectionSecretHint': 'Server-side only; never echoed', 'system.otherConfig.paymentQr.wechatPay.sectionSecretHint': 'Server-side only; never echoed',
'system.otherConfig.paymentQr.wechatPay.sectionBind': 'Official Account binding', 'system.otherConfig.paymentQr.wechatPay.sectionBind': 'Official Account binding',
'system.otherConfig.paymentQr.wechatPay.sectionBindHint': 'Must match merchant-bound AppId', 'system.otherConfig.paymentQr.wechatPay.sectionBindHint': 'Must match merchant-bound AppId',
'system.otherConfig.paymentQr.wechatPay.mchId': 'Merchant ID (MchId)', 'system.otherConfig.paymentQr.wechatPay.mchId': 'Merchant ID (MchId)',
'system.otherConfig.paymentQr.wechatPay.mchIdPlaceholder': 'e.g. 1900000109', 'system.otherConfig.paymentQr.wechatPay.mchIdPlaceholder': 'e.g. 1900000109',
'system.otherConfig.paymentQr.wechatPay.mchIdPath':
'pay.weixin.qq.com → Account Center → Merchant Info',
'system.otherConfig.paymentQr.wechatPay.mchSerialNo': 'Merchant cert serial', 'system.otherConfig.paymentQr.wechatPay.mchSerialNo': 'Merchant cert serial',
'system.otherConfig.paymentQr.wechatPay.mchSerialNoPlaceholder': 'API certificate serial from merchant portal', 'system.otherConfig.paymentQr.wechatPay.mchSerialNoPlaceholder': 'API certificate serial from merchant portal',
'system.otherConfig.paymentQr.wechatPay.mchSerialNoPath':
'Account Center → Account Settings → API Security → Merchant API Cert → Manage Cert',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyId': 'WeChat Pay public key ID',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyIdPlaceholder': 'Starts with PUB_KEY_ID_',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyIdPath':
'Account Center → API Security → WeChat Pay Public Key → apply/download to see key ID',
'system.otherConfig.paymentQr.wechatPay.notifyUrl': 'Notify URL', 'system.otherConfig.paymentQr.wechatPay.notifyUrl': 'Notify URL',
'system.otherConfig.paymentQr.wechatPay.notifyUrlPath':
'Not from merchant portal: use this system public HTTPS callback; click “Use suggested URL”',
'system.otherConfig.paymentQr.wechatPay.fillNotify': 'Use suggested URL', 'system.otherConfig.paymentQr.wechatPay.fillNotify': 'Use suggested URL',
'system.otherConfig.paymentQr.wechatPay.apiV3Key': 'APIv3 key', 'system.otherConfig.paymentQr.wechatPay.apiV3Key': 'APIv3 key',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyPlaceholder': 'Leave blank to keep existing key', 'system.otherConfig.paymentQr.wechatPay.apiV3KeyPlaceholder': 'Leave blank to keep existing key',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyRequired': 'Required on first save (32-char APIv3 key)', 'system.otherConfig.paymentQr.wechatPay.apiV3KeyRequired': 'Required on first save (32-char APIv3 key)',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyPath':
'Account Center → Account Settings → API Security → Set APIv3 key (not viewable after set)',
'system.otherConfig.paymentQr.wechatPay.privateKeyPem': 'Merchant API private key (PEM)', 'system.otherConfig.paymentQr.wechatPay.privateKeyPem': 'Merchant API private key (PEM)',
'system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder': 'Leave blank to keep; must include BEGIN PRIVATE KEY', 'system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder': 'Leave blank to keep; must include BEGIN PRIVATE KEY',
'system.otherConfig.paymentQr.wechatPay.privateKeyRequired': 'Paste or import PEM on first save', 'system.otherConfig.paymentQr.wechatPay.privateKeyRequired': 'Paste or import PEM on first save',
'system.otherConfig.paymentQr.wechatPay.privateKeyPemPath':
'Account Center → API Security → Apply Merchant API Cert; cert tool writes local apiclient_key.pem',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyPem': 'WeChat Pay public key (PEM)',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyPlaceholder': 'Leave blank to keep; must include BEGIN PUBLIC KEY',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyRequired': 'Paste or import WeChat Pay public key on first save',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyPemPath':
'Account Center → API Security → WeChat Pay Public Key → apply and download pub_key.pem',
'system.otherConfig.paymentQr.wechatPay.importPem': 'Import PEM file', 'system.otherConfig.paymentQr.wechatPay.importPem': 'Import PEM file',
'system.otherConfig.paymentQr.wechatPay.clearPem': 'Clear draft', 'system.otherConfig.paymentQr.wechatPay.clearPem': 'Clear draft',
'system.otherConfig.paymentQr.wechatPay.pemInvalid': 'File does not look like a PEM private key', 'system.otherConfig.paymentQr.wechatPay.pemInvalid': 'File does not look like a PEM private key',
'system.otherConfig.paymentQr.wechatPay.publicPemInvalid': 'File does not look like a PEM public key',
'system.otherConfig.paymentQr.wechatPay.pemImported': 'Private key imported', 'system.otherConfig.paymentQr.wechatPay.pemImported': 'Private key imported',
'system.otherConfig.paymentQr.wechatPay.publicPemImported': 'WeChat Pay public key imported',
'system.otherConfig.paymentQr.wechatPay.pemReadFailed': 'Failed to read file', 'system.otherConfig.paymentQr.wechatPay.pemReadFailed': 'Failed to read file',
'system.otherConfig.paymentQr.wechatPay.appId': 'Bound Official Account AppId', 'system.otherConfig.paymentQr.wechatPay.appId': 'Bound Official Account AppId',
'system.otherConfig.paymentQr.wechatPay.appIdPath':
'Product Center → APPID Account / Authorization → link; must match system WeChat MP config',
'system.otherConfig.paymentQr.wechatPay.appIdEmpty': 'Official Account AppId missing (configure WeChat MP first)', 'system.otherConfig.paymentQr.wechatPay.appIdEmpty': 'Official Account AppId missing (configure WeChat MP first)',
'system.otherConfig.paymentQr.wechatPay.openMpConfig': 'Configure Official Account', 'system.otherConfig.paymentQr.wechatPay.openMpConfig': 'Configure Official Account',
'system.otherConfig.paymentQr.wechatPay.mpMissing': 'No WeChat MP config in list; create one first', 'system.otherConfig.paymentQr.wechatPay.mpMissing': 'No WeChat MP config in list; create one first',
@ -5335,14 +5443,17 @@ export default {
'system.otherConfig.paymentQr.wechatPay.save': 'Save merchant config', 'system.otherConfig.paymentQr.wechatPay.save': 'Save merchant config',
'system.otherConfig.paymentQr.wechatPay.needMchId': 'Merchant ID is required', 'system.otherConfig.paymentQr.wechatPay.needMchId': 'Merchant ID is required',
'system.otherConfig.paymentQr.wechatPay.needSerial': 'Cert serial is required', 'system.otherConfig.paymentQr.wechatPay.needSerial': 'Cert serial is required',
'system.otherConfig.paymentQr.wechatPay.needPublicKeyId': 'WeChat Pay public key ID is required',
'system.otherConfig.paymentQr.wechatPay.needNotify': 'Notify URL is required', 'system.otherConfig.paymentQr.wechatPay.needNotify': 'Notify URL is required',
'system.otherConfig.paymentQr.wechatPay.needHttps': 'Notify URL must start with https://', 'system.otherConfig.paymentQr.wechatPay.needHttps': 'Notify URL must start with https://',
'system.otherConfig.paymentQr.wechatPay.needApiV3Key': 'APIv3 key is required on first save', 'system.otherConfig.paymentQr.wechatPay.needApiV3Key': 'APIv3 key is required on first save',
'system.otherConfig.paymentQr.wechatPay.needPrivateKey': 'Private key is required on first save', 'system.otherConfig.paymentQr.wechatPay.needPrivateKey': 'Private key is required on first save',
'system.otherConfig.paymentQr.wechatPay.needPlatformPublicKey': 'WeChat Pay public key is required on first save',
'system.otherConfig.paymentQr.wechatPay.loadFailed': 'Failed to load WeChat Pay merchant config', 'system.otherConfig.paymentQr.wechatPay.loadFailed': 'Failed to load WeChat Pay merchant config',
'system.otherConfig.paymentQr.wechatPay.saveSuccess': 'WeChat Pay merchant config saved', 'system.otherConfig.paymentQr.wechatPay.saveSuccess': 'WeChat Pay merchant config saved',
'system.otherConfig.paymentQr.wechatPay.saveFailed': 'Save failed', 'system.otherConfig.paymentQr.wechatPay.saveFailed': 'Save failed',
'system.otherConfig.paymentQr.wechatPay.tip': 'Direct merchant APIv3. Secrets stay server-side. NotifyUrl must be public HTTPS.', 'system.otherConfig.paymentQr.wechatPay.tip':
'Direct merchant APIv3 with WeChat Pay public-key verify. Secrets stay server-side. NotifyUrl must be public HTTPS.',
'user.recharge.deposit.result.title': 'Submitted Successfully', 'user.recharge.deposit.result.title': 'Submitted Successfully',
'user.recharge.deposit.result.subtitle': 'Under review, please wait patiently', 'user.recharge.deposit.result.subtitle': 'Under review, please wait patiently',
'user.recharge.deposit.result.actions.rechargeAgain': 'Recharge Again', 'user.recharge.deposit.result.actions.rechargeAgain': 'Recharge Again',

View File

@ -1918,10 +1918,22 @@ export default {
'order.myOrders.modal.payBatchSuccess': '已成功支付 {count} 单', 'order.myOrders.modal.payBatchSuccess': '已成功支付 {count} 单',
'order.myOrders.modal.payPartialResult': '成功 {success} 单,失败 {failed} 单,请查看失败原因后重试', 'order.myOrders.modal.payPartialResult': '成功 {success} 单,失败 {failed} 单,请查看失败原因后重试',
'order.myOrders.modal.payMethodBalance': '支付方式:账户余额', 'order.myOrders.modal.payMethodBalance': '支付方式:账户余额',
'order.myOrders.modal.payMethodHybrid': '支付方式:余额 + 微信补差', 'order.myOrders.modal.payMethodHybrid': '支付方式:余额 + 扫码补差',
'order.myOrders.modal.paySplitBalance': '余额 {amount}', 'order.myOrders.modal.paySplitBalance': '余额 {amount}',
'order.myOrders.modal.paySplitWechat': '微信 {amount}', 'order.myOrders.modal.paySplitWechat': '微信 {amount}',
'order.myOrders.modal.payHybridHint': '余额不足部分将通过微信扫码补差 {amount}', 'order.myOrders.modal.paySplitAlipay': '支付宝 {amount}',
'order.myOrders.modal.payHybridHint': '余额不足部分将通过在线扫码补差 {amount}',
'order.myOrders.modal.payUseBalance': '使用账户余额',
'order.myOrders.modal.payHybridBalanceLabel': '余额抵扣',
'order.myOrders.modal.payHybridOnlineLabel': '还需支付',
'order.myOrders.modal.payOnlineChannel': '支付方式',
'order.myOrders.modal.payChannelWechat': '微信',
'order.myOrders.modal.payChannelAlipay': '支付宝',
'order.myOrders.modal.payChannelWechatHint': '打开微信扫一扫',
'order.myOrders.modal.payChannelAlipayHint': '打开支付宝扫一扫',
'order.myOrders.modal.payAlipayTitle': '支付宝扫码补差',
'order.myOrders.modal.payAlipayTip': '请使用支付宝扫一扫完成支付',
'order.myOrders.modal.payAlipayCreateFailed': '创建支付宝补差失败',
'order.myOrders.modal.payMultiCustomerWxHint': '跨客户批量仅支持账户余额,请按客户拆分后再用微信补差。', 'order.myOrders.modal.payMultiCustomerWxHint': '跨客户批量仅支持账户余额,请按客户拆分后再用微信补差。',
'order.myOrders.modal.payWxTitle': '微信扫码补差', 'order.myOrders.modal.payWxTitle': '微信扫码补差',
'order.myOrders.modal.payWxTip': '请使用微信扫一扫完成支付,成功后自动关闭', 'order.myOrders.modal.payWxTip': '请使用微信扫一扫完成支付,成功后自动关闭',
@ -4356,7 +4368,7 @@ export default {
'system.otherConfig.brandLogo.dropReplace': '点击或拖拽更换', 'system.otherConfig.brandLogo.dropReplace': '点击或拖拽更换',
'system.otherConfig.brandLogo.invalidFile': '请上传图片文件(PNG / JPG / WEBP 等)', 'system.otherConfig.brandLogo.invalidFile': '请上传图片文件(PNG / JPG / WEBP 等)',
'system.otherConfig.brandLogo.clear': '清除', 'system.otherConfig.brandLogo.clear': '清除',
'system.otherConfig.brandLogo.clearSuccess': '已清除,将显示文字 LOGO', 'system.otherConfig.brandLogo.clearSuccess': '已清除,将显示文字 BCDship',
'system.otherConfig.brandLogo.clearFailed': '清除失败', 'system.otherConfig.brandLogo.clearFailed': '清除失败',
'system.otherConfig.brandLogo.uploading': '上传中…', 'system.otherConfig.brandLogo.uploading': '上传中…',
'system.otherConfig.brandLogo.uploadSuccess': '品牌 Logo 已更新', 'system.otherConfig.brandLogo.uploadSuccess': '品牌 Logo 已更新',
@ -4425,6 +4437,7 @@ export default {
'system.otherConfig.paymentQr.tab.qr': '收款码', 'system.otherConfig.paymentQr.tab.qr': '收款码',
'system.otherConfig.paymentQr.tab.bank': '银行账户', 'system.otherConfig.paymentQr.tab.bank': '银行账户',
'system.otherConfig.paymentQr.tab.wechatPay': '微信支付商户', 'system.otherConfig.paymentQr.tab.wechatPay': '微信支付商户',
'system.otherConfig.paymentQr.tab.alipayPay': '支付宝在线支付',
'system.otherConfig.paymentQr.alipay': '支付宝', 'system.otherConfig.paymentQr.alipay': '支付宝',
'system.otherConfig.paymentQr.wechat': '微信', 'system.otherConfig.paymentQr.wechat': '微信',
'system.otherConfig.paymentQr.replace': '更换图片', 'system.otherConfig.paymentQr.replace': '更换图片',
@ -5237,7 +5250,7 @@ export default {
'user.recharge.deposit.tips.item1': '充值与余额 1:1 到账', 'user.recharge.deposit.tips.item1': '充值与余额 1:1 到账',
'user.recharge.deposit.tips.item2': '上传清晰完整的支付截图', 'user.recharge.deposit.tips.item2': '上传清晰完整的支付截图',
'user.recharge.deposit.tips.item3': '资金到账后会短信/站内信提醒', 'user.recharge.deposit.tips.item3': '资金到账后会短信/站内信提醒',
'user.recharge.deposit.tips.online': '微信扫码支付成功后余额自动到账,无需上传截图、无需等待审核', 'user.recharge.deposit.tips.online': '在线扫码支付成功后余额自动到账,无需上传截图、无需等待审核',
'user.recharge.deposit.tips.voucher': '扫码/转账后请上传清晰截图,财务审核通过后到账', 'user.recharge.deposit.tips.voucher': '扫码/转账后请上传清晰截图,财务审核通过后到账',
'user.recharge.deposit.tips.bank': '请核对对公账户信息,填写付款户名与流水号并上传转账回单', 'user.recharge.deposit.tips.bank': '请核对对公账户信息,填写付款户名与流水号并上传转账回单',
'user.recharge.deposit.form.currentAmount': '当前充值金额', 'user.recharge.deposit.form.currentAmount': '当前充值金额',
@ -5278,12 +5291,16 @@ export default {
'user.recharge.deposit.payment.wechatDesc': '推荐快速到账', 'user.recharge.deposit.payment.wechatDesc': '推荐快速到账',
'user.recharge.deposit.payment.wechatOnline': '微信在线支付', 'user.recharge.deposit.payment.wechatOnline': '微信在线支付',
'user.recharge.deposit.payment.wechatOnlineDesc': '扫动态码 · 秒级到账', 'user.recharge.deposit.payment.wechatOnlineDesc': '扫动态码 · 秒级到账',
'user.recharge.deposit.payment.alipayOnline': '支付宝在线支付',
'user.recharge.deposit.payment.alipayOnlineDesc': '扫动态码 · 秒级到账',
'user.recharge.deposit.payment.wechatVoucher': '微信转账凭证', 'user.recharge.deposit.payment.wechatVoucher': '微信转账凭证',
'user.recharge.deposit.payment.wechatVoucherDesc': '扫静态码后上传截图审核', 'user.recharge.deposit.payment.wechatVoucherDesc': '扫静态码后上传截图审核',
'user.recharge.deposit.payment.bank': '银行转账', 'user.recharge.deposit.payment.bank': '银行转账',
'user.recharge.deposit.payment.bankDesc': '对公转账 · 填写流水后审核', 'user.recharge.deposit.payment.bankDesc': '对公转账 · 填写流水后审核',
'user.recharge.deposit.guide.onlineTitle': '下一步:生成微信支付码', 'user.recharge.deposit.guide.onlineTitle': '下一步:生成微信支付码',
'user.recharge.deposit.guide.onlineBody': '点击下方「生成支付码」,用微信扫一扫完成支付,成功后余额自动到账。', 'user.recharge.deposit.guide.onlineBody': '点击下方「生成支付码」,用微信扫一扫完成支付,成功后余额自动到账。',
'user.recharge.deposit.guide.alipayOnlineTitle': '下一步:生成支付宝支付码',
'user.recharge.deposit.guide.alipayOnlineBody': '点击下方「生成支付码」,用支付宝扫一扫完成支付,成功后余额自动到账。',
'user.recharge.deposit.guide.voucherTitle': '下一步:上传转账截图', 'user.recharge.deposit.guide.voucherTitle': '下一步:上传转账截图',
'user.recharge.deposit.guide.alipayBody': '请先扫右侧支付宝收款码完成转账,再上传清晰支付截图提交审核。', 'user.recharge.deposit.guide.alipayBody': '请先扫右侧支付宝收款码完成转账,再上传清晰支付截图提交审核。',
'user.recharge.deposit.guide.wechatVoucherBody': '请先扫右侧微信收款码完成转账,再上传清晰支付截图提交审核。', 'user.recharge.deposit.guide.wechatVoucherBody': '请先扫右侧微信收款码完成转账,再上传清晰支付截图提交审核。',
@ -5297,6 +5314,14 @@ export default {
'user.recharge.deposit.form.wxOnlineScan': '请使用微信扫码支付', 'user.recharge.deposit.form.wxOnlineScan': '请使用微信扫码支付',
'user.recharge.deposit.form.wxOnlineWaiting': '支付完成后将自动到账,请勿关闭页面', 'user.recharge.deposit.form.wxOnlineWaiting': '支付完成后将自动到账,请勿关闭页面',
'user.recharge.deposit.form.wxOnlineOrderNo': '商户单号:{no}', '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.bankPanelTitle': '对公收款账户',
'user.recharge.deposit.form.alipayPanelTitle': '支付宝收款码', 'user.recharge.deposit.form.alipayPanelTitle': '支付宝收款码',
'user.recharge.deposit.form.wechatVoucherPanelTitle': '微信收款码(转账凭证)', 'user.recharge.deposit.form.wechatVoucherPanelTitle': '微信收款码(转账凭证)',
@ -5307,7 +5332,66 @@ export default {
'user.recharge.deposit.message.wxOnlineClosed': '支付已关闭或失败,请重新发起', 'user.recharge.deposit.message.wxOnlineClosed': '支付已关闭或失败,请重新发起',
'user.recharge.deposit.message.wxOnlineNoCode': '未返回支付二维码', 'user.recharge.deposit.message.wxOnlineNoCode': '未返回支付二维码',
'user.recharge.deposit.message.wxOnlineCreateFailed': '创建微信支付失败', 'user.recharge.deposit.message.wxOnlineCreateFailed': '创建微信支付失败',
'system.otherConfig.paymentQr.wechatPay.panelTitle': '微信支付商户(APIv3)', '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.appIdPath':
'open.alipay.com → 控制台 → 对应应用(应用名称下方数字即为 AppId)',
'system.otherConfig.paymentQr.alipayPay.notifyUrl': '异步通知 URL',
'system.otherConfig.paymentQr.alipayPay.notifyUrlPath':
'非开放平台项:填本系统公网 HTTPS 回调,可点「填入建议地址」',
'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.returnUrlPath':
'非开放平台项:填本系统 H5 充值页基址,如 https://{front}/h5/recharge',
'system.otherConfig.paymentQr.alipayPay.privateKeyPem': '应用私钥',
'system.otherConfig.paymentQr.alipayPay.privateKeyPlaceholder': '留空表示不修改',
'system.otherConfig.paymentQr.alipayPay.privateKeyRequired': '首次保存须粘贴应用私钥',
'system.otherConfig.paymentQr.alipayPay.privateKeyPemPath':
'应用详情 → 开发设置 → 接口加签方式(密钥)→ 用密钥工具生成 RSA2,本地保存应用私钥(平台不回显)',
'system.otherConfig.paymentQr.alipayPay.alipayPublicKey': '支付宝公钥',
'system.otherConfig.paymentQr.alipayPay.publicKeyPlaceholder': '留空表示不修改',
'system.otherConfig.paymentQr.alipayPay.publicKeyRequired': '首次保存须粘贴支付宝公钥',
'system.otherConfig.paymentQr.alipayPay.alipayPublicKeyPath':
'应用详情 → 开发设置 → 接口加签方式 → 设置/查看 → 下载/复制「支付宝公钥」',
'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.enabled': '启用在线支付',
'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI 可用', 'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI 可用',
'system.otherConfig.paymentQr.wechatPay.enabledOff': '关闭后无法发起在线支付', 'system.otherConfig.paymentQr.wechatPay.enabledOff': '关闭后无法发起在线支付',
@ -5318,29 +5402,52 @@ export default {
'system.otherConfig.paymentQr.wechatPay.checkSecret': '密钥证书', 'system.otherConfig.paymentQr.wechatPay.checkSecret': '密钥证书',
'system.otherConfig.paymentQr.wechatPay.checkAppId': '公众号 AppId', 'system.otherConfig.paymentQr.wechatPay.checkAppId': '公众号 AppId',
'system.otherConfig.paymentQr.wechatPay.sectionBasic': '商户基础信息', 'system.otherConfig.paymentQr.wechatPay.sectionBasic': '商户基础信息',
'system.otherConfig.paymentQr.wechatPay.sectionBasicHint': '商户号、证书序列号与公网回调', 'system.otherConfig.paymentQr.wechatPay.sectionBasicHint': '商户号、证书序列号、公钥 ID 与公网回调',
'system.otherConfig.paymentQr.wechatPay.sectionSecret': '密钥与证书', 'system.otherConfig.paymentQr.wechatPay.sectionSecret': '密钥与证书',
'system.otherConfig.paymentQr.wechatPay.sectionSecretHint': '仅服务端保存,前端不回显明文', 'system.otherConfig.paymentQr.wechatPay.sectionSecretHint': '仅服务端保存,前端不回显明文',
'system.otherConfig.paymentQr.wechatPay.sectionBind': '公众号绑定', 'system.otherConfig.paymentQr.wechatPay.sectionBind': '公众号绑定',
'system.otherConfig.paymentQr.wechatPay.sectionBindHint': '须与商户平台绑定同一主体 AppId', 'system.otherConfig.paymentQr.wechatPay.sectionBindHint': '须与商户平台绑定同一主体 AppId',
'system.otherConfig.paymentQr.wechatPay.mchId': '商户号 MchId', 'system.otherConfig.paymentQr.wechatPay.mchId': '商户号 MchId',
'system.otherConfig.paymentQr.wechatPay.mchIdPlaceholder': '例如 1900000109', 'system.otherConfig.paymentQr.wechatPay.mchIdPlaceholder': '例如 1900000109',
'system.otherConfig.paymentQr.wechatPay.mchIdPath':
'pay.weixin.qq.com → 账户中心 → 商户信息',
'system.otherConfig.paymentQr.wechatPay.mchSerialNo': '商户证书序列号', 'system.otherConfig.paymentQr.wechatPay.mchSerialNo': '商户证书序列号',
'system.otherConfig.paymentQr.wechatPay.mchSerialNoPlaceholder': 'API 证书序列号(商户平台可查)', 'system.otherConfig.paymentQr.wechatPay.mchSerialNoPlaceholder': 'API 证书序列号(商户平台可查)',
'system.otherConfig.paymentQr.wechatPay.mchSerialNoPath':
'账户中心 → 账户设置 → API安全 → 商户API证书 → 管理证书',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyId': '微信支付公钥 ID',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyIdPlaceholder': 'PUB_KEY_ID_ 开头',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyIdPath':
'账户中心 → API安全 → 微信支付公钥 → 申请/下载后可见公钥 ID',
'system.otherConfig.paymentQr.wechatPay.notifyUrl': '支付回调 NotifyUrl', 'system.otherConfig.paymentQr.wechatPay.notifyUrl': '支付回调 NotifyUrl',
'system.otherConfig.paymentQr.wechatPay.notifyUrlPath':
'非商户后台项:填本系统公网 HTTPS 回调,可点「填充推荐地址」',
'system.otherConfig.paymentQr.wechatPay.fillNotify': '填充推荐地址', 'system.otherConfig.paymentQr.wechatPay.fillNotify': '填充推荐地址',
'system.otherConfig.paymentQr.wechatPay.apiV3Key': 'APIv3 密钥', 'system.otherConfig.paymentQr.wechatPay.apiV3Key': 'APIv3 密钥',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyPlaceholder': '留空则保留原密钥', 'system.otherConfig.paymentQr.wechatPay.apiV3KeyPlaceholder': '留空则保留原密钥',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyRequired': '首次保存须填写 32 位 APIv3 密钥', 'system.otherConfig.paymentQr.wechatPay.apiV3KeyRequired': '首次保存须填写 32 位 APIv3 密钥',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyPath':
'账户中心 → 账户设置 → API安全 → 设置 APIv3密钥(设置后不可回看)',
'system.otherConfig.paymentQr.wechatPay.privateKeyPem': '商户 API 私钥 PEM', 'system.otherConfig.paymentQr.wechatPay.privateKeyPem': '商户 API 私钥 PEM',
'system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder': '留空则保留原私钥;须含 BEGIN PRIVATE KEY', 'system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder': '留空则保留原私钥;须含 BEGIN PRIVATE KEY',
'system.otherConfig.paymentQr.wechatPay.privateKeyRequired': '首次保存须粘贴或导入私钥 PEM', 'system.otherConfig.paymentQr.wechatPay.privateKeyRequired': '首次保存须粘贴或导入私钥 PEM',
'system.otherConfig.paymentQr.wechatPay.privateKeyPemPath':
'账户中心 → API安全 → 申请商户API证书,用证书工具生成本地 apiclient_key.pem',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyPem': '微信支付公钥 PEM',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyPlaceholder': '留空则保留原公钥;须含 BEGIN PUBLIC KEY',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyRequired': '首次保存须粘贴或导入微信支付公钥',
'system.otherConfig.paymentQr.wechatPay.platformPublicKeyPemPath':
'账户中心 → API安全 → 微信支付公钥 → 申请并下载 pub_key.pem',
'system.otherConfig.paymentQr.wechatPay.importPem': '导入 PEM 文件', 'system.otherConfig.paymentQr.wechatPay.importPem': '导入 PEM 文件',
'system.otherConfig.paymentQr.wechatPay.clearPem': '清空本次输入', 'system.otherConfig.paymentQr.wechatPay.clearPem': '清空本次输入',
'system.otherConfig.paymentQr.wechatPay.pemInvalid': '文件内容不像 PEM 私钥', 'system.otherConfig.paymentQr.wechatPay.pemInvalid': '文件内容不像 PEM 私钥',
'system.otherConfig.paymentQr.wechatPay.publicPemInvalid': '文件内容不像 PEM 公钥',
'system.otherConfig.paymentQr.wechatPay.pemImported': '已导入私钥内容', 'system.otherConfig.paymentQr.wechatPay.pemImported': '已导入私钥内容',
'system.otherConfig.paymentQr.wechatPay.publicPemImported': '已导入微信支付公钥',
'system.otherConfig.paymentQr.wechatPay.pemReadFailed': '读取文件失败', 'system.otherConfig.paymentQr.wechatPay.pemReadFailed': '读取文件失败',
'system.otherConfig.paymentQr.wechatPay.appId': '绑定公众号 AppId', 'system.otherConfig.paymentQr.wechatPay.appId': '绑定公众号 AppId',
'system.otherConfig.paymentQr.wechatPay.appIdPath':
'产品中心 → APPID账号管理 / APPID授权管理 → 关联;须与系统「微信公众号」一致',
'system.otherConfig.paymentQr.wechatPay.appIdEmpty': '未配置公众号 AppId(请先配置「微信公众号」)', 'system.otherConfig.paymentQr.wechatPay.appIdEmpty': '未配置公众号 AppId(请先配置「微信公众号」)',
'system.otherConfig.paymentQr.wechatPay.openMpConfig': '去配置公众号', 'system.otherConfig.paymentQr.wechatPay.openMpConfig': '去配置公众号',
'system.otherConfig.paymentQr.wechatPay.mpMissing': '列表中暂无微信公众号配置,请先新增', 'system.otherConfig.paymentQr.wechatPay.mpMissing': '列表中暂无微信公众号配置,请先新增',
@ -5352,14 +5459,17 @@ export default {
'system.otherConfig.paymentQr.wechatPay.save': '保存商户配置', 'system.otherConfig.paymentQr.wechatPay.save': '保存商户配置',
'system.otherConfig.paymentQr.wechatPay.needMchId': '请填写商户号', 'system.otherConfig.paymentQr.wechatPay.needMchId': '请填写商户号',
'system.otherConfig.paymentQr.wechatPay.needSerial': '请填写证书序列号', 'system.otherConfig.paymentQr.wechatPay.needSerial': '请填写证书序列号',
'system.otherConfig.paymentQr.wechatPay.needPublicKeyId': '请填写微信支付公钥 ID',
'system.otherConfig.paymentQr.wechatPay.needNotify': '请填写支付回调地址', 'system.otherConfig.paymentQr.wechatPay.needNotify': '请填写支付回调地址',
'system.otherConfig.paymentQr.wechatPay.needHttps': 'NotifyUrl 须为 https:// 开头的公网地址', 'system.otherConfig.paymentQr.wechatPay.needHttps': 'NotifyUrl 须为 https:// 开头的公网地址',
'system.otherConfig.paymentQr.wechatPay.needApiV3Key': '首次保存须填写 APIv3 密钥', 'system.otherConfig.paymentQr.wechatPay.needApiV3Key': '首次保存须填写 APIv3 密钥',
'system.otherConfig.paymentQr.wechatPay.needPrivateKey': '首次保存须填写商户 API 私钥', 'system.otherConfig.paymentQr.wechatPay.needPrivateKey': '首次保存须填写商户 API 私钥',
'system.otherConfig.paymentQr.wechatPay.needPlatformPublicKey': '首次保存须填写微信支付公钥',
'system.otherConfig.paymentQr.wechatPay.loadFailed': '加载微信支付商户配置失败', 'system.otherConfig.paymentQr.wechatPay.loadFailed': '加载微信支付商户配置失败',
'system.otherConfig.paymentQr.wechatPay.saveSuccess': '微信支付商户配置已保存', 'system.otherConfig.paymentQr.wechatPay.saveSuccess': '微信支付商户配置已保存',
'system.otherConfig.paymentQr.wechatPay.saveFailed': '保存失败', 'system.otherConfig.paymentQr.wechatPay.saveFailed': '保存失败',
'system.otherConfig.paymentQr.wechatPay.tip': '普通商户直连 APIv3:密钥仅服务端保存,前端不回显明文。NotifyUrl 须公网 HTTPS。', 'system.otherConfig.paymentQr.wechatPay.tip':
'普通商户直连 APIv3(微信支付公钥验签):密钥仅服务端保存。NotifyUrl 须公网 HTTPS。',
'user.recharge.deposit.result.title': '提交成功', 'user.recharge.deposit.result.title': '提交成功',
'user.recharge.deposit.result.subtitle': '审核中,请耐心等待', 'user.recharge.deposit.result.subtitle': '审核中,请耐心等待',
'user.recharge.deposit.result.actions.rechargeAgain': '再转一笔', 'user.recharge.deposit.result.actions.rechargeAgain': '再转一笔',

View File

@ -12,11 +12,11 @@ export type BrandLogoUrls = {
mascot: string mascot: string
} }
/** 未配置图片时的文字占位(启动页 / 空态) */ /** 未配置图片时的文字占位(启动页 / 空态 / 登录) */
export const BRAND_TEXT_LOGO = 'LOGO' export const BRAND_TEXT_LOGO = 'BCDship'
/** @deprecated 已改为文字 LOGO */ /** @deprecated 已改为文字 BCDship */
export const EMPTY_PLACEHOLDER = '' export const EMPTY_PLACEHOLDER = ''
/** @deprecated 已改为文字 LOGO */ /** @deprecated 已改为文字 BCDship */
export const MASCOT_FALLBACK = '' export const MASCOT_FALLBACK = ''
/** 启动页在 Vue 挂载前读取,须与 index.html 一致。只存 data URL,避免签名地址过期。 */ /** 启动页在 Vue 挂载前读取,须与 index.html 一致。只存 data URL,避免签名地址过期。 */
export const MASCOT_CACHE_KEY = 'oms_brand_mascot_url' export const MASCOT_CACHE_KEY = 'oms_brand_mascot_url'
@ -404,6 +404,27 @@ export async function fetchBrandLogoUrlsPublic(): Promise<BrandLogoUrls> {
return snapshotBrandImages() 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 { function hasLocalBrandImage(): boolean {
return BRAND_CHANNELS.some((channel) => brandLogoImages[channel].startsWith('data:')) 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 { useLoginCaptchaGate } from '@/composables/useLoginCaptchaGate';
import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue'; import LoginCaptchaField from '@/components/LoginCaptchaField/index.vue';
import { ADMIN_H5_HOME_PATH, isAdminH5Path } from '@/utils/login-portal'; 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 { brandCopy } from '@/utils/brandCopy';
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue'; import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue'; import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
@ -130,6 +130,7 @@ const route = useRoute();
const router = useRouter(); const router = useRouter();
const rbacUserStore = useRbacUserStore(); const rbacUserStore = useRbacUserStore();
const logoSrc = computed(() => brandLogoImages.site); const logoSrc = computed(() => brandLogoImages.site);
ensureBrandAssetsFresh();
const { const {
requireCaptcha, requireCaptcha,
captchaId, captchaId,
@ -338,9 +339,9 @@ onMounted(() => {
.h5-login-card__logo-mark { .h5-login-card__logo-mark {
display: block; display: block;
font-size: 28px; font-size: 22px;
font-weight: 700; font-weight: 700;
letter-spacing: 0.12em; letter-spacing: 0.04em;
line-height: 1; line-height: 1;
color: #86909c; color: #86909c;
user-select: none; user-select: none;

View File

@ -177,24 +177,67 @@
<div class="h5-pay__settle-row"> <div class="h5-pay__settle-row">
<span class="h5-pay__settle-title">{{ t('h5.pay.settleTitle') }}</span> <span class="h5-pay__settle-title">{{ t('h5.pay.settleTitle') }}</span>
<span class="h5-pay__settle-mode"> <span class="h5-pay__settle-mode">
{{ needsWechatPay ? t('h5.pay.methodHybrid') : t('h5.pay.methodBalance') }} {{
!useAccountBalance
? onlinePayChannel === 'alipay'
? t('h5.pay.channelAlipay')
: t('h5.pay.channelWechat')
: needsWechatPay
? onlinePayChannel === 'alipay'
? t('h5.pay.methodHybridAlipay')
: t('h5.pay.methodHybrid')
: t('h5.pay.methodBalance')
}}
</span> </span>
</div> </div>
<label v-if="canUseAccountBalance" class="h5-pay__use-balance">
<input v-model="useAccountBalance" type="checkbox" />
<span>{{ t('h5.pay.useBalance') }}</span>
<em>{{ formatPayMoney(customerBalance) }}</em>
</label>
<div class="h5-pay__split-inline"> <div class="h5-pay__split-inline">
<span class="h5-pay__split-pill is-balance"> <span v-if="useAccountBalance" class="h5-pay__split-pill is-balance">
{{ t('h5.pay.splitBalance') }} {{ t('h5.pay.splitBalance') }}
<b>{{ formatPayMoney(needsWechatPay ? hybridBalanceUse : payableTotal) }}</b> <b>{{ formatPayMoney(needsWechatPay ? hybridBalanceUse : payableTotal) }}</b>
</span> </span>
<span v-if="needsWechatPay" class="h5-pay__split-pill is-wechat"> <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> <b>{{ formatPayMoney(hybridWechatAmount) }}</b>
</span> </span>
</div> </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') }} {{ t('h5.pay.needWechatShort') }}
</p> </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"> <p v-else-if="needsWechatPay" class="h5-pay__settle-hint">
{{ t('h5.pay.hybridWechatTip') }} {{ t('h5.pay.hybridWechatTip') }}
</p> </p>
@ -217,8 +260,15 @@
</a-spin> </a-spin>
<footer class="h5-pay__foot"> <footer class="h5-pay__foot">
<div v-if="needsWechatPay && inWeChat" class="h5-pay__foot-summary"> <div
<span>{{ t('h5.pay.footWxDue') }}</span> 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> <strong>{{ formatPayMoney(hybridWechatAmount) }}</strong>
</div> </div>
<div class="h5-pay__foot-actions"> <div class="h5-pay__foot-actions">
@ -226,7 +276,7 @@
{{ t('h5.pay.cancel') }} {{ t('h5.pay.cancel') }}
</button> </button>
<button <button
v-if="needsWechatPay && !inWeChat" v-if="needsWechatPay && onlinePayChannel === 'wechat' && !inWeChat"
type="button" type="button"
class="h5-pay__confirm" class="h5-pay__confirm"
:disabled="submitting" :disabled="submitting"
@ -273,6 +323,12 @@ import {
invokeWeChatJsapiPay, invokeWeChatJsapiPay,
isWeChatBrowser, isWeChatBrowser,
} from '@/api/recharge/wechatPay'; } from '@/api/recharge/wechatPay';
import {
closeAlipayPay,
createOrderAlipayPay,
getAlipayPayStatus,
redirectAlipayPay,
} from '@/api/recharge/alipayPay';
import { import {
formatCouponBenefit, formatCouponBenefit,
formatPayMoney, formatPayMoney,
@ -394,15 +450,20 @@ const payableTotal = computed(() => {
return couponPricing.totalPayable.value; return couponPricing.totalPayable.value;
}); });
const useAccountBalance = ref(true);
const canUseAccountBalance = computed(
() => customerBalance.value != null && customerBalance.value > 1e-6,
);
const hybridBalanceUse = computed(() => { const hybridBalanceUse = computed(() => {
if (customerBalance.value == null) return 0; if (customerBalance.value == null || !useAccountBalance.value) return 0;
return Math.min(customerBalance.value, payableTotal.value); return Math.min(customerBalance.value, payableTotal.value);
}); });
const hybridWechatAmount = computed(() => { const hybridWechatAmount = computed(() => {
if (customerBalance.value == null) return 0; if (customerBalance.value == null && useAccountBalance.value) return 0;
return Math.max(0, payableTotal.value - hybridBalanceUse.value); return Math.max(0, payableTotal.value - hybridBalanceUse.value);
}); });
const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6); const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6);
const onlinePayChannel = ref<'wechat' | 'alipay'>('wechat');
const canConfirm = computed( const canConfirm = computed(
() => () =>
@ -411,11 +472,16 @@ const canConfirm = computed(
!payConfirming.value && !payConfirming.value &&
couponPricing.allReady.value && couponPricing.allReady.value &&
previews.value.every((item) => !item.error && item.totalAmount > 0) && previews.value.every((item) => !item.error && item.totalAmount > 0) &&
(!needsWechatPay.value || inWeChat.value), (!needsWechatPay.value ||
onlinePayChannel.value === 'alipay' ||
inWeChat.value),
); );
const confirmLabel = computed(() => { const confirmLabel = computed(() => {
if (needsWechatPay.value) { 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.confirmHybridAmount', { amount: formatPayMoney(hybridWechatAmount.value) });
} }
return t('h5.pay.confirmAmount', { amount: formatPayMoney(payableTotal.value) }); return t('h5.pay.confirmAmount', { amount: formatPayMoney(payableTotal.value) });
@ -451,9 +517,13 @@ function stopStatusPoll() {
} }
} }
async function bestEffortClosePay(outTradeNo: string | null) { async function bestEffortClosePay(outTradeNo: string | null, channel: 'wx' | 'zfb' = 'wx') {
if (!outTradeNo) return; 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() { async function redirectWechatOauth() {
@ -474,14 +544,17 @@ async function redirectWechatOauth() {
`&redirect_uri=${encodeURIComponent(redirectUri)}&response_type=code&scope=snsapi_base&state=${state}#wechat_redirect`; `&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(); stopStatusPoll();
return new Promise<boolean>((resolve) => { return new Promise<boolean>((resolve) => {
let tries = 0; let tries = 0;
const tick = async () => { const tick = async () => {
tries += 1; tries += 1;
try { try {
const status = await getWeChatPayStatus(outTradeNo); const status =
channel === 'zfb'
? await getAlipayPayStatus(outTradeNo)
: await getWeChatPayStatus(outTradeNo);
if (status.status === 'Success' || status.statusCode === 3) { if (status.status === 'Success' || status.statusCode === 3) {
stopStatusPoll(); stopStatusPoll();
resolve(true); resolve(true);
@ -746,6 +819,7 @@ async function payWithWechatHybrid(oauthCode?: string) {
orderIds: props.orders.map((o) => Number(o.id)).filter((id) => id > 0), orderIds: props.orders.map((o) => Number(o.id)).filter((id) => id > 0),
couponByOrderId, couponByOrderId,
scene: 'jsapi', scene: 'jsapi',
useBalance: useAccountBalance.value,
oauthCode, oauthCode,
}); });
} catch (e: any) { } catch (e: any) {
@ -783,7 +857,7 @@ async function payWithWechatHybrid(oauthCode?: string) {
return; return;
} }
const paid = await pollUntilPaid(created.outTradeNo); const paid = await pollUntilPaid(created.outTradeNo, 'wx');
if (paid) { if (paid) {
payConfirming.value = false; payConfirming.value = false;
activeOutTradeNo = null; activeOutTradeNo = null;
@ -798,17 +872,63 @@ async function payWithWechatHybrid(oauthCode?: string) {
Message.warning(t('h5.pay.payConfirming')); 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',
useBalance: useAccountBalance.value,
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) { async function handleConfirm(oauthCode?: string) {
if (!canConfirm.value || submitting.value) return; if (!canConfirm.value || submitting.value) return;
submitting.value = true; submitting.value = true;
try { try {
if (needsWechatPay.value) { if (needsWechatPay.value) {
await payWithWechatHybrid(oauthCode); if (onlinePayChannel.value === 'alipay') {
await payWithAlipayHybrid();
} else {
await payWithWechatHybrid(oauthCode);
}
} else { } else {
await payWithBalanceOnly(); await payWithBalanceOnly();
} }
} catch (e: any) { } catch (e: any) {
await bestEffortClosePay(activeOutTradeNo); await bestEffortClosePay(
activeOutTradeNo,
onlinePayChannel.value === 'alipay' ? 'zfb' : 'wx',
);
activeOutTradeNo = null; activeOutTradeNo = null;
Message.error(e?.message || t('h5.pay.failed')); Message.error(e?.message || t('h5.pay.failed'));
emit('fail', e); emit('fail', e);
@ -1373,6 +1493,30 @@ watch(
color: #4e5969; color: #4e5969;
} }
.h5-pay__use-balance {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
font-size: 13px;
color: #1d2129;
cursor: pointer;
input {
width: 16px;
height: 16px;
accent-color: var(--app-primary-color);
}
em {
margin-left: auto;
font-style: normal;
font-size: 12px;
color: #86909c;
font-variant-numeric: tabular-nums;
}
}
.h5-pay__split-inline { .h5-pay__split-inline {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -1415,6 +1559,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 { .h5-pay__settle-hint {
margin: 8px 0 0; margin: 8px 0 0;
font-size: 11px; 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.login.switchToCustomer': 'Switch to customer login',
'h5.recharge.title': 'Recharge', '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.custom': 'Custom',
'h5.recharge.customPlaceholder': 'Enter amount', 'h5.recharge.customPlaceholder': 'Min 0.01',
'h5.recharge.payType': 'Payment method', '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.wechat': 'WeChat Pay',
'h5.recharge.wechatOnline': 'WeChat online 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.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.qrTip': 'Scan to transfer, then upload the voucher',
'h5.recharge.qrEmpty': 'Payment QR is not configured. Please contact support.', 'h5.recharge.qrEmpty': 'Payment QR is not configured. Please contact support.',
'h5.recharge.voucher': 'Transfer voucher (optional)', 'h5.recharge.voucher': 'Transfer voucher (optional)',
'h5.recharge.voucherBank': 'Bank receipt (optional)',
'h5.recharge.upload': 'Upload', 'h5.recharge.upload': 'Upload',
'h5.recharge.submit': 'Submit for review', 'h5.recharge.submit': 'Submit for review',
'h5.recharge.payNow': 'Pay now', 'h5.recharge.payNow': 'Pay now',
@ -386,7 +432,7 @@ export default {
'h5.recharge.payConfirmingTitle': 'Confirming payment', 'h5.recharge.payConfirmingTitle': 'Confirming payment',
'h5.recharge.payConfirmingHint': 'h5.recharge.payConfirmingHint':
'If charged, balance usually updates within seconds. Check recharge records later—do not pay twice.', '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.success': 'Submitted. Pending review.',
'h5.recharge.paidSuccess': 'Paid. Balance updated.', 'h5.recharge.paidSuccess': 'Paid. Balance updated.',
'h5.recharge.failed': 'Submit failed', 'h5.recharge.failed': 'Submit failed',
@ -1046,11 +1092,20 @@ export default {
'h5.pay.waybillNo': 'Waybill', 'h5.pay.waybillNo': 'Waybill',
'h5.pay.orderTotal': 'Order due', 'h5.pay.orderTotal': 'Order due',
'h5.pay.methodBalance': 'Pay with balance', 'h5.pay.methodBalance': 'Pay with balance',
'h5.pay.useBalance': 'Use account balance',
'h5.pay.methodHybrid': 'Balance first · WeChat shortfall', 'h5.pay.methodHybrid': 'Balance first · WeChat shortfall',
'h5.pay.methodHybridHint': 'Use balance {balance}, WeChat {wechat}', 'h5.pay.methodHybridHint': 'Use balance {balance}, WeChat {wechat}',
'h5.pay.settleTitle': 'Payment', 'h5.pay.settleTitle': 'Payment',
'h5.pay.splitBalance': 'Account balance', 'h5.pay.splitBalance': 'Account balance',
'h5.pay.splitWechat': 'WeChat shortfall', '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.hybridWechatTip': 'WeChat checkout will only charge the shortfall',
'h5.pay.availableBalance': 'Available {amount}', 'h5.pay.availableBalance': 'Available {amount}',
'h5.pay.orderCount': '{count} orders', 'h5.pay.orderCount': '{count} orders',

View File

@ -361,17 +361,57 @@ export default {
'h5.login.switchToCustomer': '切换至客户登录', 'h5.login.switchToCustomer': '切换至客户登录',
'h5.recharge.title': '账户充值', 'h5.recharge.title': '账户充值',
'h5.recharge.amount': '充值金额', 'h5.recharge.currentAmount': '当前充值金额',
'h5.recharge.amount': '选择金额',
'h5.recharge.custom': '自定义', 'h5.recharge.custom': '自定义',
'h5.recharge.customPlaceholder': '请输入金额', 'h5.recharge.customPlaceholder': '最低 0.01',
'h5.recharge.payType': '支付方式', '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.wechat': '微信支付',
'h5.recharge.wechatOnline': '微信在线支付', 'h5.recharge.wechatOnline': '微信在线支付',
'h5.recharge.wechatOnlineDesc': '微信内调起 · 秒级到账',
'h5.recharge.alipayOnline': '支付宝在线支付',
'h5.recharge.alipayOnlineDesc': '跳转支付宝 · 秒级到账',
'h5.recharge.alipayWapTip': '将跳转支付宝完成支付,支付后自动返回本页确认到账',
'h5.recharge.alipayRedirectFailed': '跳转支付宝失败',
'h5.recharge.wechatVoucher': '微信转账凭证', '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.qrTip': '扫码转账后请上传凭证',
'h5.recharge.qrEmpty': '暂未配置收款码,请联系客服', 'h5.recharge.qrEmpty': '暂未配置收款码,请联系客服',
'h5.recharge.voucher': '转账凭证(可选)', 'h5.recharge.voucher': '转账凭证(可选)',
'h5.recharge.voucherBank': '银行回单(可选)',
'h5.recharge.upload': '上传', 'h5.recharge.upload': '上传',
'h5.recharge.submit': '提交审核', 'h5.recharge.submit': '提交审核',
'h5.recharge.payNow': '立即支付', 'h5.recharge.payNow': '立即支付',
@ -384,7 +424,7 @@ export default {
'h5.recharge.payConfirming': '支付结果确认中,稍后可在充值记录查看', 'h5.recharge.payConfirming': '支付结果确认中,稍后可在充值记录查看',
'h5.recharge.payConfirmingTitle': '支付确认中', 'h5.recharge.payConfirmingTitle': '支付确认中',
'h5.recharge.payConfirmingHint': '若已扣款,余额通常数秒内到账;也可稍后在充值记录核对。勿重复支付。', 'h5.recharge.payConfirmingHint': '若已扣款,余额通常数秒内到账;也可稍后在充值记录核对。勿重复支付。',
'h5.recharge.needAmount': '请选择或输入充值金额', 'h5.recharge.needAmount': '请选择或输入充值金额(最低 0.01)',
'h5.recharge.success': '已提交,等待审核', 'h5.recharge.success': '已提交,等待审核',
'h5.recharge.paidSuccess': '支付成功,余额已到账', 'h5.recharge.paidSuccess': '支付成功,余额已到账',
'h5.recharge.failed': '提交失败', 'h5.recharge.failed': '提交失败',
@ -1032,12 +1072,21 @@ export default {
'h5.pay.orderTotal': '本单应付', 'h5.pay.orderTotal': '本单应付',
'h5.pay.methodBalance': '账户余额支付', 'h5.pay.methodBalance': '账户余额支付',
'h5.pay.methodHint': '支付成功后将从账户余额扣款', 'h5.pay.methodHint': '支付成功后将从账户余额扣款',
'h5.pay.useBalance': '使用账户余额',
'h5.pay.methodHybrid': '余额优先 · 微信补差', 'h5.pay.methodHybrid': '余额优先 · 微信补差',
'h5.pay.methodHybridHint': '本次用余额 {balance},微信补差 {wechat}', 'h5.pay.methodHybridAlipay': '余额优先 · 支付宝补差',
'h5.pay.methodHybridHint': '本次用余额 {balance},在线补差 {wechat}',
'h5.pay.settleTitle': '支付方式', 'h5.pay.settleTitle': '支付方式',
'h5.pay.splitBalance': '账户余额', 'h5.pay.splitBalance': '账户余额',
'h5.pay.splitWechat': '微信补差', 'h5.pay.splitWechat': '微信补差',
'h5.pay.splitAlipay': '支付宝补差',
'h5.pay.channelWechat': '微信',
'h5.pay.channelAlipay': '支付宝',
'h5.pay.hybridWechatTip': '确认后将调起微信支付,仅支付补差部分', 'h5.pay.hybridWechatTip': '确认后将调起微信支付,仅支付补差部分',
'h5.pay.hybridAlipayTip': '确认后将跳转支付宝,仅支付补差部分',
'h5.pay.confirmAlipayAmount': '支付宝支付 {amount}',
'h5.pay.footAlipayDue': '本次支付宝应付',
'h5.pay.alipayRedirectFailed': '跳转支付宝失败',
'h5.pay.availableBalance': '可用余额 {amount}', 'h5.pay.availableBalance': '可用余额 {amount}',
'h5.pay.orderCount': '{count} 笔订单', 'h5.pay.orderCount': '{count} 笔订单',
'h5.pay.feeDetails': '费用明细', 'h5.pay.feeDetails': '费用明细',

View File

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

View File

@ -502,6 +502,7 @@ import {
} from '@/composables/useAskAdvisor'; } from '@/composables/useAskAdvisor';
import { addPickupOrderOrders, getPickupOrderDetail } from '@/api/order/pickupOrder'; import { addPickupOrderOrders, getPickupOrderDetail } from '@/api/order/pickupOrder';
import { consumeOrderPayOauthResume } from '../utils/orderPayOauth'; import { consumeOrderPayOauthResume } from '../utils/orderPayOauth';
import { getAlipayPayStatus } from '@/api/recharge/alipayPay';
import H5OrderPaySheet from '../components/H5OrderPaySheet.vue'; import H5OrderPaySheet from '../components/H5OrderPaySheet.vue';
const H5OrderDetailSheet = defineAsyncComponent( const H5OrderDetailSheet = defineAsyncComponent(
@ -1500,7 +1501,69 @@ function resumeOrderPayOauthIfNeeded() {
payVisible.value = true; 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(); resumeOrderPayOauthIfNeeded();
void resumeAlipayOrderPayIfNeeded();
function onPaySuccess() { function onPaySuccess() {
payOauthCode.value = undefined; payOauthCode.value = undefined;

View File

@ -240,14 +240,12 @@
</div> </div>
<div class="lane-panel__hist"> <div class="lane-panel__hist">
<span>日均时效走势</span> <span>日均时效走势</span>
<div class="lane-panel__hist-bars"> <Chart
<i class="lane-panel__trend-chart"
v-for="(d, i) in active.dailyAvg" width="100%"
:key="`d-${i}`" height="108px"
:style="{ height: `${histHeight(d)}%`, background: latencyColor(d) }" :options="latencyTrendOption"
:title="formatDays(d)" />
/>
</div>
</div> </div>
</article> </article>
@ -298,15 +296,12 @@
</div> </div>
<div class="lane-panel__hist"> <div class="lane-panel__hist">
<span>日毛利走势</span> <span>日毛利走势</span>
<div class="lane-panel__hist-bars"> <Chart
<i class="lane-panel__trend-chart"
v-for="(p, i) in active.dailyProfit" width="100%"
:key="`p-${i}`" height="108px"
class="is-profit-bar" :options="profitTrendOption"
:style="{ height: `${profitHeight(p)}%` }" />
:title="formatMoney(p)"
/>
</div>
</div> </div>
</article> </article>
</div> </div>
@ -319,6 +314,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import Chart from '@/components/chart/index.vue'
import { import {
formatCount, formatCount,
formatDays, formatDays,
@ -482,15 +478,6 @@ function latency(lane: LaneStat) {
return props.latencyMode === 'success' ? lane.avgSuccessDays : lane.avgFailDays 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) { function growthClass(v?: number | null) {
if (v == null || Number.isNaN(Number(v))) return '' if (v == null || Number.isNaN(Number(v))) return ''
const n = Number(v) const n = Number(v)
@ -498,6 +485,180 @@ function growthClass(v?: number | null) {
if (n < 0) return 'is-down' if (n < 0) return 'is-down'
return '' 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> </script>
<style scoped lang="less"> <style scoped lang="less">
@ -1153,27 +1314,13 @@ function growthClass(v?: number | null) {
display: block; display: block;
font-size: 11px; font-size: 11px;
color: rgba(26, 46, 56, 0.42); color: rgba(26, 46, 56, 0.42);
margin-bottom: 6px; margin-bottom: 4px;
} }
} }
.lane-panel__hist-bars { .lane-panel__trend-chart {
display: flex; width: 100%;
align-items: flex-end; min-height: 108px;
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;
}
}
} }
@media (max-width: 1100px) { @media (max-width: 1100px) {

View File

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

View File

@ -12,6 +12,13 @@ import {
createOrderWeChatPay, createOrderWeChatPay,
getWeChatPayStatus, getWeChatPayStatus,
} from '@/api/recharge/wechatPay' } from '@/api/recharge/wechatPay'
import {
closeAlipayPay,
createOrderAlipayPay,
getAlipayPayStatus,
} from '@/api/recharge/alipayPay'
import wxIcon from '@/assets/wx.png'
import zfbIcon from '@/assets/zfb.png'
import { import {
formatCouponBenefit, formatCouponBenefit,
formatPayMoney, formatPayMoney,
@ -167,16 +174,26 @@ const singleBalance = computed(() => {
const pricingLoading = computed(() => couponPricing.anyLoading.value) const pricingLoading = computed(() => couponPricing.anyLoading.value)
/** 单客户:余额优先;多客户:仅余额(不足不可确认) */ /** 单客户:是否用账户余额抵扣(可关,关则全额扫码) */
const useAccountBalance = ref(true)
const canUseAccountBalance = computed(
() => !isMultiCustomer.value && singleBalance.value != null && singleBalance.value > 1e-6,
)
/** 单客户:可选余额;多客户:仅余额(不足不可确认) */
const hybridBalanceUse = computed(() => { const hybridBalanceUse = computed(() => {
if (isMultiCustomer.value || singleBalance.value == null) return 0 if (isMultiCustomer.value || singleBalance.value == null) return 0
if (!useAccountBalance.value) return 0
return Math.min(singleBalance.value, totals.value.payable) return Math.min(singleBalance.value, totals.value.payable)
}) })
const hybridWechatAmount = computed(() => { const hybridWechatAmount = computed(() => {
if (isMultiCustomer.value || singleBalance.value == null) return 0 if (isMultiCustomer.value) return 0
if (singleBalance.value == null && useAccountBalance.value) return 0
return Math.max(0, totals.value.payable - hybridBalanceUse.value) return Math.max(0, totals.value.payable - hybridBalanceUse.value)
}) })
const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6) const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6)
/** 在线补差渠道:微信扫码 / 支付宝扫码 */
const onlinePayChannel = ref<'wechat' | 'alipay'>('wechat')
const wxQrVisible = ref(false) const wxQrVisible = ref(false)
const wxQrDataUrl = ref('') const wxQrDataUrl = ref('')
@ -193,10 +210,16 @@ function stopWxPoll() {
async function cancelWxPay() { async function cancelWxPay() {
stopWxPoll() stopWxPoll()
const no = wxOutTradeNo.value const no = wxOutTradeNo.value
const channel = onlinePayChannel.value
wxQrVisible.value = false wxQrVisible.value = false
wxQrDataUrl.value = '' wxQrDataUrl.value = ''
wxOutTradeNo.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( const canConfirm = computed(
@ -446,7 +469,7 @@ async function handleConfirm() {
const queue = [...payableOrders.value] const queue = [...payableOrders.value]
if (!queue.length) return if (!queue.length) return
// 单客户且需微信补差:一笔混合支付 // 单客户且需在线补差:一笔混合支付(微信 / 支付宝)
if (!isMultiCustomer.value && needsWechatPay.value) { if (!isMultiCustomer.value && needsWechatPay.value) {
submitting.value = true submitting.value = true
try { try {
@ -454,11 +477,20 @@ async function handleConfirm() {
for (const p of queue) { for (const p of queue) {
couponByOrderId[Number(p.id)] = couponEntry(p)?.selectedCouponId ?? 0 couponByOrderId[Number(p.id)] = couponEntry(p)?.selectedCouponId ?? 0
} }
const created = await createOrderWeChatPay({ const useAlipay = onlinePayChannel.value === 'alipay'
orderIds: queue.map((p) => Number(p.id)), const created = useAlipay
couponByOrderId, ? await createOrderAlipayPay({
scene: 'native', orderIds: queue.map((p) => Number(p.id)),
}) couponByOrderId,
scene: 'precreate',
useBalance: useAccountBalance.value,
})
: await createOrderWeChatPay({
orderIds: queue.map((p) => Number(p.id)),
couponByOrderId,
scene: 'native',
useBalance: useAccountBalance.value,
})
if (created.paidImmediately) { if (created.paidImmediately) {
for (const p of queue) { for (const p of queue) {
payStatus.value = { ...payStatus.value, [p.key]: 'success' } payStatus.value = { ...payStatus.value, [p.key]: 'success' }
@ -473,7 +505,11 @@ async function handleConfirm() {
return return
} }
if (!created.codeUrl || !created.outTradeNo) { 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 wxOutTradeNo.value = created.outTradeNo
wxQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, { wxQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
@ -484,7 +520,9 @@ async function handleConfirm() {
stopWxPoll() stopWxPoll()
wxPollTimer = setInterval(async () => { wxPollTimer = setInterval(async () => {
try { 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) { if (st.status === 'Success' || st.statusCode === 3) {
stopWxPoll() stopWxPoll()
wxQrVisible.value = false wxQrVisible.value = false
@ -568,6 +606,8 @@ watch(
() => [props.visible, props.orders] as const, () => [props.visible, props.orders] as const,
([visible]) => { ([visible]) => {
if (visible) { if (visible) {
useAccountBalance.value = true
onlinePayChannel.value = 'wechat'
loadPreviews() loadPreviews()
} else { } else {
stopWxPoll() stopWxPoll()
@ -614,7 +654,21 @@ watch(
<dt>{{ t('order.myOrders.modal.paySubtotal') }}</dt> <dt>{{ t('order.myOrders.modal.paySubtotal') }}</dt>
<dd>{{ formatPayMoney(totals.subtotal) }}</dd> <dd>{{ formatPayMoney(totals.subtotal) }}</dd>
</div> </div>
<div v-if="singleBalance != null"> <template v-if="!isMultiCustomer && (needsWechatPay || canUseAccountBalance)">
<div v-if="useAccountBalance">
<dt>{{ t('order.myOrders.modal.payHybridBalanceLabel') }}</dt>
<dd>{{ formatPayMoney(hybridBalanceUse) }}</dd>
</div>
<div v-if="needsWechatPay">
<dt>{{ t('order.myOrders.modal.payHybridOnlineLabel') }}</dt>
<dd class="is-emphasis">{{ formatPayMoney(hybridWechatAmount) }}</dd>
</div>
<div v-else-if="singleBalance != null">
<dt>{{ t('order.myOrders.modal.payBalance') }}</dt>
<dd>{{ formatPayMoney(singleBalance) }}</dd>
</div>
</template>
<div v-else-if="singleBalance != null">
<dt>{{ t('order.myOrders.modal.payBalance') }}</dt> <dt>{{ t('order.myOrders.modal.payBalance') }}</dt>
<dd :class="{ 'is-danger': balanceShortfalls.length }">{{ formatPayMoney(singleBalance) }}</dd> <dd :class="{ 'is-danger': balanceShortfalls.length }">{{ formatPayMoney(singleBalance) }}</dd>
</div> </div>
@ -632,14 +686,46 @@ watch(
</div> </div>
<div>{{ t('order.myOrders.modal.payMultiCustomerWxHint') }}</div> <div>{{ t('order.myOrders.modal.payMultiCustomerWxHint') }}</div>
</a-alert> </a-alert>
<a-alert <div v-else-if="!isMultiCustomer && (canUseAccountBalance || needsWechatPay)" class="pay-method-block">
v-else-if="needsWechatPay" <label v-if="canUseAccountBalance" class="pay-balance-toggle">
type="info" <a-checkbox v-model="useAccountBalance" :disabled="submitting">
show-icon {{ t('order.myOrders.modal.payUseBalance') }}
class="pay-alert" </a-checkbox>
> <span class="pay-balance-toggle__amt">{{ formatPayMoney(singleBalance) }}</span>
{{ t('order.myOrders.modal.payHybridHint', { amount: formatPayMoney(hybridWechatAmount) }) }} </label>
</a-alert> <div
v-if="needsWechatPay"
class="pay-method-row"
role="radiogroup"
:aria-label="t('order.myOrders.modal.payOnlineChannel')"
>
<span class="pay-method-row__label">{{ t('order.myOrders.modal.payOnlineChannel') }}</span>
<button
type="button"
class="pay-method-chip"
:class="{ 'is-active': onlinePayChannel === 'wechat' }"
:disabled="submitting"
role="radio"
:aria-checked="onlinePayChannel === 'wechat'"
@click="onlinePayChannel = 'wechat'"
>
<img :src="wxIcon" alt="" />
{{ t('order.myOrders.modal.payChannelWechat') }}
</button>
<button
type="button"
class="pay-method-chip"
:class="{ 'is-active': onlinePayChannel === 'alipay' }"
:disabled="submitting"
role="radio"
:aria-checked="onlinePayChannel === 'alipay'"
@click="onlinePayChannel = 'alipay'"
>
<img :src="zfbIcon" alt="" />
{{ t('order.myOrders.modal.payChannelAlipay') }}
</button>
</div>
</div>
<a-alert v-if="isMulti && blockedOrders.length" type="info" show-icon class="pay-alert"> <a-alert v-if="isMulti && blockedOrders.length" type="info" show-icon class="pay-alert">
{{ t('order.myOrders.modal.paySkipHint', { count: blockedOrders.length }) }} {{ t('order.myOrders.modal.paySkipHint', { count: blockedOrders.length }) }}
</a-alert> </a-alert>
@ -778,9 +864,25 @@ watch(
<div v-if="wxQrVisible" class="pay-wx-layer"> <div v-if="wxQrVisible" class="pay-wx-layer">
<div class="pay-wx-card"> <div class="pay-wx-card">
<h4>{{ t('order.myOrders.modal.payWxTitle') }}</h4> <h4>
<p class="pay-wx-card__tip">{{ t('order.myOrders.modal.payWxTip') }}</p> {{
<img v-if="wxQrDataUrl" :src="wxQrDataUrl" alt="wx-pay-qr" /> 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"> <p class="pay-wx-card__amt">
{{ t('order.myOrders.modal.payWxAmount', { amount: formatPayMoney(hybridWechatAmount) }) }} {{ t('order.myOrders.modal.payWxAmount', { amount: formatPayMoney(hybridWechatAmount) }) }}
</p> </p>
@ -791,22 +893,6 @@ watch(
<template #footer> <template #footer>
<div class="pay-footer"> <div class="pay-footer">
<div class="pay-footer__method">
<template v-if="isMultiCustomer">
{{ t('order.myOrders.modal.payMethodBalance') }}
</template>
<template v-else-if="needsWechatPay">
<span>{{ t('order.myOrders.modal.payMethodHybrid') }}</span>
<span class="pay-footer__split">
{{ t('order.myOrders.modal.paySplitBalance', { amount: formatPayMoney(hybridBalanceUse) }) }}
·
{{ t('order.myOrders.modal.paySplitWechat', { amount: formatPayMoney(hybridWechatAmount) }) }}
</span>
</template>
<template v-else>
{{ t('order.myOrders.modal.payMethodBalance') }}
</template>
</div>
<a-button :disabled="submitting" @click="closeModal">{{ t('warehouse.common.cancel') }}</a-button> <a-button :disabled="submitting" @click="closeModal">{{ t('warehouse.common.cancel') }}</a-button>
<a-button <a-button
type="primary" type="primary"
@ -901,6 +987,10 @@ watch(
&.is-danger { &.is-danger {
color: rgb(var(--danger-6)); color: rgb(var(--danger-6));
} }
&.is-emphasis {
color: var(--app-primary-color);
}
} }
} }
@ -908,6 +998,76 @@ watch(
margin: 0; margin: 0;
} }
.pay-method-block {
display: flex;
flex-direction: column;
gap: 10px;
}
.pay-balance-toggle {
display: inline-flex;
align-items: center;
gap: 10px;
min-height: 32px;
cursor: pointer;
user-select: none;
}
.pay-balance-toggle__amt {
font-size: 13px;
color: var(--color-text-3);
font-variant-numeric: tabular-nums;
}
.pay-method-row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.pay-method-row__label {
margin-right: 4px;
font-size: 13px;
color: var(--color-text-2);
}
.pay-method-chip {
display: inline-flex;
align-items: center;
gap: 6px;
height: 32px;
padding: 0 12px;
border-radius: 4px;
border: 1px solid var(--color-border-2);
background: #fff;
color: var(--color-text-1);
font-size: 13px;
cursor: pointer;
transition: border-color 0.15s, background 0.15s, color 0.15s;
img {
width: 18px;
height: 18px;
object-fit: contain;
}
&:hover:not(:disabled) {
border-color: color-mix(in srgb, var(--app-primary-color) 40%, var(--color-border-2));
}
&.is-active {
border-color: var(--app-primary-color);
color: var(--app-primary-color);
background: color-mix(in srgb, var(--app-primary-color) 8%, #fff);
}
&:disabled {
opacity: 0.55;
cursor: not-allowed;
}
}
.pay-list-head { .pay-list-head {
display: flex; display: flex;
align-items: center; align-items: center;
@ -1116,21 +1276,6 @@ watch(
width: 100%; width: 100%;
} }
.pay-footer__method {
margin-right: auto;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
font-size: 13px;
color: var(--color-text-2);
}
.pay-footer__split {
font-size: 12px;
color: var(--color-text-3);
}
.pay-wx-layer { .pay-wx-layer {
position: absolute; position: absolute;
inset: 0; inset: 0;

View File

@ -71,18 +71,20 @@
@focus="$emit('warm-login')" @focus="$emit('warm-login')"
> >
<span>{{ copy.heroCta }}</span> <span>{{ copy.heroCta }}</span>
<svg <span class="ai-welcome-cta__orb" aria-hidden="true">
class="ai-welcome-cta__arrow" <svg
viewBox="0 0 16 16" class="ai-welcome-cta__arrow"
width="14" viewBox="0 0 16 16"
height="14" width="12"
aria-hidden="true" height="12"
> aria-hidden="true"
<path >
fill="currentColor" <path
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" 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> />
</svg>
</span>
</a> </a>
</div> </div>
</template> </template>

View File

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

View File

@ -1,147 +1,146 @@
<template> <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"> <header id="header" class="header site-chrome fixed-top">
<a <a
href="/" href="/"
class="site-nav-wordmark" class="site-nav-wordmark"
:class="{ :class="{
active: nav === 'home', active: nav === 'home',
'is-active': nav === 'home', 'is-active': nav === 'home',
}" }"
:aria-current="nav === 'home' ? 'page' : undefined" :aria-current="nav === 'home' ? 'page' : undefined"
aria-label="BCDship" aria-label="BCDship"
@click.prevent="onNavClick('home')" @click.prevent="onNavClick('home')"
>
<span
v-if="siteLogoSrc"
class="site-nav-wordmark__logo"
aria-hidden="true"
> >
<span <img
v-if="siteLogoSrc" :src="siteLogoSrc"
class="site-nav-wordmark__logo" alt=""
aria-hidden="true" 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 <span class="site-nav-dock__glass" aria-hidden="true"></span>
:src="siteLogoSrc" <span ref="sliderRef" class="site-nav-dock__slider" aria-hidden="true"></span>
alt="" <a
width="36" v-for="item in items"
height="36" :key="item.id"
/> :href="item.href"
</span> role="menuitem"
<span class="site-nav-wordmark__copy"> class="site-nav-dock__item"
<span class="site-nav-wordmark__text">BCDship</span> :class="{
<span class="site-nav-wordmark__tag">{{ brandCopy.navFullName }}</span> active: nav === item.id,
</span> 'is-active': nav === item.id,
</a> 'is-panel': isPanelItem(item.id) && panel === item.id,
<button }"
type="button" :aria-current="nav === item.id ? 'page' : undefined"
class="mobile-nav-toggle mobile-nav-show" :aria-expanded="isPanelItem(item.id) ? panel === item.id : undefined"
:aria-label="isZh ? '打开菜单' : 'Open menu'" :aria-haspopup="isPanelItem(item.id) ? 'dialog' : undefined"
@click="$emit('open-nav')" @click.prevent="onNavClick(item.id)"
>
<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
<span ref="sliderRef" class="site-nav-dock__slider" aria-hidden="true"></span> class="site-nav-dock__icon"
<a aria-hidden="true"
v-for="item in items" v-html="item.icon"
:key="item.id" ></span>
:href="item.href" <span class="site-nav-dock__label">{{ isZh ? item.zh : item.en }}</span>
role="menuitem" </a>
class="site-nav-dock__item" </li>
:class="{ <li class="site-nav-tools">
active: nav === item.id, <span class="site-nav-tools__glass" aria-hidden="true"></span>
'is-active': nav === item.id, <a
'is-panel': isPanelItem(item.id) && panel === item.id, v-if="!signedIn"
}" class="site-nav-login"
:aria-current="nav === item.id ? 'page' : undefined" :href="loginUrl"
:aria-expanded="isPanelItem(item.id) ? panel === item.id : undefined" @pointerenter="$emit('warm-login')"
:aria-haspopup="isPanelItem(item.id) ? 'dialog' : undefined" @focus="$emit('warm-login')"
@click.prevent="onNavClick(item.id)" @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 <circle
class="site-nav-dock__icon" cx="12"
aria-hidden="true" cy="8.2"
v-html="item.icon" r="3.4"
></span> stroke="currentColor"
<span class="site-nav-dock__label">{{ isZh ? item.zh : item.en }}</span> stroke-width="1.8"
</a> />
</li> <path
<li class="site-nav-tools"> d="M5.2 19.2c.7-3.2 3.2-5 6.8-5s6.1 1.8 6.8 5"
<span class="site-nav-tools__glass" aria-hidden="true"></span> stroke="currentColor"
<a stroke-width="1.8"
v-if="!signedIn" stroke-linecap="round"
class="site-nav-login" />
:href="loginUrl" </svg>
@pointerenter="$emit('warm-login')" </a>
@focus="$emit('warm-login')" <button
@click="onLoginClick" type="button"
>{{ isZh ? '登录' : 'Log in' }}</a> id="language-toggle-btn"
<a class="language-toggle-link"
v-else :aria-label="isZh ? 'Switch language' : '切换语言'"
class="site-nav-avatar" @click="$emit('toggle-lang')"
:href="homeUrl" >
:title="displayName" <i class="si si-translate language-toggle-icon" aria-hidden="true"></i>
:aria-label="displayName" <span class="language-toggle__next">{{ isZh ? 'EN' : '中' }}</span>
> </button>
<svg </li>
class="site-nav-avatar__icon" </ul>
width="22" </nav>
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>
</header> </header>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { brandLogoImages } from '@/utils/brandLogo'; import { brandLogoImages, ensureBrandAssetsFresh } from '@/utils/brandLogo';
import { brandCopy } from '@/utils/brandCopy'; import { brandCopy } from '@/utils/brandCopy';
import { useUserStore } from '@/store'; import { useUserStore } from '@/store';
import { useRbacUserStore } from '@/store/modules/rbac-user'; import { useRbacUserStore } from '@/store/modules/rbac-user';
@ -182,6 +181,7 @@
const signedIn = computed(() => rbacUserStore.isLoggedIn); const signedIn = computed(() => rbacUserStore.isLoggedIn);
const homeUrl = officialAppHomeUrl(); const homeUrl = officialAppHomeUrl();
const siteLogoSrc = computed(() => brandLogoImages.site); const siteLogoSrc = computed(() => brandLogoImages.site);
ensureBrandAssetsFresh();
function onLoginClick(e: MouseEvent) { function onLoginClick(e: MouseEvent) {
goOfficialLogin(router, undefined, e); goOfficialLogin(router, undefined, e);

View File

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

View File

@ -15,7 +15,8 @@
paymentQrLoading || paymentQrLoading ||
brandLogoLoading || brandLogoLoading ||
wechatNotifyLoading || wechatNotifyLoading ||
wechatPayLoading wechatPayLoading ||
alipayPayLoading
" "
@click="refreshCurrent" @click="refreshCurrent"
> >
@ -338,11 +339,22 @@
</header> </header>
<a-form :model="wechatPayForm" layout="vertical" class="wx-pay-form"> <a-form :model="wechatPayForm" layout="vertical" class="wx-pay-form">
<a-form-item <a-form-item
:label="t('system.otherConfig.paymentQr.wechatPay.mchId')"
required required
:validate-status="wechatPayErrors.mchId ? 'error' : undefined" :validate-status="wechatPayErrors.mchId ? 'error' : undefined"
:help="wechatPayErrors.mchId" :help="wechatPayErrors.mchId"
> >
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.mchId') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.mchIdPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<a-input <a-input
v-model="wechatPayForm.mchId" v-model="wechatPayForm.mchId"
allow-clear allow-clear
@ -351,11 +363,22 @@
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="t('system.otherConfig.paymentQr.wechatPay.mchSerialNo')"
required required
:validate-status="wechatPayErrors.mchSerialNo ? 'error' : undefined" :validate-status="wechatPayErrors.mchSerialNo ? 'error' : undefined"
:help="wechatPayErrors.mchSerialNo" :help="wechatPayErrors.mchSerialNo"
> >
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.mchSerialNo') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.mchSerialNoPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<a-input <a-input
v-model="wechatPayForm.mchSerialNo" v-model="wechatPayForm.mchSerialNo"
allow-clear allow-clear
@ -364,11 +387,48 @@
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="t('system.otherConfig.paymentQr.wechatPay.notifyUrl')" required
:validate-status="wechatPayErrors.platformPublicKeyId ? 'error' : undefined"
:help="wechatPayErrors.platformPublicKeyId"
>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyId') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyIdPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<a-input
v-model="wechatPayForm.platformPublicKeyId"
allow-clear
:placeholder="
t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyIdPlaceholder')
"
@input="wechatPayErrors.platformPublicKeyId = ''"
/>
</a-form-item>
<a-form-item
required required
:validate-status="wechatPayErrors.notifyUrl ? 'error' : undefined" :validate-status="wechatPayErrors.notifyUrl ? 'error' : undefined"
:help="wechatPayErrors.notifyUrl" :help="wechatPayErrors.notifyUrl"
> >
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.notifyUrl') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.notifyUrlPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<div class="wx-pay-field-row"> <div class="wx-pay-field-row">
<a-input <a-input
v-model="wechatPayForm.notifyUrl" v-model="wechatPayForm.notifyUrl"
@ -394,6 +454,13 @@
<template #label> <template #label>
<span class="wx-pay-label"> <span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.apiV3Key') }} {{ t('system.otherConfig.paymentQr.wechatPay.apiV3Key') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.apiV3KeyPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
<span <span
class="wx-pay-tag" class="wx-pay-tag"
:class="wechatPayMeta.hasApiV3Key ? 'is-ok' : 'is-miss'" :class="wechatPayMeta.hasApiV3Key ? 'is-ok' : 'is-miss'"
@ -420,6 +487,13 @@
<template #label> <template #label>
<span class="wx-pay-label"> <span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.privateKeyPem') }} {{ t('system.otherConfig.paymentQr.wechatPay.privateKeyPem') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.privateKeyPemPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
<span <span
class="wx-pay-tag" class="wx-pay-tag"
:class="wechatPayMeta.hasPrivateKey ? 'is-ok' : 'is-miss'" :class="wechatPayMeta.hasPrivateKey ? 'is-ok' : 'is-miss'"
@ -436,7 +510,7 @@
<a-textarea <a-textarea
v-model="wechatPayForm.privateKeyPem" v-model="wechatPayForm.privateKeyPem"
class="wx-pay-pem" class="wx-pay-pem"
:auto-size="{ minRows: 5, maxRows: 12 }" :auto-size="{ minRows: 4, maxRows: 10 }"
:placeholder=" :placeholder="
wechatPayMeta.hasPrivateKey wechatPayMeta.hasPrivateKey
? t('system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder') ? t('system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder')
@ -463,6 +537,60 @@
</div> </div>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyPem') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyPemPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
<span
class="wx-pay-tag"
:class="wechatPayMeta.hasPlatformPublicKey ? 'is-ok' : 'is-miss'"
>
{{
wechatPayMeta.hasPlatformPublicKey
? t('system.otherConfig.paymentQr.wechatPay.hasKey')
: t('system.otherConfig.paymentQr.wechatPay.missingKey')
}}
</span>
</span>
</template>
<div class="wx-pay-pem-block">
<a-textarea
v-model="wechatPayForm.platformPublicKeyPem"
class="wx-pay-pem"
:auto-size="{ minRows: 4, maxRows: 10 }"
:placeholder="
wechatPayMeta.hasPlatformPublicKey
? t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyPlaceholder')
: t('system.otherConfig.paymentQr.wechatPay.platformPublicKeyRequired')
"
/>
<div class="wx-pay-pem-actions">
<label class="wx-pay-file">
<input
type="file"
accept=".pem,.key,text/plain"
@change="onWechatPayPublicPemFile"
/>
{{ t('system.otherConfig.paymentQr.wechatPay.importPem') }}
</label>
<button
v-if="wechatPayForm.platformPublicKeyPem"
type="button"
class="wx-pay-link-btn"
@click="wechatPayForm.platformPublicKeyPem = ''"
>
{{ t('system.otherConfig.paymentQr.wechatPay.clearPem') }}
</button>
</div>
</div>
</a-form-item>
</a-form> </a-form>
</section> </section>
@ -475,6 +603,13 @@
<div class="wx-pay-bind__field"> <div class="wx-pay-bind__field">
<span class="wx-pay-bind__label"> <span class="wx-pay-bind__label">
{{ t('system.otherConfig.paymentQr.wechatPay.appId') }} {{ t('system.otherConfig.paymentQr.wechatPay.appId') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.wechatPay.appIdPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span> </span>
<code v-if="wechatPayMeta.appId" class="wx-pay-bind__value"> <code v-if="wechatPayMeta.appId" class="wx-pay-bind__value">
{{ wechatPayMeta.appId }} {{ wechatPayMeta.appId }}
@ -522,6 +657,263 @@
</a-spin> </a-spin>
</div> </div>
</a-tab-pane> </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
required
:validate-status="alipayPayErrors.appId ? 'error' : undefined"
:help="alipayPayErrors.appId"
>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.alipayPay.appId') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.alipayPay.appIdPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<a-input
v-model="alipayPayForm.appId"
allow-clear
:placeholder="t('system.otherConfig.paymentQr.alipayPay.appIdPlaceholder')"
@input="alipayPayErrors.appId = ''"
/>
</a-form-item>
<a-form-item
required
:validate-status="alipayPayErrors.notifyUrl ? 'error' : undefined"
:help="alipayPayErrors.notifyUrl"
>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.alipayPay.notifyUrl') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.alipayPay.notifyUrlPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<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>
<template #label>
<span class="wx-pay-label">
{{ t('system.otherConfig.paymentQr.alipayPay.returnUrl') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.alipayPay.returnUrlPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
</span>
</template>
<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') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.alipayPay.privateKeyPemPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
<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') }}
<a-tooltip
:content="t('system.otherConfig.paymentQr.alipayPay.alipayPublicKeyPath')"
position="top"
:content-style="{ maxWidth: '360px' }"
>
<IconQuestionCircle class="wechat-notify-editor__help-icon" />
</a-tooltip>
<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-tabs>
<a-modal <a-modal
v-model:visible="bankAccountFormVisible" v-model:visible="bankAccountFormVisible"
@ -721,7 +1113,7 @@
</span> </span>
</template> </template>
<template v-else> <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"> <span class="brand-logo-card__hint">
{{ t('system.otherConfig.brandLogo.dropUpload') }} {{ t('system.otherConfig.brandLogo.dropUpload') }}
</span> </span>
@ -1371,6 +1763,10 @@ import {
getWeChatPayMerchantConfig, getWeChatPayMerchantConfig,
saveWeChatPayMerchantConfig, saveWeChatPayMerchantConfig,
} from '@/api/recharge/wechatPay' } from '@/api/recharge/wechatPay'
import {
getAlipayPayMerchantConfig,
saveAlipayPayMerchantConfig,
} from '@/api/recharge/alipayPay'
import { import {
brandLogoImages, brandLogoImages,
clearCachedBrandImage, clearCachedBrandImage,
@ -1831,7 +2227,12 @@ async function selectOpsPanel(key: OpsPanelKey) {
editingId.value = undefined editingId.value = undefined
if (key === 'paymentQr') { if (key === 'paymentQr') {
paymentQrTab.value = 'qr' paymentQrTab.value = 'qr'
await Promise.all([loadPaymentQr(), loadBankAccounts(), loadWechatPayMerchant()]) await Promise.all([
loadPaymentQr(),
loadBankAccounts(),
loadWechatPayMerchant(),
loadAlipayPayMerchant(),
])
return return
} }
if (key === 'brandLogo') { if (key === 'brandLogo') {
@ -1878,7 +2279,16 @@ async function refreshCurrent() {
await loadWechatPayMerchant() await loadWechatPayMerchant()
return return
} }
await Promise.all([loadPaymentQr(), loadBankAccounts(), loadWechatPayMerchant()]) if (paymentQrTab.value === 'alipayPay') {
await loadAlipayPayMerchant()
return
}
await Promise.all([
loadPaymentQr(),
loadBankAccounts(),
loadWechatPayMerchant(),
loadAlipayPayMerchant(),
])
return return
} }
if (activePanel.value === 'brandLogo') { if (activePanel.value === 'brandLogo') {
@ -1974,34 +2384,67 @@ async function loadPaymentQr() {
} }
} }
const paymentQrTab = ref<'qr' | 'bank' | 'wechatPay'>('qr') const paymentQrTab = ref<'qr' | 'bank' | 'wechatPay' | 'alipayPay'>('qr')
const wechatPayLoading = ref(false) const wechatPayLoading = ref(false)
const wechatPaySaving = 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({ const wechatPayMeta = reactive({
configured: false, configured: false,
hasApiV3Key: false, hasApiV3Key: false,
hasPrivateKey: false, hasPrivateKey: false,
hasPlatformPublicKey: false,
appId: '' as string | undefined, appId: '' as string | undefined,
}) })
const wechatPayForm = reactive({ const wechatPayForm = reactive({
enabled: false, enabled: false,
mchId: '', mchId: '',
mchSerialNo: '', mchSerialNo: '',
platformPublicKeyId: '',
notifyUrl: '', notifyUrl: '',
apiV3Key: '', apiV3Key: '',
privateKeyPem: '', privateKeyPem: '',
platformPublicKeyPem: '',
}) })
const wechatPaySnapshot = reactive({ const wechatPaySnapshot = reactive({
enabled: false, enabled: false,
mchId: '', mchId: '',
mchSerialNo: '', mchSerialNo: '',
platformPublicKeyId: '',
notifyUrl: '', notifyUrl: '',
apiV3Key: '', apiV3Key: '',
privateKeyPem: '', privateKeyPem: '',
platformPublicKeyPem: '',
}) })
const wechatPayErrors = reactive({ const wechatPayErrors = reactive({
mchId: '', mchId: '',
mchSerialNo: '', mchSerialNo: '',
platformPublicKeyId: '',
notifyUrl: '', notifyUrl: '',
}) })
const bankAccountLoading = ref(false) const bankAccountLoading = ref(false)
@ -2016,9 +2459,11 @@ const wechatPayDirty = computed(() => {
wechatPayForm.enabled !== wechatPaySnapshot.enabled || wechatPayForm.enabled !== wechatPaySnapshot.enabled ||
wechatPayForm.mchId !== wechatPaySnapshot.mchId || wechatPayForm.mchId !== wechatPaySnapshot.mchId ||
wechatPayForm.mchSerialNo !== wechatPaySnapshot.mchSerialNo || wechatPayForm.mchSerialNo !== wechatPaySnapshot.mchSerialNo ||
wechatPayForm.platformPublicKeyId !== wechatPaySnapshot.platformPublicKeyId ||
wechatPayForm.notifyUrl !== wechatPaySnapshot.notifyUrl || wechatPayForm.notifyUrl !== wechatPaySnapshot.notifyUrl ||
wechatPayForm.apiV3Key !== wechatPaySnapshot.apiV3Key || wechatPayForm.apiV3Key !== wechatPaySnapshot.apiV3Key ||
wechatPayForm.privateKeyPem !== wechatPaySnapshot.privateKeyPem wechatPayForm.privateKeyPem !== wechatPaySnapshot.privateKeyPem ||
wechatPayForm.platformPublicKeyPem !== wechatPaySnapshot.platformPublicKeyPem
) )
}) })
@ -2027,9 +2472,11 @@ const wechatPayReady = computed(() => {
wechatPayForm.enabled && wechatPayForm.enabled &&
!!wechatPayForm.mchId.trim() && !!wechatPayForm.mchId.trim() &&
!!wechatPayForm.mchSerialNo.trim() && !!wechatPayForm.mchSerialNo.trim() &&
!!wechatPayForm.platformPublicKeyId.trim() &&
!!wechatPayForm.notifyUrl.trim() && !!wechatPayForm.notifyUrl.trim() &&
(wechatPayMeta.hasApiV3Key || !!wechatPayForm.apiV3Key.trim()) && (wechatPayMeta.hasApiV3Key || !!wechatPayForm.apiV3Key.trim()) &&
(wechatPayMeta.hasPrivateKey || !!wechatPayForm.privateKeyPem.trim()) && (wechatPayMeta.hasPrivateKey || !!wechatPayForm.privateKeyPem.trim()) &&
(wechatPayMeta.hasPlatformPublicKey || !!wechatPayForm.platformPublicKeyPem.trim()) &&
!!wechatPayMeta.appId !!wechatPayMeta.appId
) )
}) })
@ -2037,7 +2484,10 @@ const wechatPayReady = computed(() => {
const wechatPayChecklist = computed(() => [ const wechatPayChecklist = computed(() => [
{ {
key: 'mch', key: 'mch',
ok: !!wechatPayForm.mchId.trim() && !!wechatPayForm.mchSerialNo.trim(), ok:
!!wechatPayForm.mchId.trim() &&
!!wechatPayForm.mchSerialNo.trim() &&
!!wechatPayForm.platformPublicKeyId.trim(),
label: t('system.otherConfig.paymentQr.wechatPay.checkMerchant'), label: t('system.otherConfig.paymentQr.wechatPay.checkMerchant'),
}, },
{ {
@ -2047,8 +2497,10 @@ const wechatPayChecklist = computed(() => [
}, },
{ {
key: 'secret', key: 'secret',
ok: (wechatPayMeta.hasApiV3Key || !!wechatPayForm.apiV3Key.trim()) && ok:
(wechatPayMeta.hasPrivateKey || !!wechatPayForm.privateKeyPem.trim()), (wechatPayMeta.hasApiV3Key || !!wechatPayForm.apiV3Key.trim()) &&
(wechatPayMeta.hasPrivateKey || !!wechatPayForm.privateKeyPem.trim()) &&
(wechatPayMeta.hasPlatformPublicKey || !!wechatPayForm.platformPublicKeyPem.trim()),
label: t('system.otherConfig.paymentQr.wechatPay.checkSecret'), label: t('system.otherConfig.paymentQr.wechatPay.checkSecret'),
}, },
{ {
@ -2066,9 +2518,11 @@ function applyWechatPaySnapshot() {
wechatPaySnapshot.enabled = wechatPayForm.enabled wechatPaySnapshot.enabled = wechatPayForm.enabled
wechatPaySnapshot.mchId = wechatPayForm.mchId wechatPaySnapshot.mchId = wechatPayForm.mchId
wechatPaySnapshot.mchSerialNo = wechatPayForm.mchSerialNo wechatPaySnapshot.mchSerialNo = wechatPayForm.mchSerialNo
wechatPaySnapshot.platformPublicKeyId = wechatPayForm.platformPublicKeyId
wechatPaySnapshot.notifyUrl = wechatPayForm.notifyUrl wechatPaySnapshot.notifyUrl = wechatPayForm.notifyUrl
wechatPaySnapshot.apiV3Key = wechatPayForm.apiV3Key wechatPaySnapshot.apiV3Key = wechatPayForm.apiV3Key
wechatPaySnapshot.privateKeyPem = wechatPayForm.privateKeyPem wechatPaySnapshot.privateKeyPem = wechatPayForm.privateKeyPem
wechatPaySnapshot.platformPublicKeyPem = wechatPayForm.platformPublicKeyPem
} }
function fillWechatPayNotifyUrl() { function fillWechatPayNotifyUrl() {
@ -2080,11 +2534,14 @@ function resetWechatPayForm() {
wechatPayForm.enabled = wechatPaySnapshot.enabled wechatPayForm.enabled = wechatPaySnapshot.enabled
wechatPayForm.mchId = wechatPaySnapshot.mchId wechatPayForm.mchId = wechatPaySnapshot.mchId
wechatPayForm.mchSerialNo = wechatPaySnapshot.mchSerialNo wechatPayForm.mchSerialNo = wechatPaySnapshot.mchSerialNo
wechatPayForm.platformPublicKeyId = wechatPaySnapshot.platformPublicKeyId
wechatPayForm.notifyUrl = wechatPaySnapshot.notifyUrl wechatPayForm.notifyUrl = wechatPaySnapshot.notifyUrl
wechatPayForm.apiV3Key = wechatPaySnapshot.apiV3Key wechatPayForm.apiV3Key = wechatPaySnapshot.apiV3Key
wechatPayForm.privateKeyPem = wechatPaySnapshot.privateKeyPem wechatPayForm.privateKeyPem = wechatPaySnapshot.privateKeyPem
wechatPayForm.platformPublicKeyPem = wechatPaySnapshot.platformPublicKeyPem
wechatPayErrors.mchId = '' wechatPayErrors.mchId = ''
wechatPayErrors.mchSerialNo = '' wechatPayErrors.mchSerialNo = ''
wechatPayErrors.platformPublicKeyId = ''
wechatPayErrors.notifyUrl = '' wechatPayErrors.notifyUrl = ''
} }
@ -2114,6 +2571,24 @@ async function onWechatPayPemFile(ev: Event) {
Message.error(t('system.otherConfig.paymentQr.wechatPay.pemReadFailed')) Message.error(t('system.otherConfig.paymentQr.wechatPay.pemReadFailed'))
} }
} }
async function onWechatPayPublicPemFile(ev: Event) {
const input = ev.target as HTMLInputElement
const file = input.files?.[0]
input.value = ''
if (!file) return
try {
const text = await file.text()
if (!text.includes('BEGIN PUBLIC KEY')) {
Message.warning(t('system.otherConfig.paymentQr.wechatPay.publicPemInvalid'))
return
}
wechatPayForm.platformPublicKeyPem = text.trim()
Message.success(t('system.otherConfig.paymentQr.wechatPay.publicPemImported'))
} catch {
Message.error(t('system.otherConfig.paymentQr.wechatPay.pemReadFailed'))
}
}
const bankAccountRows = ref<FinanceCompanyAccount[]>([]) const bankAccountRows = ref<FinanceCompanyAccount[]>([])
const bankAccountFormVisible = ref(false) const bankAccountFormVisible = ref(false)
const bankAccountSaving = ref(false) const bankAccountSaving = ref(false)
@ -2146,15 +2621,19 @@ async function loadWechatPayMerchant() {
wechatPayForm.enabled = cfg.enabled wechatPayForm.enabled = cfg.enabled
wechatPayForm.mchId = cfg.mchId wechatPayForm.mchId = cfg.mchId
wechatPayForm.mchSerialNo = cfg.mchSerialNo wechatPayForm.mchSerialNo = cfg.mchSerialNo
wechatPayForm.platformPublicKeyId = cfg.platformPublicKeyId
wechatPayForm.notifyUrl = cfg.notifyUrl wechatPayForm.notifyUrl = cfg.notifyUrl
wechatPayForm.apiV3Key = '' wechatPayForm.apiV3Key = ''
wechatPayForm.privateKeyPem = '' wechatPayForm.privateKeyPem = ''
wechatPayForm.platformPublicKeyPem = ''
wechatPayMeta.configured = cfg.configured wechatPayMeta.configured = cfg.configured
wechatPayMeta.hasApiV3Key = cfg.hasApiV3Key wechatPayMeta.hasApiV3Key = cfg.hasApiV3Key
wechatPayMeta.hasPrivateKey = cfg.hasPrivateKey wechatPayMeta.hasPrivateKey = cfg.hasPrivateKey
wechatPayMeta.hasPlatformPublicKey = cfg.hasPlatformPublicKey
wechatPayMeta.appId = cfg.appId wechatPayMeta.appId = cfg.appId
wechatPayErrors.mchId = '' wechatPayErrors.mchId = ''
wechatPayErrors.mchSerialNo = '' wechatPayErrors.mchSerialNo = ''
wechatPayErrors.platformPublicKeyId = ''
wechatPayErrors.notifyUrl = '' wechatPayErrors.notifyUrl = ''
applyWechatPaySnapshot() applyWechatPaySnapshot()
} catch (e) { } catch (e) {
@ -2168,6 +2647,7 @@ function validateWechatPayForm(): boolean {
let ok = true let ok = true
wechatPayErrors.mchId = '' wechatPayErrors.mchId = ''
wechatPayErrors.mchSerialNo = '' wechatPayErrors.mchSerialNo = ''
wechatPayErrors.platformPublicKeyId = ''
wechatPayErrors.notifyUrl = '' wechatPayErrors.notifyUrl = ''
if (!wechatPayForm.mchId.trim()) { if (!wechatPayForm.mchId.trim()) {
wechatPayErrors.mchId = t('system.otherConfig.paymentQr.wechatPay.needMchId') wechatPayErrors.mchId = t('system.otherConfig.paymentQr.wechatPay.needMchId')
@ -2177,6 +2657,10 @@ function validateWechatPayForm(): boolean {
wechatPayErrors.mchSerialNo = t('system.otherConfig.paymentQr.wechatPay.needSerial') wechatPayErrors.mchSerialNo = t('system.otherConfig.paymentQr.wechatPay.needSerial')
ok = false ok = false
} }
if (!wechatPayForm.platformPublicKeyId.trim()) {
wechatPayErrors.platformPublicKeyId = t('system.otherConfig.paymentQr.wechatPay.needPublicKeyId')
ok = false
}
if (!wechatPayForm.notifyUrl.trim()) { if (!wechatPayForm.notifyUrl.trim()) {
wechatPayErrors.notifyUrl = t('system.otherConfig.paymentQr.wechatPay.needNotify') wechatPayErrors.notifyUrl = t('system.otherConfig.paymentQr.wechatPay.needNotify')
ok = false ok = false
@ -2192,6 +2676,10 @@ function validateWechatPayForm(): boolean {
Message.warning(t('system.otherConfig.paymentQr.wechatPay.needPrivateKey')) Message.warning(t('system.otherConfig.paymentQr.wechatPay.needPrivateKey'))
ok = false ok = false
} }
if (!wechatPayMeta.hasPlatformPublicKey && !wechatPayForm.platformPublicKeyPem.trim()) {
Message.warning(t('system.otherConfig.paymentQr.wechatPay.needPlatformPublicKey'))
ok = false
}
return ok return ok
} }
@ -2203,19 +2691,24 @@ async function handleWechatPaySave() {
enabled: wechatPayForm.enabled, enabled: wechatPayForm.enabled,
mchId: wechatPayForm.mchId.trim(), mchId: wechatPayForm.mchId.trim(),
mchSerialNo: wechatPayForm.mchSerialNo.trim(), mchSerialNo: wechatPayForm.mchSerialNo.trim(),
platformPublicKeyId: wechatPayForm.platformPublicKeyId.trim(),
notifyUrl: wechatPayForm.notifyUrl.trim() || undefined, notifyUrl: wechatPayForm.notifyUrl.trim() || undefined,
apiV3Key: wechatPayForm.apiV3Key.trim() || undefined, apiV3Key: wechatPayForm.apiV3Key.trim() || undefined,
privateKeyPem: wechatPayForm.privateKeyPem.trim() || undefined, privateKeyPem: wechatPayForm.privateKeyPem.trim() || undefined,
platformPublicKeyPem: wechatPayForm.platformPublicKeyPem.trim() || undefined,
}) })
wechatPayForm.apiV3Key = '' wechatPayForm.apiV3Key = ''
wechatPayForm.privateKeyPem = '' wechatPayForm.privateKeyPem = ''
wechatPayForm.platformPublicKeyPem = ''
wechatPayForm.enabled = cfg.enabled wechatPayForm.enabled = cfg.enabled
wechatPayForm.mchId = cfg.mchId wechatPayForm.mchId = cfg.mchId
wechatPayForm.mchSerialNo = cfg.mchSerialNo wechatPayForm.mchSerialNo = cfg.mchSerialNo
wechatPayForm.platformPublicKeyId = cfg.platformPublicKeyId
wechatPayForm.notifyUrl = cfg.notifyUrl wechatPayForm.notifyUrl = cfg.notifyUrl
wechatPayMeta.configured = cfg.configured wechatPayMeta.configured = cfg.configured
wechatPayMeta.hasApiV3Key = cfg.hasApiV3Key wechatPayMeta.hasApiV3Key = cfg.hasApiV3Key
wechatPayMeta.hasPrivateKey = cfg.hasPrivateKey wechatPayMeta.hasPrivateKey = cfg.hasPrivateKey
wechatPayMeta.hasPlatformPublicKey = cfg.hasPlatformPublicKey
wechatPayMeta.appId = cfg.appId wechatPayMeta.appId = cfg.appId
applyWechatPaySnapshot() applyWechatPaySnapshot()
Message.success(t('system.otherConfig.paymentQr.wechatPay.saveSuccess')) Message.success(t('system.otherConfig.paymentQr.wechatPay.saveSuccess'))
@ -2226,12 +2719,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) { async function onPaymentQrTabChange(key: string | number) {
const k = String(key) const k = String(key)
if (k === 'bank') { if (k === 'bank') {
await loadBankAccounts() await loadBankAccounts()
} else if (k === 'wechatPay') { } else if (k === 'wechatPay') {
await loadWechatPayMerchant() await loadWechatPayMerchant()
} else if (k === 'alipayPay') {
await loadAlipayPayMerchant()
} }
} }
@ -3936,6 +4595,9 @@ onMounted(() => {
} }
.wx-pay-bind__label { .wx-pay-bind__label {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 12px; font-size: 12px;
color: var(--color-text-3); color: var(--color-text-3);
} }

View File

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

View File

@ -584,8 +584,12 @@ export default defineConfig(({ mode }) => {
cssCodeSplit: true, cssCodeSplit: true,
// 生成 source map(默认关闭,避免线上包体积变大;需要排查问题时可临时打开) // 生成 source map(默认关闭,避免线上包体积变大;需要排查问题时可临时打开)
sourcemap: false, sourcemap: false,
// 跳过 gzip 体积统计:chunk 多时收尾很吃 CPU/内存(8c16g 生产+CI 同机更明显)
reportCompressedSize: false,
// 构建输出配置:使用 Vite 默认的代码分割策略,避免过度自定义导致库初始化顺序问题 // 构建输出配置:使用 Vite 默认的代码分割策略,避免过度自定义导致库初始化顺序问题
rollupOptions: { rollupOptions: {
// 降低并行读盘峰值,减轻同机 k3s 内存压力(默认偏高)
maxParallelFileOps: 5,
onwarn(warning, warn) { onwarn(warning, warn) {
const message = warning.message || ''; const message = warning.message || '';
if ( if (