feat:国际化多语言适配

This commit is contained in:
2025-10-29 15:48:40 +08:00
parent 985d739324
commit 3d67dc928d
41 changed files with 2636 additions and 2801 deletions
+11 -5
View File
@@ -1,6 +1,6 @@
<template>
<view class="waiting-container">
<view class="title">设备弹出中请稍候</view>
<view class="title">{{ $t('waiting.title') }}</view>
<view class="progress-wrapper">
<view class="progress-circle">
<view class="progress-left">
@@ -11,12 +11,12 @@
</view>
<view class="progress-inner">
<text class="percent">{{ progress }}%</text>
<text class="hint">正在为您弹出设备</text>
<text class="hint">{{ $t('waiting.preparing') }}</text>
</view>
</view>
</view>
<view class="desc">若长时间未弹出请联系现场工作人员或稍后重试</view>
<view class="desc">{{ $t('waiting.longTimeNotice') }}</view>
</view>
</template>
@@ -24,6 +24,9 @@
import { ref, onMounted, onUnmounted } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getOrderByOrderNoScorePayStatus, cancelOrder } from '@/config/api/order.js'
import { useI18n } from '@/utils/i18n.js'
const { t: $t } = useI18n()
const progress = ref(0)
const leftRotateDeg = ref(0)
@@ -83,7 +86,7 @@
await cancelOrder({ orderId: orderNo.value })
}
} catch (e) {}
uni.showToast({ title: '设备租借失败,订单已取消', icon: 'none' })
uni.showToast({ title: $t('waiting.rentFailed'), icon: 'none' })
setTimeout(() => {
uni.switchTab({ url: '/pages/index/index' })
}, 800)
@@ -111,7 +114,7 @@
// 超时保护:例如 60 秒
timeoutTimer = setTimeout(() => {
stopAllTimers()
uni.showToast({ title: '等待超时,请稍后重试', icon: 'none' })
uni.showToast({ title: $t('waiting.timeout'), icon: 'none' })
setTimeout(() => {
uni.switchTab({ url: '/pages/index/index' })
}, 800)
@@ -119,6 +122,9 @@
}
onLoad((query) => {
uni.setNavigationBarTitle({
title: $t('waiting.title')
})
if (query && query.orderNo) {
orderNo.value = query.orderNo
}