From 358dd78ee40aea1e43fd7987c6e604960c2d0672 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Sat, 29 Jun 2024 18:29:45 +0800
Subject: [PATCH] BTC排一.ETH排二,USDT排三其他随便

---
 src/page/assetsCenter/index.vue |   89 ++++++++++++++++++++++----------------------
 1 files changed, 45 insertions(+), 44 deletions(-)

diff --git a/src/page/assetsCenter/index.vue b/src/page/assetsCenter/index.vue
index bdfa48f..bfc9a9b 100644
--- a/src/page/assetsCenter/index.vue
+++ b/src/page/assetsCenter/index.vue
@@ -3,14 +3,14 @@
     <header>
       <van-row class="title-box">
         <van-col span="12">
-          <span class="title">{{ $t("总资产") }}</span>
+          <!-- <span class="title">{{ $t("总资产") }}</span> -->
         </van-col>
         <van-col span="12" class="right">
           <div class="w-33" style="height: 20px">{{ " " }}</div>
           <!-- <img :src="require('@/assets/3x/names8.png')" class="w-33" /> -->
         </van-col>
         <div class="pt">{{ $t("总资产估值") }}</div>
-        <div class="pt">{{ assetsFunds.total }}</div>
+        <!-- <div class="pt">{{ assetsFunds.total }}</div> -->
         <div class="pt">
           ≈ {{ currency.currency_symbol
           }}{{
@@ -21,24 +21,15 @@
         </div>
       </van-row>
       <van-row gutter="20" class="but-box">
-        <van-col
-          span="8"
-          v-for="item in tabList1"
-          :key="item.id"
-          @click="routerList(item)"
-        >
+        <van-col span="8" v-for="item in tabList1" :key="item.id" @click="routerList(item)">
           <div class="but">{{ item.text }}</div>
         </van-col>
       </van-row>
     </header>
     <div class="tabs">
       <div class="tabs-box">
-        <div
-          v-for="item in tabList"
-          :key="item.id"
-          :class="`${active === item.id ? 'active-tabls' : ''}`"
-          @click="activeCheng(item)"
-        >
+        <div v-for="item in tabList" :key="item.id" :class="`${active === item.id ? 'active-tabls' : ''}`"
+          @click="activeCheng(item)">
           {{ item.text }}
         </div>
       </div>
@@ -56,19 +47,9 @@
       <template v-if="active === 1">
         <div class="px-32 py-13 flex">
           <div class="inputBoxbg h-60 w-full rounded-full flex items-center">
-            <input
-              style="padding-left: 10px"
-              type="text"
-              v-model="keywords"
-              :placeholder="$t('搜索币种')"
-              class="h-full flex-1 search-input border-none bg-none"
-              @input="onInput"
-            />
-            <img
-              src="@/assets/3x/资源 22@3x.png"
-              alt="logo"
-              class="w-32 h-32 mx-16"
-            />
+            <input style="padding-left: 10px" type="text" v-model="keywords" :placeholder="$t('搜索币种')"
+              class="h-full flex-1 search-input border-none bg-none" @input="onInput" />
+            <img src="@/assets/3x/资源 22@3x.png" alt="logo" class="w-32 h-32 mx-16" />
           </div>
         </div>
         <div class="item-box" v-for="(item, index) in funds" :key="index">
@@ -79,7 +60,7 @@
               <div class="text">
                 {{
                   item.usable.toFixed(
-                    item.symbol.toUpperCase() === "USDT" ? 6 : 8
+                    item.symbol.toUpperCase() === "USDT" ? 2 : 2
                   ) || "0.0"
                 }}
               </div>
@@ -89,7 +70,7 @@
               <div class="text">
                 {{
                   item.lock_amount.toFixed(
-                    item.symbol.toUpperCase() === "USDT" ? 6 : 8
+                    item.symbol.toUpperCase() === "USDT" ? 2 : 2
                   ) || "0.0"
                 }}
               </div>
@@ -99,7 +80,7 @@
               <div class="text">
                 {{
                   (item.frozenAmount + item.freeze_amount).toFixed(
-                    item.symbol.toUpperCase() === "USDT" ? 6 : 8
+                    item.symbol.toUpperCase() === "USDT" ? 2 : 2
                   ) || "0.0"
                 }}
               </div>
@@ -110,10 +91,7 @@
       <!--永续合约持有仓位-->
       <div class="px-30">
         <template v-if="active === 4">
-          <PerpetualPositionList
-            :list-data="funds"
-            @sell="onRecall"
-          ></PerpetualPositionList>
+          <PerpetualPositionList :list-data="funds" @sell="onRecall"></PerpetualPositionList>
         </template>
         <!--交割合约持有仓位-->
         <template v-if="active === 2">
@@ -162,11 +140,11 @@
           text: this.$t("提币"),
           route: "/withdraw/withdrawPage",
         },
-        // {
-        //   id: 4,
-        //   text: this.$t("闪兑"),
-        //   route: "/exchange/exchangePage",
-        // },
+        {
+          id: 4,
+          text: this.$t("闪兑"),
+          route: "/exchange/exchangePage",
+        },
         {
           id: 5,
           text: this.$t("货币理财"),
@@ -186,7 +164,7 @@
       ],
       tabList: [
         { id: 1, text: this.$t("现货") },
-        { id: 2, text: this.$t("交割合约") },
+        { id: 2, text: this.$t("期权合约") },
         { id: 4, text: this.$t("永续合约") },
         { id: 5, text: this.$t("理财") },
       ],
@@ -350,6 +328,16 @@
         this.loading = false;
         let list = res.extends;
         if (this.active === 1) {
+          let btcindex = list.findIndex(item => item.symbol == 'btc')
+          if (btcindex !== -1) {
+            let movedElement = list.splice(btcindex, 1); 
+            list.unshift(movedElement[0]); 
+          }
+          let ethindex = list.findIndex(item => item.symbol == 'eth')
+          if (ethindex !== -1) {
+            let movedElement = list.splice(ethindex, 1);
+            list.splice(1, 0, movedElement[0]);
+          }
           this.funds = list;
           this.fundsDatra = list;
         }
@@ -369,20 +357,25 @@
 <style lang="scss" scoped>
 .assets-box {
   header {
-    padding: 100px 0 0px;
+    // padding: 100px 0 0px;
     color: #817cf6;
+
     .title-box {
       padding: 0 70px;
     }
+
     .but-box {
       padding: 30px;
     }
+
     .title {
       font-weight: bold;
     }
+
     .pt {
       margin-top: 15px;
     }
+
     .but {
       box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.05);
       line-height: 80px;
@@ -390,6 +383,7 @@
       margin-bottom: 30px;
     }
   }
+
   .right {
     text-align: right;
   }
@@ -399,17 +393,20 @@
   box-shadow: 0px 0px 10px 5px rgba(0, 0, 0, 0.05);
   margin: 0 15px;
   padding: 30px 30px;
+
   .tabs-content {
     margin-top: 40px;
     color: #363636;
+
     .tabs-name {
       margin-left: 10px;
-      color: #dedbe2;
+      // color: #dedbe2;
     }
   }
+
   .tabs-box {
     display: flex;
-    color: #dedbe2;
+    // color: #dedbe2;
     font-weight: 400;
     flex: 1;
     justify-content: space-between;
@@ -427,20 +424,24 @@
     margin: 0 15px;
     padding: 30px 30px;
     margin-top: 40px;
+
     .title-main {
       color: #807cf7;
       font-weight: 900;
       margin-bottom: 20px;
     }
+
     .title {
-      color: #dedbe2;
+      // color: #dedbe2;
       margin-bottom: 10px;
     }
+
     .text {
       font-weight: 900;
     }
   }
 }
+
 ::v-deep .van-loading {
   text-align: center;
   margin: 30px 0;

--
Gitblit v1.9.3