10.10综合交易所原始源码_移动端
admin
2026-01-06 04d8c6bfd48267c7b2eaccaa03170618d83e4cbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
    <div class="pb-fix">
        <van-sticky>
            <fx-header>
                <template #title>
                    <van-field class="flex-1 text-gray-100" v-model="searchVal" @input="onInput"
                        :placeholder="$t('search')" />
                </template>
            </fx-header>
        </van-sticky>
        <list-item v-for="(item, index) in searchList" :item="item" :key="index" @click-item="onClickItem"></list-item>
        <!-- 长按弹框 -->
    </div>
</template>
  
<script setup>
import ListItem from "@/components/list-item/index.vue";
import { ref, onMounted } from "vue";
import { _ItemUserOptionalItemAdd } from '@/service/quotes.api'
import { useQuotesStore } from '@/store/quotes.store'
import { useRouter, useRoute } from "vue-router";
const router = useRouter()
const route = useRoute()
 
const quotesStore = useQuotesStore()
const allList = ref([])
const searchList = ref([])
 
 
onMounted(() => {
    allList.value = quotesStore.coins
    searchList.value = allList.value
})
 
 
 
 
const onClickItem = (evt) => {
    if (route.query.id) {
        ItemUserOptionalItemAddFn(evt.symbol, route.query.id)
    }
 
}
 
const ItemUserOptionalItemAddFn = (symbol, list_id) => {
    _ItemUserOptionalItemAdd({
        symbol: symbol,
        list_id: list_id
    }).then(res => {
        router.push('/quotes/index')
    })
}
const onInput = () => {
    if (searchVal.value == '') {
        searchList.value = allList.value
    } else {
        searchList.value = allList.value.filter((item) => {
            return item.symbol.indexOf(searchVal.value.toUpperCase()) !== -1
        })
    }
}
// 搜索
const searchVal = ref('');
 
</script>
  
<style lang="scss" scoped>
:deep(.van-nav-bar__title) {
    position: relative;
    top: 2px;
    max-width: 72%;
}
 
:deep(.van-nav-bar__title) {
    flex: 1;
}
 
:deep(.van-field__control) {
    font-size: 16px;
    font-weight: 500;
    caret-color: #3157BE;
}
 
// :deep(.van-field__control::placeholder) {
//     color: var(--dark-grey);
// }
</style>