zhb 2 weken geleden
bovenliggende
commit
123d1a4bef
2 gewijzigde bestanden met toevoegingen van 21 en 6 verwijderingen
  1. 5 3
      components/cwg-system.vue
  2. 16 3
      pages/customer/components/AccountList.vue

+ 5 - 3
components/cwg-system.vue

@@ -162,8 +162,9 @@ async function confirmSwitchSystem(item: SystemItem) {
     if (props.eventSource === 'login'){
       const baseUrl = `${item.sysUrl}/#/signin`
       // #ifdef H5
-      userStore.clearUser()
+      userStore.clearUserInfo()
       window.location.replace(baseUrl)
+      // window.open(baseUrl, '_blank')
       // #endif
 
       // #ifndef H5
@@ -176,8 +177,9 @@ async function confirmSwitchSystem(item: SystemItem) {
         const token = typeof accessToken === 'string' ? accessToken : String(accessToken || '')
         const baseUrl = `${item.sysUrl}/#/signin?sysLoginToken=${btoa(token)}`
         // #ifdef H5
-        userStore.clearUser()
+        userStore.clearUserInfo()
         window.location.replace(baseUrl)
+        // window.open(baseUrl, '_blank')
         // #endif
 
         // #ifndef H5
@@ -188,7 +190,7 @@ async function confirmSwitchSystem(item: SystemItem) {
       }
     }
 
-  } catch (e) {
+  } catch (e) { 
     uni.showToast({ title: '切换系统失败', icon: 'none' })
   }
 }

+ 16 - 3
pages/customer/components/AccountList.vue

@@ -271,12 +271,25 @@ const getAccountList = async () => {
     }
     loading.value = false
 }
+  const groupCurrency1 = (type) => {
+      if (type == "GBP") {
+        return "£";
+      } else if (type == "USD") {
+        return "$";
+      } else if (type == "EUR") {
+        return "€";
+      } else if (type == "USC") {
+        return "¢";
+      } else {
+        return "$";
+      }
+    }
 // 格式化数值函数
-function formatMoney(value) {
+function formatMoney(value,currency) {
     if (value === null || value === undefined) value = 0;
     const sign = value >= 0 ? '' : '-';
     const absoluteValue = Math.abs(value);
-    return '$' + sign + numberDecimal(absoluteValue);
+    return groupCurrency1(currency) + sign + numberDecimal(absoluteValue);
 }
 
 // 转换数组
@@ -316,7 +329,7 @@ const accounts = computed(() => {
             equityWithSymbol: acc.equityWithSymbol ?? '$0.00',
             currency,
             actualLeverage: '1:' + (acc.leverage ?? 0),
-            floatingPL: formatMoney(floating),
+            floatingPL: formatMoney(floating,currency),
             platform: acc.platform || 'MT4',
             server: acc.groupCode || '',
             login: acc.login.toString(),