From 1832eb70acb3b5badc27f166180536897c8e3c98 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Tue, 09 Jul 2024 16:44:45 +0800
Subject: [PATCH] 自选变成空数组后直接显示没有更多了

---
 src/page/list/tradingList/data.list.vue |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/page/list/tradingList/data.list.vue b/src/page/list/tradingList/data.list.vue
index 8714d9c..75da375 100644
--- a/src/page/list/tradingList/data.list.vue
+++ b/src/page/list/tradingList/data.list.vue
@@ -20,13 +20,13 @@
                 class="el-icon-caret-top"
                 style="font-size: 0.3rem"
                 @click="priceAscending"
-                :style="{color: Ascend == 1?'#409eff':'#8c9fad'}"
+                :style="{ color: Ascend == 1 ? '#409eff' : '#8c9fad' }"
               ></i>
               <i
                 class="el-icon-caret-bottom"
                 style="font-size: 0.3rem"
                 @click="priceDescending"
-                 :style="{color: Ascend == 2?'#409eff':'#8c9fad'}"
+                :style="{ color: Ascend == 2 ? '#409eff' : '#8c9fad' }"
               ></i>
             </span>
           </div>
@@ -39,13 +39,13 @@
                 class="el-icon-caret-top"
                 style="font-size: 0.3rem"
                 @click="riseFallAscending"
-                 :style="{color: riseFallAscend == 1?'#409eff':'#8c9fad'}"
+                :style="{ color: Ascend == 3 ? '#409eff' : '#8c9fad' }"
               ></i>
               <i
                 class="el-icon-caret-bottom"
                 style="font-size: 0.3rem"
                 @click="riseFallDescending"
-                 :style="{color: riseFallAscend == 2?'#409eff':'#8c9fad'}"
+                :style="{ color: Ascend == 4 ? '#409eff' : '#8c9fad' }"
               ></i>
             </span>
           </div>
@@ -138,7 +138,6 @@
 import handleDt from "@/utils/deTh";
 import dazy from "./dazy.vue";
 import { WhrWebSocket } from "@/utils/WhrWebSocket";
-import { color } from "echarts/lib/export";
 
 export default {
   components: { dazy },
@@ -196,9 +195,8 @@
       getInterval: null,
       num: 1,
       refreshing: false,
-      Ascend: 0,
-      riseFallAscend: 0
-    }
+      Ascend: 0, //颜色问题
+    };
   },
 
   mounted() {
@@ -212,19 +210,19 @@
   },
   methods: {
     priceAscending() {
-      this.Ascend = 1
+      this.Ascend = 1;
       this.listArr.sort((a, b) => a.nowPrice - b.nowPrice);
     },
     priceDescending() {
-      this.Ascend = 2
+      this.Ascend = 2;
       this.listArr.sort((a, b) => b.nowPrice - a.nowPrice);
     },
     riseFallAscending() {
-      this.riseFallAscend = 1
+      this.Ascend = 3;
       this.listArr.sort((a, b) => a.hcrate - b.hcrate);
     },
     riseFallDescending() {
-      this.riseFallAscend = 2
+      this.Ascend = 4;
       this.listArr.sort((a, b) => b.hcrate - a.hcrate);
     },
 
@@ -310,7 +308,7 @@
               this.listArr = data.data.list;
               this.loadings = false;
               // this.finished = true;
-              if (this.listArr.length % 20) {
+              if (!this.listArr.length || (this.listArr.length && this.listArr.length % 20)) {
                 this.finished = true;
               }
             }
@@ -319,11 +317,20 @@
               this.listArr = data.data.list;
               this.loadings = false;
               // this.finished = true;
-              if (this.listArr.length % 20) {
+              if (!this.listArr.length || (this.listArr.length && this.listArr.length % 20)) {
                 this.finished = true;
               }
             }
           }
+          if (this.Ascend == 1) {
+            this.listArr.sort((a, b) => a.nowPrice - b.nowPrice);
+          } else if (this.Ascend == 2) {
+            this.listArr.sort((a, b) => b.nowPrice - a.nowPrice);
+          } else if (this.Ascend == 3) {
+            this.listArr.sort((a, b) => a.hcrate - b.hcrate);
+          } else if (this.Ascend == 4) {
+            this.listArr.sort((a, b) => b.hcrate - a.hcrate);
+          }
         }
       } else {
         this.finished = true;

--
Gitblit v1.9.3