Handy_Cao преди 1 седмица
родител
ревизия
7d070dbc6b

+ 10 - 2
public/locales/en-US.json

@@ -101,7 +101,8 @@
         "trade": "Trade",
         "wallet": "Wallet",
         "contract": "Contract",
-        "spot": "Spots"
+        "spot": "Spots",
+        "listing": "Listing"
     },
     "routes": {
         "news": "Market news",
@@ -1893,6 +1894,13 @@
         "tips15": "The price is not within the valid range",
         "tips16": "Please enter the take-profit price",
         "tpprice": "TP-Price",
-        "slprice": "SL-Price"
+        "slprice": "SL-Price",
+        "nav-title": "Digital Transaction",
+        "total": "Total",
+        "hots": "Hot Currencys",
+        "news": "News & Information",
+        "tips17": "Please enter the MEMO",
+        "tips18": "Whether to activate the current account",
+        "tips19": "Account is activated"
     }
 }

+ 10 - 2
public/locales/th-TH.json

@@ -101,7 +101,8 @@
         "trade": "การซื้อขาย",
         "wallet": "กระเป๋าเงิน",
         "contract": "สัญญา",
-        "spot": "สินค้าจริง"
+        "spot": "สินค้าจริง",
+        "listing": "掛牌"
     },
     "routes": {
         "news": "ข่าวสารตลาด",
@@ -1896,6 +1897,13 @@
         "tips15": "The price is not within the valid range",
         "tips16": "Please enter the take-profit price",
         "tpprice": "TP-Price",
-        "slprice": "SL-Price"
+        "slprice": "SL-Price",
+        "nav-title": "數字交易",
+        "total": "總計",
+        "hots": "熱門貨幣",
+        "news": "新聞資訊",
+        "tips17": "請輸入MEMO",
+        "tips18": "是否激活当前账户",
+        "tips19": "账户已激活"
     }
 }

+ 10 - 2
public/locales/vi-VN.json

@@ -101,7 +101,8 @@
         "trade": "Trade",
         "wallet": "Ví tiền",
         "contract": "Hợp đồng",
-        "spot": "Tiền mặt"
+        "spot": "Tiền mặt",
+        "listing": "挂牌"
     },
     "routes": {
         "news": "Thông tin thị trường",
@@ -1893,6 +1894,13 @@
         "tips15": "The price is not within the valid range",
         "tips16": "Please enter the take-profit price",
         "tpprice": "TP-Price",
-        "slprice": "SL-Price"
+        "slprice": "SL-Price",
+        "nav-title": "数字交易",
+        "total": "總計",
+        "hots": "熱門貨幣",
+        "news": "新聞資訊",
+        "tips17": "請輸入MEMO",
+        "tips18": "是否激活当前账户",
+        "tips19": "账户已激活"
     }
 }

+ 10 - 2
public/locales/zh-CN.json

@@ -101,7 +101,8 @@
         "pricing": "价格",
         "wallet": "钱包",
         "contract": "合约",
-        "spot": "现货"
+        "spot": "现货",
+        "listing": "挂牌"
     },
     "routes": {
         "news": "市场资讯",
@@ -1896,6 +1897,13 @@
         "tips15": "价格不在有效范围内",
         "tips16": "请输入止盈价格",
         "tpprice": "止盈价格",
-        "slprice": "止损价格"
+        "slprice": "止损价格",
+        "nav-title": "数字交易",
+        "total": "总计",
+        "hots": "热门货币",
+        "news": "新闻资讯",
+        "tips17": "请输入MEMO",
+        "tips18": "是否激活当前账户",
+        "tips19": "账户已激活"
     }
 }

+ 10 - 2
public/locales/zh-TW.json

@@ -101,7 +101,8 @@
         "trade": "交易",
         "wallet": "錢包",
         "contract": "合約",
-        "spot": "現貨"
+        "spot": "現貨",
+        "listing": "掛牌"
     },
     "routes": {
         "news": "市場資訊",
@@ -1896,6 +1897,13 @@
         "tips15": "價格不在有效範圍內",
         "tips16": "請輸入止盈價格",
         "tpprice": "止盈價格",
-        "slprice": "止損價格"
+        "slprice": "止損價格",
+        "nav-title": "數字交易",
+        "total": "總計",
+        "hots": "熱門貨幣",
+        "news": "新聞資訊",
+        "tips17": "請輸入MEMO",
+        "tips18": "是否激活當前賬戶",
+        "tips19": "賬戶已激活"
     }
 }

+ 5 - 4
src/packages/digital/components/field-token/index.vue

@@ -1,11 +1,11 @@
 <template>
-    <Field v-bind="$attrs" placeholder="请选择" arrow-direction="down" is-link readonly @click="showSheet = true">
+    <Field v-bind="$attrs" :placeholder="t('common.choice')" arrow-direction="down" is-link readonly @click="showSheet = true">
         <template #input v-if="tokenItem">
             <app-image-icon :url="tokenItem.icon_url" size="small" />
             <span>{{ tokenItem.name }} ({{ tokenItem.chain_id }})</span>
         </template>
     </Field>
-    <ActionSheet v-model:show="showSheet" title="请选择" teleport="body">
+    <ActionSheet v-model:show="showSheet" :title="t('common.choice')" teleport="body">
         <CellGroup style="min-height: 200px;">
             <RadioGroup v-model="tokenId" v-if="dataList.length">
                 <template v-for="(item, index) in dataList" :key="index">
@@ -20,7 +20,7 @@
                     </Cell>
                 </template>
             </RadioGroup>
-            <Empty description="暂无数据" v-else />
+            <Empty :description="t('common.nodatas')" v-else />
         </CellGroup>
     </ActionSheet>
 </template>
@@ -31,6 +31,7 @@ import { Field, ActionSheet, CellGroup, RadioGroup, Cell, Radio, Empty } from 'v
 import { useRequest } from '@/hooks/request'
 import { queryWalletTokens } from '@/services/api/digital'
 import AppImageIcon from '@mobile/components/base/image-icon/index.vue'
+import { i18n } from '@/stores'
 
 const props = defineProps({
     modelValue: {
@@ -43,7 +44,7 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['update:modelValue', 'change'])
-
+const { global: { t } } = i18n
 const showSheet = shallowRef(false)
 
 const tokenItem = computed(() => dataList.value.find((e) => e.id === tokenId.value))

+ 3 - 3
src/packages/digital/router/index.ts

@@ -1,5 +1,5 @@
 import { createWebHashHistory, RouteRecordRaw } from 'vue-router'
-import { useLoginStore } from '@/stores'
+import { i18n, useLoginStore } from '@/stores'
 import { clearPending } from '@/services/http/pending'
 import service from '@/services'
 import Page from '@mobile/components/layouts/page/index.vue'
@@ -162,7 +162,7 @@ const routes: Array<RouteRecordRaw> = [
         name: 'wallet-deposit-currency',
         component: () => import('../views/wallet/currency/index.vue'),
         props: {
-          title: '充值',
+          title: i18n.global.t('digital.wallet-deposit'),
           routeName: 'wallet-deposit'
         }
       },
@@ -171,7 +171,7 @@ const routes: Array<RouteRecordRaw> = [
         name: 'wallet-withdraw-currency',
         component: () => import('../views/wallet/currency/index.vue'),
         props: {
-          title: '提现',
+          title: i18n.global.t('digital.wallet-withdraw'),
           routeName: 'wallet-withdraw'
         }
       },

+ 2 - 2
src/packages/digital/views/home/index.vue

@@ -4,7 +4,7 @@
       <app-statusbar>
         <div class="home-header">
           <div class="home-header__title">
-            <h2>数字交易</h2>
+            <h2>{{ $t('digital.nav-title') }}</h2>
           </div>
           <div class="home-header__iconbar">
             <app-image-icon url="./img/icons/notice.svg" @click="routerTo('notice-list')" />
@@ -74,7 +74,7 @@ const tabbarItems = computed(() => ([
   },
   {
     name: 'home-listing',
-    label: '挂牌',
+    label: t('tabbar.listing'),
     icon: './img/icons/contract.svg',
     action: './img/icons/contract-active.svg',
   },

+ 9 - 5
src/packages/digital/views/home/main/index.vue

@@ -4,7 +4,7 @@
       <div class="g-account-total__inner">
         <div class="g-account-total__header">
           <div class="g-account-total__title">
-            <span>总计 (USDT)</span>
+            <span>{{ $t('digital.total') }} (USDT)</span>
             <img :src="`./img/icons/${isAmountVisible ? 'eye' : 'eye-hidden'}.svg`"
               @click="isAmountVisible = !isAmountVisible" />
           </div>
@@ -18,9 +18,9 @@
     <app-grid :items="gridItems" />
     <app-block class="home-main-hot" v-if="goodsList.length">
       <h4>
-        <span>热门货币</span>
+        <span>{{ $t('digital.hots') }}</span>
         <span @click="$router.replace({ name: 'home-contract' })">
-          更多
+          {{ $t('common.more') }}
           <Icon name="arrow" />
         </span>
       </h4>
@@ -29,7 +29,7 @@
           <ul v-if="index < 3">
             <li>
               <Tag>{{ index + 1 }}</Tag>
-              <span>{{ item.goodsid }}/{{ item.goodsname }}</span>
+              <span>{{ item.goodsid }}/{{ goodsname(item.goodscode) }}</span>
             </li>
             <li :class="item.lastColor">{{ parsePercent(item.change) }}</li>
             <li :class="item.lastColor">{{ handleNumberValue(item.last.toFixed(item.decimalplace)) }}</li>
@@ -37,7 +37,7 @@
         </template>
       </section>
     </app-block>
-    <app-article title="新闻资讯" />
+    <app-article :title="t('digital.news')" />
   </div>
 </template>
 
@@ -94,6 +94,10 @@ const gridItems = computed<GridItem[]>(() => ([
   }
 ]))
 
+const goodsname = (code: string) => {
+  return futuresStore.getI18nGoodsName(code)
+}
+
 const { dataList } = useRequest(getHotGoodses, {
   onSuccess: (res) => {
     if (!loginStore.token) {

+ 16 - 1
src/packages/digital/views/listing/goods/list/index.vue

@@ -2,7 +2,7 @@
     <app-view class="spot">
         <Tabs class="g-tabs" type="card" v-model:active="currentGroupId" shrink v-if="goodsGroups.length">
             <template v-for="(item, index) in goodsGroups" :key="index">
-                <Tab :title="item.goodsgroupname" :name="item.goodsgroupid">
+                <Tab :title="goodsGroupeName(item)" :name="item.goodsgroupid">
                     <table class="table" cellspacing="0" cellpadding="0">
                         <thead class="table-thead">
                             <tr class="table-row">
@@ -80,6 +80,21 @@ const goodsGroups = userStore.userData.goodsgroups.filter((e) => e.marketid ===
 
 const goodsList = computed(() => futuresStore.quotationList.filter((e) => e.goodsgroupid === currentGroupId.value))
 
+const goodsGroupeName = (item: Model.GoodsGroup) => {
+    switch (i18n.global.locale) {
+        case 'zh-CN':
+            return item?.goodsgroupname ?? ''
+        case 'en-US':
+            return item?.goodsgroupnameen ?? ''
+        case 'zh-TW':
+            return item?.goodsgroupnametw ?? ''
+        case 'vi':
+            return item?.goodsgroupnamevi ?? ''
+        default:
+            return item?.goodsgroupnameth ?? ''
+    }
+}
+
 const rowClick = (row: Model.GoodsQuote) => {
     router.push({
         name: 'listing-goods-detail',

+ 4 - 3
src/packages/digital/views/spot/components/account/activate/index.vue

@@ -1,6 +1,6 @@
 <template>
     <Dialog v-model:show="showDialog" show-cancel-button :before-close="onBeforeClose" @closed="onClosed"
-        message="是否激活当前账户?">
+        :message="t('digital.tips18')">
     </Dialog>
 </template>
 
@@ -10,6 +10,7 @@ import { Dialog } from 'vant'
 import { fullloading } from '@/utils/vant'
 import { digitalAccountActivate } from '@/services/api/digital'
 import { useSpotAccountStore } from '../../../../wallet/components/spot/composables'
+import { i18n } from '@/stores'
 
 const props = defineProps({
     selectedRow: {
@@ -19,7 +20,7 @@ const props = defineProps({
 })
 
 const emit = defineEmits(['closed'])
-
+const { global: { t } } = i18n
 const spotAccountStore = useSpotAccountStore()
 const showDialog = shallowRef(false)
 const refresh = shallowRef(false) // 是否刷新父组件数据
@@ -32,7 +33,7 @@ const onBeforeClose = (action: string) => {
                     CurrencyID: props.selectedRow.currencyid
                 }
             }).then(() => {
-                hideLoading('账户已激活', 'success')
+                hideLoading(t('digital.tips19'), 'success')
                 spotAccountStore.fetchTaaccountDigitals()
                 refresh.value = true
             }).catch((err) => {

+ 16 - 1
src/packages/digital/views/spot/goods/list/index.vue

@@ -2,7 +2,7 @@
     <app-view class="spot">
         <Tabs v-model:active="currentGroupId" v-if="goodsGroups.length">
             <template v-for="(item, index) in goodsGroups" :key="index">
-                <Tab :title="item.goodsgroupname" :name="item.goodsgroupid">
+                <Tab :title="goodsGroupeName(item)" :name="item.goodsgroupid">
                     <table class="table" cellspacing="0" cellpadding="0">
                         <thead class="table-thead">
                             <tr class="table-row">
@@ -78,6 +78,21 @@ const { global: { t } } = i18n
 
 const goodsGroups = userStore.userData.goodsgroups.filter((e) => e.marketid === 80201)
 
+const goodsGroupeName = (item: Model.GoodsGroup) => {
+    switch (i18n.global.locale) {
+        case 'zh-CN':
+            return item?.goodsgroupname ?? ''
+        case 'en-US':
+            return item?.goodsgroupnameen ?? ''
+        case 'zh-TW':
+            return item?.goodsgroupnametw ?? ''
+        case 'vi':
+            return item?.goodsgroupnamevi ?? ''
+        default:
+            return item?.goodsgroupnameth ?? ''
+    }
+}
+
 const goodsList = computed(() => futuresStore.quotationList.filter((e) => e.goodsgroupid === currentGroupId.value))
 
 const rowClick = (row: Model.GoodsQuote) => {

+ 6 - 4
src/packages/digital/views/wallet/components/record/index.vue

@@ -53,6 +53,7 @@ import { useRequest } from '@/hooks/request'
 import { queryTaaccountDigitalChangeApplys } from '@/services/api/digital'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppDatePicker from '@mobile/components/base/datepicker/index.vue'
+import { i18n } from '@/stores'
 
 const props = defineProps({
     params: {
@@ -61,6 +62,7 @@ const props = defineProps({
     }
 })
 
+const { global: { t } } = i18n
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.TaaccountDigitalChangeApplysRsp[]>([])
 const dateValue = shallowRef(props.params.applydate?.split('-') ?? [])
@@ -79,13 +81,13 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryTaaccountDigitalC
 const getTransferTypeText = () => {
     switch (props.params.transfertypes) {
         case '1':
-            return '充值'
+            return t('digital.wallet-deposit')
         case '2':
-            return '提现'
+            return t('digital.wallet-withdraw')
         case '3':
-            return '转入'
+            return t('transfer-in')
         case '4':
-            return '转出'
+            return t('transfer-out')
         default:
             return ''
     }

+ 1 - 1
src/packages/digital/views/wallet/index.vue

@@ -5,7 +5,7 @@
             <div class="g-account-total__inner">
                 <div class="g-account-total__header">
                     <div class="g-account-total__title">
-                        <span>总计 (USDT)</span>
+                        <span>{{ $t('digital.total') }} (USDT)</span>
                         <img :src="`./img/icons/${isAmountVisible ? 'eye' : 'eye-hidden'}.svg`"
                             @click="isAmountVisible = !isAmountVisible" />
                     </div>

+ 1 - 1
src/packages/digital/views/wallet/withdraw/index.vue

@@ -99,7 +99,7 @@ const formRules: { [key: string]: FieldRule[] } = {
     }],
     MEMO: [{
         required: true,
-        message: '请输入MEMO',
+        message: t('digital.tips17'),
     }],
 }