1
李凌
2025-10-21 1383f2e83f0830ed8120ac136d74c307f69b9671
src/views/homePage/index.vue
@@ -1,14 +1,19 @@
<template>
    <div class="home_page">
        <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 class="home_logo" :autoplay="3000" indicator-color="white">
            <van-swipe-item><img src="@/assets/imgs/home/Slider-1.jpg" alt=""></van-swipe-item>
            <van-swipe-item><img src="@/assets/imgs/home/Slider-2.jpg" alt=""></van-swipe-item>
            <van-swipe-item><img src="@/assets/imgs/home/Slider-3.jpg" alt=""></van-swipe-item>
            <van-swipe-item><img src="@/assets/imgs/home/Slider-4.jpg" alt=""></van-swipe-item>
        </van-swipe>
        </van-swipe> -->
        <video autoplay loop muted playsinline class="home_logo">
            <source src="@/assets/video/home_1.mp4" type="video/mp4">
            您的浏览器不支持 video 标签。
        </video>
        <!-- <div class="text-center font-bold mt-8 logo_text">{{ $t('复制财富,從此刻開始') }}</div>
        <div class="text-center mt-2 logo_text_small">{{ $t('超6000種熱門交易類別,立即註冊领取5000USDT') }}!</div> -->
@@ -27,7 +32,8 @@
            </div>
        </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="#fafbfc" :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)">
@@ -40,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,13 +118,14 @@
    { key: 7, name: t('提现'), icon: new URL('@/assets/imgs/home/home_6.png', import.meta.url), path: '/cryptos/Withdraw/withdrawPage' },
    // { key: 8, name: t('卡券中心'), icon: new URL('@/assets/imgs/home/home_7.png', import.meta.url) },
    // { key: 9, name: t('闪兑'), icon: new URL('@/assets/imgs/home/home_8.png', import.meta.url), path: '/cryptos/exchangePage' },
    { key: 9, name: t('划转'), icon: new URL('@/assets/imgs/home/home_8.png', import.meta.url), path: '/my/transfer' },
    // { 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: 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: t('MCB白皮书'), icon: new URL('@/assets/imgs/home/home_1.png', import.meta.url), path: '/aboutUs?serviceTerm=28' },
]
// 获取公告数据
@@ -165,6 +172,8 @@
//#region 行情数据----------------------------------------
let qList = ref([])
let qListCope = ref([]) // 备份数据
let key = ref('') // 搜索关键词
let timeout = ref(null)
const coinArr = computed(() => store.getters['home/coinArr']);
@@ -175,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)
@@ -185,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) {
@@ -228,8 +260,8 @@
    }
    .home_logo {
        width: 43rem;
        margin: 4rem auto 2rem;
        width: 48rem;
        margin: 2rem auto 1rem;
        border-radius: 1rem;
        img {