fix: 取消this.$i18n.locale的用法

This commit is contained in:
hzj 2026-05-20 14:15:51 +08:00
parent 128458f341
commit ed762c7613
2 changed files with 20 additions and 8 deletions

View File

@ -42,9 +42,9 @@
<el-tag v-else-if="order.details.env === 'TEST'" type="warning" size="mini">{{ order.details.env }}</el-tag> <el-tag v-else-if="order.details.env === 'TEST'" type="warning" size="mini">{{ order.details.env }}</el-tag>
<el-tag v-else type="danger" size="mini">{{ order.details.env }}</el-tag> <el-tag v-else type="danger" size="mini">{{ order.details.env }}</el-tag>
</div> </div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.type') }}: {{ orderReceiptTypeMap[order.details.receiptType] }}</div> <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.type') }}: {{ getReceiptTypeLabel(order.details.receiptType) }}</div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.status') }}: <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.status') }}:
<el-tag :type="orderStatusMap[order.details.status].tagType" size="mini">{{ orderStatusMap[order.details.status].label }}</el-tag> <el-tag :type="getOrderStatus(order.details.status).tagType" size="mini">{{ getOrderStatus(order.details.status).label }}</el-tag>
</div> </div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.id') }}: {{ order.details.id }}</div> <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.id') }}: {{ order.details.id }}</div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.trackId') }}: {{ order.details.trackId }}</div> <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.trackId') }}: {{ order.details.trackId }}</div>
@ -52,8 +52,8 @@
<div class="order-info-col" :span="24">{{ $t('pages.inAppPurchaseDetails.label.orderId') }}: {{ order.details.orderId }}</div> <div class="order-info-col" :span="24">{{ $t('pages.inAppPurchaseDetails.label.orderId') }}: {{ order.details.orderId }}</div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.platformChannel') }}: <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.platformChannel') }}:
<sys-origin-icon size="20px" :icon="order.details.sysOrigin" :desc="order.details.sysOrigin" /> <sys-origin-icon size="20px" :icon="order.details.sysOrigin" :desc="order.details.sysOrigin" />
<platform-svg-icon size="20px" :icon="order.details.factory.platform" /> <platform-svg-icon size="20px" :icon="getOrderFactory(order.details).platform" />
<platform-svg-icon size="20px" :icon="order.details.factory.factoryCode" /> <platform-svg-icon size="20px" :icon="getOrderFactory(order.details).factoryCode" />
</div> </div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.countryCode') }}: {{ order.details.countryCode }}</div> <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.countryCode') }}: {{ order.details.countryCode }}</div>
<div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.currency') }}: {{ order.details.currency }}</div> <div class="order-info-col">{{ $t('pages.inAppPurchaseDetails.label.currency') }}: {{ order.details.currency }}</div>
@ -73,7 +73,7 @@
<div class="blockquote">{{ $t('pages.inAppPurchaseDetails.section.statusFlow') }}</div> <div class="blockquote">{{ $t('pages.inAppPurchaseDetails.section.statusFlow') }}</div>
<div class="content"> <div class="content">
<el-steps align-center :space="200" :active="order.details.statusSteps.length" finish-status="success" style="margin: 10px 0px;"> <el-steps align-center :space="200" :active="order.details.statusSteps.length" finish-status="success" style="margin: 10px 0px;">
<el-step v-for="(item, index) in order.details.statusSteps" :key="index" :title="orderStatusMap[item.status].label" :description="item.createTime" /> <el-step v-for="(item, index) in order.details.statusSteps" :key="index" :title="getOrderStatus(item.status).label" :description="item.createTime" />
</el-steps> </el-steps>
</div> </div>
</div> </div>
@ -168,7 +168,7 @@ export default {
}, },
computed: { computed: {
orderReceiptTypeMap() { orderReceiptTypeMap() {
const locale = this.$i18n.locale const locale = this.$locale
void locale void locale
return { return {
PAYMENT: this.$t('pages.inAppPurchaseDetails.receiptType.payment'), PAYMENT: this.$t('pages.inAppPurchaseDetails.receiptType.payment'),
@ -176,7 +176,7 @@ export default {
} }
}, },
orderStatusMap() { orderStatusMap() {
const locale = this.$i18n.locale const locale = this.$locale
void locale void locale
return { return {
CREATE: { CREATE: {
@ -231,6 +231,18 @@ export default {
handleClose() { handleClose() {
this.$emit('close') this.$emit('close')
}, },
getReceiptTypeLabel(receiptType) {
return this.orderReceiptTypeMap[receiptType] || receiptType || '-'
},
getOrderStatus(status) {
return this.orderStatusMap[status] || {
label: status || '-',
tagType: 'info'
}
},
getOrderFactory(details) {
return (details && details.factory) || {}
},
loadInAppPurchase() { loadInAppPurchase() {
const that = this const that = this
that.orderLoading = true that.orderLoading = true

View File

@ -503,7 +503,7 @@ export default {
}, },
computed: { computed: {
badgeRestaurants() { badgeRestaurants() {
const locale = this.$i18n.locale const locale = this.$locale
void locale void locale
return [{ value: '0', label: this.$t('pages.gameLotteryConfigForm.word.permanent') }] return [{ value: '0', label: this.$t('pages.gameLotteryConfigForm.word.permanent') }]
}, },