feat: 添加银行卡管理功能,更新多语言支持,优化表单验证和用户界面
This commit is contained in:
@@ -24,7 +24,7 @@ async function handleCardOptions(card: any) {
|
||||
header: card.bankName,
|
||||
buttons: [
|
||||
{
|
||||
text: card.isDefault ? "默认银行卡" : "设为默认",
|
||||
text: card.isDefault ? t("bankCard.list.defaultCard") : t("bankCard.list.setDefault"),
|
||||
handler: () => {
|
||||
if (!card.isDefault) {
|
||||
handleSetDefault(card);
|
||||
@@ -32,20 +32,20 @@ async function handleCardOptions(card: any) {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "编辑",
|
||||
text: t("bankCard.list.edit"),
|
||||
handler: () => {
|
||||
router.push(`/trade-settings/bank-management/edit/${card.id}`);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "删除",
|
||||
text: t("bankCard.list.delete"),
|
||||
role: "destructive",
|
||||
handler: () => {
|
||||
handleDeleteCard(card);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "取消",
|
||||
text: t("bankCard.list.cancel"),
|
||||
role: "cancel",
|
||||
},
|
||||
],
|
||||
@@ -58,7 +58,7 @@ async function handleCardOptions(card: any) {
|
||||
async function handleSetDefault(card: any) {
|
||||
await safeClient(() => client.api.bank_account({ id: card.id }).set_default.post());
|
||||
const toast = await toastController.create({
|
||||
message: "已设置为默认银行卡",
|
||||
message: t("bankCard.messages.setDefaultSuccess"),
|
||||
duration: 2000,
|
||||
position: "bottom",
|
||||
color: "success",
|
||||
@@ -84,7 +84,7 @@ async function handleDeleteCard(card: any) {
|
||||
handler: async () => {
|
||||
await safeClient(() => client.api.bank_account({ id: card.id }).delete());
|
||||
const toast = await toastController.create({
|
||||
message: "银行卡删除成功",
|
||||
message: t("bankCard.messages.deleteSuccess"),
|
||||
duration: 2000,
|
||||
position: "bottom",
|
||||
color: "success",
|
||||
@@ -137,7 +137,7 @@ onUpdated(() => {
|
||||
<ion-header>
|
||||
<ion-toolbar class="ui-toolbar">
|
||||
<ion-back-button slot="start" />
|
||||
<ion-title>银行卡管理</ion-title>
|
||||
<ion-title>{{ t('bankCard.management') }}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -148,10 +148,10 @@ onUpdated(() => {
|
||||
<ion-icon :icon="cardOutline" class="text-4xl text-white" />
|
||||
</div>
|
||||
<h3 class="text-xl font-semibold text-#151515 dark:text-white mb-2">
|
||||
暂无银行卡
|
||||
{{ t('bankCard.empty.title') }}
|
||||
</h3>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm leading-relaxed mb-8">
|
||||
添加银行卡以便快速充值和提现
|
||||
{{ t('bankCard.empty.description') }}
|
||||
</p>
|
||||
<ion-button
|
||||
expand="block"
|
||||
@@ -159,7 +159,7 @@ onUpdated(() => {
|
||||
@click="handleAddCard"
|
||||
>
|
||||
<ion-icon slot="start" :icon="addOutline" />
|
||||
添加银行卡
|
||||
{{ t('bankCard.empty.addButton') }}
|
||||
</ion-button>
|
||||
</div>
|
||||
|
||||
@@ -172,14 +172,14 @@ onUpdated(() => {
|
||||
<div class="w-10 h-10 rounded-full bg-linear-to-r from-indigo-500 to-purple-600 flex items-center justify-center mr-3">
|
||||
<ion-icon :icon="addOutline" class="text-white text-xl" />
|
||||
</div>
|
||||
<span class="font-semibold text-#151515 dark:text-white">添加银行卡</span>
|
||||
<span class="font-semibold text-#151515 dark:text-white">{{ t('bankCard.list.addCard') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 银行卡列表 -->
|
||||
<div class="mb-8">
|
||||
<div class="mb-4">
|
||||
<span class="text-sm text-gray-600 dark:text-gray-400 font-medium">已绑定银行卡 ({{ bankCards?.length }})</span>
|
||||
<span class="text-sm text-gray-600 dark:text-gray-400 font-medium">{{ t('bankCard.list.boundCards') }} ({{ bankCards?.length }})</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -204,7 +204,7 @@ onUpdated(() => {
|
||||
v-if="card.isDefault"
|
||||
class="bg-linear-to-r from-indigo-500 to-purple-600 text-white text-xs px-2 py-0.5 rounded-lg font-medium"
|
||||
>
|
||||
默认
|
||||
{{ t('bankCard.list.defaultCard') }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-base m-0 mb-2 tracking-wider">
|
||||
@@ -212,7 +212,7 @@ onUpdated(() => {
|
||||
</p>
|
||||
<div class="flex gap-4 text-sm text-gray-500 dark:text-gray-400">
|
||||
<span class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-md text-xs">
|
||||
储蓄卡
|
||||
{{ t('bankCard.list.debitCard') }}
|
||||
</span>
|
||||
<span>{{ card.accountName }}</span>
|
||||
</div>
|
||||
@@ -233,7 +233,7 @@ onUpdated(() => {
|
||||
<!-- 默认标识条 -->
|
||||
<div v-if="card.isDefault" class="bg-linear-to-r from-indigo-500 to-purple-600 text-white px-5 py-2 flex items-center gap-2 text-sm font-medium">
|
||||
<ion-icon :icon="star" class="text-base" />
|
||||
<span>默认银行卡</span>
|
||||
<span>{{ t('bankCard.list.defaultCard') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,11 +242,11 @@ onUpdated(() => {
|
||||
<div class="rounded-xl p-4 mt-4 b-2px bg-gray-50 dark:bg-gray-900">
|
||||
<div class="flex items-center gap-3 mb-3 text-sm text-gray-600 dark:text-gray-400">
|
||||
<ion-icon :icon="checkmarkCircle" class="text-base text-green-500" />
|
||||
<span>银行卡信息经过加密保护</span>
|
||||
<span>{{ t('bankCard.tips.encryption') }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 text-sm text-gray-600 dark:text-gray-400">
|
||||
<ion-icon :icon="checkmarkCircle" class="text-base text-green-500" />
|
||||
<span>支持主流银行快速充值提现</span>
|
||||
<span>{{ t('bankCard.tips.support') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user