10.10综合交易所原始源码_移动端
admin
2026-01-06 42faef34194c466f03e29d75a63ae502e4213044
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<template>
  <div class="pb-fix">
    <div class="container-box">
      <header class="header flex" @click="router.back()">
        <div class="icon back">
          <van-icon name="arrow-left" size="20" />
        </div>
        <p class="title">{{ t('选择币种') }}</p>
      </header>
      <p class="title-box">{{ t('Hots') }}</p>
      <!-- <van-index-bar v-for="(item, index) in currencies" :key="index" :index-list="newLetter">
        <van-index-anchor class="index-anchor" :index="item.name" />
        <div @click="openAdd(items.name)" class="item-cell ml-4 py-4" v-for="(items, index) in item.list" :key="index">
          {{ items }}
        </div>
      </van-index-bar> -->
      <!-- <van-index-bar> -->
      <!-- <van-index-anchor index="A" /> -->
      <van-cell v-for="(item, index) in currencyList" @click="itemClick(item)" :key="index">
        <template #title>
          {{ item.currency }}
        </template>
      </van-cell>
 
      <!-- <van-index-anchor index="B" /> -->
      <!-- </van-index-bar> -->
    </div>
  </div>
</template>
  
<script setup>
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { IndexBar, IndexAnchor } from 'vant';
import { _getCurrencyList } from "@/service/trade.api.js";
import { _listExchanges } from '@/service/quotes.api'
import { useQuotesStore } from '@/store/quotes.store';
 
const { t } = useI18n()
const router = useRouter()
const currencies = ref([]);
const currencyList = ref([])
const quotesStore = useQuotesStore()
onMounted(() => {
  // getCurrencyList()
  listExchanges()
})
 
const getCurrencyList = () => {
  // 获取法币列表
  _getCurrencyList().then(res => {
    currencies.value = res.map(item => {
      return {
        name: item.currency
      }
    });
    console.log(currencies.value, 'currencies.value')
  })
}
 
const itemClick = (item) => {
  console.log(item, 'item')
  quotesStore.$state.currency = item.currency
  router.go(-1)
 
}
//获取币种
const listExchanges = () => {
  _listExchanges().then((res) => {
    currencyList.value = res.slice(1, res.length)
    console.log(currencyList.value[1].name)
  })
}
</script>
  
<style lang="scss" scoped>
:deep(.van-cell) {
  background: $mainBgColor;
  color: $text_color;
  border-bottom: 1px solid $border_color;
}
 
:deep(.van-cell::after) {
  border: none;
}
 
:deep(.van-index-anchor--sticky) {
  background: $border_color;
}
 
:deep(.van-index-bar__index) {
  color: $color_main;
  font-size: 12px;
  margin-top: 6px;
}
 
 
.container-box {
  .header {
    padding: 0 12px;
    align-items: center;
 
    .title {
      font-size: 16px;
      color: $text_color;
      text-align: center;
      flex: 1;
      transform: translate(-20px, 0px);
    }
 
    .icon {
      display: inline-block;
      width: 20px;
      height: 20px;
    }
  }
 
  .title-box {
    margin-top: 10px;
    padding: 0 12px;
    height: 32px;
    background: $selectSymbol_background;
    line-height: 32px;
    font-weight: 400;
    font-size: 12px;
    color: #747A8F;
  }
 
  .selectPay {
    .index-anchor {
      background: $recommend_bg;
    }
  }
 
  .item-cell {
    border-bottom: 1px solid $border_color;
  }
 
}
</style>