Compare commits

...

2 Commits

Author SHA1 Message Date
zzh
898a9bfc33 Merge pull request 'feat: 切换 bcdship 域名并收敛 deployTargets,完善微信支付充值与 AI 助手顶栏' (#32) from test into master
All checks were successful
Build and Deploy Front / deploy (push) Successful in 11m25s
Reviewed-on: #32
2026-12-01 18:42:54 +08:00
zzh
02fb9c4f28 feat: 切换 bcdship 域名并收敛 deployTargets,完善微信支付充值与 AI 助手顶栏
All checks were successful
Build and Deploy Front / deploy (push) Successful in 6m37s
将站点/API 默认值收敛到配置,避免再次全局改域名;同步 H5/PC 支付充值与助手浮层交互调整。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-12-01 18:31:30 +08:00
70 changed files with 5310 additions and 1125 deletions

View File

@ -26,7 +26,7 @@ xhs-agent-desktop
.env*
!.env.production
!.env.ideship-test
!.env.bcdship-test
# 本地简易镜像另用 Dockerfile;k3s 构建用 Dockerfile.k3s
Dockerfile

15
.env.bcdship-test Normal file
View File

@ -0,0 +1,15 @@
# =============================================================================
# bcdship 测试环境 — pnpm dev:test / pnpm build:test
# API:https://api.test.bcdship.com/{admin|itfx|track}
# 站点:https://test.bcdship.com
# =============================================================================
VITE_DEPLOY_TARGET=bcdship
VITE_API_ORIGIN=https://api.test.bcdship.com
VITE_API_ADMIN_URL=https://api.test.bcdship.com/admin
VITE_API_ASSET_ORIGIN=https://api.test.bcdship.com/admin
VITE_OMS_ADMIN_URL=https://api.test.bcdship.com/admin
VITE_WECOM_KF_URL=https://work.weixin.qq.com/kfid/kfcae09c206f6c7045a
# 测试站可选:填同一 GA4 或单独测试媒体资源;空则不加载
# VITE_GA_MEASUREMENT_ID=

View File

@ -1,13 +1,13 @@
# =============================================================================
# 本地开发 → ideship 测试环境(禁止本地直连生产)
# Vite 代理:https://api.test.ideship.com/{admin|itfx|track}
# 站点对照:https://test.ideship.com
# 本地开发 → bcdship 测试环境(禁止本地直连生产)
# Vite 代理:https://api.test.bcdship.com/{admin|itfx|track}
# 站点对照:https://test.bcdship.com
# =============================================================================
VITE_DEPLOY_TARGET=ideship
VITE_OMS_ADMIN_URL=https://api.test.ideship.com/admin
VITE_API_ORIGIN=https://api.test.ideship.com
VITE_API_ADMIN_URL=https://api.test.ideship.com/admin
VITE_API_ASSET_ORIGIN=https://api.test.ideship.com/admin
VITE_DEPLOY_TARGET=bcdship
VITE_OMS_ADMIN_URL=https://api.test.bcdship.com/admin
VITE_API_ORIGIN=https://api.test.bcdship.com
VITE_API_ADMIN_URL=https://api.test.bcdship.com/admin
VITE_API_ASSET_ORIGIN=https://api.test.bcdship.com/admin
VITE_WECOM_KF_URL=https://work.weixin.qq.com/kfid/kfcae09c206f6c7045a
VITE_ZHIPU_API_KEY=85bbbef6bafd4ca383eef04189decd07.lKVQHcLGtYE8oUn5

View File

@ -1,15 +0,0 @@
# =============================================================================
# ideship 测试环境 — pnpm dev:test / pnpm build:test
# API:https://api.test.ideship.com/{admin|itfx|track}
# 站点:https://test.ideship.com
# =============================================================================
VITE_DEPLOY_TARGET=ideship
VITE_API_ORIGIN=https://api.test.ideship.com
VITE_API_ADMIN_URL=https://api.test.ideship.com/admin
VITE_API_ASSET_ORIGIN=https://api.test.ideship.com/admin
VITE_OMS_ADMIN_URL=https://api.test.ideship.com/admin
VITE_WECOM_KF_URL=https://work.weixin.qq.com/kfid/kfcae09c206f6c7045a
# 测试站可选:填同一 GA4 或单独测试媒体资源;空则不加载
# VITE_GA_MEASUREMENT_ID=

View File

@ -1,17 +1,17 @@
# =============================================================================
# 生产构建专用(pnpm build:prod)— 请勿用于本地开发直连
# 三套 API:https://api.ideship.com/{admin|itfx|track}
# 前端站点:https://ideship.com
# 本地开发请用 .env.development → api.test.ideship.com
# 三套 API:https://api.bcdship.com/{admin|itfx|track}
# 前端站点:https://bcdship.com
# 本地开发请用 .env.development → api.test.bcdship.com
# =============================================================================
VITE_DEPLOY_TARGET=ideship
VITE_API_ORIGIN=https://api.ideship.com
VITE_API_ADMIN_URL=https://api.ideship.com/admin
VITE_API_ASSET_ORIGIN=https://api.ideship.com/admin
VITE_OMS_ADMIN_URL=https://api.ideship.com/admin
VITE_DEPLOY_TARGET=bcdship
VITE_API_ORIGIN=https://api.bcdship.com
VITE_API_ADMIN_URL=https://api.bcdship.com/admin
VITE_API_ASSET_ORIGIN=https://api.bcdship.com/admin
VITE_OMS_ADMIN_URL=https://api.bcdship.com/admin
VITE_WECOM_KF_URL=https://work.weixin.qq.com/kfid/kfcae09c206f6c7045a
# Google Analytics 4(官网 https://ideship.com)
# Google Analytics 4(官网 https://bcdship.com)
# 地域/设备/来源自动有;首页点击见事件 home_*
VITE_GA_MEASUREMENT_ID=G-1XWZ7LL1PW

View File

@ -567,7 +567,7 @@ const { t } = useI18n();
- [ ] 分页组件置于**列表上方工具栏右侧**(列表右上角),**§7.3**;分页 10/30/50/100,默认 50
- [ ] 操作按钮按权限使用 `hasPermission`
- [ ] 路由 meta 配置 `permission`
- [ ] **部署**:前端与 Admin API **分域名**(如 `ideship.com` / `api.ideship.com`);TLS 走 Traefik + cert-manager(**§十五**)
- [ ] **部署**:前端与 Admin API **分域名**(如 `bcdship.com` / `api.bcdship.com`);TLS 走 Traefik + cert-manager(**§十五**)
- [ ] 文案通过 i18n,不写死中文
- [ ] 命名符合本规范(文件、路由、变量、i18n key)
@ -581,7 +581,7 @@ const { t } = useI18n();
**约定:**
1. **前后端分域名**(方案 A):站点如 `ideship.com` / `test.ideship.com`,API 如 `api.ideship.com` / `api.test.ideship.com`。浏览器直连 API,前端容器不做 Admin 反代,也无 `/__cos__` 反代。
1. **前后端分域名**(方案 A):站点如 `bcdship.com` / `test.bcdship.com`,API 如 `api.bcdship.com` / `api.test.bcdship.com`。浏览器直连 API,前端容器不做 Admin 反代,也无 `/__cos__` 反代。
2. SPA 回退由 `serve -s`(或等价静态服务器)处理;刷新 `/order/batchJobs` 等路径应回 `index.html`,不依赖 nginx `try_files`。
3. 官网 **`/`** 为 Vue 路由(`src/views/site`);静态资源在 **`/site/`**;**`/9610.html`** 为 `public/9610.html`。客户登录 **`/login`**,管理端 **`/admin`**。
4. 面单/附件预览:开发可用 Vite `/__cos__`;生产优先 `file-storage/access-url` 新鲜签名直开,失败再 `stream` → blob(勿依赖过期库内签名 URL)。

View File

@ -162,8 +162,8 @@ Content-Type: application/json
- [ ] **G1** Ingress(tls) + cert-manager 证书就绪;前端 Service 健康
- [ ] **G2** 刷新站点域名下 `/xhs/analysis` 等返回 SPA,**不** 404
- [ ] **G3** `POST https://api.ideship.com/admin/xhs/agent/list`(带 Token)正常
- [ ] **G4** Agent 使用生产 `--oms-url https://api.ideship.com/admin`
- [ ] **G3** `POST https://api.bcdship.com/admin/xhs/agent/list`(带 Token)正常
- [ ] **G4** Agent 使用生产 `--oms-url https://api.bcdship.com/admin`
---
@ -233,7 +233,7 @@ curl.exe -s "http://localhost:5281/admin/rbac/auth/login" ...
### 5.5 前端 dev 正常、生产 404
- 站点域名下页面由 `serve -s` 回退 `index.html`
- API 请求应走 `VITE_API_ADMIN_URL`(如 `https://api.ideship.com/admin`),不要打到前端静态域名的 `/xhs/agent/list`
- API 请求应走 `VITE_API_ADMIN_URL`(如 `https://api.bcdship.com/admin`),不要打到前端静态域名的 `/xhs/agent/list`
### 5.6 AI 生成 / 分析失败

View File

@ -202,15 +202,15 @@ flowchart TD
## 4. 接口说明
API 前缀:`https://api.ideship.com/admin`(`ASPNETCORE_PATHBASE=/admin`)
API 前缀:`https://api.bcdship.com/admin`(`ASPNETCORE_PATHBASE=/admin`)
生产三套服务:
| 服务 | Swagger / PATHBASE |
|------|-------------------|
| Admin | https://api.ideship.com/admin/index.html |
| Itfx | https://api.ideship.com/itfx/index.html |
| Track | https://api.ideship.com/track/index.html |
| Admin | https://api.bcdship.com/admin/index.html |
| Itfx | https://api.bcdship.com/itfx/index.html |
| Track | https://api.bcdship.com/track/index.html |
### 4.1 获取登录二维码
@ -308,7 +308,7 @@ Content-Type: application/json
**现网配置 URL:**
```
https://api.ideship.com/admin/apiwechat/verification
https://api.bcdship.com/admin/apiwechat/verification
```
(旧站曾用 `https://oms.nanafa.com/api/apiwechat/verification` 反代到 Admin。)
@ -418,13 +418,13 @@ src/SimpleAdmin.Api/
| 项 | 值 |
|----|-----|
| URL | `https://api.ideship.com/admin/apiwechat/verification` |
| URL | `https://api.bcdship.com/admin/apiwechat/verification` |
| Token | 与数据库/AppSettings 一致 |
| 消息加解密 | **明文**(当前实现) |
### 7.3 网关 / 回调
生产已弃用站内 nginx。微信服务器回调应直连 **API 域名**(如 `https://api.ideship.com/admin/apiwechat/verification`),由 Traefik Ingress 转发到后端 Service;前端静态容器不做 `/api/apiwechat` 反代。
生产已弃用站内 nginx。微信服务器回调应直连 **API 域名**(如 `https://api.bcdship.com/admin/apiwechat/verification`),由 Traefik Ingress 转发到后端 Service;前端静态容器不做 `/api/apiwechat` 反代。
本地开发仍可由 Vite 代理 `/api/apiwechat` → Admin。
---
@ -468,9 +468,9 @@ src/SimpleAdmin.Api/
完整 URL 示例:
```
GET https://api.ideship.com/admin/wechat/mp/login-qrcode?loginUuid=abc123
GET https://api.ideship.com/admin/rbac/auth/wx-login/status?loginUuid=abc123
POST https://api.ideship.com/admin/rbac/auth/wx-login
POST https://api.ideship.com/admin/apiwechat/verification
GET https://api.ideship.com/admin/wechat/oauth/config
GET https://api.bcdship.com/admin/wechat/mp/login-qrcode?loginUuid=abc123
GET https://api.bcdship.com/admin/rbac/auth/wx-login/status?loginUuid=abc123
POST https://api.bcdship.com/admin/rbac/auth/wx-login
POST https://api.bcdship.com/admin/apiwechat/verification
GET https://api.bcdship.com/admin/wechat/oauth/config
```

View File

@ -11,11 +11,11 @@
"preinstall": "node -e \"if (!process.env.npm_config_user_agent || !process.env.npm_config_user_agent.includes('pnpm')) { console.error('Please use pnpm to install dependencies.'); process.exit(1); }\"",
"generate:order-template": "node scripts/generate-order-template.js",
"dev": "vite",
"dev:test": "vite --mode ideship-test",
"dev:test": "vite --mode bcdship-test",
"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:prod": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=8192 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 ideship-test",
"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:nanafa": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=1 node --max-old-space-size=8192 node_modules/vite/bin/vite.js build --mode nanafa",
"postbuild": "node scripts/postbuild-cleanup-dist.js",
"report": "cross-env REPORT=true pnpm run build",

View File

@ -7,8 +7,8 @@
<meta name="description" content="BCD 9610跨境电商出口指南:报关、退税与专线物流怎么选,一看就懂。">
<meta property="og:title" content="9610跨境电商出口方案选择指南 | BCD国际物流">
<meta property="og:description" content="BCD 9610跨境电商出口指南:报关、退税与专线物流怎么选,一看就懂。">
<meta property="og:image" content="https://ideship.com/site/img/og-cover.png">
<meta property="og:url" content="https://ideship.com/9610.html">
<meta property="og:image" content="https://bcdship.com/site/img/og-cover.png">
<meta property="og:url" content="https://bcdship.com/9610.html">
<meta property="og:type" content="website">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }

View File

@ -64,11 +64,19 @@
portalTransition.value = '';
}
/** 用顶层路由名作 key,避免业务页切路由时整页 remount */
/**
* 登录/独立页用自身 key(iris 互切);主应用 DEFAULT_LAYOUT 用稳定 key,
* 避免跨模块(如 order→user 充值)整壳 remount 闪缩。
*/
function portalViewKey(r: RouteLocationNormalizedLoaded) {
const top = r.matched[0];
if (top?.name) return String(top.name);
return top?.path || r.path;
const path = String(r.path || '');
if (isStandalonePortalPath(path) || isLoginPath(path)) {
const top = r.matched[0];
return String(top?.name || r.name || path);
}
const name = r.name ? String(r.name) : '';
if (name && isLoginRouteName(name)) return name;
return 'oms-main-shell';
}
function prepareSheet(node: HTMLElement, z: number) {

View File

@ -3,6 +3,7 @@
*/
import type { AxiosError } from 'axios'
import { axiosInstance } from '@/api/rbac'
import { fixApiUploadsMissingAdmin } from '@/config/deployTargets'
import { resolveAdminApiPath, resolveAdminAssetOrigin } from '@/utils/adminApi'
/** 从 axios / 业务响应中提取可读错误信息 */
@ -152,11 +153,8 @@ export function resolveOmsAssetUrl(path?: string | null): string {
if (/^https?:\/\//i.test(value) || value.startsWith('data:') || value.startsWith('blob:')) {
const cosProxied = toCosSameOriginProxyUrl(value)
if (cosProxied) return cosProxied
// 纠正常见错链:api.nanafa.com/uploads → api.nanafa.com/admin/uploads
return value.replace(
/^(https?:\/\/api\.(?:nanafa|ideship)\.com)\/uploads\//i,
'$1/admin/uploads/',
)
// 纠正常见错链:api.*/uploads → api.*/admin/uploads(域名见 deployTargets)
return fixApiUploadsMissingAdmin(value)
}
const origin = resolveAdminAssetOrigin()
const rel = value.startsWith('/') ? value : `/${value}`

View File

@ -19,7 +19,7 @@ import { OpenAPI } from './generated/core/OpenAPI'
import { axiosInstance } from './axios-config'
import { resolveOpenApiBase } from '@/utils/adminApi'
// 生产:OpenAPI.BASE = https://api.ideship.com/admin(方案 A);开发:空 BASE + Vite 代理
// 生产:OpenAPI.BASE = {apiOrigin}/admin(方案 A,见 deployTargets);开发:空 BASE + Vite 代理
OpenAPI.BASE = resolveOpenApiBase()
// 认证 token 管理

View File

@ -16,19 +16,40 @@ export interface RechargeRecordListParams {
export interface SubmitRechargeParams {
customerId?: number
rechargeAmount: number
/** 1-微信 2-支付宝 */
payType: 1 | 2
/** 1-微信 2-支付宝 3-银行转账 */
payType: 1 | 2 | 3
remark?: string
/** 可选;未传时 rechargeScreenshot 字段默认提交 "0" */
screenshotFile?: File | null
}
export interface RechargeBankAccount {
configured: boolean
accountName: string
bankName: string
accountNo: string
currency: string
}
export interface RechargeExportParams {
customerId?: number | string
startTime?: string
endTime?: string
}
/** GET /recharge/recharge/bank-account */
export async function getRechargeBankAccount(): Promise<RechargeBankAccount> {
const res = await axiosInstance.get(omsUrl('/recharge/recharge/bank-account'))
const data = unwrapData(res.data) as Record<string, unknown> | null
return {
configured: Boolean(data?.configured ?? data?.Configured),
accountName: String(data?.accountName ?? data?.AccountName ?? ''),
bankName: String(data?.bankName ?? data?.BankName ?? ''),
accountNo: String(data?.accountNo ?? data?.AccountNo ?? ''),
currency: String(data?.currency ?? data?.Currency ?? 'CNY'),
}
}
/** POST /recharge/recharge/submit(multipart/form-data) */
export async function submitRechargeApplication(params: SubmitRechargeParams) {
const form = new FormData()

View File

@ -0,0 +1,276 @@
import { axiosInstance } from '@/api/rbac'
import { assertBusinessOk, omsUrl, unwrapData } from '@/api/oms/common'
export type WeChatPayScene = 'native' | 'jsapi'
export interface WeChatJsapiPayParams {
appId: string
timeStamp: string
nonceStr: string
package: string
signType: string
paySign: string
}
export interface CreateWeChatPayResult {
outTradeNo: string
rechargeRecordId: number
channel: string
status: string
codeUrl?: string
expireTime?: string
jsapi?: WeChatJsapiPayParams
}
export interface WeChatPayStatusResult {
outTradeNo: string
status: string
statusCode: number
amount: number
transactionId?: string
paidTime?: string
rechargeRecordId: number
codeUrl?: string
}
function mapCreate(raw: any): CreateWeChatPayResult {
const js = raw?.jsapi ?? raw?.Jsapi
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,
expireTime: (raw?.expireTime ?? raw?.ExpireTime) || undefined,
jsapi: js
? {
appId: String(js.appId ?? js.AppId ?? ''),
timeStamp: String(js.timeStamp ?? js.TimeStamp ?? ''),
nonceStr: String(js.nonceStr ?? js.NonceStr ?? ''),
package: String(js.package ?? js.Package ?? ''),
signType: String(js.signType ?? js.SignType ?? 'RSA'),
paySign: String(js.paySign ?? js.PaySign ?? ''),
}
: undefined,
}
}
function mapStatus(raw: any): WeChatPayStatusResult {
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/wechat/create */
export async function createWeChatPay(params: {
rechargeAmount: number
scene: WeChatPayScene
customerId?: number
oauthCode?: string
}) {
const headers: Record<string, string> = {}
if (params.oauthCode) {
headers['X-Wechat-OAuth-Code'] = params.oauthCode
}
const res = await axiosInstance.post(
omsUrl('/recharge/pay/wechat/create'),
{
rechargeAmount: params.rechargeAmount,
scene: params.scene,
customerId: params.customerId,
oauthCode: params.oauthCode,
},
{ headers },
)
return mapCreate(unwrapData(res.data) ?? res.data)
}
/** GET /recharge/pay/wechat/status */
export async function getWeChatPayStatus(outTradeNo: string) {
const res = await axiosInstance.get(omsUrl('/recharge/pay/wechat/status'), {
params: { outTradeNo },
})
return mapStatus(unwrapData(res.data) ?? res.data)
}
/** POST /recharge/pay/wechat/close */
export async function closeWeChatPay(outTradeNo: string) {
const res = await axiosInstance.post(omsUrl('/recharge/pay/wechat/close'), { outTradeNo })
assertBusinessOk(res.data)
}
export interface CreateOrderWeChatPayLine {
orderId: number
serviceNo?: string
payableAmount: number
balanceAmount: number
wechatAmount: number
couponInstanceId?: number
}
export interface CreateOrderWeChatPayResult {
payableTotal: number
balanceAmount: number
wechatAmount: number
customerBalance: number
paidImmediately: boolean
outTradeNo?: string
channel?: string
status?: string
codeUrl?: string
expireTime?: string
jsapi?: WeChatJsapiPayParams
lines: CreateOrderWeChatPayLine[]
}
/** POST /order/pay/wechat/create — 余额优先,差额微信 */
export async function createOrderWeChatPay(params: {
orderIds: number[]
couponByOrderId?: Record<number, number | null>
scene: WeChatPayScene
oauthCode?: string
}) {
const headers: Record<string, string> = {}
if (params.oauthCode) {
headers['X-Wechat-OAuth-Code'] = params.oauthCode
}
const res = await axiosInstance.post(
omsUrl('/order/pay/wechat/create'),
{
orderIds: params.orderIds,
couponByOrderId: params.couponByOrderId,
scene: params.scene,
oauthCode: params.oauthCode,
},
{ headers },
)
const raw = unwrapData(res.data) ?? res.data
const js = raw?.jsapi ?? raw?.Jsapi
const linesRaw = raw?.lines ?? raw?.Lines ?? []
return {
payableTotal: Number(raw?.payableTotal ?? raw?.PayableTotal ?? 0),
balanceAmount: Number(raw?.balanceAmount ?? raw?.BalanceAmount ?? 0),
wechatAmount: Number(raw?.wechatAmount ?? raw?.WechatAmount ?? 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,
expireTime: (raw?.expireTime ?? raw?.ExpireTime) || undefined,
jsapi: js
? {
appId: String(js.appId ?? js.AppId ?? ''),
timeStamp: String(js.timeStamp ?? js.TimeStamp ?? ''),
nonceStr: String(js.nonceStr ?? js.NonceStr ?? ''),
package: String(js.package ?? js.Package ?? ''),
signType: String(js.signType ?? js.SignType ?? 'RSA'),
paySign: String(js.paySign ?? js.PaySign ?? ''),
}
: 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),
wechatAmount: Number(row?.wechatAmount ?? row?.WechatAmount ?? 0),
couponInstanceId: row?.couponInstanceId ?? row?.CouponInstanceId ?? undefined,
})),
} as CreateOrderWeChatPayResult
}
export interface WeChatPayMerchantConfig {
configured: boolean
enabled: boolean
mchId: string
mchSerialNo: string
notifyUrl: string
hasApiV3Key: boolean
hasPrivateKey: boolean
appId?: string
}
export async function getWeChatPayMerchantConfig(): Promise<WeChatPayMerchantConfig> {
const res = await axiosInstance.get(omsUrl('/system/other-config/wechat-pay-merchant'))
const data = unwrapData(res.data) as any
return {
configured: Boolean(data?.configured ?? data?.Configured),
enabled: Boolean(data?.enabled ?? data?.Enabled),
mchId: String(data?.mchId ?? data?.MchId ?? ''),
mchSerialNo: String(data?.mchSerialNo ?? data?.MchSerialNo ?? ''),
notifyUrl: String(data?.notifyUrl ?? data?.NotifyUrl ?? ''),
hasApiV3Key: Boolean(data?.hasApiV3Key ?? data?.HasApiV3Key),
hasPrivateKey: Boolean(data?.hasPrivateKey ?? data?.HasPrivateKey),
appId: (data?.appId ?? data?.AppId) || undefined,
}
}
export async function saveWeChatPayMerchantConfig(payload: {
enabled: boolean
mchId: string
mchSerialNo: string
notifyUrl?: string
apiV3Key?: string
privateKeyPem?: string
}) {
const res = await axiosInstance.post(
omsUrl('/system/other-config/wechat-pay-merchant/save'),
payload,
)
assertBusinessOk(res.data)
return getWeChatPayMerchantConfig()
}
/** 微信内 JSAPI 调起 */
export function invokeWeChatJsapiPay(params: WeChatJsapiPayParams): Promise<'ok' | 'cancel' | 'fail'> {
return invokeWeixinBridge(params)
}
function invokeWeixinBridge(params: WeChatJsapiPayParams): Promise<'ok' | 'cancel' | 'fail'> {
return new Promise((resolve) => {
const run = () => {
const bridge = (window as any).WeixinJSBridge
if (!bridge?.invoke) {
resolve('fail')
return
}
bridge.invoke(
'getBrandWCPayRequest',
{
appId: params.appId,
timeStamp: params.timeStamp,
nonceStr: params.nonceStr,
package: params.package,
signType: params.signType || 'RSA',
paySign: params.paySign,
},
(res: { err_msg?: string }) => {
const msg = String(res?.err_msg || '')
if (msg.includes(':ok')) resolve('ok')
else if (msg.includes(':cancel')) resolve('cancel')
else resolve('fail')
},
)
}
if (typeof (window as any).WeixinJSBridge === 'undefined') {
document.addEventListener('WeixinJSBridgeReady', run, false)
setTimeout(() => {
if (typeof (window as any).WeixinJSBridge === 'undefined') resolve('fail')
}, 3000)
} else {
run()
}
})
}
export function isWeChatBrowser() {
return /MicroMessenger/i.test(navigator.userAgent || '')
}

View File

@ -18,7 +18,7 @@ export interface WxFollowQrcodeResult {
/** H5 网页授权公开配置(wechat_mp) */
export interface WxOAuthConfigResult {
appId: string;
/** OAuth 回调根,如 https://ideship.com;空则用当前页 origin */
/** OAuth 回调根(站点 origin);空则用当前页 origin */
oauthRedirectBase?: string | null;
}

12
src/assets/bank.svg Normal file
View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
<rect width="72" height="72" rx="16" fill="#2F6BFF"/>
<path
d="M36 16L54 26.5V30H18V26.5L36 16Z"
fill="#FFFFFF"
/>
<rect x="20" y="32" width="6" height="18" rx="1.5" fill="#FFFFFF"/>
<rect x="33" y="32" width="6" height="18" rx="1.5" fill="#FFFFFF"/>
<rect x="46" y="32" width="6" height="18" rx="1.5" fill="#FFFFFF"/>
<rect x="17" y="50" width="38" height="5" rx="1.5" fill="#FFFFFF"/>
<rect x="33" y="22" width="6" height="6" rx="1.2" fill="#2F6BFF"/>
</svg>

After

Width:  |  Height:  |  Size: 581 B

View File

@ -364,6 +364,13 @@ body {
background-image: none !important;
}
/* 客户/代理门户:根容器留白交由 layout-content--customer(与侧栏 gap/inset 统一) */
.layout-content--customer .page-layout-root > [class*='-container'],
.layout-content--customer .page-layout-root > [class*='-page'],
.layout-content--customer .page-layout-root > [class*='-layout'] {
padding: 0 !important;
}
/* 块级外壳统一去描边(侧栏 / 列表卡 / 表格壳 / 内容面板) */
.layout-content .custom-left-menu,
.layout-content .warehouse-list-page-card,

View File

@ -14,6 +14,10 @@
import { getInterfaceGetInterfaceById } from '@/api/InterfaceServices/interface';
import { getMethodText } from '@/views/api/upstreamInterface/utils';
import { useTabRowCounts } from '@/utils/useTabRowCounts';
import {
isKnownApiAbsoluteUrl,
rewriteKnownApiAbsoluteUrl,
} from '@/config/deployTargets';
import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath';
/** 请求日志页含 Handsontable,仅打开「查看报文」时再加载 */
@ -1339,29 +1343,15 @@
/**
* 开发态:把已知外域 URL 改写到 Vite 代理,避免浏览器 CORS。
* - api.nanafa.com / api(.test).ideship.com → /nanafa/...
* - 旧 itfx IP → /api/...
* - lsp.globex.cn → /external/...
* 生产/测试构建:nanafa 旧址改写到当前环境 API 根(方案 A)
* 已知 API 域名列表见 deployTargets;生产/测试构建改写到当前环境 API 根。
*/
function rewriteDebuggerUrlForProxy(rawUrl: string): string {
const url = String(rawUrl || '').trim();
if (!url) return url;
const apiOrigin = prodApiOrigin();
// http(s)://api.nanafa.com/... 或 api(.test).ideship.com/...
if (/^https?:\/\/api\.(?:nanafa|ideship)\.com(?::\d+)?(\/|$)/i.test(url)
|| /^https?:\/\/api\.test\.ideship\.com(?::\d+)?(\/|$)/i.test(url)) {
if (import.meta.env.DEV) {
return url
.replace(/^https?:\/\/api\.nanafa\.com(?::\d+)?/i, '/nanafa')
.replace(/^https?:\/\/api\.test\.ideship\.com(?::\d+)?/i, '/nanafa')
.replace(/^https?:\/\/api\.ideship\.com(?::\d+)?/i, '/nanafa');
}
return url
.replace(/^https?:\/\/api\.nanafa\.com(?::\d+)?/i, apiOrigin)
.replace(/^https?:\/\/api\.test\.ideship\.com(?::\d+)?/i, apiOrigin)
.replace(/^https?:\/\/api\.ideship\.com(?::\d+)?/i, apiOrigin);
if (isKnownApiAbsoluteUrl(url)) {
return rewriteKnownApiAbsoluteUrl(url, import.meta.env.DEV ? '/nanafa' : apiOrigin);
}
// 旧 itfx 直连 IP

View File

@ -406,6 +406,7 @@ function formatSummaryValue(key: string, value: unknown): string {
const n = Number(value)
if (n === 1) return '微信'
if (n === 2) return '支付宝'
if (n === 3) return '银行转账'
}
if (key === 'operatorType' || key === 'OperatorType') {
if (String(value) === 'price') return '价格'
@ -541,7 +542,7 @@ const rechargeView = computed(() => {
const payType = Number(obj?.payType ?? obj?.PayType)
const payTypeName =
pickPayload(obj, 'payTypeName', 'PayTypeName') ||
(payType === 2 ? '支付宝' : payType === 1 ? '微信' : '—')
(payType === 2 ? '支付宝' : payType === 1 ? '微信' : payType === 3 ? '银行转账' : '—')
return {
customerCode: pickPayload(obj, 'customerCode', 'CustomerCode'),
customerName: pickPayload(obj, 'customerName', 'CustomerName'),

View File

@ -116,33 +116,27 @@
@pointerdown="onFloatChromePointerDown"
>
<template v-if="mode === 'float'">
<div class="ai-app-bar__actions ai-app-bar__actions--float-only" @pointerdown.stop>
<button
type="button"
class="ai-float-icon-btn"
:aria-label="t('ediAssistant.historyTitle')"
@click="historyOpen = !historyOpen"
>
<icon-history />
</button>
<button
type="button"
class="ai-float-icon-btn"
:disabled="chatLoading"
:aria-label="t('ediAssistant.newChat')"
@click="startNewChat"
>
<icon-plus />
</button>
<button
type="button"
class="ai-float-icon-btn ai-float-icon-btn--close"
:aria-label="t('ediAssistant.close')"
@click="goBack"
>
<icon-close />
</button>
</div>
<!-- ChatGPT/Claude 式:历史左、新对话右;关窗靠 FAB / Esc,不放叉号 -->
<button
type="button"
class="ai-float-icon-btn"
:aria-label="t('ediAssistant.historyTitle')"
@pointerdown.stop
@click="historyOpen = !historyOpen"
>
<icon-history />
</button>
<div class="ai-app-bar__drag" aria-hidden="true" />
<button
type="button"
class="ai-float-icon-btn"
:disabled="chatLoading"
:aria-label="t('ediAssistant.newChat')"
@pointerdown.stop
@click="startNewChat"
>
<icon-plus />
</button>
</template>
<template v-else>
<button
@ -172,50 +166,58 @@
</header>
<div v-if="waybillContext" class="ai-waybill-context">
<div class="ai-waybill-context__main">
<icon-file />
<div class="ai-waybill-context__info">
<span class="ai-waybill-context__title">
{{ t('ediAssistant.waybillContext', { no: waybillDisplayNo }) }}
</span>
<span v-if="waybillStatusLabel" class="ai-waybill-context__status">
{{ waybillStatusLabel }}
<div class="ai-waybill-context__top">
<div class="ai-waybill-context__main">
<span class="ai-waybill-context__icon" aria-hidden="true">
<icon-file />
</span>
<div class="ai-waybill-context__info">
<div class="ai-waybill-context__title-row">
<span class="ai-waybill-context__label">{{ t('ediAssistant.waybillContextLabel') }}</span>
<span v-if="waybillStatusLabel" class="ai-waybill-context__status">
{{ waybillStatusLabel }}
</span>
</div>
<span class="ai-waybill-context__no">{{ waybillDisplayNo }}</span>
</div>
</div>
<div class="ai-waybill-context__aside">
<div class="ai-waybill-context__actions" role="toolbar">
<button type="button" class="ai-waybill-chip" @click="goToWaybill">
{{ t('ediAssistant.viewWaybill') }}
</button>
<button
v-if="!isOpsAudience"
type="button"
class="ai-waybill-chip"
:disabled="chatLoading"
@click="askWaybillTrack"
>
{{ t('ediAssistant.queryTrack') }}
</button>
</div>
<div class="ai-waybill-context__icons">
<button
v-if="mode !== 'float'"
type="button"
class="ai-waybill-context__icon-btn"
:aria-label="t('ediAssistant.back')"
:title="t('ediAssistant.back')"
@click="goBack"
>
<icon-left />
</button>
<button
type="button"
class="ai-waybill-context__icon-btn"
:aria-label="t('ediAssistant.endWaybillConsult')"
:title="t('ediAssistant.endWaybillConsult')"
@click="clearWaybillContext"
>
<icon-close />
</button>
</div>
</div>
</div>
<div class="ai-waybill-context__actions">
<button type="button" class="ai-waybill-context__link" @click="goToWaybill">
{{ t('ediAssistant.viewWaybill') }}
</button>
<button
v-if="!isOpsAudience"
type="button"
class="ai-waybill-context__btn"
:disabled="chatLoading"
@click="askWaybillTrack"
>
{{ t('ediAssistant.queryTrack') }}
</button>
<button type="button" class="ai-waybill-context__clear" @click="clearWaybillContext">
{{ t('ediAssistant.endWaybillConsult') }}
</button>
<button
v-if="mode !== 'float'"
type="button"
class="ai-waybill-context__back"
@click="goBack"
>
<icon-left />
{{ t('ediAssistant.back') }}
</button>
<button
v-else
type="button"
class="ai-waybill-context__clear"
@click="goBack"
>
{{ t('ediAssistant.close') }}
</button>
</div>
</div>
@ -308,44 +310,44 @@
>
<template #assistant-extra="{ isLatest }">
<div
v-if="isLatest && !isOpsAudience && customerBizActions.length"
class="ai-msg-followups ai-msg-followups--biz"
v-if="isLatest && (!isOpsAudience || listOpsGuideModules().length)"
class="ai-msg-followups"
role="toolbar"
>
<button
v-for="act in customerBizActions"
:key="act.key"
type="button"
class="ai-followup-chip is-biz"
:disabled="chatLoading"
@click="runCustomerBizAction(act.key)"
>
{{ t(act.labelKey) }}
</button>
</div>
<div v-if="isLatest && !isOpsAudience" class="ai-msg-followups" role="toolbar">
<button
v-for="cap in mcpCapabilities"
:key="cap.id"
type="button"
class="ai-followup-chip"
:disabled="chatLoading"
@click="startMcpCapability(cap.id)"
>
{{ t(cap.titleKey) }}
</button>
</div>
<div v-else-if="isLatest && isOpsAudience" class="ai-msg-followups" role="toolbar">
<button
v-for="link in listOpsGuideModules()"
:key="link.path"
type="button"
class="ai-followup-chip"
:disabled="chatLoading"
@click="router.push(link.path)"
>
{{ link.title }}
</button>
<template v-if="!isOpsAudience">
<button
v-for="act in customerBizActions"
:key="`biz-${act.key}`"
type="button"
class="ai-followup-chip is-biz"
:disabled="chatLoading"
@click="runCustomerBizAction(act.key)"
>
{{ t(act.labelKey) }}
</button>
<button
v-for="cap in mcpCapabilities"
:key="`cap-${cap.id}`"
type="button"
class="ai-followup-chip"
:disabled="chatLoading"
@click="startMcpCapability(cap.id)"
>
{{ t(cap.titleKey) }}
</button>
</template>
<template v-else>
<button
v-for="link in listOpsGuideModules()"
:key="link.path"
type="button"
class="ai-followup-chip"
:disabled="chatLoading"
@click="router.push(link.path)"
>
{{ link.title }}
</button>
</template>
</div>
</template>
</EdiChatDialog>
@ -1694,13 +1696,20 @@ async function applyWaybillContextFromRoute() {
}
function onKeydown(e: KeyboardEvent) {
if (e.key === 'Escape') {
if (advisorDrawerOpen.value) {
advisorDrawerOpen.value = false;
return;
}
goBack();
if (e.key !== 'Escape') return;
if (advisorDrawerOpen.value) {
advisorDrawerOpen.value = false;
return;
}
if (historyOpen.value) {
historyOpen.value = false;
return;
}
// H5 Tab 无关闭叉:Esc 不离开助手页;PC 浮窗仍可 Esc 收起
if (mode.value === 'float' && String(route.path || '').startsWith('/h5')) {
return;
}
goBack();
}
watch(

View File

@ -74,7 +74,7 @@
border-right: 1px solid color-mix(in srgb, var(--color-text-1, #1d2129) 8%, transparent);
border-radius: 0;
box-shadow: 12px 0 28px rgba(15, 23, 42, 0.1);
background: var(--ai-sidebar-surface);
background: #fff;
transform: translateX(-105%);
transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
pointer-events: auto;
@ -86,13 +86,13 @@
.ai-advisor-shell--float .ai-history-backdrop {
display: block;
position: absolute;
inset: 0;
position: absolute !important;
inset: 0 !important;
z-index: 5;
border: none;
margin: 0;
padding: 0;
background: rgba(15, 23, 42, 0.22);
background: rgba(15, 23, 42, 0.18) !important;
opacity: 0;
pointer-events: none;
transition: opacity 0.18s ease;
@ -131,39 +131,39 @@
}
.ai-advisor-shell--float .ai-app-bar--float {
align-self: flex-end;
width: auto;
align-self: stretch;
width: 100%;
max-width: none;
margin: 6px 12px 2px;
gap: 0;
padding: 4px;
border: 1px solid color-mix(in srgb, var(--color-text-1, #1d2129) 8%, transparent);
border-radius: 999px;
margin: 0;
gap: 8px;
padding: 8px 10px 4px;
border: none;
border-bottom: none;
border-radius: 0;
cursor: grab;
user-select: none;
touch-action: none;
background: color-mix(in srgb, var(--ai-shell-surface, #fff) 92%, transparent);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
justify-content: center;
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
box-shadow: none;
justify-content: space-between;
align-items: center;
}
.ai-advisor-shell--float .ai-app-bar__actions--float-only {
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 0;
gap: 2px;
.ai-advisor-shell--float .ai-app-bar__drag {
flex: 1;
min-width: 24px;
align-self: stretch;
min-height: 32px;
}
/* --chat 的上下不对称 padding 会盖掉 float 顶栏,单独拉回居中 */
/* --chat 的上下不对称 padding 会盖掉 float 顶栏,单独拉回通栏左右布局 */
.ai-advisor-shell--float.ai-advisor-shell--chat .ai-app-bar--float {
min-height: 0;
min-height: 40px;
height: auto;
padding: 4px;
gap: 0;
padding: 8px 10px 4px;
gap: 8px;
}
.ai-advisor-shell--float .ai-float-icon-btn .arco-icon,
@ -245,18 +245,9 @@
cursor: not-allowed;
}
.ai-advisor-shell--float .ai-float-icon-btn--close:hover:not(:disabled) {
background: color-mix(in srgb, #f53f3f 12%, transparent);
color: #f53f3f;
}
.ai-advisor-shell--float .ai-waybill-context {
max-width: none;
margin: 0 12px;
padding: 8px 10px;
border-radius: 12px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 6%, transparent);
border: 1px solid color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, transparent);
margin: 0 12px 8px;
}
.ai-advisor-shell--float .ai-app-main {
@ -909,36 +900,77 @@
.ai-waybill-context {
flex-shrink: 0;
display: flex;
flex-wrap: wrap;
flex-direction: column;
gap: 0;
margin: 0 2px 10px;
padding: 10px 12px;
border-radius: 14px;
border: 1px solid color-mix(in srgb, var(--app-primary-color, #1d7281) 14%, transparent);
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 6%, #fff);
color: var(--color-text-1, #1d2129);
}
.ai-waybill-context__top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin: 0 2px 10px;
padding: 10px 12px;
border-radius: 12px;
border: 1px solid rgba(255, 180, 0, 0.28);
background: rgba(255, 180, 0, 0.1);
color: var(--kc-primary, #2d8c8c);
font-size: 0.82rem;
min-width: 0;
}
.ai-waybill-context__main {
display: flex;
align-items: flex-start;
gap: 8px;
gap: 10px;
min-width: 0;
flex: 1;
}
.ai-waybill-context__icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
flex-shrink: 0;
border-radius: 10px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, #fff);
color: var(--app-primary-color, #1d7281);
}
.ai-waybill-context__icon :deep(svg),
.ai-waybill-context__icon .arco-icon {
font-size: 16px;
color: inherit;
margin: 0;
}
.ai-waybill-context__info {
display: flex;
flex-direction: column;
gap: 4px;
gap: 2px;
min-width: 0;
}
.ai-waybill-context__title {
.ai-waybill-context__title-row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
min-width: 0;
}
.ai-waybill-context__label {
font-size: 12px;
font-weight: 600;
color: var(--color-text-3, #86909c);
}
.ai-waybill-context__no {
font-size: 14px;
font-weight: 700;
letter-spacing: -0.01em;
color: var(--color-text-1, #1d2129);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -946,89 +978,97 @@
.ai-waybill-context__status {
display: inline-flex;
align-self: flex-start;
padding: 2px 8px;
border-radius: 999px;
background: rgba(45, 140, 140, 0.1);
color: var(--app-primary-color, #2d8c8c);
font-size: 0.72rem;
font-weight: 600;
}
.ai-waybill-context__actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
padding: 1px 8px;
border-radius: 999px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, #fff);
color: var(--app-primary-color, #1d7281);
font-size: 11px;
font-weight: 650;
line-height: 18px;
}
.ai-waybill-context__link,
.ai-waybill-context__btn,
.ai-waybill-context__clear,
.ai-waybill-context__back {
.ai-waybill-context__aside {
display: inline-flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
flex-shrink: 0;
margin-left: auto;
}
.ai-waybill-context__icons {
display: inline-flex;
align-items: center;
gap: 2px;
flex-shrink: 0;
}
.ai-waybill-context__icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0 10px;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ai-waybill-context__link {
border: 1px solid rgba(45, 140, 140, 0.18);
background: var(--app-elevated-bg);
color: var(--app-primary-color, #2d8c8c);
}
.ai-waybill-context__link:hover {
border-color: var(--app-primary-color, #2d8c8c);
}
.ai-waybill-context__btn {
border: none;
background: var(--app-primary-color, #2d8c8c);
color: #fff;
}
.ai-waybill-context__btn:hover:not(:disabled) {
filter: brightness(1.05);
}
.ai-waybill-context__btn:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.ai-waybill-context__clear {
border: none;
border-radius: 8px;
background: transparent;
color: var(--kc-secondary, #6a75b8);
color: var(--color-text-3, #86909c);
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
}
.ai-waybill-context__clear:hover {
.ai-waybill-context__icon-btn:hover {
background: color-mix(in srgb, var(--color-text-1, #1d2129) 6%, transparent);
color: var(--color-text-1, #1d2129);
}
.ai-waybill-context__icon-btn:last-child:hover {
background: color-mix(in srgb, #f53f3f 10%, transparent);
color: #f53f3f;
}
.ai-waybill-context__back {
.ai-waybill-context__actions {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 4px;
border: 1px solid rgba(45, 140, 140, 0.18);
background: var(--app-elevated-bg);
color: var(--app-primary-color, #2d8c8c);
justify-content: flex-end;
gap: 2px;
}
.ai-waybill-context__back:hover {
border-color: var(--app-primary-color, #2d8c8c);
background: var(--app-card-bg);
.ai-waybill-chip {
height: 26px;
padding: 0 8px;
border-radius: 6px;
border: none;
background: transparent;
color: var(--color-text-3, #86909c);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
}
.ai-waybill-context :deep(svg) {
flex-shrink: 0;
font-size: 0.95rem;
color: var(--kc-tertiary, #ffb400);
margin-top: 2px;
.ai-waybill-chip:hover:not(:disabled) {
background: color-mix(in srgb, var(--color-text-1, #1d2129) 5%, transparent);
color: var(--color-text-1, #1d2129);
}
.ai-waybill-chip:disabled {
opacity: 0.45;
cursor: not-allowed;
}
@media (max-width: 420px) {
.ai-waybill-context__top {
align-items: flex-start;
}
.ai-waybill-context__aside {
flex-direction: column;
align-items: flex-end;
gap: 2px;
}
}
.ai-waybill-context__text {
@ -1480,12 +1520,14 @@
filter: none;
}
/* 与官网欢迎提问卡一致:32px 圆钮,空态浅灰 / 有内容黑底上箭头 */
/* 32px 圆钮:空态浅灰 / 有内容珊瑚红上箭头 */
.ai-advisor-shell--round-send .ai-composer-send {
--ai-send-coral: #ff6f61;
--ai-send-coral-hover: #f05a4c;
width: 32px;
height: 32px;
border-radius: 999px;
background: #0d0d0d;
background: var(--ai-send-coral);
color: #fff;
box-shadow: none;
font-size: inherit;
@ -1518,18 +1560,18 @@
}
.ai-advisor-shell--round-send .ai-composer-send:hover:not(:disabled):not(.is-empty) {
background: #2f2f2f;
background: var(--ai-send-coral-hover);
transform: none;
filter: none;
}
.ai-advisor-shell--round-send .ai-composer-send:focus-visible {
outline: 2px solid #0d0d0d;
outline: 2px solid var(--ai-send-coral);
outline-offset: 2px;
}
.ai-advisor-shell--round-send .ai-composer-send:disabled:not(.is-empty) {
background: #0d0d0d;
background: var(--ai-send-coral);
color: #fff;
opacity: 0.45;
cursor: not-allowed;
@ -1538,7 +1580,7 @@
}
.ai-advisor-shell--round-send .ai-composer-send:not(:disabled):not(.is-empty):active {
background: #2f2f2f;
background: var(--ai-send-coral-hover);
filter: none;
}
@ -1600,7 +1642,8 @@
display: inline-flex;
}
.ai-history-sidebar {
/* 仅页面态:历史抽屉可盖住整页。浮窗/H5 Tab 勿用 fixed,否则遮罩会灰掉整个屏幕 */
.ai-advisor-shell--page .ai-history-sidebar {
position: fixed;
top: 0;
left: 0;
@ -1614,12 +1657,12 @@
}
#ai-advisor-shell.ai-history-open .ai-history-sidebar,
.ai-advisor-shell.ai-history-open .ai-history-sidebar {
.ai-advisor-shell--page.ai-history-open .ai-history-sidebar {
transform: translateX(0);
}
#ai-advisor-shell.ai-history-open .ai-history-backdrop,
.ai-advisor-shell.ai-history-open .ai-history-backdrop {
.ai-advisor-shell--page.ai-history-open .ai-history-backdrop {
display: block;
position: fixed;
inset: 0;
@ -2457,35 +2500,50 @@
}
.ai-advisor-shell--chat .ai-msg-followups--biz {
margin-bottom: 2px;
}
.ai-advisor-shell--chat .ai-followup-chip.is-biz {
background: color-mix(in srgb, var(--app-primary-color) 12%, #fff);
color: var(--app-primary-color);
font-weight: 650;
}
.ai-advisor-shell--chat .ai-msg-followups {
gap: 6px;
display: flex;
flex-wrap: wrap;
gap: 4px 6px;
margin-top: 6px;
padding-top: 6px;
border-top: 1px solid color-mix(in srgb, var(--color-text-1, #1d2129) 5%, transparent);
}
.ai-advisor-shell--chat .ai-followup-chip {
height: 30px;
padding: 0 12px;
border: 1px solid var(--ai-customer-line, rgba(29, 33, 41, 0.08));
border-radius: 999px;
height: 24px;
padding: 0 8px;
border: none;
border-radius: 6px;
background: transparent;
color: var(--ai-customer-ink, #1d2129);
font-size: 0.78rem;
font-weight: 600;
transition: background 0.15s ease, border-color 0.15s ease;
color: var(--color-text-3, #86909c);
font-size: 12px;
font-weight: 500;
line-height: 1;
box-shadow: none;
transition: background 0.15s ease, color 0.15s ease;
}
.ai-advisor-shell--chat .ai-followup-chip.is-biz {
background: color-mix(in srgb, var(--color-text-1, #1d2129) 3.5%, transparent);
color: var(--color-text-2, #4e5969);
}
.ai-advisor-shell--chat .ai-followup-chip:hover:not(:disabled) {
border-color: color-mix(in srgb, var(--app-primary-color) 30%, transparent);
background: color-mix(in srgb, var(--app-primary-color) 6%, #fff);
background: color-mix(in srgb, var(--color-text-1, #1d2129) 5%, transparent);
color: var(--color-text-1, #1d2129);
}
.ai-advisor-shell--chat .ai-followup-chip.is-biz:hover:not(:disabled) {
background: color-mix(in srgb, var(--app-primary-color) 8%, transparent);
color: var(--app-primary-color);
}
.ai-advisor-shell--chat .ai-followup-chip:active:not(:disabled) {
opacity: 0.85;
}
.ai-advisor-shell--chat .ai-followup-chip:disabled {
opacity: 0.4;
}
.ai-advisor-shell--chat .edi-chat-dialog .ai-msg-row--user .ai-msg-bubble {
@ -2519,12 +2577,18 @@
padding: 12px 12px 16px;
border: none;
border-radius: 0 20px 20px 0;
background: #f7f8fa;
background: #fff;
box-shadow: 16px 0 40px rgba(15, 23, 42, 0.12);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}
.ai-advisor-shell--float .ai-history-sidebar--chat {
width: min(300px, 86%);
border-radius: 0;
background: #fff;
}
.ai-history-sidebar--chat .ai-history-sidebar__toolbar {
display: flex;
align-items: center;

View File

@ -125,8 +125,10 @@
.edi-chat-dialog .ai-msg-followups {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding-top: 4px;
align-items: center;
gap: 4px 6px;
margin-top: 6px;
padding-top: 0;
}
.edi-chat-dialog .ai-msg-row--typing .ai-msg-body--typing span {

View File

@ -38,25 +38,43 @@
<div v-if="accountSubtitle" class="csr-user-panel__sub">{{ accountSubtitle }}</div>
</div>
</div>
<button
<div
v-if="showLanguageMenu"
type="button"
class="csr-user-panel__lang-toggle"
:title="t('nav.userMenu.switchLanguage', { lang: nextLanguageOption.label })"
:aria-label="t('nav.userMenu.switchLanguage', { lang: nextLanguageOption.label })"
@click="onPanelAction(`lang:${nextLanguageOption.value}`)"
class="csr-user-panel__lang"
role="group"
:aria-label="t('nav.userMenu.language')"
>
{{ nextLanguageOption.short }}
</button>
<button
v-for="opt in languageOptions"
:key="opt.value"
type="button"
class="csr-user-panel__lang-btn"
:class="{ 'is-active': currentLanguage === opt.value }"
:aria-pressed="currentLanguage === opt.value"
:title="opt.label"
@click="onPanelAction(`lang:${opt.value}`)"
>
{{ opt.short }}
</button>
</div>
</div>
<button
v-if="showRechargeCta"
type="button"
class="csr-user-panel__cta"
class="csr-user-panel__balance"
@click="onPanelAction('recharge')"
>
{{ t('nav.balance.recharge') }}
<span v-if="balanceText" class="csr-user-panel__cta-balance">¥{{ balanceText }}</span>
<span class="csr-user-panel__balance-meta">
<span class="csr-user-panel__balance-label">{{ t('nav.balance.label') }}</span>
<span class="csr-user-panel__balance-amount">
<template v-if="balanceText">¥{{ balanceText }}</template>
<template v-else>—</template>
</span>
</span>
<span class="csr-user-panel__balance-action">
{{ t('nav.balance.recharge') }}
<i class="fa fa-angle-right" aria-hidden="true" />
</span>
</button>
</div>
@ -253,7 +271,7 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import { computed, nextTick, onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { Message } from '@arco-design/web-vue';
@ -344,11 +362,7 @@ const languageOptions = [
{ value: 'en-US', label: 'English', short: 'EN' },
] as const;
/** 点击切换到另一种语言(单按钮,非分段滑块) */
const nextLanguageOption = computed(() => {
const current = String(locale.value || 'zh-CN');
return languageOptions.find((item) => item.value !== current) || languageOptions[1];
});
const currentLanguage = computed(() => String(locale.value || 'zh-CN'));
const isCustomerPortal = computed(() => rbacUserStore.isCustomerPortal());
@ -570,10 +584,11 @@ function closeMenu() {
menuVisible.value = false;
}
function onPanelAction(key: string) {
// 切语言留在面板内,其它操作关闭
async function onPanelAction(key: string) {
// 切语言留在面板内,其它操作关闭;先收起下拉再跳转,避免弹层卸掉时主区宽度闪缩
if (!key.startsWith('lang:')) {
closeMenu();
await nextTick();
}
void onMenuClick({ key });
}
@ -601,7 +616,10 @@ const onMenuClick = async (event: { key: string }) => {
}
if (key.startsWith('lang:')) {
changeLocale(key.slice('lang:'.length));
const next = key.slice('lang:'.length);
if (next && next !== currentLanguage.value) {
changeLocale(next);
}
return;
}
@ -766,12 +784,12 @@ const onMenuClick = async (event: { key: string }) => {
/* Cursor 风格:侧栏 dock 账户面板 */
.csr-account-dropdown {
width: 170px !important;
min-width: 170px !important;
max-width: 170px !important;
width: 224px !important;
min-width: 224px !important;
max-width: 224px !important;
padding: 0 !important;
border: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.08)) !important;
border-radius: 10px !important;
border-radius: 12px !important;
box-shadow:
0 8px 28px rgba(15, 23, 42, 0.12),
0 2px 8px rgba(15, 23, 42, 0.06) !important;
@ -805,8 +823,8 @@ const onMenuClick = async (event: { key: string }) => {
}
.csr-user-panel {
width: 170px;
max-width: 170px;
width: 224px;
max-width: 224px;
box-sizing: border-box;
display: flex;
flex-direction: column;
@ -815,14 +833,17 @@ const onMenuClick = async (event: { key: string }) => {
color: var(--color-text-1);
&__header {
padding: 10px 10px 8px;
padding: 14px 12px 12px;
border-bottom: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06));
display: flex;
flex-direction: column;
gap: 12px;
}
&__top {
display: flex;
align-items: flex-start;
gap: 6px;
align-items: center;
gap: 10px;
min-width: 0;
}
@ -830,44 +851,63 @@ const onMenuClick = async (event: { key: string }) => {
flex: 1;
display: flex;
align-items: center;
gap: 8px;
gap: 10px;
min-width: 0;
}
&__lang-toggle {
&__lang {
flex-shrink: 0;
display: inline-flex;
align-items: center;
padding: 2px;
border-radius: 8px;
background: var(--color-fill-2, #f2f3f5);
}
&__lang-btn {
min-width: 28px;
height: 26px;
padding: 0 4px;
height: 24px;
padding: 0 7px;
border: none;
border-radius: 6px;
background: transparent;
color: var(--color-text-2);
font-size: 12px;
font-weight: 500;
color: var(--color-text-3);
font-size: 11px;
font-weight: 600;
letter-spacing: 0.02em;
line-height: 1;
cursor: pointer;
transition: color 0.12s ease, background-color 0.12s ease;
transition:
color 0.12s ease,
background-color 0.12s ease,
box-shadow 0.12s ease;
&:hover {
&:hover:not(.is-active) {
color: var(--color-text-1);
}
&.is-active {
background: #fff;
color: var(--app-primary-color, #1d7281);
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 6%, #fff);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
cursor: default;
}
}
&__avatar {
width: 32px;
height: 32px;
width: 36px;
height: 36px;
border-radius: 50%;
object-fit: cover;
flex-shrink: 0;
background: var(--color-fill-3, #e5e6eb);
box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
&--fallback {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-size: 14px;
font-weight: 700;
color: var(--color-text-1);
}
@ -881,7 +921,7 @@ const onMenuClick = async (event: { key: string }) => {
&__name {
font-size: 14px;
font-weight: 650;
line-height: 1.3;
line-height: 1.25;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -890,49 +930,115 @@ const onMenuClick = async (event: { key: string }) => {
&__sub {
margin-top: 2px;
font-size: 12px;
line-height: 1.3;
color: var(--color-text-3);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__cta {
&__balance {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
gap: 10px;
width: 100%;
margin-top: 8px;
height: 30px;
padding: 0 10px;
border: 1px solid color-mix(in srgb, var(--app-primary-color, #1d7281) 28%, transparent);
border-radius: 6px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 8%, #fff);
color: var(--app-primary-color, #1d7281);
font-size: 12px;
font-weight: 600;
min-height: 52px;
padding: 8px 10px 8px 12px;
border: none;
border-radius: 10px;
background:
linear-gradient(
135deg,
color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff) 0%,
color-mix(in srgb, var(--app-primary-color, #1d7281) 4%, #fff) 100%
);
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color, #1d7281) 16%, transparent);
color: var(--color-text-1);
text-align: left;
cursor: pointer;
transition: background-color 0.14s ease;
transition:
background-color 0.14s ease,
box-shadow 0.14s ease,
transform 0.14s ease;
&:hover {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 14%, #fff);
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color, #1d7281) 28%, transparent);
background:
linear-gradient(
135deg,
color-mix(in srgb, var(--app-primary-color, #1d7281) 14%, #fff) 0%,
color-mix(in srgb, var(--app-primary-color, #1d7281) 6%, #fff) 100%
);
.csr-user-panel__balance-action {
color: var(--app-primary-color, #1d7281);
}
}
&:active {
transform: scale(0.985);
}
}
&__cta-balance {
font-variant-numeric: tabular-nums;
&__balance-meta {
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
&__balance-label {
font-size: 11px;
font-weight: 500;
letter-spacing: 0.04em;
color: var(--color-text-3);
}
&__balance-amount {
font-size: 18px;
font-weight: 700;
font-variant-numeric: tabular-nums;
line-height: 1.2;
color: var(--dep-ink, #1a2e38);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&__balance-action {
flex-shrink: 0;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 5px 8px;
border-radius: 999px;
background: #fff;
color: var(--app-primary-color, #1d7281);
font-size: 12px;
font-weight: 600;
line-height: 1;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
transition: color 0.12s ease, background-color 0.12s ease;
.fa {
font-size: 12px;
opacity: 0.85;
}
}
&__body {
padding: 6px;
max-height: min(52vh, 360px);
padding: 8px;
max-height: min(56vh, 420px);
overflow-x: hidden;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 2px;
}
&__footer {
padding: 6px;
padding: 8px;
border-top: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06));
background: color-mix(in srgb, var(--color-fill-2, #f2f3f5) 55%, #fff);
}
@ -942,8 +1048,8 @@ const onMenuClick = async (event: { key: string }) => {
align-items: center;
gap: 10px;
width: 100%;
min-height: 36px;
padding: 0 10px;
min-height: 40px;
padding: 0 12px;
border: none;
border-radius: 8px;
background: transparent;

View File

@ -1311,7 +1311,9 @@ const onBalanceMenuClick = (event: any) => {
} else if (key === 'rechargeRecord') {
router.push({ name: 'FinanceRechargeRecord' });
} else if (key === 'accountFlow') {
router.push({ name: 'FinanceAccountFlow' });
router.push({ name: 'UserAccountFlow' }).catch(() => {
router.push({ name: 'FinanceAccountFlow' }).catch(() => undefined);
});
}
};
@ -1408,7 +1410,7 @@ onUnmounted(() => {
align-items: center;
gap: 8px;
/* 独立白底圆角方标 */
/* 独立白底胶囊标(高度与 .top-nav-menu 同为 44) */
.top-nav-logo {
position: relative;
z-index: 2;
@ -1416,10 +1418,11 @@ onUnmounted(() => {
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 44px;
height: 44px;
min-width: 64px;
margin: 0;
border-radius: 8px;
padding: 0 14px;
border-radius: 999px;
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.08);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
@ -1427,9 +1430,11 @@ onUnmounted(() => {
text-decoration: none;
cursor: pointer;
overflow: hidden;
box-sizing: border-box;
transition:
border-color 0.18s ease,
box-shadow 0.18s ease;
box-shadow 0.18s ease,
transform 0.14s ease;
&:hover {
border-color: rgba(15, 23, 42, 0.12);
@ -1439,11 +1444,13 @@ onUnmounted(() => {
&:active {
border-color: rgba(15, 23, 42, 0.1);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
transform: scale(0.98);
}
img {
height: 36px;
width: 36px;
height: 28px;
width: auto;
max-width: 88px;
box-sizing: border-box;
object-fit: contain;
display: block;

View File

@ -1,24 +1,37 @@
/**
* 部署目标(由 Vite mode / env 文件切换,勿在业务里写死域名)
* 部署域名 SSOT(业务代码勿再写死 *.xxx.com)
*
* 换域名:改本文件 + 对应 .env.* 即可。
*
* | 目标 | 前端 | API |
* |------|------|-----|
* | ideship(生产构建) | https://ideship.com | https://api.ideship.com/{admin,itfx,track} |
* | ideship 测试(本地默认) | https://test.ideship.com | https://api.test.ideship.com/{admin,itfx,track} |
* | nanafa(旧测试) | https://oms.nanafa.com | http://api.nanafa.com/{admin,itfx,track} |
*
* 本地:pnpm dev / pnpm dev:test → 仅测试 API(禁止直连生产)
* 构建:pnpm build:prod(生产) / pnpm build:test(测试)
* | bcdship 生产 | siteOrigin | apiOrigin/{admin,itfx,track} |
* | bcdship 测试 | BCDSHIP_TEST_API.siteOrigin | BCDSHIP_TEST_API.apiOrigin/... |
* | nanafa(旧测试) | oms.nanafa.com | api.nanafa.com/... |
*/
export type DeployTarget = 'ideship' | 'nanafa'
export type DeployTarget = 'bcdship' | 'nanafa'
export type DeployEndpoints = {
siteOrigin: string
apiOrigin: string
adminBase: string
itfxBase: string
trackBase: string
cosOrigin: string
}
/** 当前主站根域(不含子域) */
export const PRIMARY_DOMAIN_ROOT = 'bcdship.com'
export const DEPLOY_TARGETS = {
ideship: {
siteOrigin: 'https://ideship.com',
apiOrigin: 'https://api.ideship.com',
adminBase: 'https://api.ideship.com/admin',
itfxBase: 'https://api.ideship.com/itfx',
trackBase: 'https://api.ideship.com/track',
bcdship: {
siteOrigin: `https://${PRIMARY_DOMAIN_ROOT}`,
apiOrigin: `https://api.${PRIMARY_DOMAIN_ROOT}`,
adminBase: `https://api.${PRIMARY_DOMAIN_ROOT}/admin`,
itfxBase: `https://api.${PRIMARY_DOMAIN_ROOT}/itfx`,
trackBase: `https://api.${PRIMARY_DOMAIN_ROOT}/track`,
cosOrigin: `https://cos.${PRIMARY_DOMAIN_ROOT}`,
},
nanafa: {
siteOrigin: 'https://oms.nanafa.com',
@ -26,22 +39,102 @@ export const DEPLOY_TARGETS = {
adminBase: 'http://api.nanafa.com/admin',
itfxBase: 'http://api.nanafa.com/itfx',
trackBase: 'http://api.nanafa.com/track',
cosOrigin: '',
},
} as const
} as const satisfies Record<DeployTarget, DeployEndpoints>
/** 本地开发 / 测试构建默认的 ideship 测试网关(与 DEPLOY_TARGETS.ideship 生产区分) */
export const IDESHIP_TEST_API = {
siteOrigin: 'https://test.ideship.com',
apiOrigin: 'https://api.test.ideship.com',
adminBase: 'https://api.test.ideship.com/admin',
itfxBase: 'https://api.test.ideship.com/itfx',
trackBase: 'https://api.test.ideship.com/track',
} as const
/** 本地开发 / 测试构建默认的 bcdship 测试网关 */
export const BCDSHIP_TEST_API = {
siteOrigin: `https://test.${PRIMARY_DOMAIN_ROOT}`,
apiOrigin: `https://api.test.${PRIMARY_DOMAIN_ROOT}`,
adminBase: `https://api.test.${PRIMARY_DOMAIN_ROOT}/admin`,
itfxBase: `https://api.test.${PRIMARY_DOMAIN_ROOT}/itfx`,
trackBase: `https://api.test.${PRIMARY_DOMAIN_ROOT}/track`,
cosOrigin: `https://cos.test.${PRIMARY_DOMAIN_ROOT}`,
} as const satisfies DeployEndpoints
export function resolveDeployTarget(): DeployTarget {
const raw = String(import.meta.env.VITE_DEPLOY_TARGET ?? '').trim().toLowerCase()
if (raw === 'nanafa') return 'nanafa'
if (raw === 'ideship') return 'ideship'
// 未显式配置:仅生产构建默认 ideship;开发默认走测试(由 .env.development 注入 URL)
return import.meta.env.PROD ? 'ideship' : 'nanafa'
function escapeRegExp(value: string): string {
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}
const PRIMARY_ROOT_RE = escapeRegExp(PRIMARY_DOMAIN_ROOT)
/** bcdship 系 PATHBASE=/track 只需单段 Track */
export function usesPrimaryTrackPath(origin: string): boolean {
return new RegExp(PRIMARY_ROOT_RE, 'i').test(origin)
}
/** 测试前端主机 */
export function isTestFrontHost(hostname: string): boolean {
const host = String(hostname || '').trim().toLowerCase()
if (!host) return false
const root = PRIMARY_DOMAIN_ROOT.toLowerCase()
return host === `test.${root}` || host === `app.test.${root}` || host.endsWith(`.test.${root}`)
}
/**
* 已知 API 绝对地址(主站 / 测试 / nanafa)→ 替换为 toOrigin 或相对前缀。
* toOrigin 示例:测试 apiOrigin,或开发态 `/nanafa`
*/
export function rewriteKnownApiAbsoluteUrl(url: string, toOrigin: string): string {
const trimmed = String(url || '').trim()
if (!trimmed) return trimmed
return trimmed
.replace(/^https?:\/\/api\.nanafa\.com(?::\d+)?/i, toOrigin)
.replace(new RegExp(`^https?:\\/\\/api\\.test\\.${PRIMARY_ROOT_RE}(?::\\d+)?`, 'i'), toOrigin)
.replace(new RegExp(`^https?:\\/\\/api\\.${PRIMARY_ROOT_RE}(?::\\d+)?`, 'i'), toOrigin)
}
export function isKnownApiAbsoluteUrl(url: string): boolean {
const trimmed = String(url || '').trim()
if (!trimmed) return false
return (
/^https?:\/\/api\.nanafa\.com(?::\d+)?(\/|$)/i.test(trimmed) ||
new RegExp(`^https?:\\/\\/api\\.${PRIMARY_ROOT_RE}(?::\\d+)?(\\/|$)`, 'i').test(trimmed) ||
new RegExp(`^https?:\\/\\/api\\.test\\.${PRIMARY_ROOT_RE}(?::\\d+)?(\\/|$)`, 'i').test(trimmed)
)
}
/** api.xxx.com/uploads → api.xxx.com/admin/uploads */
export function fixApiUploadsMissingAdmin(url: string): string {
return String(url || '').replace(
new RegExp(
`^(https?:\\/\\/api\\.(?:(?:test\\.)?${PRIMARY_ROOT_RE}|nanafa\\.com))(\\/uploads\\/)`,
'i',
),
'$1/admin$2',
)
}
/** 开发态:去掉已知 Admin 绝对前缀,改走 Vite 同源代理 */
export function stripKnownAdminAbsolutePrefix(url: string): string {
const trimmed = String(url || '').trim()
if (!trimmed) return trimmed
const proxied = trimmed
.replace(new RegExp(`^https?:\\/\\/api\\.(?:${PRIMARY_ROOT_RE}|nanafa\\.com)\\/admin`, 'i'), '')
.replace(new RegExp(`^https?:\\/\\/api\\.test\\.${PRIMARY_ROOT_RE}\\/admin`, 'i'), '')
return proxied || trimmed
}
export function resolveDeployTarget(
rawTarget?: string,
opts?: { prod?: boolean },
): DeployTarget {
const fromEnv =
typeof import.meta !== 'undefined'
? String((import.meta as ImportMeta).env?.VITE_DEPLOY_TARGET ?? '').trim()
: ''
const raw = String(rawTarget ?? fromEnv).trim().toLowerCase()
if (raw === 'nanafa') return 'nanafa'
if (raw === 'bcdship') return 'bcdship'
const isProd =
typeof opts?.prod === 'boolean'
? opts.prod
: typeof import.meta !== 'undefined' && Boolean((import.meta as ImportMeta).env?.PROD)
return isProd ? 'bcdship' : 'nanafa'
}
export function resolveDeployEndpoints(target?: DeployTarget): DeployEndpoints {
const key = target ?? resolveDeployTarget()
return DEPLOY_TARGETS[key]
}

8
src/env.d.ts vendored
View File

@ -44,12 +44,12 @@ declare global {
interface ImportMetaEnv {
readonly VITE_API_BASE_URL: string;
readonly VITE_OMS_URL?: string;
/** 部署目标:ideship | nanafa(本地开发请指向测试 API) */
readonly VITE_DEPLOY_TARGET?: 'ideship' | 'nanafa' | string;
/** Admin 基址;本地默认测试 https://api.test.ideship.com/admin */
/** 部署目标:bcdship | nanafa(本地开发请指向测试 API) */
readonly VITE_DEPLOY_TARGET?: 'bcdship' | 'nanafa' | string;
/** Admin 基址;本地默认见 deployTargets 测试网关 */
readonly VITE_API_ADMIN_URL?: string;
readonly VITE_OMS_ADMIN_URL?: string;
/** API 根;本地默认测试 https://api.test.ideship.com */
/** API 根;本地默认见 deployTargets 测试网关 */
readonly VITE_API_ORIGIN?: string;
/** 静态资源 origin;本地默认测试 admin */
readonly VITE_API_ASSET_ORIGIN?: string;

View File

@ -127,21 +127,25 @@
}
}
/* 客户门户:无顶栏;侧栏与右侧内容卡片同 inset / 圆角 */
/* 客户/代理门户:无顶栏;侧栏与主区同 inset,中间留间隙,页面根勿再叠一层 padding */
.layout-content--customer {
/* 与 customer-side-rail --csr-panel-inset / agent --asr-panel-inset 对齐 */
--portal-panel-inset: 16px;
--app-page-padding: 0;
--app-page-padding-list: 0;
--app-page-padding-top: 0;
flex-direction: row;
align-items: stretch;
min-height: 0;
padding-top: 0;
gap: 0;
/* 侧栏面板与主区之间的空隙(原先左右 margin 都是 0 会贴死) */
gap: var(--portal-panel-inset);
.layout-main-wrap {
flex: 1;
min-width: 0;
min-height: 0;
/* 顶/底与左侧菜单齐平,不顶到视口上沿 */
/* 顶/底/右与侧栏外缘齐平;左侧间距交给 gap */
margin: var(--portal-panel-inset) var(--portal-panel-inset) var(--portal-panel-inset) 0;
display: flex;
flex-direction: column;
@ -176,5 +180,15 @@
display: flex;
flex-direction: column;
}
/*
* 主区已与侧栏同高 inset;页面根再 padding 会矮一截且像多套灰底。
* 列表白卡片内部留白放在 *-page-card / 内容面板上。
*/
:deep(.page-layout-root > [class*='-container']),
:deep(.page-layout-root > [class*='-page']),
:deep(.page-layout-root > [class*='-layout']) {
padding: 0 !important;
}
}
</style>

View File

@ -8,22 +8,20 @@
>
<AppMascotState mode="loading" description="页面加载中…" />
</div>
<!-- 仅透明度交叉淡入:不用位移/out-in,避免整页高度塌陷抖动 -->
<Transition name="page-fade">
<keep-alive :include="cacheList" :max="keepAliveMax">
<component
:is="Component"
v-if="Component && canMountPage(viewRoute)"
:key="getComponentKey(viewRoute)"
/>
</keep-alive>
</Transition>
<!-- 路由切换瞬时替换:离场页不得盖在新页上淡出(否则会短闪上一页) -->
<keep-alive :include="cacheList" :max="keepAliveMax">
<component
:is="Component"
v-if="Component && canMountPage(viewRoute)"
:key="getComponentKey(viewRoute)"
/>
</keep-alive>
</router-view>
</div>
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { computed, nextTick, ref, watch } from 'vue';
import type { RouteLocationNormalized } from 'vue-router';
import { useRoute } from 'vue-router';
import { useTabBarStore } from '@/store';
@ -40,26 +38,38 @@
const cacheList = computed(() => tabBarStore.getCacheList);
const keepAliveMax = MAX_KEEP_ALIVE_TABS;
const heavyReady = ref(isHeavyPluginsReady());
/** 插件刚就绪时多留一帧 loading,等页面挂上再撤壳,避免中间闪白 */
const holdShell = ref(false);
watch(
() => route.path,
(path) => {
if (!routeNeedsHeavyPlugins(path)) {
heavyReady.value = true;
holdShell.value = false;
return;
}
if (isHeavyPluginsReady()) {
heavyReady.value = true;
holdShell.value = false;
return;
}
heavyReady.value = false;
holdShell.value = true;
void ensureHeavyPlugins()
.then(() => {
.then(async () => {
heavyReady.value = true;
await nextTick();
await new Promise<void>((resolve) => {
requestAnimationFrame(() => resolve());
});
holdShell.value = false;
})
.catch(() => {
.catch(async () => {
// 失败也放行,避免永久转圈;页面内组件会自行报错
heavyReady.value = true;
await nextTick();
holdShell.value = false;
});
},
{ immediate: true },
@ -75,7 +85,8 @@
routeLoc: RouteLocationNormalized,
) {
if (!Component) return true;
return !canMountPage(routeLoc);
if (!canMountPage(routeLoc)) return true;
return holdShell.value;
}
/** 与 keep-alive include(组件 name)对齐,避免 name 未就绪时退回 path 导致 key 抖动、页面重复挂载 */
@ -118,8 +129,12 @@
overflow: hidden;
}
.page-layout-root :deep(> *:not(.page-route-shell)) {
flex: 1;
/* 直接子页面必须撑满主区,避免充值等居中卡片页高度塌成内容高 */
.page-layout-root > :deep(*:not(.page-route-shell)) {
flex: 1 1 auto;
align-self: stretch;
width: 100%;
min-width: 0;
min-height: 0;
}
@ -133,21 +148,4 @@
background: var(--app-page-bg, #f0f3f4);
}
.page-fade-enter-active,
.page-fade-leave-active {
transition: opacity 0.16s ease;
}
.page-fade-leave-active {
position: absolute;
inset: 0;
width: 100%;
z-index: 1;
pointer-events: none;
}
.page-fade-enter-from,
.page-fade-leave-to {
opacity: 0;
}
</style>

View File

@ -63,9 +63,9 @@ export default {
'ediAssistant.mcp.field.cargoName': 'Cargo name',
'ediAssistant.mcp.field.customsOrderNo': 'Waybill No.',
'ediAssistant.mcp.field.orderNo': 'Waybill No.',
'ediAssistant.cta.goPrice': 'Check rates & order',
'ediAssistant.cta.goOrders': 'Open shipments',
'ediAssistant.cta.goPay': 'Pay now',
'ediAssistant.cta.goPrice': 'Rates & order',
'ediAssistant.cta.goOrders': 'Open waybill',
'ediAssistant.cta.goPay': 'Pay',
'ediAssistant.human': 'Talk to online advisor',
'ediAssistant.wecomKf': 'Chat on WeCom',
'ediAssistant.you': 'You',
@ -117,8 +117,9 @@ export default {
'ediAssistant.batchPanel.empty': 'No recent batch jobs',
'ediAssistant.batchPanel.viewAll': 'View all',
'ediAssistant.waybillContext': 'Current waybill: {no}',
'ediAssistant.viewWaybill': 'View waybill →',
'ediAssistant.queryTrack': 'Track shipment',
'ediAssistant.waybillContextLabel': 'Current waybill',
'ediAssistant.viewWaybill': 'View waybill',
'ediAssistant.queryTrack': 'Track',
'ediAssistant.endWaybillConsult': 'End waybill consult',
'ediAssistant.waybillWelcomeTitle': 'How can Xiaodi help with this shipment?',
'ediAssistant.waybillWelcomeSub': 'Waybill {no} is loaded — track it or ask about fees~',

View File

@ -61,7 +61,7 @@ export default {
'ediAssistant.mcp.field.cargoName': '客户品名',
'ediAssistant.mcp.field.customsOrderNo': '运单号',
'ediAssistant.mcp.field.orderNo': '运单号',
'ediAssistant.cta.goPrice': '去查价下单',
'ediAssistant.cta.goPrice': '查价下单',
'ediAssistant.cta.goOrders': '打开运单',
'ediAssistant.cta.goPay': '去支付',
'ediAssistant.human': '联系在线顾问',
@ -114,7 +114,8 @@ export default {
'ediAssistant.batchPanel.empty': '暂无最近批量任务',
'ediAssistant.batchPanel.viewAll': '查看全部',
'ediAssistant.waybillContext': '当前运单:{no}',
'ediAssistant.viewWaybill': '查看运单 →',
'ediAssistant.waybillContextLabel': '当前运单',
'ediAssistant.viewWaybill': '查看运单',
'ediAssistant.queryTrack': '查轨迹',
'ediAssistant.endWaybillConsult': '结束运单咨询',
'ediAssistant.waybillWelcomeTitle': '这票需要小迪帮什么?',

View File

@ -71,6 +71,7 @@ export default {
'menu.user.profile': 'Personal Center',
'menu.user.recharge': 'Recharge',
'menu.user.invoice': 'My Invoices',
'menu.user.accountFlow': 'Account Transactions',
'menu.finance': 'Finance',
'menu.finance.analysis': 'Financial Analysis',
'menu.finance.rechargeRecord': 'Recharge Records',
@ -2128,6 +2129,16 @@ export default {
'order.myOrders.modal.payBatchSuccess': '{count} orders paid',
'order.myOrders.modal.payPartialResult': '{success} paid, {failed} failed. Check the reasons and retry.',
'order.myOrders.modal.payMethodBalance': 'Payment method: account balance',
'order.myOrders.modal.payMethodHybrid': 'Payment method: balance + WeChat shortfall',
'order.myOrders.modal.paySplitBalance': 'Balance {amount}',
'order.myOrders.modal.paySplitWechat': 'WeChat {amount}',
'order.myOrders.modal.payHybridHint': 'Shortfall will be paid via WeChat QR: {amount}',
'order.myOrders.modal.payMultiCustomerWxHint': 'Multi-customer batch supports balance only. Split by customer to use WeChat.',
'order.myOrders.modal.payWxTitle': 'WeChat QR shortfall',
'order.myOrders.modal.payWxTip': 'Scan with WeChat to finish payment. This dialog closes on success.',
'order.myOrders.modal.payWxAmount': 'WeChat amount {amount}',
'order.myOrders.modal.payWxCancel': 'Cancel payment',
'order.myOrders.modal.payWxCreateFailed': 'Failed to create WeChat payment',
'order.myOrders.modal.payEmpty': 'No orders to pay',
'order.myOrders.actions.intercept': 'Intercept',
'order.myOrders.actions.cancelIntercept': 'Cancel intercept',
@ -4270,9 +4281,9 @@ export default {
'system.otherConfig.actions.refresh': 'Refresh',
'system.otherConfig.actions.save': 'Save',
'system.otherConfig.actions.cancel': 'Cancel',
'system.otherConfig.actions.paymentQr': 'Payment QR',
'system.otherConfig.actions.paymentQr': 'Payment Receive',
'system.otherConfig.actions.brandLogo': 'Brand settings',
'system.otherConfig.paymentQr.navDesc': 'Shown on customer deposit',
'system.otherConfig.paymentQr.navDesc': 'QR codes and bank accounts',
'system.otherConfig.brandLogo.navDesc': 'Copy and brand images',
'system.otherConfig.wechatOrderNotify.navDesc': 'WeChat / email templates',
'system.otherConfig.brandLogo.title': 'Brand settings',
@ -4375,9 +4386,12 @@ export default {
'system.otherConfig.wechatOrderNotify.trialSuccess': 'Trial finished',
'system.otherConfig.wechatOrderNotify.trialFailed': 'Trial failed',
'system.otherConfig.wechatOrderNotify.trialResultTitle': 'WeChat trial result',
'system.otherConfig.paymentQr.title': 'Deposit Payment QR',
'system.otherConfig.paymentQr.title': 'Deposit payment receive',
'system.otherConfig.paymentQr.tip':
'Shown on PC/H5 deposit pages. Changes take effect immediately.',
'Shown on PC/H5 deposit: QR codes and bank transfer accounts. Changes take effect immediately.',
'system.otherConfig.paymentQr.tab.qr': 'QR codes',
'system.otherConfig.paymentQr.tab.bank': 'Bank accounts',
'system.otherConfig.paymentQr.tab.wechatPay': 'WeChat Pay merchant',
'system.otherConfig.paymentQr.alipay': 'Alipay',
'system.otherConfig.paymentQr.wechat': 'WeChat',
'system.otherConfig.paymentQr.replace': 'Replace',
@ -4394,6 +4408,28 @@ export default {
'system.otherConfig.paymentQr.uploadSuccess': 'Payment QR updated',
'system.otherConfig.paymentQr.uploadFailed': 'Upload failed',
'system.otherConfig.paymentQr.loadFailed': 'Failed to load payment QR',
'system.otherConfig.paymentQr.bank.add': 'Add account',
'system.otherConfig.paymentQr.bank.edit': 'Edit account',
'system.otherConfig.paymentQr.bank.delete': 'Delete',
'system.otherConfig.paymentQr.bank.action': 'Actions',
'system.otherConfig.paymentQr.bank.accountName': 'Account name',
'system.otherConfig.paymentQr.bank.bankName': 'Bank',
'system.otherConfig.paymentQr.bank.accountNo': 'Account no.',
'system.otherConfig.paymentQr.bank.currency': 'Currency',
'system.otherConfig.paymentQr.bank.isDefault': 'Default',
'system.otherConfig.paymentQr.bank.defaultBadge': 'Default',
'system.otherConfig.paymentQr.bank.emptyTitle': 'No company accounts',
'system.otherConfig.paymentQr.bank.emptyHint':
'Shown for bank-transfer top-ups. You usually only need a few accounts.',
'system.otherConfig.paymentQr.bank.yes': 'Yes',
'system.otherConfig.paymentQr.bank.no': 'No',
'system.otherConfig.paymentQr.bank.needFields': 'Please fill in complete account info',
'system.otherConfig.paymentQr.bank.saveSuccess': 'Account saved',
'system.otherConfig.paymentQr.bank.saveFailed': 'Failed to save account',
'system.otherConfig.paymentQr.bank.loadFailed': 'Failed to load bank accounts',
'system.otherConfig.paymentQr.bank.deleteConfirm': 'Delete this bank account?',
'system.otherConfig.paymentQr.bank.deleteSuccess': 'Account deleted',
'system.otherConfig.paymentQr.bank.deleteFailed': 'Failed to delete account',
'system.otherConfig.status.enabled': 'Enabled',
'system.otherConfig.status.disabled': 'Disabled',
'system.otherConfig.table.configCode': 'Config Code',
@ -4414,7 +4450,7 @@ export default {
'system.otherConfig.form.remark': 'Remark',
'system.otherConfig.placeholder.input': 'Please enter',
'system.otherConfig.placeholder.configCode': 'e.g. track_service',
'system.otherConfig.placeholder.baseUrl': 'e.g. https://api.ideship.com/track',
'system.otherConfig.placeholder.baseUrl': 'e.g. https://api.bcdship.com/track',
'system.otherConfig.placeholder.appSecretEdit': 'Leave blank to keep unchanged',
'system.otherConfig.modal.addTitle': 'Add Config',
'system.otherConfig.modal.editTitle': 'Edit Config',
@ -5163,6 +5199,9 @@ export default {
'user.recharge.deposit.tips.item1': 'Recharge and balance 1:1 arrival',
'user.recharge.deposit.tips.item2': 'Upload clear and complete payment screenshot',
'user.recharge.deposit.tips.item3': 'SMS/In-site message reminder after funds arrive',
'user.recharge.deposit.tips.online': 'WeChat scan-to-pay credits instantly—no screenshot or review',
'user.recharge.deposit.tips.voucher': 'After transfer, upload a clear screenshot for finance review',
'user.recharge.deposit.tips.bank': 'Use the corporate account, fill payer/reference, then upload the bank receipt',
'user.recharge.deposit.form.currentAmount': 'Current recharge amount',
'user.recharge.deposit.form.stepChip': 'Step {step}/3',
'user.recharge.deposit.form.selectAmount': 'Select Amount',
@ -5172,16 +5211,117 @@ export default {
'user.recharge.deposit.form.customConfirm': 'Confirm',
'user.recharge.deposit.form.customCancel': 'Cancel',
'user.recharge.deposit.form.paymentMethod': 'Payment Method',
'user.recharge.deposit.form.paymentMethodHint': 'Prefer online pay; transfer options require a voucher and finance review',
'user.recharge.deposit.form.qrTip': 'Click QR code to zoom in and view details',
'user.recharge.deposit.form.qrEmpty': 'Payment QR is not configured. Please contact support.',
'user.recharge.deposit.form.bankEmpty': 'Receiving bank account is not configured. Please contact support.',
'user.recharge.deposit.form.bankAccountName': 'Account Name',
'user.recharge.deposit.form.bankName': 'Bank',
'user.recharge.deposit.form.bankAccountNo': 'Account No',
'user.recharge.deposit.form.bankCurrency': 'Currency',
'user.recharge.deposit.form.copy': 'Copy',
'user.recharge.deposit.form.copied': 'Copied',
'user.recharge.deposit.form.payerName': 'Payer Name',
'user.recharge.deposit.form.payerNamePlaceholder': 'Enter the payer account name',
'user.recharge.deposit.form.transferSerial': 'Transfer Reference',
'user.recharge.deposit.form.transferSerialPlaceholder': 'Enter bank transfer / transaction reference',
'user.recharge.deposit.form.uploadVoucher': 'Upload Voucher',
'user.recharge.deposit.form.uploadVoucherDesc': 'Please upload a clear payment screenshot for quick finance confirmation',
'user.recharge.deposit.form.uploading': 'Uploading',
'user.recharge.deposit.form.uploadScreenshot': 'Upload Screenshot',
'user.recharge.deposit.payment.alipay': 'Alipay',
'user.recharge.deposit.payment.alipayDesc': 'Support scan code and transfer',
'user.recharge.deposit.payment.groupInstant': 'Instant credit',
'user.recharge.deposit.payment.groupInstantDesc': 'Credits on success—no screenshot',
'user.recharge.deposit.payment.groupReview': 'Transfer voucher (review required)',
'user.recharge.deposit.payment.groupReviewDesc': 'Upload a screenshot after transfer; credits after approval',
'user.recharge.deposit.payment.recommend': 'Recommended',
'user.recharge.deposit.payment.alipay': 'Alipay transfer',
'user.recharge.deposit.payment.alipayDesc': 'Scan static QR, then upload screenshot',
'user.recharge.deposit.payment.wechat': 'WeChat Pay',
'user.recharge.deposit.payment.wechatDesc': 'Recommended for fast arrival',
'user.recharge.deposit.payment.wechatOnline': 'WeChat Online Pay',
'user.recharge.deposit.payment.wechatOnlineDesc': 'Dynamic QR · instant credit',
'user.recharge.deposit.payment.wechatVoucher': 'WeChat Transfer Voucher',
'user.recharge.deposit.payment.wechatVoucherDesc': 'Scan static QR, then upload screenshot',
'user.recharge.deposit.payment.bank': 'Bank Transfer',
'user.recharge.deposit.payment.bankDesc': 'Corporate transfer · review with reference',
'user.recharge.deposit.guide.onlineTitle': 'Next: create WeChat payment QR',
'user.recharge.deposit.guide.onlineBody': 'Tap “Create payment QR”, scan with WeChat, and balance credits automatically.',
'user.recharge.deposit.guide.voucherTitle': 'Next: upload transfer screenshot',
'user.recharge.deposit.guide.alipayBody': 'Scan the Alipay QR on the right, then upload a clear payment screenshot for review.',
'user.recharge.deposit.guide.wechatVoucherBody': 'Scan the WeChat QR on the right, then upload a clear payment screenshot for review.',
'user.recharge.deposit.guide.bankTitle': 'Next: fill transfer details and upload receipt',
'user.recharge.deposit.guide.bankBody': 'Transfer to the corporate account on the right, fill payer/reference, and upload the bank receipt.',
'user.recharge.deposit.form.wxOnlineHint': 'No screenshot needed—auto credit after payment',
'user.recharge.deposit.form.wxOnlinePanelTitle': 'WeChat online pay steps',
'user.recharge.deposit.form.wxOnlineStep1': 'Tap “Create payment QR”',
'user.recharge.deposit.form.wxOnlineStep2': 'Scan with WeChat and pay',
'user.recharge.deposit.form.wxOnlineStep3': 'This page confirms and credits automatically',
'user.recharge.deposit.form.wxOnlineScan': 'Scan with WeChat to pay',
'user.recharge.deposit.form.wxOnlineWaiting': 'Balance credits automatically after payment. Keep this page open.',
'user.recharge.deposit.form.wxOnlineOrderNo': 'Merchant order: {no}',
'user.recharge.deposit.form.bankPanelTitle': 'Corporate receiving account',
'user.recharge.deposit.form.alipayPanelTitle': 'Alipay QR',
'user.recharge.deposit.form.wechatVoucherPanelTitle': 'WeChat QR (voucher)',
'user.recharge.deposit.form.voucherPanelTip': 'Match the amount before transferring, and keep the screenshot for review',
'user.recharge.deposit.actions.createPay': 'Create payment QR',
'user.recharge.deposit.actions.cancelPay': 'Cancel payment',
'user.recharge.deposit.message.wxOnlinePaid': 'WeChat payment succeeded. Balance updated.',
'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.wxOnlineCreateFailed': 'Failed to create WeChat payment',
'system.otherConfig.paymentQr.wechatPay.panelTitle': 'WeChat Pay merchant (APIv3)',
'system.otherConfig.paymentQr.wechatPay.enabled': 'Enable online pay',
'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI available',
'system.otherConfig.paymentQr.wechatPay.enabledOff': 'Online pay disabled when off',
'system.otherConfig.paymentQr.wechatPay.statusReady': 'Ready',
'system.otherConfig.paymentQr.wechatPay.statusPending': 'Incomplete',
'system.otherConfig.paymentQr.wechatPay.checkMerchant': 'Merchant',
'system.otherConfig.paymentQr.wechatPay.checkNotify': 'Notify URL',
'system.otherConfig.paymentQr.wechatPay.checkSecret': 'Secrets',
'system.otherConfig.paymentQr.wechatPay.checkAppId': 'MP AppId',
'system.otherConfig.paymentQr.wechatPay.sectionBasic': 'Merchant basics',
'system.otherConfig.paymentQr.wechatPay.sectionBasicHint': 'MchId, cert serial, public notify URL',
'system.otherConfig.paymentQr.wechatPay.sectionSecret': 'Keys & cert',
'system.otherConfig.paymentQr.wechatPay.sectionSecretHint': 'Server-side only; never echoed',
'system.otherConfig.paymentQr.wechatPay.sectionBind': 'Official Account binding',
'system.otherConfig.paymentQr.wechatPay.sectionBindHint': 'Must match merchant-bound AppId',
'system.otherConfig.paymentQr.wechatPay.mchId': 'Merchant ID (MchId)',
'system.otherConfig.paymentQr.wechatPay.mchIdPlaceholder': 'e.g. 1900000109',
'system.otherConfig.paymentQr.wechatPay.mchSerialNo': 'Merchant cert serial',
'system.otherConfig.paymentQr.wechatPay.mchSerialNoPlaceholder': 'API certificate serial from merchant portal',
'system.otherConfig.paymentQr.wechatPay.notifyUrl': 'Notify URL',
'system.otherConfig.paymentQr.wechatPay.fillNotify': 'Use suggested URL',
'system.otherConfig.paymentQr.wechatPay.apiV3Key': 'APIv3 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.privateKeyPem': 'Merchant API private key (PEM)',
'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.importPem': 'Import PEM file',
'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.pemImported': 'Private key imported',
'system.otherConfig.paymentQr.wechatPay.pemReadFailed': 'Failed to read file',
'system.otherConfig.paymentQr.wechatPay.appId': 'Bound Official Account AppId',
'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.mpMissing': 'No WeChat MP config in list; create one first',
'system.otherConfig.paymentQr.wechatPay.hasKey': 'Configured',
'system.otherConfig.paymentQr.wechatPay.missingKey': 'Missing',
'system.otherConfig.paymentQr.wechatPay.dirtyHint': 'Unsaved changes',
'system.otherConfig.paymentQr.wechatPay.cleanHint': 'In sync with server',
'system.otherConfig.paymentQr.wechatPay.reset': 'Revert',
'system.otherConfig.paymentQr.wechatPay.save': 'Save merchant config',
'system.otherConfig.paymentQr.wechatPay.needMchId': 'Merchant ID is required',
'system.otherConfig.paymentQr.wechatPay.needSerial': 'Cert serial 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.needApiV3Key': 'APIv3 key is required on first save',
'system.otherConfig.paymentQr.wechatPay.needPrivateKey': 'Private key is required on first save',
'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.saveFailed': 'Save failed',
'system.otherConfig.paymentQr.wechatPay.tip': 'Direct merchant APIv3. Secrets stay server-side. NotifyUrl must be public HTTPS.',
'user.recharge.deposit.result.title': 'Submitted Successfully',
'user.recharge.deposit.result.subtitle': 'Under review, please wait patiently',
'user.recharge.deposit.result.actions.rechargeAgain': 'Recharge Again',
@ -5190,6 +5330,7 @@ export default {
'user.recharge.deposit.actions.nextStep': 'Next',
'user.recharge.deposit.actions.submitReview': 'Submit for Review',
'user.recharge.deposit.message.selectAmount': 'Please select recharge amount',
'user.recharge.deposit.message.fillBankRemark': 'Please enter payer name and transfer reference',
'user.recharge.deposit.message.uploadSuccess': 'Upload successfully',
'user.recharge.deposit.message.uploadFailed': 'Upload failed',
'user.recharge.deposit.message.uploadVoucherFirst': 'Please upload recharge voucher first',
@ -5198,6 +5339,7 @@ export default {
'user.recharge.deposit.message.pendingApproval': 'Submitted for approval ({no}); credited after approval',
'user.recharge.deposit.message.pendingApprovalFallback': 'Submitted for approval; credited after approval',
'user.recharge.deposit.message.bypassed': 'Recharge credited',
'user.recharge.deposit.message.copyFailed': 'Copy failed, please copy manually',
// User - Recharge Record
'user.recharge.record.search.serialNo': 'Serial No',
@ -5242,6 +5384,7 @@ export default {
'user.recharge.record.message.approvalDetailMissing': 'Approval instance missing; refresh and retry',
'user.recharge.record.payment.alipay': 'Alipay',
'user.recharge.record.payment.wechat': 'WeChat',
'user.recharge.record.payment.bank': 'Bank Transfer',
'user.recharge.record.actions.approve': 'Approve',
'user.recharge.record.actions.reject': 'Reject',
'user.recharge.record.actions.viewApproval': 'View approval',
@ -5261,6 +5404,10 @@ export default {
'user.accountFlow.bizType.pickupPay': 'Pickup payment',
'user.accountFlow.bizType.manualAdjust': 'Manual adjust',
'user.accountFlow.bizType.storageRent': 'Storage rent',
'user.accountFlow.bizType.referralCommission': 'Referral commission',
'user.accountFlow.bizType.commissionToBalance': 'Commission to balance',
'user.accountFlow.bizType.commissionWithdraw': 'Commission withdraw',
'user.accountFlow.bizType.marketingAdjust': 'Marketing adjust',
'user.accountFlow.message.loadError': 'Failed to load account transactions',
'user.accountFlow.table.serialNumber': 'Serial no.',
'user.accountFlow.table.createTime': 'Time',

View File

@ -71,6 +71,7 @@ export default {
'menu.user.profile': '个人中心',
'menu.user.recharge': '资金充值',
'menu.user.invoice': '我的发票',
'menu.user.accountFlow': '资金流水',
'menu.finance': '财务',
'menu.finance.analysis': '财务分析',
'menu.finance.rechargeRecord': '充值记录',
@ -1896,6 +1897,16 @@ export default {
'order.myOrders.modal.payBatchSuccess': '已成功支付 {count} 单',
'order.myOrders.modal.payPartialResult': '成功 {success} 单,失败 {failed} 单,请查看失败原因后重试',
'order.myOrders.modal.payMethodBalance': '支付方式:账户余额',
'order.myOrders.modal.payMethodHybrid': '支付方式:余额 + 微信补差',
'order.myOrders.modal.paySplitBalance': '余额 {amount}',
'order.myOrders.modal.paySplitWechat': '微信 {amount}',
'order.myOrders.modal.payHybridHint': '余额不足部分将通过微信扫码补差 {amount}',
'order.myOrders.modal.payMultiCustomerWxHint': '跨客户批量仅支持账户余额,请按客户拆分后再用微信补差。',
'order.myOrders.modal.payWxTitle': '微信扫码补差',
'order.myOrders.modal.payWxTip': '请使用微信扫一扫完成支付,成功后自动关闭',
'order.myOrders.modal.payWxAmount': '应付微信金额 {amount}',
'order.myOrders.modal.payWxCancel': '取消支付',
'order.myOrders.modal.payWxCreateFailed': '创建微信支付失败',
'order.myOrders.modal.payEmpty': '暂无可支付订单',
'order.myOrders.actions.intercept': '拦截',
'order.myOrders.actions.cancelIntercept': '取消拦截',
@ -4282,9 +4293,9 @@ export default {
'system.otherConfig.actions.refresh': '刷新',
'system.otherConfig.actions.save': '保存',
'system.otherConfig.actions.cancel': '取消',
'system.otherConfig.actions.paymentQr': '收款码',
'system.otherConfig.actions.paymentQr': '收款配置',
'system.otherConfig.actions.brandLogo': '品牌配置',
'system.otherConfig.paymentQr.navDesc': '客户充值展示用',
'system.otherConfig.paymentQr.navDesc': '收款码与银行账户',
'system.otherConfig.brandLogo.navDesc': '文案与品牌图片',
'system.otherConfig.wechatOrderNotify.navDesc': '微信 / 邮件模板',
'system.otherConfig.brandLogo.title': '品牌配置',
@ -4387,9 +4398,12 @@ export default {
'system.otherConfig.wechatOrderNotify.trialSuccess': '试发完成',
'system.otherConfig.wechatOrderNotify.trialFailed': '试发失败',
'system.otherConfig.wechatOrderNotify.trialResultTitle': '微信试发结果',
'system.otherConfig.paymentQr.title': '充值收款码',
'system.otherConfig.paymentQr.title': '充值收款配置',
'system.otherConfig.paymentQr.tip':
'用于客户 PC / H5 充值页展示。更换后立即生效。',
'用于客户 PC / H5 充值页:扫码收款与银行转账账户。更换后立即生效。',
'system.otherConfig.paymentQr.tab.qr': '收款码',
'system.otherConfig.paymentQr.tab.bank': '银行账户',
'system.otherConfig.paymentQr.tab.wechatPay': '微信支付商户',
'system.otherConfig.paymentQr.alipay': '支付宝',
'system.otherConfig.paymentQr.wechat': '微信',
'system.otherConfig.paymentQr.replace': '更换图片',
@ -4406,6 +4420,27 @@ export default {
'system.otherConfig.paymentQr.uploadSuccess': '收款码已更新',
'system.otherConfig.paymentQr.uploadFailed': '上传失败',
'system.otherConfig.paymentQr.loadFailed': '加载收款码失败',
'system.otherConfig.paymentQr.bank.add': '新增账户',
'system.otherConfig.paymentQr.bank.edit': '编辑账户',
'system.otherConfig.paymentQr.bank.delete': '删除',
'system.otherConfig.paymentQr.bank.action': '操作',
'system.otherConfig.paymentQr.bank.accountName': '户名',
'system.otherConfig.paymentQr.bank.bankName': '开户行',
'system.otherConfig.paymentQr.bank.accountNo': '账号',
'system.otherConfig.paymentQr.bank.currency': '币种',
'system.otherConfig.paymentQr.bank.isDefault': '默认',
'system.otherConfig.paymentQr.bank.defaultBadge': '默认账户',
'system.otherConfig.paymentQr.bank.emptyTitle': '暂无公司账户',
'system.otherConfig.paymentQr.bank.emptyHint': '用于转账充值展示收款信息,一般只需维护少数几个账户。',
'system.otherConfig.paymentQr.bank.yes': '是',
'system.otherConfig.paymentQr.bank.no': '否',
'system.otherConfig.paymentQr.bank.needFields': '请填写完整账户信息',
'system.otherConfig.paymentQr.bank.saveSuccess': '账户已保存',
'system.otherConfig.paymentQr.bank.saveFailed': '保存账户失败',
'system.otherConfig.paymentQr.bank.loadFailed': '加载银行账户失败',
'system.otherConfig.paymentQr.bank.deleteConfirm': '确认删除该银行账户?',
'system.otherConfig.paymentQr.bank.deleteSuccess': '账户已删除',
'system.otherConfig.paymentQr.bank.deleteFailed': '删除账户失败',
'system.otherConfig.status.enabled': '启用',
'system.otherConfig.status.disabled': '禁用',
'system.otherConfig.table.configCode': '配置编码',
@ -4426,7 +4461,7 @@ export default {
'system.otherConfig.form.remark': '备注',
'system.otherConfig.placeholder.input': '请输入',
'system.otherConfig.placeholder.configCode': '如 track_service',
'system.otherConfig.placeholder.baseUrl': '如 https://api.ideship.com/track',
'system.otherConfig.placeholder.baseUrl': '如 https://api.bcdship.com/track',
'system.otherConfig.placeholder.appSecretEdit': '留空则不修改',
'system.otherConfig.modal.addTitle': '新增配置',
'system.otherConfig.modal.editTitle': '编辑配置',
@ -5181,6 +5216,9 @@ export default {
'user.recharge.deposit.tips.item1': '充值与余额 1:1 到账',
'user.recharge.deposit.tips.item2': '上传清晰完整的支付截图',
'user.recharge.deposit.tips.item3': '资金到账后会短信/站内信提醒',
'user.recharge.deposit.tips.online': '微信扫码支付成功后余额自动到账,无需上传截图、无需等待审核',
'user.recharge.deposit.tips.voucher': '扫码/转账后请上传清晰截图,财务审核通过后到账',
'user.recharge.deposit.tips.bank': '请核对对公账户信息,填写付款户名与流水号并上传转账回单',
'user.recharge.deposit.form.currentAmount': '当前充值金额',
'user.recharge.deposit.form.stepChip': '步骤 {step}/3',
'user.recharge.deposit.form.selectAmount': '选择金额',
@ -5190,16 +5228,117 @@ export default {
'user.recharge.deposit.form.customConfirm': '确定',
'user.recharge.deposit.form.customCancel': '取消',
'user.recharge.deposit.form.paymentMethod': '支付方式',
'user.recharge.deposit.form.paymentMethodHint': '推荐优先使用在线支付;转账类方式需上传凭证并由财务审核',
'user.recharge.deposit.form.qrTip': '点击二维码可放大查看详情',
'user.recharge.deposit.form.qrEmpty': '暂未配置收款码,请联系客服',
'user.recharge.deposit.form.bankEmpty': '暂未配置收款账户,请联系客服',
'user.recharge.deposit.form.bankAccountName': '收款户名',
'user.recharge.deposit.form.bankName': '开户行',
'user.recharge.deposit.form.bankAccountNo': '银行账号',
'user.recharge.deposit.form.bankCurrency': '币种',
'user.recharge.deposit.form.copy': '复制',
'user.recharge.deposit.form.copied': '已复制',
'user.recharge.deposit.form.payerName': '付款户名',
'user.recharge.deposit.form.payerNamePlaceholder': '请填写付款账户户名',
'user.recharge.deposit.form.transferSerial': '银行流水号',
'user.recharge.deposit.form.transferSerialPlaceholder': '请填写转账流水号/交易参考号',
'user.recharge.deposit.form.uploadVoucher': '上传凭证',
'user.recharge.deposit.form.uploadVoucherDesc': '请上传清晰的付款截图,以便财务快速确认',
'user.recharge.deposit.form.uploading': '上传中',
'user.recharge.deposit.form.uploadScreenshot': '上传截图',
'user.recharge.deposit.payment.alipay': '支付宝',
'user.recharge.deposit.payment.alipayDesc': '支持扫码及转账',
'user.recharge.deposit.payment.groupInstant': '即时到账',
'user.recharge.deposit.payment.groupInstantDesc': '支付成功即入账,无需截图',
'user.recharge.deposit.payment.groupReview': '转账凭证(需审核)',
'user.recharge.deposit.payment.groupReviewDesc': '完成转账后上传截图,审核通过后到账',
'user.recharge.deposit.payment.recommend': '推荐',
'user.recharge.deposit.payment.alipay': '支付宝转账',
'user.recharge.deposit.payment.alipayDesc': '扫静态码后上传截图审核',
'user.recharge.deposit.payment.wechat': '微信支付',
'user.recharge.deposit.payment.wechatDesc': '推荐快速到账',
'user.recharge.deposit.payment.wechatOnline': '微信在线支付',
'user.recharge.deposit.payment.wechatOnlineDesc': '扫动态码 · 秒级到账',
'user.recharge.deposit.payment.wechatVoucher': '微信转账凭证',
'user.recharge.deposit.payment.wechatVoucherDesc': '扫静态码后上传截图审核',
'user.recharge.deposit.payment.bank': '银行转账',
'user.recharge.deposit.payment.bankDesc': '对公转账 · 填写流水后审核',
'user.recharge.deposit.guide.onlineTitle': '下一步:生成微信支付码',
'user.recharge.deposit.guide.onlineBody': '点击下方「生成支付码」,用微信扫一扫完成支付,成功后余额自动到账。',
'user.recharge.deposit.guide.voucherTitle': '下一步:上传转账截图',
'user.recharge.deposit.guide.alipayBody': '请先扫右侧支付宝收款码完成转账,再上传清晰支付截图提交审核。',
'user.recharge.deposit.guide.wechatVoucherBody': '请先扫右侧微信收款码完成转账,再上传清晰支付截图提交审核。',
'user.recharge.deposit.guide.bankTitle': '下一步:填写转账信息并上传回单',
'user.recharge.deposit.guide.bankBody': '请按右侧对公账户转账,填写付款户名与流水号,并上传银行回单截图。',
'user.recharge.deposit.form.wxOnlineHint': '无需上传截图,支付成功后自动入账',
'user.recharge.deposit.form.wxOnlinePanelTitle': '微信在线支付流程',
'user.recharge.deposit.form.wxOnlineStep1': '点击「生成支付码」',
'user.recharge.deposit.form.wxOnlineStep2': '打开微信扫一扫完成支付',
'user.recharge.deposit.form.wxOnlineStep3': '本页自动确认并到账',
'user.recharge.deposit.form.wxOnlineScan': '请使用微信扫码支付',
'user.recharge.deposit.form.wxOnlineWaiting': '支付完成后将自动到账,请勿关闭页面',
'user.recharge.deposit.form.wxOnlineOrderNo': '商户单号:{no}',
'user.recharge.deposit.form.bankPanelTitle': '对公收款账户',
'user.recharge.deposit.form.alipayPanelTitle': '支付宝收款码',
'user.recharge.deposit.form.wechatVoucherPanelTitle': '微信收款码(转账凭证)',
'user.recharge.deposit.form.voucherPanelTip': '请确认金额一致后再转账,并保留截图用于审核',
'user.recharge.deposit.actions.createPay': '生成支付码',
'user.recharge.deposit.actions.cancelPay': '取消支付',
'user.recharge.deposit.message.wxOnlinePaid': '微信支付成功,余额已到账',
'user.recharge.deposit.message.wxOnlineClosed': '支付已关闭或失败,请重新发起',
'user.recharge.deposit.message.wxOnlineNoCode': '未返回支付二维码',
'user.recharge.deposit.message.wxOnlineCreateFailed': '创建微信支付失败',
'system.otherConfig.paymentQr.wechatPay.panelTitle': '微信支付商户(APIv3)',
'system.otherConfig.paymentQr.wechatPay.enabled': '启用在线支付',
'system.otherConfig.paymentQr.wechatPay.enabledOn': 'Native / JSAPI 可用',
'system.otherConfig.paymentQr.wechatPay.enabledOff': '关闭后无法发起在线支付',
'system.otherConfig.paymentQr.wechatPay.statusReady': '配置完整',
'system.otherConfig.paymentQr.wechatPay.statusPending': '待完善',
'system.otherConfig.paymentQr.wechatPay.checkMerchant': '商户号',
'system.otherConfig.paymentQr.wechatPay.checkNotify': '回调地址',
'system.otherConfig.paymentQr.wechatPay.checkSecret': '密钥证书',
'system.otherConfig.paymentQr.wechatPay.checkAppId': '公众号 AppId',
'system.otherConfig.paymentQr.wechatPay.sectionBasic': '商户基础信息',
'system.otherConfig.paymentQr.wechatPay.sectionBasicHint': '商户号、证书序列号与公网回调',
'system.otherConfig.paymentQr.wechatPay.sectionSecret': '密钥与证书',
'system.otherConfig.paymentQr.wechatPay.sectionSecretHint': '仅服务端保存,前端不回显明文',
'system.otherConfig.paymentQr.wechatPay.sectionBind': '公众号绑定',
'system.otherConfig.paymentQr.wechatPay.sectionBindHint': '须与商户平台绑定同一主体 AppId',
'system.otherConfig.paymentQr.wechatPay.mchId': '商户号 MchId',
'system.otherConfig.paymentQr.wechatPay.mchIdPlaceholder': '例如 1900000109',
'system.otherConfig.paymentQr.wechatPay.mchSerialNo': '商户证书序列号',
'system.otherConfig.paymentQr.wechatPay.mchSerialNoPlaceholder': 'API 证书序列号(商户平台可查)',
'system.otherConfig.paymentQr.wechatPay.notifyUrl': '支付回调 NotifyUrl',
'system.otherConfig.paymentQr.wechatPay.fillNotify': '填充推荐地址',
'system.otherConfig.paymentQr.wechatPay.apiV3Key': 'APIv3 密钥',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyPlaceholder': '留空则保留原密钥',
'system.otherConfig.paymentQr.wechatPay.apiV3KeyRequired': '首次保存须填写 32 位 APIv3 密钥',
'system.otherConfig.paymentQr.wechatPay.privateKeyPem': '商户 API 私钥 PEM',
'system.otherConfig.paymentQr.wechatPay.privateKeyPlaceholder': '留空则保留原私钥;须含 BEGIN PRIVATE KEY',
'system.otherConfig.paymentQr.wechatPay.privateKeyRequired': '首次保存须粘贴或导入私钥 PEM',
'system.otherConfig.paymentQr.wechatPay.importPem': '导入 PEM 文件',
'system.otherConfig.paymentQr.wechatPay.clearPem': '清空本次输入',
'system.otherConfig.paymentQr.wechatPay.pemInvalid': '文件内容不像 PEM 私钥',
'system.otherConfig.paymentQr.wechatPay.pemImported': '已导入私钥内容',
'system.otherConfig.paymentQr.wechatPay.pemReadFailed': '读取文件失败',
'system.otherConfig.paymentQr.wechatPay.appId': '绑定公众号 AppId',
'system.otherConfig.paymentQr.wechatPay.appIdEmpty': '未配置公众号 AppId(请先配置「微信公众号」)',
'system.otherConfig.paymentQr.wechatPay.openMpConfig': '去配置公众号',
'system.otherConfig.paymentQr.wechatPay.mpMissing': '列表中暂无微信公众号配置,请先新增',
'system.otherConfig.paymentQr.wechatPay.hasKey': '已配置',
'system.otherConfig.paymentQr.wechatPay.missingKey': '未配置',
'system.otherConfig.paymentQr.wechatPay.dirtyHint': '有未保存的修改',
'system.otherConfig.paymentQr.wechatPay.cleanHint': '当前内容已与服务器一致',
'system.otherConfig.paymentQr.wechatPay.reset': '还原',
'system.otherConfig.paymentQr.wechatPay.save': '保存商户配置',
'system.otherConfig.paymentQr.wechatPay.needMchId': '请填写商户号',
'system.otherConfig.paymentQr.wechatPay.needSerial': '请填写证书序列号',
'system.otherConfig.paymentQr.wechatPay.needNotify': '请填写支付回调地址',
'system.otherConfig.paymentQr.wechatPay.needHttps': 'NotifyUrl 须为 https:// 开头的公网地址',
'system.otherConfig.paymentQr.wechatPay.needApiV3Key': '首次保存须填写 APIv3 密钥',
'system.otherConfig.paymentQr.wechatPay.needPrivateKey': '首次保存须填写商户 API 私钥',
'system.otherConfig.paymentQr.wechatPay.loadFailed': '加载微信支付商户配置失败',
'system.otherConfig.paymentQr.wechatPay.saveSuccess': '微信支付商户配置已保存',
'system.otherConfig.paymentQr.wechatPay.saveFailed': '保存失败',
'system.otherConfig.paymentQr.wechatPay.tip': '普通商户直连 APIv3:密钥仅服务端保存,前端不回显明文。NotifyUrl 须公网 HTTPS。',
'user.recharge.deposit.result.title': '提交成功',
'user.recharge.deposit.result.subtitle': '审核中,请耐心等待',
'user.recharge.deposit.result.actions.rechargeAgain': '再转一笔',
@ -5208,6 +5347,7 @@ export default {
'user.recharge.deposit.actions.nextStep': '下一步',
'user.recharge.deposit.actions.submitReview': '提交审核',
'user.recharge.deposit.message.selectAmount': '请选择充值金额',
'user.recharge.deposit.message.fillBankRemark': '请填写付款户名和银行流水号',
'user.recharge.deposit.message.uploadSuccess': '上传成功',
'user.recharge.deposit.message.uploadFailed': '上传失败',
'user.recharge.deposit.message.uploadVoucherFirst': '请先上传充值凭证',
@ -5216,6 +5356,7 @@ export default {
'user.recharge.deposit.message.pendingApproval': '已提交审批({no}),通过后入账',
'user.recharge.deposit.message.pendingApprovalFallback': '已提交审批,通过后入账',
'user.recharge.deposit.message.bypassed': '充值已入账',
'user.recharge.deposit.message.copyFailed': '复制失败,请手动复制',
// 用户 - 充值记录
'user.recharge.record.search.serialNo': '流水号',
@ -5260,6 +5401,7 @@ export default {
'user.recharge.record.message.approvalDetailMissing': '暂无审批单,请刷新后重试',
'user.recharge.record.payment.alipay': '支付宝',
'user.recharge.record.payment.wechat': '微信',
'user.recharge.record.payment.bank': '银行转账',
'user.recharge.record.actions.approve': '通过',
'user.recharge.record.actions.reject': '拒绝',
'user.recharge.record.actions.viewApproval': '查看审批',
@ -5279,6 +5421,10 @@ export default {
'user.accountFlow.bizType.pickupPay': '揽收支付',
'user.accountFlow.bizType.manualAdjust': '人工调整',
'user.accountFlow.bizType.storageRent': '仓租扣费',
'user.accountFlow.bizType.referralCommission': '推荐佣金',
'user.accountFlow.bizType.commissionToBalance': '佣金转入余额',
'user.accountFlow.bizType.commissionWithdraw': '佣金提现',
'user.accountFlow.bizType.marketingAdjust': '营销调整',
'user.accountFlow.message.loadError': '加载资金流水失败',
'user.accountFlow.table.serialNumber': '流水号',
'user.accountFlow.table.createTime': '交易时间',

View File

@ -36,7 +36,8 @@ const DASHBOARD: AppRouteRecordRaw = {
icon: 'icon-mind-mapping',
order: 10,
ignoreCache: true,
frameSrc: 'https://api.test.ideship.com/admin/eventbus',
// 相对 API 根;页面内用 prodApiOrigin() 拼接,勿写死域名
frameSrcPath: '/admin/eventbus',
},
},
{
@ -52,7 +53,7 @@ const DASHBOARD: AppRouteRecordRaw = {
icon: 'icon-relation',
order: 11,
ignoreCache: true,
frameSrc: 'https://api.test.ideship.com/track/eventbus',
frameSrcPath: '/track/eventbus',
},
},
],

View File

@ -162,6 +162,23 @@ const USER: AppRouteRecordRaw = {
customerPortalOnly: true,
},
},
{
path: 'accountFlow',
name: 'UserAccountFlow',
component: () => import('@/views/user/accountFlow/index.vue'),
meta: {
locale: 'menu.user.accountFlow',
requiresAuth: true,
roles: ['*'],
hideInMenu: true,
ignoreCache: true,
syncInMenu: true,
menuPermission: 'User.AccountFlow',
order: 15,
customerPortalOnly: true,
icon: 'icon-swap',
},
},
],
};

View File

@ -21,5 +21,7 @@ declare module 'vue-router' {
ignoreCache?: boolean; // if set true, the page will not be cached
/** 外链嵌入页地址(iframe src),如 EventBus Dashboard */
frameSrc?: string;
/** 相对 API 根的嵌入路径;页面内拼接 prodApiOrigin(),勿写死域名 */
frameSrcPath?: string;
}
}

View File

@ -2,13 +2,12 @@
* Admin API 地址(方案 A)
* - 开发:相对路径,Vite 代理到 Admin
* - 生产/测试:{apiOrigin}/admin(可用 VITE_API_ADMIN_URL 覆盖)
* - 浏览器在 test.ideship.com 时强制 api.test.ideship.com/admin
* - 浏览器在测试前端主机时强制测试 Admin
*/
import { BCDSHIP_TEST_API } from '@/config/deployTargets'
import { isTestFrontHost, prodApiOrigin } from './rewriteBrowserApiPath'
const DEFAULT_TEST_ADMIN = 'https://api.test.ideship.com/admin'
function normalizeBase(base: string): string {
return base.trim().replace(/\/$/, '')
}
@ -23,7 +22,7 @@ function isBrowserOnTestFront(): boolean {
function prodAdminBase(): string {
if (isBrowserOnTestFront()) {
return DEFAULT_TEST_ADMIN
return BCDSHIP_TEST_API.adminBase
}
const override = import.meta.env.VITE_API_ADMIN_URL as string | undefined
if (override?.trim()) return normalizeBase(override)
@ -49,14 +48,14 @@ export function resolveOpenApiBase(): string {
/** 桌面 Agent 等直连 Admin 网关 */
export function resolveDirectAdminApiUrl(): string {
if (isBrowserOnTestFront()) {
return DEFAULT_TEST_ADMIN
return BCDSHIP_TEST_API.adminBase
}
const override = import.meta.env.VITE_API_ADMIN_URL as string | undefined
if (override?.trim()) {
return normalizeBase(override)
}
if (import.meta.env.DEV) {
return DEFAULT_TEST_ADMIN
return BCDSHIP_TEST_API.adminBase
}
return prodAdminBase()
}
@ -66,7 +65,7 @@ export function resolveDirectAdminApiUrl(): string {
*/
export function resolveAdminAssetOrigin(): string {
if (isBrowserOnTestFront()) {
return DEFAULT_TEST_ADMIN
return BCDSHIP_TEST_API.adminBase
}
const override = import.meta.env.VITE_API_ASSET_ORIGIN as string | undefined
if (override?.trim()) {

View File

@ -1,5 +1,4 @@
import type { OmsLoginType } from '@/api/rbac'
import type { MenuTreeDto } from '@/api/rbac'
import { OmsLoginType, type MenuTreeDto } from '@/api/rbac'
import { canAccessCustomerPortalRoute, isAdminPortalOnlyPath, isCustomerPortalOnlyPath } from '@/utils/login-portal'
/** 客户顶栏高频入口(路径越靠前优先级越高) */
@ -82,10 +81,14 @@ const CUSTOMER_NAV_DOCK_ONLY_PATH_PREFIXES = [
*/
const BALANCE_MENU_PATH_PREFIXES = [
'/user/recharge',
'/user/accountFlow',
'/finance/rechargeRecord',
'/finance/accountFlow',
] as const
/** 资产类里仍放进侧栏「更多」的入口(不进用户下拉) */
const CUSTOMER_MORE_FROM_USER_PATH_PREFIXES = ['/user/accountFlow'] as const
function matchesPathPrefix(path: string, prefix: string): boolean {
return path === prefix || path.startsWith(`${prefix}/`)
}
@ -99,6 +102,9 @@ export function isCustomerBalanceMenuPath(path: string): boolean {
export function resolveCustomerNavGroupId(path: string): CustomerNavGroupId {
const p = path.trim() || '/'
if (CUSTOMER_MORE_FROM_USER_PATH_PREFIXES.some((prefix) => matchesPathPrefix(p, prefix))) {
return 'more'
}
if (p === '/user' || p.startsWith('/user/')) return 'account'
if (p === '/finance' || p.startsWith('/finance/')) return 'account'
if (p === '/marketing' || p.startsWith('/marketing/')) return 'account'
@ -303,6 +309,21 @@ export function buildCustomerFlatNavMenus(
push(toNavItem(menu))
}
// 客户门户固定入口:资金流水(不依赖菜单是否已同步)
if (Number(loginType) === OmsLoginType.Customer || loginType === OmsLoginType.Customer) {
push({
name: '资金流水',
path: '/user/accountFlow',
route: '/user/accountFlow',
meta: {
title: '资金流水',
order: 15,
customerPortalOnly: true,
icon: 'icon-swap',
},
})
}
result.sort((a, b) => {
const pa = navPriority(getCustomerNavPath(a))
const pb = navPriority(getCustomerNavPath(b))

View File

@ -131,6 +131,7 @@ const CUSTOMER_PORTAL_ONLY_PATH_PREFIXES = [
'/user/marketing',
'/user/recharge',
'/user/invoice',
'/user/accountFlow',
'/h5',
] as const

View File

@ -21,6 +21,7 @@ export const MENU_NAME_TO_LOCALE_KEY: Record<string, string> = {
发票管理: 'menu.finance.invoiceManage',
抬头管理: 'menu.finance.invoiceProfile',
我的发票: 'menu.user.invoice',
资金流水: 'menu.user.accountFlow',
营销: 'menu.marketing',
营销指引: 'menu.marketing.marketingGuide',
订单: 'menu.order',

View File

@ -41,6 +41,7 @@ export const SUB_MENU_DEFAULT_ICONS: Record<string, string> = {
'menu.finance.analysis': 'IconBarChart',
'menu.finance.rechargeRecord': 'IconList',
'menu.finance.accountFlow': 'IconSwap',
'menu.user.accountFlow': 'IconSwap',
'menu.finance.receivablePayable': 'IconFile',
'menu.finance.invoiceManage': 'IconFile',
'menu.finance.invoiceProfile': 'IconUser',

View File

@ -6,6 +6,7 @@ import {
omsUrl,
resolveOmsAssetUrl,
} from '@/api/oms/common'
import { stripKnownAdminAbsolutePrefix } from '@/config/deployTargets'
const COS_PROXY_PREFIX = '/__cos__'
const PREVIEW_FETCH_TIMEOUT_MS = 25000
@ -72,8 +73,7 @@ function rewriteDevAdminAssetPath(url: string): string {
if (!import.meta.env.DEV) return url
const trimmed = String(url || '').trim()
if (!trimmed) return trimmed
const proxied = trimmed.replace(/^https?:\/\/api\.(?:ideship|nanafa)\.com\/admin/i, '')
return proxied || trimmed
return stripKnownAdminAbsolutePrefix(trimmed)
}
function stripAdminPrefix(key: string): string {

View File

@ -26,7 +26,7 @@ const service: AxiosInstance = axios.create({
service.interceptors.request.use(
(config: AxiosRequestConfig) => {
config.headers = config.headers ?? {};
// 生产:改写为 https://api.ideship.com/{itfx|track|...}(方案 A)
// 生产:改写为 {apiOrigin}/{itfx|track|...}(方案 A,域名见 deployTargets)
// 开发:Vite 代理 /api、/Track
if (config.url) {
config.url = rewriteBrowserApiPath(config.url);

View File

@ -1,11 +1,16 @@
/**
* 方案 A:浏览器直连 API 网关 PATHBASE;开发仍走 Vite 代理旧路径。
* - prod:https://api.ideship.com
* - test(test.ideship.com):https://api.test.ideship.com
* - 浏览器在测试站点时优先按域名判定(避免 test 镜像误用 production 环境变量打成正式 API)
* - 非测试站点可用 VITE_API_ORIGIN 覆盖
* 默认域名来自 deployTargets;可用 VITE_API_ORIGIN 覆盖。
* 测试站点主机强制走测试 API,避免误打生产。
*/
import {
BCDSHIP_TEST_API,
DEPLOY_TARGETS,
isTestFrontHost,
usesPrimaryTrackPath,
} from '@/config/deployTargets'
const SPA_API_PREFIXES = [
'upstreamInterface',
'upstreamInterfaceConfig',
@ -19,16 +24,7 @@ const SPA_API_PREFIXES = [
'trackApi',
] as const
const DEFAULT_PROD_API = 'https://api.ideship.com'
const DEFAULT_TEST_API = 'https://api.test.ideship.com'
export function isTestFrontHost(hostname: string): boolean {
return (
hostname === 'test.ideship.com' ||
hostname === 'app.test.ideship.com' || // 旧域名兼容
hostname.endsWith('.test.ideship.com')
)
}
export { isTestFrontHost }
function isBrowserOnTestFront(): boolean {
return typeof window !== 'undefined' && isTestFrontHost(window.location.hostname)
@ -36,13 +32,12 @@ function isBrowserOnTestFront(): boolean {
/** 生产/测试 API 根(无尾斜杠) */
export function prodApiOrigin(): string {
// 测试站点强制走测试 API,不被错误打进包的 VITE_API_ORIGIN 覆盖
if (isBrowserOnTestFront()) {
return DEFAULT_TEST_API
return BCDSHIP_TEST_API.apiOrigin
}
const override = (import.meta.env.VITE_API_ORIGIN as string | undefined)?.trim()
if (override) return override.replace(/\/$/, '')
return DEFAULT_PROD_API
return DEPLOY_TARGETS.bcdship.apiOrigin
}
function isItfxSpaPath(afterApi: string): boolean {
@ -52,14 +47,9 @@ function isItfxSpaPath(afterApi: string): boolean {
)
}
/** 与 vite.config rewriteTrackProxyPath 一致:ideship PATHBASE=/track 只需单段 Track */
const TRACK_ROOT_SERVICES = ['Warning', 'ProviderService', 'Dictionary'] as const
function usesIdeshipTrackPath(origin: string): boolean {
return /ideship\.com/i.test(origin)
}
/** /Track/... → /track/...(ideship 剥掉历史双 Track) */
/** /Track/... → /track/...(主站剥掉历史双 Track) */
function rewriteTrackApiPath(path: string, origin: string): string {
for (const name of TRACK_ROOT_SERVICES) {
const prefix = `/Track/${name}`
@ -67,31 +57,30 @@ function rewriteTrackApiPath(path: string, origin: string): string {
return `${origin}/track${path.slice('/Track'.length)}`
}
}
if (usesIdeshipTrackPath(origin) && path.startsWith('/Track/Track/')) {
if (usesPrimaryTrackPath(origin) && path.startsWith('/Track/Track/')) {
return `${origin}/track/Track/${path.slice('/Track/Track/'.length)}`
}
return `${origin}/track${path}`
}
/** 已是 /track/... 时,ideship 仍规范化多余的 /Track/Track/ */
/** 已是 /track/... 时,主站仍规范化多余的 /Track/Track/ */
function normalizeTrackPathbase(path: string, origin: string): string {
if (usesIdeshipTrackPath(origin) && path.startsWith('/track/Track/Track/')) {
if (usesPrimaryTrackPath(origin) && path.startsWith('/track/Track/Track/')) {
return `${origin}/track/Track/${path.slice('/track/Track/Track/'.length)}`
}
return `${origin}${path}`
}
/** 生产:遗留路径 → https://api.ideship.com/{itfx|track|admin}/... */
/** 生产:遗留路径 → {apiOrigin}/{itfx|track|admin}/... */
export function rewriteBrowserApiPath(url: string): string {
if (!url || import.meta.env.DEV) return url
if (/^https?:\/\//i.test(url) || url.startsWith('data:') || url.startsWith('blob:')) {
return url
}
let path = url.startsWith('/') ? url : `/${url}`
const path = url.startsWith('/') ? url : `/${url}`
const origin = prodApiOrigin()
// 已是绝对 PATHBASE 相对路径 → 挂到 api 域名
if (path.startsWith('/itfx/') || path === '/itfx') {
return `${origin}${path}`
}
@ -106,7 +95,6 @@ export function rewriteBrowserApiPath(url: string): string {
return `${origin}/admin${path.slice(4)}`
}
// 旧站 /api/upload/* → Admin wwwroot(勿进 /itfx)
if (path.startsWith('/api/upload/') || path === '/api/upload') {
const rest = path === '/api/upload' ? '' : path.slice('/api/upload'.length)
return `${origin}/admin/uploads${rest}`
@ -115,7 +103,7 @@ export function rewriteBrowserApiPath(url: string): string {
if (path.startsWith('/api/')) {
const rest = path.slice(5)
if (isItfxSpaPath(rest)) {
return path // 仍是前端路由,勿打到 API
return path
}
return `${origin}/itfx/${rest}`
}
@ -126,7 +114,7 @@ export function rewriteBrowserApiPath(url: string): string {
if (path.startsWith('/trackApi/')) {
const rest = path.slice('/trackApi/'.length)
if (usesIdeshipTrackPath(origin) && rest.startsWith('Track/Track/')) {
if (usesPrimaryTrackPath(origin) && rest.startsWith('Track/Track/')) {
return `${origin}/track/Track/${rest.slice('Track/Track/'.length)}`
}
return `${origin}/track/${rest}`

View File

@ -11,7 +11,7 @@ export type WeChatH5Page = 'register' | 'bind' | 'login';
type WeChatOAuthRuntimeConfig = {
appId: string;
/** 规范化后的 origin,如 https://ideship.com;空则用当前页 */
/** 规范化后的站点 origin;空则用当前页 */
redirectOrigin: string;
};

View File

@ -263,6 +263,7 @@
:visible="supplierVisible"
:title="t('finance.contract.supplier.title')"
:width="720"
:footer="false"
unmount-on-close
@cancel="supplierVisible = false"
>
@ -273,23 +274,18 @@
</div>
<a-table
:data="supplierRows"
:columns="supplierColumns"
:loading="supplierLoading"
:pagination="false"
row-key="id"
size="small"
>
<a-table-column :title="t('finance.contract.supplier.code')" data-index="supplierCode" />
<a-table-column :title="t('finance.contract.supplier.name')" data-index="supplierName" />
<a-table-column :title="t('finance.contract.supplier.bank')">
<template #cell="{ record }">
{{ [record.bankAccountName, record.bankName, record.bankAccountNo].filter(Boolean).join(' / ') }}
</template>
</a-table-column>
<a-table-column title="操作" :width="80">
<template #cell="{ record }">
<a-link @click="openSupplierForm(record)">编辑</a-link>
</template>
</a-table-column>
<template #bank="{ record }">
{{ [record.bankAccountName, record.bankName, record.bankAccountNo].filter(Boolean).join(' / ') }}
</template>
<template #action="{ record }">
<a-link @click="openSupplierForm(record)">编辑</a-link>
</template>
</a-table>
<a-modal
v-model:visible="supplierFormVisible"
@ -392,6 +388,25 @@ const supplierForm = reactive({
bankAccountNo: '',
currency: 'CNY',
})
const supplierColumns = computed(() => [
{
title: t('finance.contract.supplier.code'),
dataIndex: 'supplierCode',
},
{
title: t('finance.contract.supplier.name'),
dataIndex: 'supplierName',
},
{
title: t('finance.contract.supplier.bank'),
slotName: 'bank',
},
{
title: '操作',
slotName: 'action',
width: 80,
},
])
const partyLoading = ref(false)
const partyOptions = ref<Array<{ label: string; value: number }>>([])

View File

@ -57,12 +57,6 @@
>
{{ t('finance.paymentApply.search.actions.create') }}
</a-button>
<a-button
v-if="hasPermission('Finance.PaymentApply.CompanyAccount')"
@click="accountVisible = true"
>
{{ t('finance.paymentApply.search.actions.companyAccount') }}
</a-button>
</a-space>
</div>
<div class="toolbar-right">
@ -224,58 +218,6 @@
</a-form>
</a-modal>
<a-drawer
:visible="accountVisible"
:title="t('finance.paymentApply.companyAccount.title')"
:width="720"
unmount-on-close
@cancel="accountVisible = false"
>
<div class="supplier-toolbar">
<a-button class="app-btn-primary-soft" @click="openAccountForm()">
{{ t('finance.paymentApply.companyAccount.add') }}
</a-button>
</div>
<a-table :data="accountRows" :loading="accountLoading" :pagination="false" row-key="id" size="small">
<a-table-column :title="t('finance.paymentApply.companyAccount.accountName')" data-index="accountName" />
<a-table-column :title="t('finance.paymentApply.companyAccount.bankName')" data-index="bankName" />
<a-table-column :title="t('finance.paymentApply.companyAccount.accountNo')" data-index="accountNo" />
<a-table-column :title="t('finance.paymentApply.companyAccount.isDefault')" :width="80">
<template #cell="{ record }">{{ record.isDefault ? '是' : '否' }}</template>
</a-table-column>
<a-table-column title="操作" :width="80">
<template #cell="{ record }">
<a-link @click="openAccountForm(record)">编辑</a-link>
</template>
</a-table-column>
</a-table>
<a-modal
v-model:visible="accountFormVisible"
:title="t('finance.paymentApply.companyAccount.add')"
:ok-loading="accountSaving"
unmount-on-close
@before-ok="handleAccountSave"
>
<a-form :model="accountForm" layout="vertical">
<a-form-item :label="t('finance.paymentApply.companyAccount.accountName')" required>
<a-input v-model="accountForm.accountName" />
</a-form-item>
<a-form-item :label="t('finance.paymentApply.companyAccount.bankName')" required>
<a-input v-model="accountForm.bankName" />
</a-form-item>
<a-form-item :label="t('finance.paymentApply.companyAccount.accountNo')" required>
<a-input v-model="accountForm.accountNo" />
</a-form-item>
<a-form-item label="币种">
<a-input v-model="accountForm.currency" />
</a-form-item>
<a-form-item :label="t('finance.paymentApply.companyAccount.isDefault')">
<a-switch v-model="accountForm.isDefault" />
</a-form-item>
</a-form>
</a-modal>
</a-drawer>
<ApprovalDetailDrawer
v-model:visible="approvalDrawerVisible"
:instance-id="approvalDrawerInstanceId"
@ -285,7 +227,7 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { computed, onMounted, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { Message, Modal } from '@arco-design/web-vue'
import dayjs from 'dayjs'
@ -302,11 +244,8 @@ import { extractOmsRequestError } from '@/api/oms/common'
import { AgentAdminApi } from '@/api/agent'
import { getActiveFinanceContractByParty } from '@/api/finance/contract'
import {
getFinanceCompanyAccountList,
getFinanceCompanyAccountOptions,
getFinanceSupplierOptions,
saveFinanceCompanyAccount,
type FinanceCompanyAccount,
type FinanceSupplier,
} from '@/api/finance/master'
import {
@ -360,20 +299,6 @@ const markPaidForm = reactive({
paidVoucherUrl: '',
})
const accountVisible = ref(false)
const accountLoading = ref(false)
const accountRows = ref<FinanceCompanyAccount[]>([])
const accountFormVisible = ref(false)
const accountSaving = ref(false)
const accountForm = reactive({
id: undefined as number | undefined,
accountName: '',
bankName: '',
accountNo: '',
currency: 'CNY',
isDefault: false,
})
const form = reactive({
id: undefined as number | undefined,
paymentType: PAYMENT_TYPE.Supplier as string,
@ -771,51 +696,6 @@ async function handleMarkPaidOk() {
}
}
async function loadAccounts() {
accountLoading.value = true
try {
const { items } = await getFinanceCompanyAccountList({ page: 1, pageSize: 200 })
accountRows.value = items
} finally {
accountLoading.value = false
}
}
function openAccountForm(row?: FinanceCompanyAccount) {
accountForm.id = row?.id
accountForm.accountName = row?.accountName || ''
accountForm.bankName = row?.bankName || ''
accountForm.accountNo = row?.accountNo || ''
accountForm.currency = row?.currency || 'CNY'
accountForm.isDefault = row?.isDefault || false
accountFormVisible.value = true
}
async function handleAccountSave() {
if (!accountForm.accountName.trim() || !accountForm.bankName.trim() || !accountForm.accountNo.trim()) {
Message.warning('请填写完整账户信息')
return false
}
accountSaving.value = true
try {
await saveFinanceCompanyAccount({ ...accountForm })
Message.success(t('finance.paymentApply.message.saveSuccess'))
accountFormVisible.value = false
await loadAccounts()
await loadCompanyAccounts()
return true
} catch (e) {
Message.error(extractOmsRequestError(e))
return false
} finally {
accountSaving.value = false
}
}
watch(accountVisible, (v) => {
if (v) loadAccounts()
})
onMounted(() => {
refreshAll()
})
@ -938,8 +818,4 @@ onMounted(() => {
gap: 8px;
margin-bottom: 8px;
}
.supplier-toolbar {
margin-bottom: 12px;
}
</style>

View File

@ -186,8 +186,8 @@ function resolvePayImageUrl(raw: unknown): string | undefined {
function mapRow(item: any): RechargeRecord {
const pt = Number(item.payType ?? item.PayType)
// 接口约定:1-微信 2-支付宝
const payType = pt === 2 ? 'zfb' : 'wx'
// 接口约定:1-微信 2-支付宝 3-银行转账
const payType = pt === 2 ? 'zfb' : pt === 1 ? 'wx' : pt === 3 ? 'bank' : ''
const auditTimeRaw = item.auditTime ?? item.AuditTime
const approvalPending = Boolean(item.approvalPending ?? item.ApprovalPending)
const approvalId = item.approvalInstanceId ?? item.ApprovalInstanceId ?? null
@ -339,7 +339,10 @@ function customCellRenderer(row: number, col: number, value: any, rowData: any):
if (rowData?.payType === 'wx') {
return `<span style="display:inline-flex;align-items:center;gap:6px;"><img src="${wxIcon}" alt="${t('user.recharge.record.payment.wechat')}" style="width:16px;height:16px;object-fit:contain;" /><span>${t('user.recharge.record.payment.wechat')}</span></span>`
}
return '--'
if (rowData?.payType === 'bank') {
return `<span>${t('user.recharge.record.payment.bank')}</span>`
}
return rowData?.payType ? String(rowData.payType) : '--'
}
if (colKey === 'payAmount') {
return rowData?.payAmount != null ? `¥${rowData.payAmount}` : '--'
@ -393,6 +396,13 @@ function actionRenderer(row: any, _rowIndex: number): string {
renderWarehouseActionBtn('viewApproval', t('user.recharge.record.actions.viewApproval')),
])
}
// 微信在线支付未成功前不可人工通过(后端也会拦)
const canApprove = row?.canManualApprove !== false
if (!canApprove) {
return wrapWarehouseActions([
renderWarehouseActionBtn('reject', t('user.recharge.record.actions.reject')),
])
}
return wrapWarehouseActions([
renderWarehouseActionBtn('approve', t('user.recharge.record.actions.approve')),
renderWarehouseActionBtn('reject', t('user.recharge.record.actions.reject')),

View File

@ -46,8 +46,7 @@ defineOptions({ name: 'H5AdminEddie' });
min-height: 0;
}
:deep(.ai-app-bar__back),
:deep(.ai-waybill-context__back) {
:deep(.ai-app-bar__back) {
display: none !important;
}

View File

@ -81,6 +81,7 @@ export default {
'h5Admin.recharge.rejectFail': 'Reject failed',
'h5Admin.recharge.pay.alipay': 'Alipay',
'h5Admin.recharge.pay.wechat': 'WeChat',
'h5Admin.recharge.pay.bank': 'Bank Transfer',
'h5Admin.workplace.customer.orders': 'Lane volume',
'h5Admin.workplace.customer.receivable': 'Lane AR',

View File

@ -81,6 +81,7 @@ export default {
'h5Admin.recharge.rejectFail': '驳回失败',
'h5Admin.recharge.pay.alipay': '支付宝',
'h5Admin.recharge.pay.wechat': '微信',
'h5Admin.recharge.pay.bank': '银行转账',
'h5Admin.workplace.customer.orders': '线路单量',
'h5Admin.workplace.customer.receivable': '线路应收',

View File

@ -70,7 +70,7 @@
</span>
</div>
<span class="h5-ar__pay">
<img :src="payIcon(row.payType)" alt="" />
<img v-if="payIcon(row.payType)" :src="payIcon(row.payType)" alt="" />
{{ payLabel(row.payType) }}
</span>
</div>
@ -135,6 +135,7 @@
{{ t('h5Admin.recharge.reject') }}
</button>
<button
v-if="row.canManualApprove !== false"
type="button"
class="h5-ar__btn is-primary"
:disabled="actingId === row.id"
@ -212,7 +213,7 @@ interface RechargeRow {
id?: number | string;
serialNo: string;
payTime: string;
payType: 'zfb' | 'wx' | '';
payType: 'zfb' | 'wx' | 'bank' | '';
payAmount: number;
payImage?: string;
payStatus: string;
@ -266,7 +267,7 @@ function mapRow(item: any): RechargeRow {
id: item.id ?? item.Id,
serialNo: String(item.serialNumber ?? item.SerialNumber ?? ''),
payTime: String(item.rechargeTime ?? item.RechargeTime ?? ''),
payType: pt === 2 ? 'zfb' : pt === 1 ? 'wx' : '',
payType: pt === 2 ? 'zfb' : pt === 1 ? 'wx' : pt === 3 ? 'bank' : '',
payAmount: Number(item.rechargeAmount ?? item.RechargeAmount ?? 0) || 0,
payImage: resolvePayImageUrl(item.rechargeScreenshot ?? item.RechargeScreenshot),
payStatus: String(item.rechargeStatus ?? item.RechargeStatus ?? ''),
@ -326,12 +327,15 @@ function statusTone(code: string, approvalPending?: boolean) {
}
function payIcon(type: RechargeRow['payType']) {
return type === 'zfb' ? zfbIcon : wxIcon;
if (type === 'zfb') return zfbIcon;
if (type === 'wx') return wxIcon;
return '';
}
function payLabel(type: RechargeRow['payType']) {
if (type === 'zfb') return t('h5Admin.recharge.pay.alipay');
if (type === 'wx') return t('h5Admin.recharge.pay.wechat');
if (type === 'bank') return t('h5Admin.recharge.pay.bank');
return '—';
}

View File

@ -240,17 +240,21 @@ function onShellClose() {
border-radius: 0;
}
/* H5 顶栏不拖动浮窗 */
/* H5 Tab:通栏顶控,不拖动;中间留白仅作间距 */
:deep(.ai-advisor-shell--float .ai-app-bar--float) {
cursor: default;
touch-action: manipulation;
margin: 8px 12px 0;
padding: 6px 12px 2px;
}
:deep(.ai-advisor-shell--float .ai-app-bar--float:active) {
cursor: default;
}
:deep(.ai-advisor-shell--float .ai-app-bar__drag) {
pointer-events: none;
}
/* 历史抽屉在窄屏全高 */
:deep(.ai-advisor-shell--float .ai-history-sidebar) {
width: min(300px, 86%);

File diff suppressed because it is too large Load Diff

View File

@ -76,7 +76,7 @@
:class="{ 'is-active': payType === 'wx' }"
@click="payType = 'wx'"
>
{{ t('h5.recharge.wechat') }}
{{ t('h5.recharge.wechatOnline') }}
</button>
<button
type="button"
@ -86,16 +86,28 @@
>
{{ t('h5.recharge.alipay') }}
</button>
<button
type="button"
class="h5-rc__seg"
:class="{ 'is-active': payType === 'wxVoucher' }"
@click="payType = 'wxVoucher'"
>
{{ t('h5.recharge.wechatVoucher') }}
</button>
</div>
<div class="h5-rc__qr">
<template v-if="payType === 'wx'">
<p v-if="inWeChat" class="h5-rc__online-tip">{{ t('h5.recharge.jsapiTip') }}</p>
<p v-else class="h5-rc__online-tip is-warn">{{ t('h5.recharge.needWechatBrowser') }}</p>
</template>
<div v-else class="h5-rc__qr">
<img v-if="currentQrDisplay" :src="currentQrDisplay" alt="qrcode" />
<p v-else class="h5-rc__qr-empty">{{ t('h5.recharge.qrEmpty') }}</p>
<p v-if="currentQrDisplay">{{ t('h5.recharge.qrTip') }}</p>
</div>
</section>
<section class="h5-rc__card">
<section v-if="payType !== 'wx'" class="h5-rc__card">
<p class="h5-rc__label">{{ t('h5.recharge.voucher') }}</p>
<a-upload
:file-list="fileList"
@ -117,7 +129,11 @@
</template>
<div v-else class="h5-rc__success">
<a-result status="success" :title="t('h5.recharge.success')" />
<a-result
:status="paidOnline ? 'success' : payConfirming ? 'warning' : 'success'"
:title="successTitle"
:subtitle="payConfirming ? t('h5.recharge.payConfirmingHint') : undefined"
/>
</div>
</div>
@ -126,11 +142,11 @@
v-if="step < 2"
type="button"
class="h5-rc__submit"
:disabled="submitting"
:disabled="submitting || (payType === 'wx' && !inWeChat)"
@click="submit"
>
<span v-if="submitting" class="h5-rc__loading" aria-hidden="true" />
{{ t('h5.recharge.submit') }}
{{ payType === 'wx' ? t('h5.recharge.payNow') : t('h5.recharge.submit') }}
</button>
<button v-else type="button" class="h5-rc__submit" @click="close">
{{ t('h5.recharge.done') }}
@ -141,15 +157,26 @@
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { computed, onBeforeUnmount, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { Message } from '@arco-design/web-vue';
import { IconClose, IconPlus } from '@arco-design/web-vue/es/icon';
import { submitRechargeApplication } from '@/api/recharge/rechargeRecord';
import {
closeWeChatPay,
createWeChatPay,
getWeChatPayMerchantConfig,
getWeChatPayStatus,
invokeWeChatJsapiPay,
isWeChatBrowser,
} from '@/api/recharge/wechatPay';
import { loadPaymentReceiveQrUrls } from '@/utils/paymentReceiveQr';
defineOptions({ name: 'H5RechargeSheet' });
const OAUTH_FLAG = 'oms_wx_pay_oauth';
const OAUTH_AMOUNT_KEY = 'oms_wx_pay_amount';
const props = defineProps<{
visible: boolean;
}>();
@ -167,11 +194,17 @@ const presets = [500, 1000, 1500, 3000];
const amount = ref(500);
const customMode = ref(false);
const customAmount = ref<number | undefined>();
const payType = ref<'wx' | 'zfb'>('wx');
const payType = ref<'wx' | 'zfb' | 'wxVoucher'>('wx');
const fileList = ref<any[]>([]);
const screenshotFile = ref<File | null>(null);
const submitting = ref(false);
const step = ref(0);
const paidOnline = ref(false);
/** JSAPI 已返回 ok 但轮询未确认入账 */
const payConfirming = ref(false);
const inWeChat = ref(isWeChatBrowser());
let statusPollTimer: ReturnType<typeof setInterval> | null = null;
let activeOutTradeNo: string | null = null;
const drawerStyle = {
borderRadius: '20px 20px 0 0',
@ -184,10 +217,26 @@ const finalAmount = computed(() =>
);
const currentQrDisplay = computed(() =>
payType.value === 'wx' ? wxQrDisplay.value : zfbQrDisplay.value,
payType.value === 'wxVoucher' ? wxQrDisplay.value : zfbQrDisplay.value,
);
const successTitle = computed(() =>
paidOnline.value
? t('h5.recharge.paidSuccess')
: payConfirming.value
? t('h5.recharge.payConfirmingTitle')
: t('h5.recharge.success'),
);
function stopStatusPoll() {
if (statusPollTimer) {
clearInterval(statusPollTimer);
statusPollTimer = null;
}
}
function resetForm() {
stopStatusPoll();
amount.value = 500;
customMode.value = false;
customAmount.value = undefined;
@ -196,6 +245,19 @@ function resetForm() {
screenshotFile.value = null;
submitting.value = false;
step.value = 0;
paidOnline.value = false;
payConfirming.value = false;
activeOutTradeNo = null;
}
async function bestEffortClosePay(outTradeNo?: string | null) {
const no = String(outTradeNo || '').trim();
if (!no) return;
try {
await closeWeChatPay(no);
} catch {
/* ignore */
}
}
function close() {
@ -225,11 +287,140 @@ function handleFileChange(files: any) {
if (!files?.length) screenshotFile.value = null;
}
async function submit() {
if (finalAmount.value < 0.01) {
Message.warning(t('h5.recharge.needAmount'));
function takeOauthCodeFromUrl(): string | undefined {
const url = new URL(window.location.href);
const code = url.searchParams.get('code') || undefined;
const state = url.searchParams.get('state') || '';
if (!code || !state.startsWith(OAUTH_FLAG)) return undefined;
url.searchParams.delete('code');
url.searchParams.delete('state');
window.history.replaceState({}, '', url.toString());
return code;
}
async function redirectWechatOauth() {
const cfg = await getWeChatPayMerchantConfig();
const appId = cfg.appId?.trim();
if (!appId) {
throw new Error(t('h5.recharge.needMpAppId'));
}
try {
sessionStorage.setItem(
OAUTH_AMOUNT_KEY,
JSON.stringify({
amount: amount.value,
customMode: customMode.value,
customAmount: customAmount.value,
}),
);
} catch {
/* ignore */
}
const redirectUri = `${window.location.origin}/h5/recharge`;
const state = `${OAUTH_FLAG}_${Date.now()}`;
window.location.href =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${encodeURIComponent(appId)}` +
`&redirect_uri=${encodeURIComponent(redirectUri)}&response_type=code&scope=snsapi_base&state=${state}#wechat_redirect`;
}
async function pollUntilPaid(outTradeNo: string) {
stopStatusPoll();
return new Promise<boolean>((resolve) => {
let tries = 0;
const tick = async () => {
tries += 1;
try {
const status = await getWeChatPayStatus(outTradeNo);
if (status.status === 'Success' || status.statusCode === 3) {
stopStatusPoll();
resolve(true);
return;
}
if (status.status === 'Closed' || status.status === 'Failed') {
stopStatusPoll();
resolve(false);
return;
}
} catch {
/* ignore */
}
if (tries >= 30) {
stopStatusPoll();
resolve(false);
}
};
void tick();
statusPollTimer = setInterval(tick, 2000);
});
}
async function submitWxOnline(oauthCode?: string) {
if (!inWeChat.value) {
Message.warning(t('h5.recharge.needWechatBrowser'));
return;
}
submitting.value = true;
try {
let created;
try {
created = await createWeChatPay({
rechargeAmount: Number(finalAmount.value),
scene: 'jsapi',
oauthCode,
});
} catch (e: any) {
const msg = String(e?.message || '');
if (!oauthCode && (msg.includes('OpenId') || msg.includes('openid') || msg.includes('授权'))) {
await redirectWechatOauth();
return;
}
throw e;
}
if (!created.jsapi) {
throw new Error(t('h5.recharge.jsapiParamsMissing'));
}
activeOutTradeNo = created.outTradeNo;
const result = await invokeWeChatJsapiPay(created.jsapi);
if (result === 'cancel') {
await bestEffortClosePay(created.outTradeNo);
activeOutTradeNo = null;
Message.info(t('h5.recharge.payCancel'));
return;
}
if (result === 'fail') {
await bestEffortClosePay(created.outTradeNo);
activeOutTradeNo = null;
Message.error(t('h5.recharge.payFail'));
return;
}
const paid = await pollUntilPaid(created.outTradeNo);
if (paid) {
paidOnline.value = true;
payConfirming.value = false;
activeOutTradeNo = null;
step.value = 2;
emit('success');
return;
}
// 未确认到账:不伪装成功、不 emit success;展示确认中态,后台仍可回调入账
payConfirming.value = true;
paidOnline.value = false;
step.value = 2;
Message.warning(t('h5.recharge.payConfirming'));
} catch (e: any) {
await bestEffortClosePay(activeOutTradeNo);
activeOutTradeNo = null;
Message.error(e?.message || t('h5.recharge.failed'));
} finally {
submitting.value = false;
}
}
async function submitVoucher() {
submitting.value = true;
try {
const result: any = await submitRechargeApplication({
@ -252,6 +443,8 @@ async function submit() {
} else {
Message.success(t('h5.recharge.success'));
}
paidOnline.value = false;
payConfirming.value = false;
step.value = 2;
emit('success');
} catch (e: any) {
@ -261,17 +454,62 @@ async function submit() {
}
}
async function submit() {
if (finalAmount.value < 0.01) {
Message.warning(t('h5.recharge.needAmount'));
return;
}
if (payType.value === 'wx') {
await submitWxOnline();
return;
}
await submitVoucher();
}
watch(
() => props.visible,
async (visible) => {
if (!visible) return;
if (!visible) {
stopStatusPoll();
return;
}
resetForm();
inWeChat.value = isWeChatBrowser();
try {
const raw = sessionStorage.getItem(OAUTH_AMOUNT_KEY);
if (raw) {
const saved = JSON.parse(raw) as {
amount?: number;
customMode?: boolean;
customAmount?: number;
};
if (saved.customMode) {
customMode.value = true;
customAmount.value = Number(saved.customAmount || 0) || undefined;
} else if (saved.amount && saved.amount > 0) {
amount.value = Number(saved.amount);
}
sessionStorage.removeItem(OAUTH_AMOUNT_KEY);
}
} catch {
/* ignore */
}
const urls = await loadPaymentReceiveQrUrls();
zfbQrDisplay.value = urls.alipay;
wxQrDisplay.value = urls.wechat;
const oauthCode = takeOauthCodeFromUrl();
if (oauthCode && inWeChat.value) {
payType.value = 'wx';
await submitWxOnline(oauthCode);
}
},
{ immediate: true },
);
onBeforeUnmount(() => {
stopStatusPoll();
});
</script>
<style lang="less">
@ -370,208 +608,145 @@ watch(
.h5-rc__amount-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
}
.h5-rc__chip {
height: 40px;
border: none;
border-radius: 12px;
border-radius: 10px;
background: #f2f3f5;
color: #4e5969;
color: #1d2129;
font-size: 14px;
font-weight: 600;
cursor: pointer;
&.is-active {
color: #fff;
background: var(--app-primary-color);
box-shadow: 0 6px 14px color-mix(in srgb, var(--app-primary-color) 28%, transparent);
}
}
.h5-rc__amount-preview {
display: flex;
align-items: baseline;
justify-content: space-between;
margin-top: 14px;
padding: 14px 16px;
border-radius: 14px;
background: color-mix(in srgb, var(--app-primary-color) 8%, #fff);
span {
font-size: 13px;
color: #4e5969;
}
strong {
font-size: 28px;
font-weight: 700;
color: var(--app-primary-color);
font-variant-numeric: tabular-nums;
letter-spacing: -0.02em;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 16%, #fff);
color: var(--app-primary-color, #1d7281);
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color, #1d7281) 35%, transparent);
}
}
.h5-rc__amount-focus {
margin-top: 12px;
display: flex;
align-items: center;
gap: 4px;
min-height: 64px;
margin-top: 14px;
padding: 8px 16px;
border-radius: 14px;
background: color-mix(in srgb, var(--app-primary-color) 8%, #fff);
gap: 8px;
}
.h5-rc__amount-prefix {
font-size: 24px;
font-size: 20px;
font-weight: 700;
color: var(--app-primary-color);
line-height: 1;
color: #1d2129;
}
.h5-rc__amount-input {
flex: 1;
width: 100%;
}
:deep(.arco-input-wrapper) {
background: transparent !important;
border: none !important;
box-shadow: none !important;
padding: 0;
}
.h5-rc__amount-preview {
margin-top: 12px;
display: flex;
align-items: baseline;
justify-content: space-between;
color: #86909c;
font-size: 13px;
:deep(.arco-input) {
font-size: 28px;
font-weight: 700;
strong {
font-size: 22px;
color: #1d2129;
font-variant-numeric: tabular-nums;
height: 40px;
line-height: 40px;
}
:deep(.arco-input::placeholder) {
color: #c9cdd4;
font-size: 16px;
font-weight: 600;
}
}
.h5-rc__pay-types {
display: flex;
gap: 4px;
padding: 3px;
border-radius: 12px;
background: #eef0f3;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 12px;
}
.h5-rc__seg {
flex: 1;
flex: 1 1 30%;
min-width: 96px;
height: 36px;
border: none;
border-radius: 10px;
background: transparent;
background: #f2f3f5;
color: #4e5969;
font-size: 13px;
font-weight: 500;
color: #86909c;
cursor: pointer;
&.is-active {
background: #fff;
color: #1d2129;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 16%, #fff);
color: var(--app-primary-color, #1d7281);
font-weight: 600;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
}
.h5-rc__online-tip {
margin: 0;
font-size: 13px;
line-height: 1.5;
color: #4e5969;
&.is-warn {
color: #d97706;
}
}
.h5-rc__qr {
margin-top: 16px;
text-align: center;
img {
width: 160px;
height: 160px;
width: 180px;
height: 180px;
object-fit: contain;
padding: 12px;
border-radius: 16px;
background: #f7f8fa;
border-radius: 12px;
}
p {
margin: 10px 0 0;
margin: 8px 0 0;
font-size: 12px;
color: #86909c;
}
.h5-rc__qr-empty {
margin: 0;
padding: 48px 16px;
border-radius: 16px;
background: #f7f8fa;
color: #86909c;
font-size: 13px;
line-height: 1.5;
}
}
.h5-rc__uploader {
:deep(.arco-upload-picture-card) {
width: 96px;
height: 96px;
margin: 0;
border: none;
border-radius: 14px;
background: #f7f8fa;
}
:deep(.arco-upload-list-picture-card .arco-upload-list-item) {
width: 96px;
height: 96px;
margin: 0;
border: none;
border-radius: 14px;
overflow: hidden;
}
.h5-rc__qr-empty {
padding: 36px 12px;
color: #c9cdd4;
}
.h5-rc__upload {
width: 88px;
height: 88px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
gap: 4px;
color: #86909c;
font-size: 12px;
font-weight: 500;
:deep(.arco-icon) {
font-size: 20px;
color: var(--app-primary-color);
}
}
.h5-rc__success {
padding: 32px 8px 16px;
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
padding: 24px 8px 12px;
}
.h5-rc__foot {
flex-shrink: 0;
padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
padding: 12px 16px 16px;
background: #fff;
box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.04);
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}
.h5-rc__submit {
width: 100%;
height: 48px;
height: 44px;
border: none;
border-radius: 12px;
background: var(--app-primary-color);
background: var(--app-primary-color, #1d7281);
color: #fff;
font-size: 15px;
font-weight: 600;
@ -580,11 +755,10 @@ watch(
justify-content: center;
gap: 8px;
cursor: pointer;
box-shadow: 0 8px 18px color-mix(in srgb, var(--app-primary-color) 28%, transparent);
&:disabled {
opacity: 0.7;
box-shadow: none;
opacity: 0.55;
cursor: not-allowed;
}
}
@ -594,7 +768,7 @@ watch(
border: 2px solid rgba(255, 255, 255, 0.35);
border-top-color: #fff;
border-radius: 50%;
animation: h5-rc-spin 0.7s linear infinite;
animation: h5-rc-spin 0.8s linear infinite;
}
@keyframes h5-rc-spin {

View File

@ -367,14 +367,28 @@ export default {
'h5.recharge.customPlaceholder': 'Enter amount',
'h5.recharge.payType': 'Payment method',
'h5.recharge.wechat': 'WeChat Pay',
'h5.recharge.wechatOnline': 'WeChat online pay',
'h5.recharge.wechatVoucher': 'WeChat transfer voucher',
'h5.recharge.alipay': 'Alipay',
'h5.recharge.qrTip': 'Scan to transfer, then upload the voucher',
'h5.recharge.qrEmpty': 'Payment QR is not configured. Please contact support.',
'h5.recharge.voucher': 'Transfer voucher (optional)',
'h5.recharge.upload': 'Upload',
'h5.recharge.submit': 'Submit for review',
'h5.recharge.payNow': 'Pay now',
'h5.recharge.jsapiTip': 'Opens WeChat checkout; balance credits automatically after success',
'h5.recharge.needWechatBrowser': 'Open this page in WeChat for online pay, or use PC scan-to-pay',
'h5.recharge.needMpAppId': 'Official Account AppId is missing; cannot authorize OpenId',
'h5.recharge.jsapiParamsMissing': 'JSAPI pay params missing',
'h5.recharge.payCancel': 'Payment cancelled',
'h5.recharge.payFail': 'Failed to launch WeChat Pay',
'h5.recharge.payConfirming': 'Confirming payment; check recharge records shortly',
'h5.recharge.payConfirmingTitle': 'Confirming payment',
'h5.recharge.payConfirmingHint':
'If charged, balance usually updates within seconds. Check recharge records later—do not pay twice.',
'h5.recharge.needAmount': 'Please select or enter an amount',
'h5.recharge.success': 'Submitted. Pending review.',
'h5.recharge.paidSuccess': 'Paid. Balance updated.',
'h5.recharge.failed': 'Submit failed',
'h5.recharge.backMe': 'Back to Me',
'h5.recharge.done': 'Done',
@ -1016,6 +1030,27 @@ export default {
'h5.pay.waybillNo': 'Waybill',
'h5.pay.orderTotal': 'Order due',
'h5.pay.methodBalance': 'Pay with balance',
'h5.pay.methodHybrid': 'Balance first · WeChat shortfall',
'h5.pay.methodHybridHint': 'Use balance {balance}, WeChat {wechat}',
'h5.pay.settleTitle': 'Payment',
'h5.pay.splitBalance': 'Account balance',
'h5.pay.splitWechat': 'WeChat shortfall',
'h5.pay.hybridWechatTip': 'WeChat checkout will only charge the shortfall',
'h5.pay.availableBalance': 'Available {amount}',
'h5.pay.orderCount': '{count} orders',
'h5.pay.feeDetails': 'Fee details',
'h5.pay.confirmHybrid': 'Confirm & WeChat pay',
'h5.pay.confirmAmount': 'Pay {amount}',
'h5.pay.confirmHybridAmount': 'WeChat pay {amount}',
'h5.pay.footWxDue': 'WeChat due',
'h5.pay.needWechatBrowser': 'Open in WeChat to pay the shortfall',
'h5.pay.needWechatOrRecharge': 'Not in WeChat. Recharge to cover the shortfall, or open this page in WeChat.',
'h5.pay.needWechatShort': 'Not in WeChat — recharge or open in WeChat',
'h5.pay.needMpAppId': 'Official account AppId is not configured',
'h5.pay.jsapiParamsMissing': 'JSAPI pay params missing',
'h5.pay.payCancel': 'WeChat payment cancelled',
'h5.pay.payFail': 'Failed to open WeChat checkout',
'h5.pay.payConfirming': 'Confirming payment… Check orders shortly; do not pay again',
'h5.pay.methodHint': 'Will be deducted from your account balance',
'h5.pay.confirm': 'Pay now',
'h5.pay.paying': 'Paying…',
@ -1029,6 +1064,7 @@ export default {
'h5.pay.balanceLowTitle': 'Insufficient balance',
'h5.pay.balanceLow': 'Your balance is not enough for this payment. Recharge first, then come back to pay.',
'h5.pay.goRecharge': 'Recharge',
'h5.pay.goRechargeShortfall': 'Recharge {amount}',
'h5.pay.later': 'Later',
'h5.pay.coupon': 'Coupon',
'h5.pay.couponNone': 'No coupon',

View File

@ -366,14 +366,27 @@ export default {
'h5.recharge.customPlaceholder': '请输入金额',
'h5.recharge.payType': '支付方式',
'h5.recharge.wechat': '微信支付',
'h5.recharge.wechatOnline': '微信在线支付',
'h5.recharge.wechatVoucher': '微信转账凭证',
'h5.recharge.alipay': '支付宝',
'h5.recharge.qrTip': '扫码转账后请上传凭证',
'h5.recharge.qrEmpty': '暂未配置收款码,请联系客服',
'h5.recharge.voucher': '转账凭证(可选)',
'h5.recharge.upload': '上传',
'h5.recharge.submit': '提交审核',
'h5.recharge.payNow': '立即支付',
'h5.recharge.jsapiTip': '将在微信内调起收银台,支付成功后余额自动到账',
'h5.recharge.needWechatBrowser': '请在微信内打开本页使用在线支付;或改用 PC 扫码',
'h5.recharge.needMpAppId': '未配置公众号 AppId,无法授权获取 OpenId',
'h5.recharge.jsapiParamsMissing': '未返回 JSAPI 调起参数',
'h5.recharge.payCancel': '已取消支付',
'h5.recharge.payFail': '调起微信支付失败',
'h5.recharge.payConfirming': '支付结果确认中,稍后可在充值记录查看',
'h5.recharge.payConfirmingTitle': '支付确认中',
'h5.recharge.payConfirmingHint': '若已扣款,余额通常数秒内到账;也可稍后在充值记录核对。勿重复支付。',
'h5.recharge.needAmount': '请选择或输入充值金额',
'h5.recharge.success': '已提交,等待审核',
'h5.recharge.paidSuccess': '支付成功,余额已到账',
'h5.recharge.failed': '提交失败',
'h5.recharge.backMe': '返回我的',
'h5.recharge.done': '完成',
@ -1003,18 +1016,40 @@ export default {
'h5.pay.orderTotal': '本单应付',
'h5.pay.methodBalance': '账户余额支付',
'h5.pay.methodHint': '支付成功后将从账户余额扣款',
'h5.pay.methodHybrid': '余额优先 · 微信补差',
'h5.pay.methodHybridHint': '本次用余额 {balance},微信补差 {wechat}',
'h5.pay.settleTitle': '支付方式',
'h5.pay.splitBalance': '账户余额',
'h5.pay.splitWechat': '微信补差',
'h5.pay.hybridWechatTip': '确认后将调起微信支付,仅支付补差部分',
'h5.pay.availableBalance': '可用余额 {amount}',
'h5.pay.orderCount': '{count} 笔订单',
'h5.pay.feeDetails': '费用明细',
'h5.pay.confirm': '确认支付',
'h5.pay.confirmAmount': '余额支付 {amount}',
'h5.pay.confirmHybrid': '确认并微信支付',
'h5.pay.confirmHybridAmount': '微信支付 {amount}',
'h5.pay.footWxDue': '本次微信应付',
'h5.pay.paying': '支付中…',
'h5.pay.cancel': '取消',
'h5.pay.empty': '暂无可支付订单',
'h5.pay.noFeeRows': '暂无费用明细',
'h5.pay.success': '支付成功',
'h5.pay.failed': '支付失败',
'h5.pay.needWechatBrowser': '请在微信内打开后再使用微信补差',
'h5.pay.needWechatOrRecharge': '当前不在微信内,无法完成补差。可先充值补足余额,或改用微信打开后再付。',
'h5.pay.needWechatShort': '非微信环境,请充值补足或改用微信打开',
'h5.pay.needMpAppId': '未配置公众号 AppId,无法微信授权',
'h5.pay.jsapiParamsMissing': '未返回 JSAPI 调起参数',
'h5.pay.payCancel': '已取消微信支付',
'h5.pay.payFail': '微信支付调起失败',
'h5.pay.payConfirming': '支付结果确认中,请稍后在订单列表查看;勿重复支付',
'h5.pay.invalidAmount': '应收金额无效,无法支付',
'h5.pay.loadFailed': '加载费用明细失败',
'h5.pay.balanceLowTitle': '余额不足',
'h5.pay.balanceLow': '当前余额不足以完成本次支付,请先充值后再回来付款',
'h5.pay.goRecharge': '去充值',
'h5.pay.goRechargeShortfall': '充值补足 {amount}',
'h5.pay.later': '稍后再说',
'h5.pay.coupon': '优惠券',
'h5.pay.couponNone': '不使用优惠券',

View File

@ -323,9 +323,9 @@
</a-spin>
<H5OrderPaySheet
v-if="payVisible"
v-model:visible="payVisible"
:orders="payOrders"
:oauth-code="payOauthCode"
@success="onPaySuccess"
@fail="onPayFail"
/>
@ -501,10 +501,9 @@ import {
buildWaybillContextFromRow,
} from '@/composables/useAskAdvisor';
import { addPickupOrderOrders, getPickupOrderDetail } from '@/api/order/pickupOrder';
import { consumeOrderPayOauthResume } from '../utils/orderPayOauth';
import H5OrderPaySheet from '../components/H5OrderPaySheet.vue';
const H5OrderPaySheet = defineAsyncComponent(
() => import('../components/H5OrderPaySheet.vue'),
);
const H5OrderDetailSheet = defineAsyncComponent(
() => import('../components/H5OrderDetailSheet.vue'),
);
@ -554,6 +553,7 @@ const fulfillOrderCount = ref(0);
const payVisible = ref(false);
const payOrders = ref<{ id: number | string; waybillNo?: string }[]>([]);
const payOauthCode = ref<string | undefined>();
const detailVisible = ref(false);
const detailOrderId = ref<number | string>('');
const detailTab = ref<'overview' | 'track' | 'fee'>('overview');
@ -1225,6 +1225,7 @@ function requireBatchRows(rows: any[], emptyKey: string) {
function runBatchPay() {
const rows = batchPayRows.value;
if (!requireBatchRows(rows, 'h5.orders.batch.needPay')) return;
payOauthCode.value = undefined;
payOrders.value = rows.map((row) => ({
id: row.id,
waybillNo: row.waybillNo || row.customerOrderNo,
@ -1486,11 +1487,23 @@ function goDetail(row: any, tab?: string) {
}
function openPay(row: any) {
payOauthCode.value = undefined;
payOrders.value = [{ id: row.id, waybillNo: row.waybillNo }];
payVisible.value = true;
}
function resumeOrderPayOauthIfNeeded() {
const resume = consumeOrderPayOauthResume();
if (!resume) return;
payOrders.value = resume.orders;
payOauthCode.value = resume.oauthCode;
payVisible.value = true;
}
resumeOrderPayOauthIfNeeded();
function onPaySuccess() {
payOauthCode.value = undefined;
if (isBatchSelection.value) {
selectedOrderIds.value = [];
}

View File

@ -0,0 +1,38 @@
export type H5OrderPayOauthOrder = {
id: number | string
waybillNo?: string
serviceNo?: string
}
export type H5OrderPayOauthResume = {
orders: H5OrderPayOauthOrder[]
oauthCode: string
}
export const H5_ORDER_PAY_OAUTH_FLAG = 'oms_order_pay'
export const H5_ORDER_PAY_OAUTH_ORDERS_KEY = 'h5_order_pay_oauth_orders'
/** 授权回跳后由订单页消费:恢复待支付订单 + oauth code */
export function consumeOrderPayOauthResume(): H5OrderPayOauthResume | null {
try {
const url = new URL(window.location.href)
const code = url.searchParams.get('code') || ''
const state = url.searchParams.get('state') || ''
if (!code || !state.startsWith(H5_ORDER_PAY_OAUTH_FLAG)) return null
url.searchParams.delete('code')
url.searchParams.delete('state')
window.history.replaceState({}, '', url.toString())
const raw = sessionStorage.getItem(H5_ORDER_PAY_OAUTH_ORDERS_KEY)
sessionStorage.removeItem(H5_ORDER_PAY_OAUTH_ORDERS_KEY)
if (!raw) return null
const orders = JSON.parse(raw) as H5OrderPayOauthOrder[]
if (!Array.isArray(orders) || !orders.length) return null
return { orders, oauthCode: code }
} catch {
return null
}
}
export function saveOrderPayOauthOrders(orders: H5OrderPayOauthOrder[]) {
sessionStorage.setItem(H5_ORDER_PAY_OAUTH_ORDERS_KEY, JSON.stringify(orders))
}

View File

@ -32,6 +32,7 @@
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useMenuDisplay } from '@/composables/useMenuDisplay';
import { prodApiOrigin } from '@/utils/rewriteBrowserApiPath';
const { t } = useI18n();
const route = useRoute();
@ -41,6 +42,11 @@
const frameSrc = computed(() => {
const fromMeta = String(route.meta.frameSrc || '').trim();
if (fromMeta) return fromMeta;
const fromPath = String(route.meta.frameSrcPath || '').trim();
if (fromPath) {
const path = fromPath.startsWith('/') ? fromPath : `/${fromPath}`;
return `${prodApiOrigin()}${path}`;
}
return String(route.query.url || '').trim();
});

View File

@ -3,9 +3,15 @@ import { computed, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { Message } from '@arco-design/web-vue'
import { IconClose, IconDown, IconRight } from '@arco-design/web-vue/es/icon'
import QRCode from 'qrcode'
import { getOrderDetail, postOrderPay, type OrderPayCouponOption } from '@/api/order'
import { getDictListAll, type DictDto } from '@/api/system/dict'
import { CustomerService } from '@/api/customer'
import {
closeWeChatPay,
createOrderWeChatPay,
getWeChatPayStatus,
} from '@/api/recharge/wechatPay'
import {
formatCouponBenefit,
formatPayMoney,
@ -161,12 +167,46 @@ const singleBalance = computed(() => {
const pricingLoading = computed(() => couponPricing.anyLoading.value)
/** 单客户:余额优先;多客户:仅余额(不足不可确认) */
const hybridBalanceUse = computed(() => {
if (isMultiCustomer.value || singleBalance.value == null) return 0
return Math.min(singleBalance.value, totals.value.payable)
})
const hybridWechatAmount = computed(() => {
if (isMultiCustomer.value || singleBalance.value == null) return 0
return Math.max(0, totals.value.payable - hybridBalanceUse.value)
})
const needsWechatPay = computed(() => hybridWechatAmount.value > 1e-6)
const wxQrVisible = ref(false)
const wxQrDataUrl = ref('')
const wxOutTradeNo = ref('')
let wxPollTimer: ReturnType<typeof setInterval> | null = null
function stopWxPoll() {
if (wxPollTimer) {
clearInterval(wxPollTimer)
wxPollTimer = null
}
}
async function cancelWxPay() {
stopWxPoll()
const no = wxOutTradeNo.value
wxQrVisible.value = false
wxQrDataUrl.value = ''
wxOutTradeNo.value = ''
if (no) await closeWeChatPay(no).catch(() => undefined)
}
const canConfirm = computed(
() =>
!loading.value
&& !submitting.value
&& !pricingLoading.value
&& payableOrders.value.length > 0,
&& !wxQrVisible.value
&& payableOrders.value.length > 0
&& (needsWechatPay.value || balanceShortfalls.value.length === 0),
)
const confirmText = computed(() => {
@ -393,14 +433,83 @@ async function loadPreviews() {
}
}
function closeModal() {
async function closeModal() {
if (submitting.value) return
if (wxQrVisible.value) {
await cancelWxPay()
}
emit('update:visible', false)
}
async function handleConfirm() {
if (!canConfirm.value) return
const queue = [...payableOrders.value]
if (!queue.length) return
// 单客户且需微信补差:一笔混合支付
if (!isMultiCustomer.value && needsWechatPay.value) {
submitting.value = true
try {
const couponByOrderId: Record<number, number | null> = {}
for (const p of queue) {
couponByOrderId[Number(p.id)] = couponEntry(p)?.selectedCouponId ?? 0
}
const created = await createOrderWeChatPay({
orderIds: queue.map((p) => Number(p.id)),
couponByOrderId,
scene: 'native',
})
if (created.paidImmediately) {
for (const p of queue) {
payStatus.value = { ...payStatus.value, [p.key]: 'success' }
}
Message.success(
queue.length > 1
? t('order.myOrders.modal.payBatchSuccess', { count: queue.length })
: t('order.myOrders.modal.paySuccess'),
)
emit('success')
emit('update:visible', false)
return
}
if (!created.codeUrl || !created.outTradeNo) {
throw new Error(t('order.myOrders.modal.payWxCreateFailed'))
}
wxOutTradeNo.value = created.outTradeNo
wxQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
width: 200,
margin: 1,
})
wxQrVisible.value = true
stopWxPoll()
wxPollTimer = setInterval(async () => {
try {
const st = await getWeChatPayStatus(created.outTradeNo!)
if (st.status === 'Success' || st.statusCode === 3) {
stopWxPoll()
wxQrVisible.value = false
wxQrDataUrl.value = ''
for (const p of queue) {
payStatus.value = { ...payStatus.value, [p.key]: 'success' }
}
Message.success(t('order.myOrders.modal.paySuccess'))
emit('success')
emit('update:visible', false)
}
} catch {
/* ignore poll errors */
}
}, 2000)
} catch (e: any) {
Message.error(e?.message || t('order.myOrders.modal.payFailed'))
emit('fail', e)
} finally {
submitting.value = false
}
return
}
// 多客户或纯余额:逐单 /order/pay
submitting.value = true
progress.value = { done: 0, total: queue.length }
let successCount = 0
@ -461,6 +570,10 @@ watch(
if (visible) {
loadPreviews()
} else {
stopWxPoll()
wxQrVisible.value = false
wxQrDataUrl.value = ''
wxOutTradeNo.value = ''
previews.value = []
submitting.value = false
couponPricing.reset()
@ -508,15 +621,24 @@ watch(
</dl>
</section>
<a-alert v-if="balanceShortfalls.length" type="warning" show-icon class="pay-alert">
<template v-if="!isMultiCustomer">
{{ t('order.myOrders.modal.payBalanceShort', { amount: formatPayMoney(balanceShortfalls[0].shortfall) }) }}
</template>
<template v-else>
<div v-for="item in balanceShortfalls" :key="item.name">
{{ t('order.myOrders.modal.payBalanceShortCustomer', { name: item.name, amount: formatPayMoney(item.shortfall) }) }}
</div>
</template>
<a-alert
v-if="balanceShortfalls.length && isMultiCustomer"
type="warning"
show-icon
class="pay-alert"
>
<div v-for="item in balanceShortfalls" :key="item.name">
{{ t('order.myOrders.modal.payBalanceShortCustomer', { name: item.name, amount: formatPayMoney(item.shortfall) }) }}
</div>
<div>{{ t('order.myOrders.modal.payMultiCustomerWxHint') }}</div>
</a-alert>
<a-alert
v-else-if="needsWechatPay"
type="info"
show-icon
class="pay-alert"
>
{{ t('order.myOrders.modal.payHybridHint', { amount: formatPayMoney(hybridWechatAmount) }) }}
</a-alert>
<a-alert v-if="isMulti && blockedOrders.length" type="info" show-icon class="pay-alert">
{{ t('order.myOrders.modal.paySkipHint', { count: blockedOrders.length }) }}
@ -653,11 +775,38 @@ watch(
</div>
</div>
<a-empty v-else-if="!loading" :description="t('order.myOrders.modal.payEmpty')" />
<div v-if="wxQrVisible" class="pay-wx-layer">
<div class="pay-wx-card">
<h4>{{ t('order.myOrders.modal.payWxTitle') }}</h4>
<p class="pay-wx-card__tip">{{ t('order.myOrders.modal.payWxTip') }}</p>
<img v-if="wxQrDataUrl" :src="wxQrDataUrl" alt="wx-pay-qr" />
<p class="pay-wx-card__amt">
{{ t('order.myOrders.modal.payWxAmount', { amount: formatPayMoney(hybridWechatAmount) }) }}
</p>
<a-button @click="cancelWxPay">{{ t('order.myOrders.modal.payWxCancel') }}</a-button>
</div>
</div>
</a-spin>
<template #footer>
<div class="pay-footer">
<span class="pay-footer__method">{{ t('order.myOrders.modal.payMethodBalance') }}</span>
<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
type="primary"
@ -674,6 +823,7 @@ watch(
<style scoped lang="less">
.pay-spin {
position: relative;
display: block;
width: 100%;
min-height: 160px;
@ -963,11 +1113,66 @@ watch(
align-items: center;
justify-content: flex-end;
gap: 8px;
width: 100%;
}
.pay-footer__method {
margin-right: auto;
color: var(--color-text-3);
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 {
position: absolute;
inset: 0;
z-index: 5;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.92);
}
.pay-wx-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 20px 24px;
border-radius: 12px;
border: 1px solid var(--color-border-2);
background: #fff;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
h4 {
margin: 0;
font-size: 15px;
}
img {
width: 200px;
height: 200px;
}
}
.pay-wx-card__tip {
margin: 0;
font-size: 12px;
color: var(--color-text-3);
}
.pay-wx-card__amt {
margin: 0;
font-size: 14px;
font-weight: 600;
color: var(--app-primary-color, #1d7281);
}
</style>

View File

@ -1351,12 +1351,13 @@
width: 100%;
flex: 1;
min-height: 0;
padding: 16px;
/* 门户下由 layout --app-page-padding=0 对齐侧栏;运营端仍用默认页面壳留白 */
padding: var(--app-page-padding, 8px 16px 16px);
overflow: hidden;
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: var(--app-page-bg);
background-color: transparent;
}
.price-check-layout { display: flex; gap: 12px; flex: 1; min-height: 0; min-width: 0; }
.price-check-main { flex: 5 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }

View File

@ -296,6 +296,7 @@ export const OMS_DICT_BATCH_SEED: DictSeedRow[] = [
...pack('pay_type', [
['1', '微信'],
['2', '支付宝'],
['3', '银行转账'],
]),
...pack('principal_type', [
['user', '内部用户'],

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,331 @@
<template>
<div class="account-flow-page">
<div class="account-flow-page-card">
<div class="table-toolbar">
<div class="toolbar-left">
<a-space wrap :size="12">
<a-input
v-model="keyword"
allow-clear
:placeholder="t('user.accountFlow.search.keywordPlaceholder')"
style="width: 220px"
@press-enter="handleSearch"
/>
<a-select
v-model="bizTypeFilter"
:placeholder="t('user.accountFlow.search.bizTypePlaceholder')"
allow-clear
style="width: 140px"
>
<a-option value="all">{{ t('user.accountFlow.search.bizTypeAll') }}</a-option>
<a-option value="recharge">{{ t('user.accountFlow.bizType.recharge') }}</a-option>
<a-option value="orderPay">{{ t('user.accountFlow.bizType.orderPay') }}</a-option>
<a-option value="pickupPay">{{ t('user.accountFlow.bizType.pickupPay') }}</a-option>
<a-option value="manualAdjust">{{ t('user.accountFlow.bizType.manualAdjust') }}</a-option>
<a-option value="storageRent">{{ t('user.accountFlow.bizType.storageRent') }}</a-option>
<a-option value="referralCommission">{{ t('user.accountFlow.bizType.referralCommission') }}</a-option>
<a-option value="commissionToBalance">{{ t('user.accountFlow.bizType.commissionToBalance') }}</a-option>
<a-option value="commissionWithdraw">{{ t('user.accountFlow.bizType.commissionWithdraw') }}</a-option>
<a-option value="marketingAdjust">{{ t('user.accountFlow.bizType.marketingAdjust') }}</a-option>
</a-select>
<a-range-picker
v-model="dateRange"
show-time
format="YYYY-MM-DD HH:mm:ss"
:placeholder="[
t('user.accountFlow.search.dateRange'),
t('user.accountFlow.search.dateRange'),
]"
style="width: 380px"
/>
<a-button class="app-btn-search" @click="handleSearch">
{{ t('user.accountFlow.search.actions.search') }}
</a-button>
<a-button @click="handleReset">
{{ t('user.accountFlow.search.actions.reset') }}
</a-button>
</a-space>
</div>
<div class="toolbar-right">
<div class="pagination-controls">
<PaginationPro
:total-count="totalCount"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
/>
</div>
</div>
</div>
<a-spin class="list-spin" :loading="listLoading">
<div ref="tableContainerRef" class="list-wrap">
<HandsontablePro
:columns="hotColumns"
:data="tableRows"
:total="totalCount"
:current-page="currentPage"
:page-size="pageSize"
:read-only="true"
:stretch-columns="true"
:custom-cell-renderer="customCellRenderer"
:height="handsontableHeight"
:search-params="headerSearchParams"
sort-mode="remote"
:sort-field="listSortField"
:sort-order="listSortOrder"
@search="handleHeaderSearch"
@sort-change="handleSortChange"
/>
</div>
</a-spin>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, onMounted, reactive } from 'vue'
import { useI18n } from 'vue-i18n'
import { Message } from '@arco-design/web-vue'
import HandsontablePro from '@/components/HandsontablePro/index.vue'
import PaginationPro from '@/components/PaginationPro/index.vue'
import { useTableContainerHeight } from '@/composables/useTableContainerHeight'
import dayjs from 'dayjs'
import { getAccountFlowList } from '@/api/customer/accountFlow'
import { getMoneyToneColor } from '@/utils/statusTag'
import {
adaptAccountFlowHeaderFilters,
withServerFilterColumns,
withSortableColumns,
} from '@/utils/headerFilterAdapter'
defineOptions({
name: 'UserAccountFlow',
})
const { t } = useI18n()
const { tableContainerRef, tableHeight } = useTableContainerHeight()
const handsontableHeight = computed(() => Math.max(tableHeight.value || 0, 400))
interface AccountFlowRow {
serialNumber: string
createTime: string
bizTypeName: string
bizNo: string
amount: number
balanceBefore: number
balanceAfter: number
remark: string
}
function mapRow(item: any): AccountFlowRow {
return {
serialNumber: item.serialNumber ?? '',
createTime: item.createTime ?? '',
bizTypeName: item.bizTypeName ?? item.bizType ?? '',
bizNo: item.bizNo ?? '--',
amount: Number(item.amount ?? 0),
balanceBefore: Number(item.balanceBefore ?? 0),
balanceAfter: Number(item.balanceAfter ?? 0),
remark: item.remark ?? '',
}
}
const tableRows = ref<AccountFlowRow[]>([])
const totalCount = ref(0)
const listLoading = ref(false)
const keyword = ref('')
const bizTypeFilter = ref('all')
const dateRange = ref<any[]>([])
const headerSearchParams = reactive<Record<string, string>>({})
const listSortField = ref<string | null>(null)
const listSortOrder = ref<'asc' | 'desc' | null>(null)
const currentPage = ref(1)
const pageSize = ref(50)
const FLOW_SERVER_KEYS = ['serialNumber', 'bizNo', 'amount', 'createTime', 'remark'] as const
const FLOW_SORTABLE_KEYS = ['createTime', 'amount'] as const
const hotColumns = computed(() =>
withSortableColumns(
withServerFilterColumns(
[
{ key: 'serialNumber', label: t('user.accountFlow.table.serialNumber'), width: 180 },
{ key: 'createTime', label: t('user.accountFlow.table.createTime'), width: 170 },
{ key: 'bizTypeName', label: t('user.accountFlow.table.bizType'), width: 120 },
{ key: 'bizNo', label: t('user.accountFlow.table.bizNo'), width: 160 },
{ key: 'amount', label: t('user.accountFlow.table.amount'), width: 110 },
{ key: 'balanceBefore', label: t('user.accountFlow.table.balanceBefore'), width: 110 },
{ key: 'balanceAfter', label: t('user.accountFlow.table.balanceAfter'), width: 110 },
{ key: 'remark', label: t('user.accountFlow.table.remark'), width: 180 },
],
FLOW_SERVER_KEYS,
(col) => {
if (col.key === 'createTime') {
return { filterType: 'date' as const, headerMode: 'icon' as const }
}
if (col.key === 'amount') {
return { filterType: 'number' as const, headerMode: 'icon' as const }
}
return {}
},
),
FLOW_SORTABLE_KEYS,
),
)
function formatMoney(value: unknown) {
const num = Number(value)
return Number.isFinite(num) ? num.toFixed(2) : '--'
}
const customCellRenderer = (_rowData: any, colKey: string, value: any) => {
if (colKey === 'amount') {
const num = Number(value ?? 0)
const color = getMoneyToneColor(num >= 0)
const prefix = num > 0 ? '+' : ''
return `<span style="color:${color};font-weight:500;">${prefix}${formatMoney(num)}</span>`
}
if (colKey === 'balanceBefore' || colKey === 'balanceAfter') {
return formatMoney(value)
}
return null
}
function buildListParams() {
const adapted = adaptAccountFlowHeaderFilters(headerSearchParams)
const params: Record<string, any> = {
page: currentPage.value,
pageSize: pageSize.value,
}
const kw = (adapted.keyword || keyword.value.trim() || '').trim()
if (kw) params.keyword = kw
if (adapted.bizType && adapted.bizType !== 'all') {
params.bizType = adapted.bizType
} else if (bizTypeFilter.value && bizTypeFilter.value !== 'all') {
params.bizType = bizTypeFilter.value
}
if (adapted.createTimeStart || adapted.createTimeEnd) {
params.startTime = adapted.createTimeStart
params.endTime = adapted.createTimeEnd
} else if (dateRange.value?.length === 2 && dateRange.value[0] && dateRange.value[1]) {
params.startTime = dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss')
params.endTime = dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss')
}
if (adapted.amountMin != null) params.amountMin = adapted.amountMin
if (adapted.amountMax != null) params.amountMax = adapted.amountMax
if (listSortField.value) params.sortField = listSortField.value
if (listSortOrder.value) params.sortOrder = listSortOrder.value
return params
}
async function loadList() {
listLoading.value = true
try {
const { items, total } = await getAccountFlowList(buildListParams() as any)
totalCount.value = total
tableRows.value = (items || []).map(mapRow)
} catch (e: any) {
Message.error(e?.message || t('user.accountFlow.message.loadError'))
tableRows.value = []
totalCount.value = 0
} finally {
listLoading.value = false
}
}
function handleHeaderSearch() {
currentPage.value = 1
loadList()
}
function handleSortChange(payload: { field: string | null; order: 'asc' | 'desc' | null }) {
listSortField.value = payload.field
listSortOrder.value = payload.order
currentPage.value = 1
loadList()
}
function handleSearch() {
currentPage.value = 1
loadList()
}
function handleReset() {
keyword.value = ''
bizTypeFilter.value = 'all'
dateRange.value = []
Object.keys(headerSearchParams).forEach((k) => {
headerSearchParams[k] = ''
})
listSortField.value = null
listSortOrder.value = null
currentPage.value = 1
loadList()
}
function handlePageChange(page: number) {
currentPage.value = page
loadList()
}
function handlePageSizeChange(size: number) {
pageSize.value = size
currentPage.value = 1
loadList()
}
onMounted(() => {
loadList()
})
</script>
<style lang="less" scoped>
.account-flow-page {
/* 门户根 padding 由 layout 统一清零并与侧栏同高;运营端仍可用变量留白 */
padding: var(--app-page-padding-list, 8px 16px 16px);
background: var(--app-page-bg, #f0f3f4);
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.account-flow-page-card {
background: var(--app-card-bg, #fff);
border-radius: 8px;
padding: 16px;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.table-toolbar {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 12px;
margin-bottom: 12px;
flex-shrink: 0;
}
.list-spin {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.list-wrap {
flex: 1;
min-height: 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
}
</style>

View File

@ -776,7 +776,8 @@ onMounted(() => {
.user-invoice-container {
width: 100%;
box-sizing: border-box;
padding: 16px 16px 24px;
/* 门户下根 padding=0,与侧栏同高;运营端保留壳留白 */
padding: var(--app-page-padding, 16px 16px 24px);
display: flex;
flex-direction: column;
background: var(--app-page-bg);

View File

@ -1,5 +1,5 @@
<template>
<div class="deposit-page animate__animated animate__fadeInUp animate__faster">
<div class="deposit-page">
<section class="deposit-card">
<div class="card-header">
<div class="card-intro">
@ -73,49 +73,197 @@
</div>
</div>
<p class="block-title block-title--spaced">{{ $t('user.recharge.deposit.form.paymentMethod') }}</p>
<div class="pay-type-grid">
<button
type="button"
class="pay-card"
:class="{ active: payType === 'zfb' }"
@click="payType = 'zfb'"
>
<img :src="zfbIcon" :alt="$t('user.recharge.deposit.payment.alipay')" />
<div>
<p class="pay-name">{{ $t('user.recharge.deposit.payment.alipay') }}</p>
<div class="pay-method">
<div class="pay-method__head">
<p class="block-title">{{ $t('user.recharge.deposit.form.paymentMethod') }}</p>
<p class="pay-method__sub">{{ $t('user.recharge.deposit.form.paymentMethodHint') }}</p>
</div>
<div class="pay-method__group">
<div class="pay-method__group-label">
<span class="pay-method__group-tag is-instant">
{{ $t('user.recharge.deposit.payment.groupInstant') }}
</span>
<span class="pay-method__group-desc">
{{ $t('user.recharge.deposit.payment.groupInstantDesc') }}
</span>
</div>
</button>
<button
type="button"
class="pay-card"
:class="{ active: payType === 'wx' }"
@click="payType = 'wx'"
>
<img :src="wxIcon" :alt="$t('user.recharge.deposit.payment.wechat')" />
<div>
<p class="pay-name">{{ $t('user.recharge.deposit.payment.wechat') }}</p>
<div class="pay-type-grid">
<button
type="button"
class="pay-card pay-card--featured"
:class="{ active: payType === 'wxOnline' }"
@click="payType = 'wxOnline'"
>
<span class="pay-card__badge">{{ $t('user.recharge.deposit.payment.recommend') }}</span>
<img :src="wxIcon" :alt="$t('user.recharge.deposit.payment.wechatOnline')" />
<div class="pay-card__text">
<p class="pay-name">{{ $t('user.recharge.deposit.payment.wechatOnline') }}</p>
<p class="pay-desc">{{ $t('user.recharge.deposit.payment.wechatOnlineDesc') }}</p>
</div>
</button>
</div>
</button>
</div>
<div class="pay-method__group">
<div class="pay-method__group-label">
<span class="pay-method__group-tag is-review">
{{ $t('user.recharge.deposit.payment.groupReview') }}
</span>
<span class="pay-method__group-desc">
{{ $t('user.recharge.deposit.payment.groupReviewDesc') }}
</span>
</div>
<div class="pay-type-grid">
<button
type="button"
class="pay-card"
:class="{ active: payType === 'zfb' }"
@click="payType = 'zfb'"
>
<img :src="zfbIcon" :alt="$t('user.recharge.deposit.payment.alipay')" />
<div class="pay-card__text">
<p class="pay-name">{{ $t('user.recharge.deposit.payment.alipay') }}</p>
<p class="pay-desc">{{ $t('user.recharge.deposit.payment.alipayDesc') }}</p>
</div>
</button>
<button
type="button"
class="pay-card"
:class="{ active: payType === 'wx' }"
@click="payType = 'wx'"
>
<img :src="wxIcon" :alt="$t('user.recharge.deposit.payment.wechatVoucher')" />
<div class="pay-card__text">
<p class="pay-name">{{ $t('user.recharge.deposit.payment.wechatVoucher') }}</p>
<p class="pay-desc">{{ $t('user.recharge.deposit.payment.wechatVoucherDesc') }}</p>
</div>
</button>
<button
type="button"
class="pay-card"
:class="{ active: payType === 'bank' }"
@click="payType = 'bank'"
>
<img :src="bankIcon" :alt="$t('user.recharge.deposit.payment.bank')" />
<div class="pay-card__text">
<p class="pay-name">{{ $t('user.recharge.deposit.payment.bank') }}</p>
<p class="pay-desc">{{ $t('user.recharge.deposit.payment.bankDesc') }}</p>
</div>
</button>
</div>
</div>
<div class="pay-guide" :class="payType === 'wxOnline' ? 'is-instant' : 'is-review'">
<strong>{{ selectedPayGuideTitle }}</strong>
<p>{{ selectedPayGuideBody }}</p>
</div>
<div v-if="payType === 'bank'" class="bank-remark-fields">
<label class="bank-field">
<span class="bank-field__label">{{ $t('user.recharge.deposit.form.payerName') }}</span>
<a-input
v-model="payerName"
allow-clear
:placeholder="$t('user.recharge.deposit.form.payerNamePlaceholder')"
/>
</label>
<label class="bank-field">
<span class="bank-field__label">{{ $t('user.recharge.deposit.form.transferSerial') }}</span>
<a-input
v-model="transferSerial"
allow-clear
:placeholder="$t('user.recharge.deposit.form.transferSerialPlaceholder')"
/>
</label>
</div>
</div>
</div>
<div class="step0-qr">
<div class="qr-wrapper">
<div v-if="payType === 'zfb'" class="qr-image">
<a-image v-if="zfbQrDisplay" :src="zfbQrDisplay" :preview="true" width="200" />
<p v-else class="qr-empty">{{ $t('user.recharge.deposit.form.qrEmpty') }}</p>
<div v-if="payType === 'bank'" class="bank-card">
<p class="side-panel-caption">{{ $t('user.recharge.deposit.form.bankPanelTitle') }}</p>
<template v-if="bankAccount.configured">
<div class="bank-row">
<span class="bank-label">{{ $t('user.recharge.deposit.form.bankAccountName') }}</span>
<span class="bank-value">{{ bankAccount.accountName }}</span>
<button type="button" class="bank-copy" @click="copyText(bankAccount.accountName)">
{{ $t('user.recharge.deposit.form.copy') }}
</button>
</div>
<div class="bank-row">
<span class="bank-label">{{ $t('user.recharge.deposit.form.bankName') }}</span>
<span class="bank-value">{{ bankAccount.bankName }}</span>
<button type="button" class="bank-copy" @click="copyText(bankAccount.bankName)">
{{ $t('user.recharge.deposit.form.copy') }}
</button>
</div>
<div class="bank-row">
<span class="bank-label">{{ $t('user.recharge.deposit.form.bankAccountNo') }}</span>
<span class="bank-value bank-value--mono">{{ bankAccount.accountNo }}</span>
<button type="button" class="bank-copy" @click="copyText(bankAccount.accountNo)">
{{ $t('user.recharge.deposit.form.copy') }}
</button>
</div>
<div class="bank-row">
<span class="bank-label">{{ $t('user.recharge.deposit.form.bankCurrency') }}</span>
<span class="bank-value">{{ bankAccount.currency || 'CNY' }}</span>
</div>
</template>
<p v-else class="qr-empty">{{ $t('user.recharge.deposit.form.bankEmpty') }}</p>
</div>
<div v-else class="qr-image">
<a-image v-if="wxQrDisplay" :src="wxQrDisplay" :preview="true" width="200" />
<p v-else class="qr-empty">{{ $t('user.recharge.deposit.form.qrEmpty') }}</p>
<div v-else-if="payType === 'wxOnline'" class="online-guide-card">
<div class="online-guide-card__icon" aria-hidden="true">
<img :src="wxIcon" alt="" />
</div>
<p class="online-guide-card__title">{{ $t('user.recharge.deposit.form.wxOnlinePanelTitle') }}</p>
<ol class="online-guide-card__steps">
<li>{{ $t('user.recharge.deposit.form.wxOnlineStep1') }}</li>
<li>{{ $t('user.recharge.deposit.form.wxOnlineStep2') }}</li>
<li>{{ $t('user.recharge.deposit.form.wxOnlineStep3') }}</li>
</ol>
<p class="online-guide-card__foot">{{ $t('user.recharge.deposit.form.wxOnlineHint') }}</p>
</div>
<div v-else class="voucher-qr-panel">
<p class="side-panel-caption">
{{
payType === 'zfb'
? $t('user.recharge.deposit.form.alipayPanelTitle')
: $t('user.recharge.deposit.form.wechatVoucherPanelTitle')
}}
</p>
<div class="qr-image">
<a-image
v-if="payType === 'zfb' ? zfbQrDisplay : wxQrDisplay"
:src="payType === 'zfb' ? zfbQrDisplay : wxQrDisplay"
:preview="true"
width="200"
/>
<p v-else class="qr-empty">{{ $t('user.recharge.deposit.form.qrEmpty') }}</p>
</div>
<p class="voucher-qr-panel__tip">{{ $t('user.recharge.deposit.form.voucherPanelTip') }}</p>
</div>
</div>
</div>
</div>
</div>
<div v-if="current === 1" class="form-block">
<div v-if="current === 1 && payType === 'wxOnline'" class="form-block form-block--wx-online">
<p class="block-title">{{ $t('user.recharge.deposit.form.wxOnlineScan') }}</p>
<div class="wx-online-panel">
<div v-if="wxOnlineQrDataUrl" class="wx-online-qr">
<img :src="wxOnlineQrDataUrl" alt="wechat-pay-qr" />
</div>
<a-spin v-else :loading="wxOnlineCreating" />
<p class="wx-online-tip">{{ $t('user.recharge.deposit.form.wxOnlineWaiting') }}</p>
<p v-if="wxOnlineOutTradeNo" class="wx-online-no">
{{ $t('user.recharge.deposit.form.wxOnlineOrderNo', { no: wxOnlineOutTradeNo }) }}
</p>
</div>
</div>
<div v-else-if="current === 1" class="form-block">
<p class="block-title">{{ $t('user.recharge.deposit.form.uploadVoucher') }}</p>
<a-upload
@ -152,24 +300,38 @@
</div>
<div v-if="current < 2" class="action-row">
<a-button v-if="current === 1" @click="current--">{{ $t('user.recharge.deposit.actions.prevStep') }}</a-button>
<a-button v-if="current === 1 && payType === 'wxOnline'" :loading="wxOnlineClosing" @click="cancelWxOnlinePay">
{{ $t('user.recharge.deposit.actions.cancelPay') }}
</a-button>
<a-button v-else-if="current === 1" @click="current--">
{{ $t('user.recharge.deposit.actions.prevStep') }}
</a-button>
<a-button
v-if="current === 1"
v-if="current === 1 && payType !== 'wxOnline'"
type="primary"
:loading="submitting"
@click="submit"
>
{{ $t('user.recharge.deposit.actions.submitReview') }}
</a-button>
<a-button v-if="current === 0" type="primary" @click="handleNext">
{{ $t('user.recharge.deposit.actions.nextStep') }}
<a-button
v-if="current === 0"
type="primary"
:loading="wxOnlineCreating"
@click="handleNext"
>
{{
payType === 'wxOnline'
? $t('user.recharge.deposit.actions.createPay')
: $t('user.recharge.deposit.actions.nextStep')
}}
</a-button>
</div>
</a-form>
<div class="tips-strip">
<span class="tips-strip__label">{{ $t('user.recharge.deposit.tips.title') }}</span>
<span>{{ $t('user.recharge.deposit.tips.item1') }}</span>
<span>{{ tipsStripText }}</span>
</div>
</section>
</div>
@ -177,13 +339,24 @@
<script lang="ts" setup>
import { useI18n } from 'vue-i18n';
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
import { Message } from '@arco-design/web-vue';
import { IconPlus } from '@arco-design/web-vue/es/icon';
import QRCode from 'qrcode';
import zfbIcon from '@/assets/zfb.png';
import wxIcon from '@/assets/wx.png';
import { submitRechargeApplication } from '@/api/recharge/rechargeRecord';
import bankIcon from '@/assets/bank.svg?url';
import {
getRechargeBankAccount,
submitRechargeApplication,
type RechargeBankAccount,
} from '@/api/recharge/rechargeRecord';
import {
closeWeChatPay,
createWeChatPay,
getWeChatPayStatus,
} from '@/api/recharge/wechatPay';
import { loadPaymentReceiveQrUrls } from '@/utils/paymentReceiveQr';
const { t } = useI18n();
@ -197,6 +370,13 @@ const PRESET_AMOUNTS = [200, 500, 1000, 3000] as const;
const router = useRouter();
const zfbQrDisplay = ref('');
const wxQrDisplay = ref('');
const bankAccount = reactive<RechargeBankAccount>({
configured: false,
accountName: '',
bankName: '',
accountNo: '',
currency: 'CNY',
});
const current = ref(0);
const formModel = reactive({});
const rechargeAmount = ref(500);
@ -205,11 +385,53 @@ const draftCustomAmount = ref<number | undefined>(undefined);
const customAmountVisible = ref(false);
const customAmountInputRef = ref<{ focus?: () => void } | null>(null);
const lastPresetAmount = ref(500);
const payType = ref<'zfb' | 'wx'>('zfb');
const payType = ref<'wxOnline' | 'zfb' | 'wx' | 'bank'>('wxOnline');
const payerName = ref('');
const transferSerial = ref('');
const fileList = ref<any[]>([]);
const screenshotFile = ref<File | null>(null);
const previewUrl = ref('');
const submitting = ref(false);
const wxOnlineCreating = ref(false);
const wxOnlineClosing = ref(false);
const wxOnlineOutTradeNo = ref('');
const wxOnlineQrDataUrl = ref('');
let wxOnlinePollTimer: ReturnType<typeof setInterval> | null = null;
function payTypeCode(): 1 | 2 | 3 {
if (payType.value === 'zfb') return 2;
if (payType.value === 'bank') return 3;
return 1;
}
function buildBankRemark(): string {
const name = payerName.value.trim();
const serial = transferSerial.value.trim();
return `付款户名:${name};流水号:${serial}`;
}
async function copyText(text: string) {
const value = String(text || '').trim();
if (!value) return;
try {
if (navigator.clipboard?.writeText) {
await navigator.clipboard.writeText(value);
} else {
const input = document.createElement('textarea');
input.value = value;
input.setAttribute('readonly', 'true');
input.style.position = 'fixed';
input.style.left = '-9999px';
document.body.appendChild(input);
input.select();
document.execCommand('copy');
document.body.removeChild(input);
}
Message.success(t('user.recharge.deposit.form.copied'));
} catch {
Message.error(t('user.recharge.deposit.message.copyFailed'));
}
}
const finalAmount = computed(() => {
return rechargeAmount.value === 0 ? customAmount.value : rechargeAmount.value;
@ -225,6 +447,25 @@ const customAmountLabel = computed(() => {
return t('user.recharge.deposit.form.custom');
});
const selectedPayGuideTitle = computed(() => {
if (payType.value === 'wxOnline') return t('user.recharge.deposit.guide.onlineTitle');
if (payType.value === 'bank') return t('user.recharge.deposit.guide.bankTitle');
return t('user.recharge.deposit.guide.voucherTitle');
});
const selectedPayGuideBody = computed(() => {
if (payType.value === 'wxOnline') return t('user.recharge.deposit.guide.onlineBody');
if (payType.value === 'bank') return t('user.recharge.deposit.guide.bankBody');
if (payType.value === 'zfb') return t('user.recharge.deposit.guide.alipayBody');
return t('user.recharge.deposit.guide.wechatVoucherBody');
});
const tipsStripText = computed(() => {
if (payType.value === 'wxOnline') return t('user.recharge.deposit.tips.online');
if (payType.value === 'bank') return t('user.recharge.deposit.tips.bank');
return t('user.recharge.deposit.tips.voucher');
});
function onPresetAmountChange(value: string | number | boolean) {
const n = Number(value);
if (PRESET_AMOUNTS.includes(n as (typeof PRESET_AMOUNTS)[number])) {
@ -265,12 +506,90 @@ function cancelCustomAmount() {
}
}
const handleNext = () => {
function stopWxOnlinePoll() {
if (wxOnlinePollTimer) {
clearInterval(wxOnlinePollTimer);
wxOnlinePollTimer = null;
}
}
async function startWxOnlinePoll(outTradeNo: string) {
stopWxOnlinePoll();
const tick = async () => {
try {
const status = await getWeChatPayStatus(outTradeNo);
if (status.status === 'Success' || status.statusCode === 3) {
stopWxOnlinePoll();
Message.success(t('user.recharge.deposit.message.wxOnlinePaid'));
current.value = 2;
} else if (status.status === 'Closed' || status.status === 'Failed') {
stopWxOnlinePoll();
Message.warning(t('user.recharge.deposit.message.wxOnlineClosed'));
}
} catch {
/* 轮询失败忽略,下一轮重试 */
}
};
await tick();
wxOnlinePollTimer = setInterval(tick, 2000);
}
async function startWxOnlinePay() {
wxOnlineCreating.value = true;
try {
const created = await createWeChatPay({
rechargeAmount: Number(finalAmount.value),
scene: 'native',
});
if (!created.codeUrl) {
throw new Error(t('user.recharge.deposit.message.wxOnlineNoCode'));
}
wxOnlineOutTradeNo.value = created.outTradeNo;
wxOnlineQrDataUrl.value = await QRCode.toDataURL(created.codeUrl, {
width: 220,
margin: 1,
});
current.value = 1;
await startWxOnlinePoll(created.outTradeNo);
} catch (error: any) {
Message.error(error?.message || t('user.recharge.deposit.message.wxOnlineCreateFailed'));
} finally {
wxOnlineCreating.value = false;
}
}
async function cancelWxOnlinePay() {
stopWxOnlinePoll();
const outTradeNo = wxOnlineOutTradeNo.value;
wxOnlineClosing.value = true;
try {
if (outTradeNo) {
await closeWeChatPay(outTradeNo).catch(() => undefined);
}
} finally {
wxOnlineClosing.value = false;
wxOnlineOutTradeNo.value = '';
wxOnlineQrDataUrl.value = '';
current.value = 0;
}
}
const handleNext = async () => {
if (rechargeAmount.value === 0 && customAmount.value <= 0) {
Message.warning(t('user.recharge.deposit.message.selectAmount'));
customAmountVisible.value = true;
return;
}
if (payType.value === 'bank') {
if (!payerName.value.trim() || !transferSerial.value.trim()) {
Message.warning(t('user.recharge.deposit.message.fillBankRemark'));
return;
}
}
if (payType.value === 'wxOnline') {
await startWxOnlinePay();
return;
}
current.value++;
};
@ -316,7 +635,8 @@ const submit = async () => {
try {
const result: any = await submitRechargeApplication({
rechargeAmount: Number(finalAmount.value),
payType: payType.value === 'zfb' ? 2 : 1,
payType: payTypeCode(),
remark: payType.value === 'bank' ? buildBankRemark() : undefined,
screenshotFile: screenshotFile.value ?? undefined,
});
const decision = String(result?.decision ?? result?.Decision ?? '').trim();
@ -343,15 +663,20 @@ const submit = async () => {
};
const reset = () => {
stopWxOnlinePoll();
current.value = 0;
rechargeAmount.value = 500;
lastPresetAmount.value = 500;
customAmount.value = 0;
draftCustomAmount.value = undefined;
customAmountVisible.value = false;
payType.value = 'zfb';
payType.value = 'wxOnline';
payerName.value = '';
transferSerial.value = '';
fileList.value = [];
screenshotFile.value = null;
wxOnlineOutTradeNo.value = '';
wxOnlineQrDataUrl.value = '';
if (previewUrl.value.startsWith('blob:')) {
URL.revokeObjectURL(previewUrl.value);
}
@ -363,9 +688,19 @@ const goToRecord = () => {
};
onMounted(async () => {
const urls = await loadPaymentReceiveQrUrls();
const [urls, account] = await Promise.all([
loadPaymentReceiveQrUrls(),
getRechargeBankAccount().catch(() => null),
]);
zfbQrDisplay.value = urls.alipay;
wxQrDisplay.value = urls.wechat;
if (account) {
Object.assign(bankAccount, account);
}
});
onBeforeUnmount(() => {
stopWxOnlinePoll();
});
</script>
@ -386,9 +721,13 @@ onMounted(async () => {
inset 0 2px 6px rgba(15, 23, 42, 0.07);
box-sizing: border-box;
height: 100%;
/* 由 page-layout flex 撑满主区,避免跳转后只剩卡片高度像整页收缩 */
flex: 1 1 auto;
align-self: stretch;
width: 100%;
min-height: 0;
padding: 20px 24px;
height: 100%;
/* 根节点 padding 见下方非 scoped:门户 [class*='-page']{padding:0!important} 会盖过 scoped */
background: var(--app-page-bg, #f0f3f4);
display: flex;
align-items: flex-start;
@ -398,6 +737,7 @@ onMounted(async () => {
.deposit-card {
width: min(880px, 100%);
flex: 0 0 auto;
margin: 0 auto;
padding: 24px 28px 20px;
background: var(--dep-panel-bg);
@ -669,47 +1009,286 @@ onMounted(async () => {
flex-shrink: 0;
}
.pay-method {
display: flex;
flex-direction: column;
gap: 14px;
}
.pay-method__head {
.block-title {
margin-bottom: 4px;
}
}
.pay-method__sub {
margin: 0;
font-size: 12px;
line-height: 1.5;
color: var(--dep-soft);
}
.pay-method__group {
display: flex;
flex-direction: column;
gap: 8px;
}
.pay-method__group-label {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.pay-method__group-tag {
display: inline-flex;
align-items: center;
height: 22px;
padding: 0 8px;
border-radius: 6px;
font-size: 12px;
font-weight: 600;
&.is-instant {
color: #0f766e;
background: color-mix(in srgb, #0f766e 12%, #fff);
}
&.is-review {
color: #9a6700;
background: color-mix(in srgb, #9a6700 12%, #fff);
}
}
.pay-method__group-desc {
font-size: 12px;
color: var(--dep-soft);
}
.pay-type-grid {
display: flex;
flex-wrap: wrap;
gap: 12px;
gap: 10px;
margin: 0;
width: auto;
max-width: 100%;
}
.pay-card {
position: relative;
border: none;
border-radius: 14px;
padding: 12px 24px;
padding: 12px 14px;
display: flex;
gap: 10px;
align-items: center;
flex: 0 0 auto;
flex: 1 1 180px;
min-width: 168px;
width: auto;
max-width: 260px;
text-align: left;
background: #ffffff;
box-shadow: var(--dep-well-shadow);
cursor: pointer;
transition: box-shadow 0.2s ease;
transition:
box-shadow 0.2s ease,
transform 0.15s ease;
img {
img,
.pay-card__glyph {
width: 36px;
height: 36px;
flex-shrink: 0;
}
.pay-card__glyph {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 10px;
background: color-mix(in srgb, var(--app-primary-color) 14%, #fff);
color: var(--app-primary-color);
font-size: 15px;
font-weight: 700;
}
&.pay-card--featured {
max-width: 320px;
min-width: 220px;
padding-top: 16px;
background:
linear-gradient(
135deg,
color-mix(in srgb, var(--app-primary-color) 8%, #fff) 0%,
#fff 60%
);
}
&.active {
box-shadow:
var(--dep-well-shadow-deep),
inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color) 35%, transparent);
inset 0 0 0 1.5px color-mix(in srgb, var(--app-primary-color) 45%, transparent);
}
&:hover:not(.active) {
box-shadow: var(--dep-well-shadow-deep);
transform: translateY(-1px);
}
}
.pay-card__badge {
position: absolute;
top: 0;
right: 10px;
transform: translateY(-40%);
height: 20px;
padding: 0 8px;
border-radius: 999px;
font-size: 11px;
font-weight: 600;
line-height: 20px;
color: #fff;
background: var(--app-primary-color);
}
.pay-card__text {
min-width: 0;
}
.pay-guide {
padding: 10px 12px;
border-radius: 10px;
background: #f7f9fa;
strong {
display: block;
margin-bottom: 4px;
font-size: 13px;
color: var(--dep-ink);
}
p {
margin: 0;
font-size: 12px;
line-height: 1.55;
color: var(--dep-muted);
}
&.is-instant {
background: color-mix(in srgb, #0f766e 8%, #fff);
border: 1px solid color-mix(in srgb, #0f766e 18%, transparent);
strong {
color: #0f766e;
}
}
&.is-review {
background: color-mix(in srgb, #9a6700 8%, #fff);
border: 1px solid color-mix(in srgb, #9a6700 16%, transparent);
strong {
color: #9a6700;
}
}
}
.side-panel-caption {
margin: 0 0 10px;
font-size: 13px;
font-weight: 600;
color: var(--dep-ink);
text-align: left;
}
.online-guide-card {
border: none;
border-radius: 16px;
padding: 20px 18px 16px;
background: #ffffff;
box-shadow: var(--dep-well-shadow);
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 10px;
min-width: 260px;
max-width: 320px;
text-align: left;
}
.online-guide-card__icon {
width: 44px;
height: 44px;
border-radius: 12px;
display: inline-flex;
align-items: center;
justify-content: center;
background: color-mix(in srgb, #07c160 12%, #fff);
img {
width: 28px;
height: 28px;
}
}
.online-guide-card__title {
margin: 0;
font-size: 14px;
font-weight: 600;
color: var(--dep-ink);
}
.online-guide-card__steps {
margin: 0;
padding-left: 18px;
font-size: 12px;
line-height: 1.7;
color: var(--dep-muted);
}
.online-guide-card__foot {
margin: 0;
font-size: 12px;
line-height: 1.5;
color: var(--dep-soft);
}
.voucher-qr-panel {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.voucher-qr-panel__tip {
margin: 0;
max-width: 240px;
font-size: 12px;
line-height: 1.5;
color: var(--dep-soft);
text-align: center;
}
.bank-remark-fields {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: 14px;
max-width: 420px;
}
.bank-field {
display: flex;
flex-direction: column;
gap: 6px;
}
.bank-field__label {
font-size: 12px;
line-height: 1.4;
color: var(--dep-soft);
}
.pay-name {
margin: 0;
font-size: 14px;
@ -728,6 +1307,56 @@ onMounted(async () => {
text-align: center;
}
.bank-card {
border: none;
border-radius: 16px;
padding: 18px 16px;
background: #ffffff;
box-shadow: var(--dep-well-shadow);
display: flex;
flex-direction: column;
gap: 12px;
min-width: 280px;
max-width: 360px;
text-align: left;
}
.bank-row {
display: grid;
grid-template-columns: 72px minmax(0, 1fr) auto;
gap: 8px;
align-items: start;
}
.bank-label {
font-size: 12px;
line-height: 1.5;
color: var(--dep-soft);
}
.bank-value {
font-size: 13px;
line-height: 1.5;
color: var(--dep-ink);
word-break: break-all;
}
.bank-value--mono {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
letter-spacing: 0.02em;
}
.bank-copy {
border: none;
background: transparent;
color: var(--app-primary-color);
font-size: 12px;
line-height: 1.5;
padding: 0;
cursor: pointer;
white-space: nowrap;
}
.qr-image {
border: none;
border-radius: 16px;
@ -766,6 +1395,48 @@ onMounted(async () => {
}
}
.form-block--wx-online {
display: flex;
flex-direction: column;
align-items: center;
}
.wx-online-panel {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 16px 20px 8px;
}
.wx-online-qr {
width: 220px;
height: 220px;
border-radius: 12px;
overflow: hidden;
box-shadow: var(--dep-well-shadow);
img {
width: 100%;
height: 100%;
display: block;
}
}
.wx-online-tip {
margin: 0;
font-size: 13px;
color: var(--dep-muted);
text-align: center;
}
.wx-online-no {
margin: 0;
font-size: 12px;
color: var(--dep-soft);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.qr-tip {
margin: 10px 0 0;
font-size: 13px;
@ -852,10 +1523,6 @@ onMounted(async () => {
}
@media (max-width: 900px) {
.deposit-page {
padding: 16px;
}
.deposit-card {
width: 100%;
padding: 18px 16px 16px;
@ -892,6 +1559,20 @@ onMounted(async () => {
</style>
<style lang="less">
/*
* 压过门户 `.layout-content--customer[data-v] .page-layout-root > [class*='-page']{padding:0!important}`。
* 必须写完整后代选择器;勿 `:global(.layout-content--customer) {…}` 以免打到壳层。
*/
.layout-content.layout-content--customer .page-layout-root > .deposit-page.deposit-page {
padding: 20px 24px !important;
}
@media (max-width: 900px) {
.layout-content.layout-content--customer .page-layout-root > .deposit-page.deposit-page {
padding: 16px !important;
}
}
.deposit-custom-amount-popover.arco-popover-popup-content {
padding: 8px !important;
border-radius: 10px;

View File

@ -11,6 +11,12 @@ import UnoCSS from 'unocss/vite';
import configArcoStyleImportPlugin from './config/plugin/arcoStyleImport';
import configCompressPlugin from './config/plugin/compress';
import { createDevSpaPathMatcher } from './config/devSpaRoutes';
import {
BCDSHIP_TEST_API,
DEPLOY_TARGETS,
resolveDeployTarget,
usesPrimaryTrackPath,
} from './src/config/deployTargets';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
@ -30,22 +36,25 @@ export default defineConfig(({ mode }) => {
const path = (req.originalUrl || req.url || '').split('?')[0] ?? '';
return spaMatcher.isSpaPath(path) ? '/index.html' : undefined;
};
// 开发默认打测试环境;可用 VITE_API_ORIGIN / VITE_OMS_ADMIN_URL 覆盖
// 开发默认打测试环境;可用 VITE_API_ORIGIN / VITE_OMS_ADMIN_URL 覆盖(域名见 deployTargets)
const omsAdminTarget = (
env.VITE_OMS_ADMIN_URL || env.VITE_API_ADMIN_URL || 'https://api.test.ideship.com/admin'
env.VITE_OMS_ADMIN_URL || env.VITE_API_ADMIN_URL || BCDSHIP_TEST_API.adminBase
).replace(/\/$/, '');
// API 根(itfx/track):优先 VITE_API_ORIGIN,否则从 Admin URL 去掉 /admin
const apiOrigin = (
env.VITE_API_ORIGIN ||
omsAdminTarget.replace(/\/admin\/?$/, '') ||
'https://api.test.ideship.com'
BCDSHIP_TEST_API.apiOrigin
).replace(/\/$/, '');
// ideship:PATHBASE=/track → /track/Track/Order/...
const cosProxyFallback =
DEPLOY_TARGETS.bcdship.cosOrigin || BCDSHIP_TEST_API.cosOrigin;
// 主站:PATHBASE=/track → /track/Track/Order/...
// nanafa:网关仍吃 /track/Track/Track/Order/...(前端历史双 Track)
// 下列服务挂在 /track 根下(不是 /Track/xxx 控制器),前端却写成 Track/xxx,需剥掉网关前缀
const deployTarget = resolveDeployTarget(env.VITE_DEPLOY_TARGET, {
prod: mode === 'production',
});
const trackUseSingleSegment =
String(env.VITE_DEPLOY_TARGET || '').toLowerCase() === 'ideship' ||
/ideship\.com/i.test(apiOrigin);
deployTarget === 'bcdship' || usesPrimaryTrackPath(apiOrigin);
const TRACK_SPA_SEGMENTS = [
'guide',
@ -126,7 +135,7 @@ export default defineConfig(({ mode }) => {
timeout: 30000,
proxyTimeout: 30000,
},
// Admin API:目标由 VITE_OMS_ADMIN_URL 决定(默认 https://api.test.ideship.com/admin)
// Admin API:目标由 VITE_OMS_ADMIN_URL 决定(默认见 deployTargets 测试网关)
'/rbac': {
target: omsAdminTarget,
changeOrigin: true,
@ -226,7 +235,7 @@ export default defineConfig(({ mode }) => {
// 必须走 https:自定义域 http 会 302 到 https,浏览器跟随后因证书主机名不匹配,img 直接空白。
// secure:false 让代理忽略该证书,页面只请求 localhost。
'/__cos__': {
target: 'https://cos.ideship.com',
target: cosProxyFallback,
changeOrigin: true,
secure: false,
xfwd: false,
@ -235,7 +244,7 @@ export default defineConfig(({ mode }) => {
router: (req) => {
const raw = String(req.originalUrl || req.url || '').split('?')[0];
const host = raw.replace(/^\/__cos__\//, '').split('/')[0];
return host ? `https://${host}` : 'https://cos.ideship.com';
return host ? `https://${host}` : cosProxyFallback;
},
rewrite: (path) => path.replace(/^\/__cos__\/[^/]+/, '') || '/',
configure: (proxy) => {

View File

@ -9,7 +9,8 @@ from pathlib import Path
@dataclass
class AgentSettings:
oms_url: str = "https://api.test.ideship.com/admin"
# 默认对齐前端 deployTargets 测试 Admin;可用本地配置覆盖
oms_url: str = "https://api.test.bcdship.com/admin"
token: str = ""
device_name: str = ""
bridge_port: int = 9333

View File

@ -110,7 +110,7 @@ class LicenseConfig:
class OmsConfig:
"""OMS 物流查价 API(POST /order/price-check)。"""
api_base_url: str = "https://api.test.ideship.com/admin"
api_base_url: str = "https://api.test.bcdship.com/admin"
timeout_sec: int = 30
auth_token: str = ""
contact_name: str = ""