From 6cd1d790d0a55b8f763de8d1d129cca2772393e4 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Mon, 22 Dec 2025 18:37:14 +0800
Subject: [PATCH] 1

---
 src/views/homePage/index.vue |   54 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/src/views/homePage/index.vue b/src/views/homePage/index.vue
index 36e40c6..4c024fb 100644
--- a/src/views/homePage/index.vue
+++ b/src/views/homePage/index.vue
@@ -1,7 +1,7 @@
 <template>
-    <div class="home_page">
+    <div class="home_page mainBackground textColor">
 
-        <Head></Head>
+        <Head @search="onSearch"></Head>
         <!-- <div class="home_logo flex justify-center"><img src="@/assets/imgs/home/home_logo.png" alt=""></div> -->
         <!-- <van-swipe class="home_logo" :autoplay="3000" indicator-color="white">
             <van-swipe-item><img src="@/assets/imgs/home/Slider-1.jpg" alt=""></van-swipe-item>
@@ -33,7 +33,7 @@
         </div>
 
         <!-- 新闻 -->
-        <!-- <van-notice-bar class="font-26 mt-10 index_notice" background="#fafbfc" :scrollable="false" wrapable
+        <van-notice-bar class="font-26 mt-10 index_notice" background="#333" :scrollable="false" wrapable
             color="#333333">
             <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
                 <van-swipe-item v-for="item in announceList" :key="item.id" @click="toAnnounceDetail(item.uuid)">
@@ -46,7 +46,7 @@
                     </div>
                 </van-swipe-item>
             </van-swipe>
-        </van-notice-bar> -->
+        </van-notice-bar>
 
         <!-- <div class="flex justify-between mt-10">
             <van-swipe class="home_swipe_1" :autoplay="2000">
@@ -112,7 +112,7 @@
     // { key: 3, name: `C2C ${t('交易')}`, icon: new URL('@/assets/imgs/home/home_3.png', import.meta.url) },
     // { key: 4, name: t('邀请好友'), icon: new URL('@/assets/imgs/home/home_4.png', import.meta.url) },
     // { key: 5, name: t('合约'), icon: new URL('@/assets/imgs/home/home_5.png', import.meta.url), path: '/trade/index' },
-    { key: 6, name: t('现货'), icon: new URL('@/assets/imgs/home/home_5.png', import.meta.url), path: '/cryptos/trade/btcusdt' },
+    // { key: 6, name: t('现货'), icon: new URL('@/assets/imgs/home/home_5.png', import.meta.url), path: '/cryptos/trade/btcusdt' },
     { key: 2, name: t('储值'), icon: new URL('@/assets/imgs/home/home_2.png', import.meta.url), path: '/cryptos/recharge/rechargeList?isForeign=true' },
     // { key: 7, name: t('提现'), icon: new URL('@/assets/imgs/home/home_6.png', import.meta.url), path: '/exchange/withdraw-usdt' }
     { key: 7, name: t('提现'), icon: new URL('@/assets/imgs/home/home_6.png', import.meta.url), path: '/cryptos/Withdraw/withdrawPage' },
@@ -121,10 +121,11 @@
     // { key: 9, name: t('划转'), icon: new URL('@/assets/imgs/home/home_8.png', import.meta.url), path: '/my/transfer' },
     // { key: 10, name: t('更多'), icon: new URL('@/assets/imgs/home/home_9.png', import.meta.url) },
 
-    { key: 11, name: "STO", icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url), path: '/ICO/ico' },
+    // { key: 11, name: "STO", icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url), path: '/ICO/ico' },
     // { key: 12, name: "C2C", icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url), path: '/wantBuy' },
     // { key: 13, name: t('质押'), icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url), path: '' },
     { key: 14, name: t('onLineService'), icon: new URL('@/assets/imgs/home/home_10.png', import.meta.url), path: '/customerService' },
+    { key: 15, name: 'DXCM PDF', icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url), path: '' },
 ]
 
 // 获取公告数据
@@ -171,6 +172,8 @@
 
 //#region 行情数据----------------------------------------
 let qList = ref([])
+let qListCope = ref([]) // 备份数据
+let key = ref('') // 搜索关键词
 let timeout = ref(null)
 const coinArr = computed(() => store.getters['home/coinArr']);
 
@@ -181,7 +184,16 @@
     if (!(list instanceof Array)) {
         return
     }
-    qList.value = list;
+
+    // 通过关键字进行筛选
+    if (key.value) {
+        qList.value = list.filter(item => {
+            return item.symbol_data.toLowerCase().includes(key.value.toLowerCase()) || item.name.toLowerCase().includes(key.value.toLowerCase())
+        })
+    } else {
+        qList.value = list
+    }
+    qListCope.value = list; // 备份数据
 
     if (timeout.value) {
         clearTimeout(timeout.value)
@@ -191,6 +203,20 @@
     }, TIME_OUT)
 }
 fetchQList()
+
+// 搜索
+const onSearch = (val) => {
+    key.value = val
+
+    if (!val) {
+        qList.value = qListCope.value
+        return
+    }
+    let newList = qListCope.value.filter(item => {
+        return item.symbol_data.toLowerCase().includes(val.toLowerCase()) || item.name.toLowerCase().includes(val.toLowerCase())
+    })
+    qList.value = newList
+}
 
 onBeforeUnmount(() => {
     if (timeout.value) {
@@ -202,13 +228,15 @@
 </script>
 
 <style lang="scss">
+@import '@/assets/theme/index.scss';
+
 .home_page {
-    background: $white;
+    // background: $white;
     min-height: 100vh;
     width: 100%;
     padding: 1rem 1rem 10rem 1rem;
     // $log-c: #282828;
-    $tab-c: #343434;
+    $tab-c: #888;
     $inp-c: #999;
     $crd-b: #f7f7f7;
 
@@ -227,8 +255,14 @@
         }
 
         .notice_content {
+            @include themify() {
+                color: themed("text_color");
+            }
+
             &>div:first-child {
-                color: $text_color1;
+                @include themify() {
+                    color: themed("text_color1");
+                }
             }
         }
     }

--
Gitblit v1.9.3