|
|
@@ -2,25 +2,25 @@
|
|
|
<template>
|
|
|
<app-view class="wallet-deposit g-layout g-form">
|
|
|
<template #header>
|
|
|
- <app-navbar title="充值" />
|
|
|
+ <app-navbar :title="t('digital.wallet-deposit')" />
|
|
|
</template>
|
|
|
<Form ref="formRef" class="g-form__container g-layout-block" @submit="onSubmit">
|
|
|
<CellGroup inset>
|
|
|
- <app-field-currency name="currency" label="币种" label-align="top" :rules="formRules.currency"
|
|
|
+ <app-field-currency name="currency" :label="t('banksign.currency')" label-align="top" :rules="formRules.currency"
|
|
|
v-model="state.currencyId" @change="onCurrencyChange" />
|
|
|
</CellGroup>
|
|
|
<CellGroup inset>
|
|
|
- <app-field-token name="token" label="存款网络" label-align="top" :rules="formRules.token"
|
|
|
+ <app-field-token name="token" :label="t('digital.depositnetwork')" label-align="top" :rules="formRules.token"
|
|
|
v-model="state.tokenId" :currency="state.currencyName" @change="onTokenChange" />
|
|
|
</CellGroup>
|
|
|
</Form>
|
|
|
<CellGroup inset v-if="tokenItem">
|
|
|
- <Cell title="余额" :value="balance" />
|
|
|
+ <Cell :title="t('account.balance')" :value="balance" />
|
|
|
<div class="wallet-deposit__address">
|
|
|
<dl class="g-layout-block g-layout-block--inset">
|
|
|
<dt>
|
|
|
- <h3>存款地址</h3>
|
|
|
- <span>*仅将 {{ state.currencyName }} 存入此地址</span>
|
|
|
+ <h3>{{ t('digital.depositaddres') }}</h3>
|
|
|
+ <span>{{ `${t('digital.tips11')}` }} {{ currentyItem?.label }} {{ `${t('digital.tips12')}` }}</span>
|
|
|
</dt>
|
|
|
<dd v-for="(item, index) in addressList" :key="index">
|
|
|
<span>{{ item.address }}</span>
|
|
|
@@ -29,11 +29,11 @@
|
|
|
</dd>
|
|
|
</dl>
|
|
|
<div class="g-layout-block g-layout-block--inset">
|
|
|
- <Button type="primary" size="small" block @click="formRef?.submit">创建新地址</Button>
|
|
|
+ <Button type="primary" size="small" block @click="formRef?.submit">{{ $t('digital.newaddress') }}</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</CellGroup>
|
|
|
- <Dialog v-model:show="state.showDialog" :show-confirm-button="false" cancel-button-text="关闭" show-cancel-button
|
|
|
+ <Dialog v-model:show="state.showDialog" :show-confirm-button="false" :cancel-button-text="t('operation.close1')" show-cancel-button
|
|
|
destroy-on-close>
|
|
|
<div class="wallet-deposit__qrcode">
|
|
|
<app-qrcode :text="state.qrContent" :width="240" />
|
|
|
@@ -51,6 +51,7 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { queryWalletAddress, createDigitalWalletAddress } from '@/services/api/digital'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useSpotAccountStore } from '../components/spot/composables'
|
|
|
+import { i18n } from '@/stores'
|
|
|
import AppQrcode from '@/components/base/qrcode/index.vue'
|
|
|
import AppFieldCurrency from '@/packages/digital/components/field-currency/index.vue'
|
|
|
import AppFieldToken from '@/packages/digital/components/field-token/index.vue'
|
|
|
@@ -60,6 +61,7 @@ const { getQueryStringToNumber } = useNavigation()
|
|
|
const spotAccountStore = useSpotAccountStore()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const currencyId = getQueryStringToNumber('id')
|
|
|
+const { global: { t } } = i18n
|
|
|
|
|
|
const state = reactive({
|
|
|
showSheet: false,
|
|
|
@@ -86,12 +88,12 @@ const balance = computed(() => {
|
|
|
|
|
|
// 表单验证规则
|
|
|
const formRules: { [key: string]: FieldRule[] } = {
|
|
|
- currency: [{
|
|
|
- message: '请选择币种',
|
|
|
- validator: () => !!state.currencyId
|
|
|
+ currenty: [{
|
|
|
+ message: t('digital.tips4'),
|
|
|
+ validator: () => !!state.currentyId
|
|
|
}],
|
|
|
token: [{
|
|
|
- message: '请选择网络',
|
|
|
+ message: t('digital.tips3'),
|
|
|
validator: () => !!state.tokenId
|
|
|
}],
|
|
|
}
|
|
|
@@ -114,15 +116,15 @@ const openQRcode = (address: string) => {
|
|
|
|
|
|
const onCopy = (status: boolean) => {
|
|
|
if (status) {
|
|
|
- showSuccessToast({ message: '已复制,快去粘贴吧~' })
|
|
|
+ showSuccessToast({ message: t('banksign.wallet.deposit.paste') })
|
|
|
} else {
|
|
|
- showFailToast('复制失败')
|
|
|
+ showFailToast(t('banksign.wallet.deposit.pastefailure'))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const onSubmit = () => {
|
|
|
dialog({
|
|
|
- message: '确认创建新地址吗?',
|
|
|
+ message: t('digital.tips9'),
|
|
|
showCancelButton: true,
|
|
|
}).then(() => {
|
|
|
const { channel_code, chain_id } = tokenItem.value ?? {}
|
|
|
@@ -135,7 +137,7 @@ const onSubmit = () => {
|
|
|
AddrType: 1
|
|
|
}
|
|
|
}).then(() => {
|
|
|
- hideLoading('创建成功', 'success')
|
|
|
+ hideLoading(t('digital.tips10'), 'success')
|
|
|
getWalletAddress()
|
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|