diff --git a/src/mobile/views/aggregate/index.vue b/src/mobile/views/aggregate/index.vue index d523351..a19de92 100644 --- a/src/mobile/views/aggregate/index.vue +++ b/src/mobile/views/aggregate/index.vue @@ -41,7 +41,7 @@ const paid = computed(() => order.value.status === 'paid') /** * 根据 UA 识别收银场景 */ -function detectScene(): string { +function detectClientEnv(): string { const ua = navigator.userAgent.toLowerCase() if (ua.includes('micromessenger')) { return 'wechat_pay' @@ -59,14 +59,14 @@ function detectScene(): string { /** * 场景展示名 */ -function sceneLabel(scene: string) { - if (scene === 'alipay') { - return t('aggregate.scene.alipay') +function clientEnvLabel(clientEnv: string) { + if (clientEnv === 'alipay') { + return t('aggregate.clientEnv.alipay') } - if (scene === 'union_pay') { - return t('aggregate.scene.union') + if (clientEnv === 'union_pay') { + return t('aggregate.clientEnv.union') } - return t('aggregate.scene.wechat') + return t('aggregate.clientEnv.wechat') } onMounted(async () => { @@ -123,10 +123,10 @@ async function doPay() { } paying.value = true try { - const scene = detectScene() + const clientEnv = detectClientEnv() payResult.value = await aggregatePay({ orderNo, - scene, + clientEnv, device: 'mobile', }) // 同步成功 @@ -216,7 +216,7 @@ function redirectIfNeeded() {
{{ t('aggregate.countdown') }}: {{ countdown }}
-
{{ t('aggregate.sceneLabel') }}: {{ sceneLabel(detectScene()) }}
+
{{ t('aggregate.clientEnvLabel') }}: {{ clientEnvLabel(detectClientEnv()) }}
diff --git a/src/pc/views/aggregate/Index.vue b/src/pc/views/aggregate/Index.vue index b6cece9..0e1c788 100644 --- a/src/pc/views/aggregate/Index.vue +++ b/src/pc/views/aggregate/Index.vue @@ -29,7 +29,7 @@ const amountYuan = computed(() => { const paid = computed(() => order.value.status === 'paid') -function detectScene(): string { +function detectClientEnv(): string { const ua = navigator.userAgent.toLowerCase() if (ua.includes('micromessenger')) { return 'wechat_pay' @@ -78,7 +78,7 @@ async function doPay() { try { payResult.value = await aggregatePay({ orderNo, - scene: detectScene(), + clientEnv: detectClientEnv(), device: 'pc', }) if (payResult.value?.status === 'success') { diff --git a/src/shared/api/gateway.ts b/src/shared/api/gateway.ts index e9ec5de..aa179e3 100644 --- a/src/shared/api/gateway.ts +++ b/src/shared/api/gateway.ts @@ -50,7 +50,7 @@ export function getGatewayOrder(orderNo: string): Promise { /** 聚合扫码发起支付 */ export function aggregatePay(data: { orderNo: string - scene: string + clientEnv: string openId?: string device?: string clientIp?: string diff --git a/src/shared/locales/en-US/aggregate.json b/src/shared/locales/en-US/aggregate.json index 6cf39fe..9ad72c4 100644 --- a/src/shared/locales/en-US/aggregate.json +++ b/src/shared/locales/en-US/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "Aggregate Pay", "orderNo": "Order No", "countdown": "Time left", - "sceneLabel": "Scene", - "scene": { + "clientEnvLabel": "Scene", + "clientEnv": { "wechat": "WeChat", "alipay": "Alipay", "union": "UnionPay" diff --git a/src/shared/locales/id-ID/aggregate.json b/src/shared/locales/id-ID/aggregate.json index 1cc3757..daa3707 100644 --- a/src/shared/locales/id-ID/aggregate.json +++ b/src/shared/locales/id-ID/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "Pembayaran Agregat", "orderNo": "Nomor Pesanan", "countdown": "Waktu tersisa", - "sceneLabel": "Pemandangan", - "scene": { + "clientEnvLabel": "Pemandangan", + "clientEnv": { "wechat": "Wechat wechat", "alipay": "Alipay", "union": "UnionPay" diff --git a/src/shared/locales/ja-JP/aggregate.json b/src/shared/locales/ja-JP/aggregate.json index 3e02f17..3201147 100644 --- a/src/shared/locales/ja-JP/aggregate.json +++ b/src/shared/locales/ja-JP/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "総支払額", "orderNo": "注文番号", "countdown": "残り時間", - "sceneLabel": "シーン", - "scene": { + "clientEnvLabel": "シーン", + "clientEnv": { "wechat": "微信", "alipay": "アリペイ", "union": "銀聯" diff --git a/src/shared/locales/ko-KR/aggregate.json b/src/shared/locales/ko-KR/aggregate.json index 51015b1..47ec261 100644 --- a/src/shared/locales/ko-KR/aggregate.json +++ b/src/shared/locales/ko-KR/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "총액지불", "orderNo": "주문 번호", "countdown": "남은 시간", - "sceneLabel": "장면", - "scene": { + "clientEnvLabel": "장면", + "clientEnv": { "wechat": "위챗", "alipay": "알리페이", "union": "유니온페이" diff --git a/src/shared/locales/ms-MY/aggregate.json b/src/shared/locales/ms-MY/aggregate.json index 4201cd5..5e37fad 100644 --- a/src/shared/locales/ms-MY/aggregate.json +++ b/src/shared/locales/ms-MY/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "Bayaran Agregat", "orderNo": "Pesanan No", "countdown": "Masa yang tinggal", - "sceneLabel": "tempat kejadian", - "scene": { + "clientEnvLabel": "tempat kejadian", + "clientEnv": { "wechat": "WeChat", "alipay": "Alipay", "union": "UnionPay" diff --git a/src/shared/locales/th-TH/aggregate.json b/src/shared/locales/th-TH/aggregate.json index 107947e..7b8dd1c 100644 --- a/src/shared/locales/th-TH/aggregate.json +++ b/src/shared/locales/th-TH/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "จ่ายเงินรวม", "orderNo": "หมายเลขคำสั่งซื้อ", "countdown": "เหลือเวลา", - "sceneLabel": "ฉาก", - "scene": { + "clientEnvLabel": "ฉาก", + "clientEnv": { "wechat": "วีแชท", "alipay": "อาลีเพย์", "union": "ยูเนี่ยนเพย์" diff --git a/src/shared/locales/vi-VN/aggregate.json b/src/shared/locales/vi-VN/aggregate.json index 837dfa3..56ef14a 100644 --- a/src/shared/locales/vi-VN/aggregate.json +++ b/src/shared/locales/vi-VN/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "Tổng lương", "orderNo": "Số thứ tự", "countdown": "Thời gian còn lại", - "sceneLabel": "Bối cảnh", - "scene": { + "clientEnvLabel": "Bối cảnh", + "clientEnv": { "wechat": "WeChat", "alipay": "Alipay", "union": "UnionPay" diff --git a/src/shared/locales/zh-CN/aggregate.json b/src/shared/locales/zh-CN/aggregate.json index 7dcc029..a45b3c4 100644 --- a/src/shared/locales/zh-CN/aggregate.json +++ b/src/shared/locales/zh-CN/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "聚合支付", "orderNo": "订单号", "countdown": "剩余时间", - "sceneLabel": "支付环境", - "scene": { + "clientEnvLabel": "支付环境", + "clientEnv": { "wechat": "微信", "alipay": "支付宝", "union": "云闪付" diff --git a/src/shared/locales/zh-HK/aggregate.json b/src/shared/locales/zh-HK/aggregate.json index 656267a..4913bcc 100644 --- a/src/shared/locales/zh-HK/aggregate.json +++ b/src/shared/locales/zh-HK/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "聚合支付", "orderNo": "訂單號", "countdown": "剩餘時間", - "sceneLabel": "支付環境", - "scene": { + "clientEnvLabel": "支付環境", + "clientEnv": { "wechat": "微信", "alipay": "支付寶", "union": "雲閃付" diff --git a/src/shared/locales/zh-TW/aggregate.json b/src/shared/locales/zh-TW/aggregate.json index 85e6650..df3dfb2 100644 --- a/src/shared/locales/zh-TW/aggregate.json +++ b/src/shared/locales/zh-TW/aggregate.json @@ -2,8 +2,8 @@ "defaultTitle": "聚合支付", "orderNo": "訂單號", "countdown": "剩餘時間", - "sceneLabel": "支付環境", - "scene": { + "clientEnvLabel": "支付環境", + "clientEnv": { "wechat": "微信", "alipay": "支付寶", "union": "雲閃付"