Handy_Cao 16 giờ trước cách đây
mục cha
commit
88cab6736c

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

@@ -97,7 +97,8 @@
         "numbers": "nuber",
         "max": "the max",
         "mini": "the mini",
-        "refresh": "refresh"
+        "refresh": "refresh",
+        "date": "Select date"
     },
     "tabbar": {
         "home": "Homepage",
@@ -1282,7 +1283,7 @@
             "tradesettings": "Order settings",
             "tipssetting": "Notification settings",
             "others": "Other settings",
-            "language": "Language settings",
+            "language": "Internationalization",
             "chinese": "简体中文",
             "english": "English",
             "enth": "ภาษาไทย",

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

@@ -97,7 +97,8 @@
         "numbers": "的數字",
         "max": "最大",
         "mini": "最小",
-        "refresh": "刷新"
+        "refresh": "刷新",
+        "date": "日期選擇"
     },
     "tabbar": {
         "home": "หน้าหลัก",

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

@@ -97,7 +97,8 @@
         "numbers": "的數字",
         "max": "最大",
         "mini": "最小",
-        "refresh": "刷新"
+        "refresh": "刷新",
+        "date": "日期選擇"
     },
     "tabbar": {
         "home": "Trang chủ",

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

@@ -97,7 +97,8 @@
         "numbers": "的数字",
         "max": "最大",
         "mini": "最小",
-        "refresh": "刷新"
+        "refresh": "刷新",
+        "date": "日期选择"
     },
     "tabbar": {
         "home": "首页",

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

@@ -97,7 +97,8 @@
         "numbers": "的數字",
         "max": "最大",
         "mini": "最小",
-        "refresh": "刷新"
+        "refresh": "刷新",
+        "date": "日期選擇"
     },
     "tabbar": {
         "home": "首頁",

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

@@ -162,7 +162,7 @@ const routes: Array<RouteRecordRaw> = [
         name: 'wallet-deposit-currency',
         component: () => import('../views/wallet/currency/index.vue'),
         props: {
-          title: i18n.global.t('digital.wallet-deposit'),
+          title: '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: i18n.global.t('digital.wallet-withdraw'),
+          title: 'digital.wallet-withdraw',
           routeName: 'wallet-withdraw'
         }
       },

+ 1 - 1
src/packages/digital/views/contract/goods/detail/index.vue

@@ -193,7 +193,7 @@ const calculations = computed(() => {
     // 保证金设置(固定) 时:可开数量 = 可用余额 / (合约乘数 * 固定值)
     // 保证金设置(比率) 时:可开数量 = 可用余额 / (价格 * 合约乘数 * 比率值)
     // 账户可用余额为负的情况下,合约商品交易界面的可开数量应显示为0
-    const maxBuyQty = maxBalance <= 0 ? 0 : (marketmarginalgorithm === 2 ? maxBalance / (agreeunit * marketmarginvalue) : maxBalance / (price * agreeunit * marketmarginvalue))
+    const maxBuyQty = (maxBalance <= 0 || price === 0) ? 0 : (marketmarginalgorithm === 2 ? maxBalance / (agreeunit * marketmarginvalue) : maxBalance / (price * agreeunit * marketmarginvalue))
 
     return {
         estimatedAmount,

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

@@ -29,7 +29,7 @@
           <ul v-if="index < 3">
             <li>
               <Tag>{{ index + 1 }}</Tag>
-              <span>{{ item.goodsid }}/{{ goodsname(item.goodscode) }}</span>
+              <span>{{ item.goodsid }}/{{ item.goodscode }}</span>
             </li>
             <li :class="item.lastColor">{{ parsePercent(item.change) }}</li>
             <li :class="item.lastColor">{{ handleNumberValue(item.last.toFixed(item.decimalplace)) }}</li>
@@ -94,10 +94,6 @@ const gridItems = computed<GridItem[]>(() => ([
   }
 ]))
 
-const goodsname = (code: string) => {
-  return futuresStore.getI18nGoodsName(code)
-}
-
 const { dataList } = useRequest(getHotGoodses, {
   onSuccess: (res) => {
     if (!loginStore.token) {

+ 2 - 1
src/packages/digital/views/setting/luanguage/index.vue

@@ -1,7 +1,7 @@
 <template>
     <app-view class="setting-luanguage" background="primary">
         <template #header>
-            <app-navbar title="语言设置" />
+            <app-navbar :title="t('mine.setting.language')" />
         </template>
         <CellGroup>
             <template v-for="(item, index) in dataList" :key="index">
@@ -31,6 +31,7 @@ import viVN from 'vant/es/locale/lang/vi-VN'
 
 const { routerBack } = useNavigation()
 const { dataList } = useRequest(getI18nConfigs)
+const { global: { t } } = i18n
 
 const languageMap: { [key: string]: Language } = {
     'zh-CN': Language.Simplified,

+ 5 - 1
src/packages/digital/views/spot/detail/index.vue

@@ -62,7 +62,7 @@
         <ActionSheet v-model:show="showSheet" :title="t('common.choice')">
             <CellGroup style="min-height: 200px;">
                 <template v-for="(item, index) in quotes" :key="index">
-                    <Cell :title="item.goodsname" :value="item.goodscode" :border="false" is-link clickable
+                    <Cell :title="goodsname(item.goodscode)" :value="item.goodscode" :border="false" is-link clickable
                         @click="navigateToSpotDetail(item.goodsid)" />
                 </template>
             </CellGroup>
@@ -135,6 +135,10 @@ const gridItems = computed(() => {
     return items
 })
 
+const goodsname = (code: string) => {
+    return futuresStore.getI18nGoodsName(code)
+}
+
 // 获取金额
 const getAccountAmount = (value: number) => {
     if (isAmountVisible.value) {

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

@@ -1,7 +1,7 @@
 <template>
     <app-view>
         <template #header>
-            <app-navbar :title="title">
+            <app-navbar :title="i18n.global.t(title)">
                 <template #footer>
                     <app-search />
                 </template>
@@ -15,6 +15,7 @@
 import { useNavigation } from '@mobile/router/navigation'
 import AppSearch from '@/packages/digital/components/search/index.vue'
 import SpotAccount from '../components/spot/index.vue'
+import { i18n } from '@/stores'
 
 const props = defineProps({
     title: {

+ 4 - 3
src/packages/mobile/components/base/datepicker/index.vue

@@ -6,7 +6,7 @@
             </slot>
         </div>
         <Popup v-model:show="show" position="bottom" round>
-            <DatePicker v-model="currentDate" title="选择日期" @cancel="onCancel" @confirm="onConfirm" />
+            <DatePicker v-model="currentDate" :title="t('common.date')" @cancel="onCancel" @confirm="onConfirm" />
         </Popup>
     </div>
 </template>
@@ -15,6 +15,7 @@
 import { ref, onMounted, computed, PropType } from 'vue'
 import { Popup, DatePicker } from 'vant'
 import moment from 'moment'
+import { i18n } from '@/stores'
 
 const props = defineProps({
     modelValue: {
@@ -29,12 +30,12 @@ const props = defineProps({
     // 占位符文本
     placeholder: {
         type: String,
-        default: '日期选择'
+        default: i18n.global.t('common.date')
     }
 })
 
 const emit = defineEmits(['update:modelValue', 'confirm'])
-
+const { global: { t } } = i18n
 const show = ref(false)
 
 const currentDate = computed({