Browse Source

feat(i18n): 国际化客户钱包页面和错误消息

- 将客户钱包页面中的硬编码文本替换为国际化键
- 为钱包明细导出功能添加新的国际化条目
- 统一错误消息使用国际化文本
- 更新地区钱包名称显示以支持多语言
jiangcheng/feature-20260306102603-钱包体系
zhangrenyuan 1 month ago
parent
commit
14d367ce90
  1. 30
      src/components/locales/lang/en.js
  2. 29
      src/components/locales/lang/zh-CN.js
  3. 2
      src/views/usergold/gold/clientCountBalance.vue
  4. 130
      src/views/usergold/gold/clientCountWallet.vue

30
src/components/locales/lang/en.js

@ -88,6 +88,7 @@ export default {
searchButton: "Search",
exportExcel: "Export Excel",
viewExportList: "Export List",
exportCompanyWalletDetail: "Export Company Wallet Detail",
reset: "Reset",
audit: "Audit",
refund: "Refund",
@ -143,6 +144,8 @@ export default {
taskGold: "Task Coins",
SGD: "SGD",
goldCoin: "Coins",
recharge: "Recharge",
consume: "Consume",
: "items",
: "",
goldBean: "Beans",
@ -401,6 +404,9 @@ export default {
activityLoadFailed: "Activity load failed",
activityDataLoadFailed: "Activity data error",
getDataFailed: "Get data failed",
exportWalletDetailError: "Export wallet detail error",
selectCompanyWallet: "Please select company wallet",
getDetailFailed: "Get detail failed",
// Permission
noPermissionText: "No permission, contact admin",
permissionPrompt: "Permission Prompt",
@ -428,6 +434,9 @@ export default {
name: "Name",
jwcode: "Homily ID",
market: "Region",
hongKong: "Hong Kong",
companyWallet: "Company Wallet",
companyWalletPlaceholder: "Select Company Wallet",
position: "Position",
roleName: "Role",
departmentPermission: "Dept Perm",
@ -913,10 +922,31 @@ export default {
clientCountDetail: "Coin Details",
// 客户钱包 ---------------------------------
clientCountWallet: "Wallet",
wallet: "Wallet",
user: "User",
recharge: "Recharge",
consume: "Consume",
refund: "Refund",
other: "Other",
currentBalance: "Current Balance",
transactionType: "Type",
transactionDesc: "Desc",
transactionOrderNo: "Order No.",
transactionStatus: "Status",
exceptionData: "Exception Data",
time: "Time",
market: {
hkGold: "Hong Kong",
sgHcGold: "Singapore HC",
sgCmGold: "Singapore CM",
myGold: "Malaysia",
sgGold: "Singapore",
caGold: "Canada",
thHsGold: "Thailand HS",
thHaGold: "Thailand HA",
vnGold: "Vietnam",
bjGold: "Beijing",
},
type: {
recharge: "Recharge",
consume: "Consume",

29
src/components/locales/lang/zh-CN.js

@ -88,6 +88,7 @@ export default {
searchButton: "查询",
exportExcel: "导出Excel",
viewExportList: "查看导出列表",
exportCompanyWalletDetail: "导出公司钱包明细",
reset: "重置",
audit: "审核",
refund: "退款",
@ -143,6 +144,8 @@ export default {
taskGold: "任务金币",
SGD: "新币",
goldCoin: "金币",
recharge: "充值",
consume: "消耗",
: "条",
: "个",
goldBean: "金豆",
@ -401,6 +404,8 @@ export default {
activityLoadFailed: "活动列表加载失败,请稍后重试",
activityDataLoadFailed: "活动数据加载异常,请稍后重试",
getDataFailed: "获取数据失败",
exportWalletDetailError: "导出钱包明细出错",
selectCompanyWallet: "请选择公司钱包",
// 权限
noPermissionText: "您暂无该页面操作权限,请联系管理员",
permissionPrompt: "权限提示",
@ -428,6 +433,9 @@ export default {
name: "姓名",
jwcode: "精网号",
market: "所属地区",
hongKong: "香港",
companyWallet: "公司钱包",
companyWalletPlaceholder: "请选择公司钱包",
position: "职位",
roleName: "角色名称",
departmentPermission: "部门权限",
@ -920,10 +928,31 @@ export default {
clientCountDetail: "金币明细",
// 客户钱包 ---------------------------------
clientCountWallet: "钱包",
wallet: "钱包",
user: "用户",
recharge: "充值",
consume: "消耗",
refund: "退款",
other: "其他",
currentBalance: "当前余额",
transactionType: "交易类型",
transactionDesc: "交易说明",
transactionOrderNo: "交易单号",
transactionStatus: "交易状态",
exceptionData: "异常数据",
time: "时间",
market: {
hkGold: "香港",
sgHcGold: "新加坡HC",
sgCmGold: "新加坡CM",
myGold: "马来西亚",
sgGold: "新加坡",
caGold: "加拿大",
thHsGold: "泰国HS",
thHaGold: "泰国HA",
vnGold: "越南",
bjGold: "北京",
},
type: {
recharge: "充值",
consume: "消耗",

2
src/views/usergold/gold/clientCountBalance.vue

@ -582,7 +582,7 @@ const handleMouseLeave = () => {
>
<div class="popover-content" v-if="popoverData">
<div class="popover-header">
<span class="header-title">永久金币</span>
<span class="header-title">{{ $t('common.permanentGold') }}</span>
<span class="header-amount">{{ popoverData.currentPermanentGold || 0 }}</span>
</div>
<div class="popover-list">

130
src/views/usergold/gold/clientCountWallet.vue

@ -158,7 +158,7 @@ const get = async function (val) {
});
total.value = result.data.size;
} else {
ElMessage.error(result.msg || '获取数据失败');
ElMessage.error(result.msg || t('elmessage.getDataFailed'));
}
} catch (error) {
console.log('请求失败', error)
@ -194,27 +194,27 @@ const cellClick = function (row, column) {
console.log('cellClick', column)
const walletId = propToWalletId[column.property];
const propToMarketName = {
hkGold: '香港',
sgHcGold: '新加坡HC',
myGold: '马来西亚',
sgGold: '新加坡',
caGold: '加拿大',
thHsGold: '泰国HS',
thHaGold: '泰国HA',
vnGold: '越南',
bjGold: '北京'
}
const marketName = propToMarketName[column.property]
if (marketName && walletId) {
currentWalletInfo.value = {
userName: row.name,
jwcode: row.jwcode,
marketName: row.market, //
walletName: marketName + '钱包', //
currentBalance: row[column.property] || 0,
walletId: walletId
}
hkGold: t('clientCount.market.hkGold'),
sgHcGold: t('clientCount.market.sgHcGold'),
myGold: t('clientCount.market.myGold'),
sgGold: t('clientCount.market.sgGold'),
caGold: t('clientCount.market.caGold'),
thHsGold: t('clientCount.market.thHsGold'),
thHaGold: t('clientCount.market.thHaGold'),
vnGold: t('clientCount.market.vnGold'),
bjGold: t('clientCount.market.bjGold')
}
const marketName = propToMarketName[column.property]
if (marketName && walletId) {
currentWalletInfo.value = {
userName: row.name,
jwcode: row.jwcode,
marketName: row.market, //
walletName: marketName + t('clientCount.wallet'), //
currentBalance: row[column.property] || 0,
walletId: walletId
}
walletDetailQuery.value.pageNum = 1
getWalletDetail()
walletDetailVisible.value = true
@ -253,7 +253,7 @@ const getWalletDetail = async () => {
if (result.code === 200) {
walletDetailList.value = result.data.list.map(item => ({
time: item.createTime,
type: item.type === 0 ? '充值' : '消耗',
type: item.type === 0 ? t('common.recharge') : t('common.consume'),
amount: item.type === 1 ? -Math.abs(item.amount) : Math.abs(item.amount),
desc: item.description,
orderNo: item.orderCode,
@ -261,7 +261,7 @@ const getWalletDetail = async () => {
}))
walletDetailTotal.value = result.data.total
} else {
ElMessage.error(result.msg || '获取明细失败')
ElMessage.error(result.msg || t('elmessage.getDetailFailed'))
}
} catch (error) {
console.error(error)
@ -328,7 +328,7 @@ const exportExcel = async function () {
ElMessage.success(t('elmessage.exportSuccess'))
//
} else {
ElMessage.error(res.msg || '导出失败')
ElMessage.error(res.msg || t('elmessage.exportFailed'))
}
}
@ -351,11 +351,11 @@ const exportWalletDetail = async () => {
if (res.code === 200) {
ElMessage.success(t('elmessage.exportSuccess'))
} else {
ElMessage.error(res.msg || '导出失败')
ElMessage.error(res.msg || t('elmessage.exportFailed'))
}
} catch (error) {
console.error('导出钱包明细出错:', error)
ElMessage.error('导出钱包明细出错')
ElMessage.error(t('elmessage.exportWalletDetailError'))
}
}
@ -364,7 +364,7 @@ const selectWallet = async function () {
}
const exportExcelOnlyOne = async function () {
if (!selectWalletForm.value.companyWalletId) {
ElMessage.error('请选择公司钱包')
ElMessage.error(t('elmessage.selectCompanyWallet'))
return
}
@ -388,11 +388,11 @@ const exportExcelOnlyOne = async function () {
ElMessage.success(t('elmessage.exportSuccess'))
openExportList() //
} else {
ElMessage.error(res.msg || '导出失败')
ElMessage.error(res.msg || t('elmessage.exportFailed'))
}
} catch (error) {
console.error('导出失败:', error)
ElMessage.error('导出失败')
ElMessage.error(t('elmessage.exportFailed'))
} finally {
selectWalletVisible.value = false
}
@ -404,7 +404,7 @@ const selectWalletVisible = ref(false)
const selectWalletFormRef = ref(null)
const selectWalletRules = {
companyWalletId: [
{ required: true, message: '请选择公司钱包', trigger: 'change' }
{ required: true, message: t('common_list.companyWalletPlaceholder'), trigger: 'change' }
]
}
//
@ -419,39 +419,39 @@ const selectWalletForm = ref({})
const companyWalletList = ref([
{
id: 1,
name: '香港钱包'
name: t('clientCount.market.hkGold') + t('clientCount.wallet')
},
{
id: 2,
name: '新加坡HC'
name: t('clientCount.market.sgHcGold')
},
{
id: 3,
name: '马来西亚'
name: t('clientCount.market.myGold')
},
{
id: 4,
name: '新加坡CM'
name: t('clientCount.market.sgCmGold')
},
{
id: 5,
name: '加拿大'
name: t('clientCount.market.caGold')
},
{
id: 6,
name: '泰国HS'
name: t('clientCount.market.thHsGold')
},
{
id: 7,
name: '泰国HA'
name: t('clientCount.market.thHaGold')
},
{
id: 8,
name: '越南'
name: t('clientCount.market.vnGold')
},
{
id: 9,
name: '北京'
name: t('clientCount.market.bjGold')
}
])
//
@ -600,7 +600,7 @@ const format3 = (num) => {
<el-button type="primary" @click="search()">{{ $t('common.search') }}</el-button>
<el-button @click="reset" type="success">{{ $t('common.reset') }}</el-button>
<el-button type="primary" @click="exportExcel()">{{ $t('common.exportExcel') }}</el-button>
<el-button type="primary" @click="selectWallet()">导出公司钱包明细</el-button>
<el-button type="primary" @click="selectWallet()">{{ $t('common.exportCompanyWalletDetail') }}</el-button>
<el-button type="primary" @click="openExportList">{{ $t('common.viewExportList') }}</el-button>
</div>
<!-- </div> -->
@ -618,49 +618,49 @@ const format3 = (num) => {
</template>
</el-table-column>
<el-table-column prop="name" :label="$t('common_list.name')" width="140" />
<el-table-column prop="jwcode" :label="$t('common_list.jwcode')" width="160" />
<el-table-column prop="jwcode" :label="$t('common_list.jwcode')" width="140" />
<el-table-column prop="market" :label="$t('common_list.market')" width="140" />
<el-table-column prop="hkGold" label="香港" sortable="custom" min-width="120">
<el-table-column prop="hkGold" :label="$t('clientCount.market.hkGold')" sortable="custom" min-width="140">
<template #default="scope">
<span>{{ (scope.row.hkGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="sgHcGold" label="新加坡HC" sortable="custom" min-width="120">
<el-table-column prop="sgHcGold" :label="$t('clientCount.market.sgHcGold')" sortable="custom" min-width="150">
<template #default="scope">
<span>{{ (scope.row.sgHcGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="myGold" label="马来西亚" sortable="custom" min-width="120">
<el-table-column prop="myGold" :label="$t('clientCount.market.myGold')" sortable="custom" min-width="120">
<template #default="scope">
<span>{{ (scope.row.myGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="sgGold" label="新加坡" sortable="custom" min-width="120">
<el-table-column prop="sgGold" :label="$t('clientCount.market.sgGold')" sortable="custom" min-width="120">
<template #default="scope">
<span>{{ (scope.row.sgGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="caGold" label="加拿大" sortable="custom" min-width="120">
<el-table-column prop="caGold" :label="$t('clientCount.market.caGold')" sortable="custom" min-width="120">
<template #default="scope">
<span>{{ (scope.row.caGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="thHsGold" label="泰国HS" sortable="custom" min-width="120">
<el-table-column prop="thHsGold" :label="$t('clientCount.market.thHsGold')" sortable="custom" min-width="140">
<template #default="scope">
<span>{{ (scope.row.thHsGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="thHaGold" label="泰国HA" sortable="custom" min-width="120">
<el-table-column prop="thHaGold" :label="$t('clientCount.market.thHaGold')" sortable="custom" min-width="140">
<template #default="scope">
<span>{{ (scope.row.thHaGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="vnGold" label="越南" sortable="custom" min-width="120">
<el-table-column prop="vnGold" :label="$t('clientCount.market.vnGold')" sortable="custom" min-width="120">
<template #default="scope">
<span>{{ (scope.row.vnGold || 0) }}</span>
</template>
</el-table-column>
<el-table-column prop="bjGold" label="北京" sortable="custom" min-width="120">
<el-table-column prop="bjGold" :label="$t('clientCount.market.bjGold')" sortable="custom" min-width="120">
<template #default="scope">
<span>{{ (scope.row.bjGold || 0) }}</span>
</template>
@ -707,15 +707,15 @@ const format3 = (num) => {
<el-dialog v-model="selectWalletVisible" width="30%" top="20%" :before-close="closeSelectWallet">
<el-form :model="selectWalletForm" :rules="selectWalletRules" ref="selectWalletFormRef" label-width="120px">
<el-form-item label="公司钱包" prop="companyWalletId" style="margin-top: 30px;">
<el-select v-model="selectWalletForm.companyWalletId" placeholder="请选择公司钱包" style="width: 80%;">
<el-form-item :label="$t('common_list.companyWallet')" prop="companyWalletId" style="margin-top: 30px;">
<el-select v-model="selectWalletForm.companyWalletId" :placeholder="$t('common_list.companyWalletPlaceholder')" style="width: 80%;">
<el-option v-for="item in companyWalletList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div style="display: flex; justify-content: flex-end;">
<el-button type="primary" @click="exportExcelOnlyOne()">确定</el-button>
<el-button type="primary" @click="exportExcelOnlyOne()">{{ $t('common.confirm') }}</el-button>
</div>
</template>
</el-dialog>
@ -724,32 +724,32 @@ const format3 = (num) => {
<template #header>
<div class="wallet-detail-header" style="display: flex; gap: 40px; justify-content: space-between; align-items: center; font-size: 16px;">
<span style="font-weight: bold; color: #F56C6C;">* {{ currentWalletInfo.walletName }}</span>
<span><span style="color: #F56C6C;">*</span> 用户: {{ currentWalletInfo.userName }} (ID: {{ currentWalletInfo.jwcode }})</span>
<span><span style="color: #F56C6C;">*</span> 地区: {{ currentWalletInfo.marketName }}</span>
<span><span style="color: #F56C6C;">*</span> {{ $t('clientCount.user') }}: {{ currentWalletInfo.userName }} (ID: {{ currentWalletInfo.jwcode }})</span>
<span><span style="color: #F56C6C;">*</span> {{ $t('common.market') }}: {{ currentWalletInfo.marketName }}</span>
</div>
<div style="margin-top: 15px; font-size: 16px;">
<span style="color: #F56C6C; font-weight: bold;">* 当前余额: {{ format3(currentWalletInfo.currentBalance || 0) }} 金币</span>
<span style="color: #F56C6C; font-weight: bold;">* {{ $t('clientCount.currentBalance') }}: {{ format3(currentWalletInfo.currentBalance || 0) }} {{ $t('common.goldCoin') }}</span>
</div>
</template>
<el-table :data="walletDetailList" v-loading="walletDetailLoading" style="width: 100%; height: 50vh; overflow-y: auto;" border stripe>
<el-table-column prop="time" label="时间" align="center" width="180">
<el-table-column prop="time" :label="$t('clientCount.time')" align="center" width="180">
<template #default="scope">{{ scope.row.time }}</template>
</el-table-column>
<el-table-column prop="type" label="交易类型" align="center" width="120" />
<el-table-column prop="amount" label="金额" align="center" width="120">
<el-table-column prop="type" :label="$t('clientCount.transactionType')" align="center" width="120" />
<el-table-column prop="amount" :label="$t('common_list.money')" align="center" width="120">
<template #default="scope">
<span :style="{ color: scope.row.amount >= 0 ? '#67C23A' : '#F56C6C', fontWeight: 'bold' }">
{{ scope.row.amount > 0 ? '+' + format3(scope.row.amount) : format3(scope.row.amount) }}
</span>
</template>
</el-table-column>
<el-table-column prop="desc" label="交易说明" align="center" />
<el-table-column prop="orderNo" label="交易单号" align="center" width="220" />
<el-table-column prop="status" label="交易状态" align="center" width="220" fixed="right">
<el-table-column prop="desc" :label="$t('clientCount.transactionDesc')" align="center" />
<el-table-column prop="orderNo" :label="$t('clientCount.transactionOrderNo')" align="center" width="220" />
<el-table-column prop="status" :label="$t('clientCount.transactionStatus')" align="center" width="220" fixed="right">
<template #default="scope">
<el-tag :type="scope.row.status === 1 ? 'success' : scope.row.status === 2 ? 'danger' : 'info'" :effect="scope.row.status === 1 ? 'light' : 'plain'">
{{ scope.row.status === 1 ? '正常' : scope.row.status === 2 ? '已退款' : '异常数据' }}
{{ scope.row.status === 1 ? $t('common.normal') : scope.row.status === 2 ? $t('common_list.refunded') : $t('clientCount.exceptionData') }}
</el-tag>
</template>
</el-table-column>
@ -852,4 +852,4 @@ const format3 = (num) => {
margin-right: 20px;
}
}
</style>
</style>
Loading…
Cancel
Save