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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
| <template>
| <div class="header flex font-28">
| <div class="user" @click="$router.push('/userCenter')"><img src="@/assets/theme/dark/image/Group.png" alt=""></div>
| <div class="styleWh tabBackground rounded-full flex items-center input-container">
| <img src="@/assets/image/icon-search.png" alt="logo" />
| <input type="text" v-model="keywords" :placeholder="$t('搜索币种')" class="h-full flex-1 border-none bg-none textColor"
| @input="onInput" />
| </div>
| <div class="custom" @click="tokefu">
| <img src="@/assets/image/customer.png" alt="">
| </div>
| </div>
| </template>
|
| <script>
| import { THEME } from '@/config/theme'
| export default {
| props: {
| unread_num: {
| type: String,
| default: '',
| },
| },
| data() {
| return {
| THEME,
| keywords: '',
| inputTimeout: null,
| active: 1,
| tabList: [
| { id: 1, text: this.$t('自选'), data: [], loading: true },
| { id: 2, text: this.$t('现货'), data: [], loading: true },
| { id: 3, text: this.$t('合约'), data: [], loading: true }
| ],
| }
| },
| methods: {
| onInput() { // 输入
| if (this.inputTimeout) {
| clearTimeout(this.inputTimeout)
| this.inputTimeout = null
| }
| this.inputTimeout = setTimeout(() => {
| this.getFilterData()
| }, 50)
| },
| getFilterData() { // 过滤后的数据
| const index = this.active / 1 - 1
| //console.log(index)
| this.tabList[index]['data'] = this.tabList[index]['data'].filter(item => item.symbol.includes(this.keywords))
| },
| tokefu() {
| this.$router.push('/customerService')
| }
| }
| }
| </script>
|
| <style lang="scss" scoped>
| @import "@/assets/init.scss";
|
| #cryptos {
| .header {
| height: 72px;
| display: flex;
| justify-content: center;
| align-items: center;
| padding-top: 10px;
| margin-bottom: 10px;
|
| .user {
| width: 66px;
| height: 66px;
|
| img {
| width: 100%;
| height: 100%;
| }
| }
|
| .input-container {
| height: 64px;
|
| img {
| margin: 0 20px;
| width: 2rem;
| height: 2rem;
| }
| }
|
| .custom {
| width: 44px;
| height: 44px;
|
| img {
| width: 100%;
| height: 100%;
| }
| }
| }
|
| .styleWh {
| margin-left: 22px;
| margin-right: 26px;
| flex: 1;
| }
| }
| </style>
|
|