Handy_Cao 1 anno fa
parent
commit
e775a56468

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

@@ -1162,6 +1162,8 @@
         "accountinfo": "AccountInformation",
         "reckondate": "ReckonDate",
         "reportdetail": "ReportDetail",
+        "day": "DayReport",
+        "month": "MonthReport",
         "trade": {
             "tradeqty": "TradeQty",
             "tradeprice": "TradePrice",

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

@@ -1165,6 +1165,8 @@
         "accountinfo": "账户信息",
         "reckondate": "结算日期",
         "reportdetail": "报表明细",
+        "day": "日报表",
+        "month": "月报表",
         "trade": {
             "tradeqty": "数量",
             "tradeprice": "价格",

+ 4 - 2
src/packages/mobile/views/mine/setting/Index.vue

@@ -33,16 +33,18 @@ import { Cell, CellGroup } from 'vant'
 import AppIconfont from '@/components/base/iconfont/index.vue'
 import { i18n } from '@/stores'
 import { Locale } from 'vant'
+import { localData } from '@/stores/storage'
 import enUS from 'vant/es/locale/lang/en-US'
 
 const changeLuanguage = () => {
     if ( i18n.global.locale === 'zh-CN' ) {
         i18n.global.locale = 'en-US'
-        Locale.use('en-US', enUS)
     } else {
         i18n.global.locale = 'zh-CN'
-        Locale.use('zh-CN', enUS)
     }
+    Locale.use(i18n.global.locale, enUS)
+    /// 设置语言
+    localData.setValue('appLanguage', i18n.global.locale)
 }
 
 defineProps({

+ 4 - 3
src/packages/mobile/views/report/components/index.vue

@@ -50,7 +50,7 @@ import { formatDecimal, handleNoneValue } from '@/filters'
 import { useComponent } from '@/hooks/component'
 import { queryMarketRun } from '@/services/api/market'
 import { queryReportMonthTaaccount, queryReportReckonDayTaaccount } from '@/services/api/report'
-import { useAccountStore, useUserStore } from '@/stores'
+import { useAccountStore, useUserStore, i18n } from '@/stores'
 import moment from 'moment'
 
 const componentMap = new Map<string, unknown>([
@@ -67,12 +67,13 @@ const showPicker = shallowRef(false)
 const marketInfo = shallowRef<Model.MarketRunRsp>()
 const currentDate = shallowRef<string[]>([])
 const taaccount = shallowRef<Model.ReportMonthTaaccountRsp | Model.ReportReckonDayTaaccountRsp>()
+const { global: { t } } = i18n
 
 const { componentRef, componentId, closeComponent, openComponent } = useComponent()
 
 const reportType = [
-    { text: '日报表', value: 1 },
-    { text: '月报表', value: 2 }
+    { text: t('report.day'), value: 1 },
+    { text: t('report.month'), value: 2 }
 ]
 
 const pickerFormat = computed(() => reportTypeValue.value === 1 ? 'YYYY-MM-DD' : 'YYYY-MM')