lxf
2025-07-11 2a95677853ec636b4c568d0045a8bb1d4ef13097
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<template>
  <section class="pb-fix">
    <div class="container-box">
      <header class="header">
        <div class="flex-l">
          <div class="icon back">
            <img src="@/assets/image/back.png" alt="" @click="onRoute('/quotes/openTrade')">
          </div>
          <span class="title">历史成交</span>
        </div>
        <div class="icon-group">
          <div class="icon refresh">
            <img src="@/assets/image/quotes/refresh.png" alt="">
          </div>
          <div class="icon search" @click="onRoute('/exchangeHistory/search')">
            <img src="@/assets/image/optional/search.png" alt="">
          </div>
        </div>
      </header>
      <section class="tab-container">
        <van-tabs v-model:active="tabActive">
          <van-tab title="历史成交" />
          <van-tab title="历史成交汇总" />
        </van-tabs>
        <div class="select-date-container flex">
          <div class="flex-l">
            <div class="flex-l-item" @click="showCalendar = true">
              <span>{{ startTime }}</span>
            </div>
            <span class="symbol">~</span>
            <div class="flex-l-item" @click="showCalendar = true">
              <span>{{ endTime }}</span>
            </div>
          </div>
          <div class="flex-r">
            <van-button type="primary" size="small">确定</van-button>
          </div>
          <van-calendar v-model:show="showCalendar" type="range" @confirm="onConfirm" :confirm-text="$t('confirm')"
            :confirm-disabled-text="$t('confirm')" :formatter="formatter" :title="$t('selectDate')" :min-date="minDate"
            :max-date="maxDate" />
        </div>
        <div>
          <DealTab v-if="tabActive === 0" />
          <DealTab2 v-if="tabActive === 1" />
        </div>
      </section>
    </div>
  </section>
</template>
    
<script setup>
import { ref, onMounted, onBeforeMount } from 'vue';
import { useUserStore } from '@/store/user';
import { useRoute, useRouter } from 'vue-router';
import { DatePicker } from 'vant';
import {
  contractOrder
} from "@/service/trade.api.js";
import { _getQuotes } from '@/service/quotes.api'
import { useI18n } from 'vue-i18n'
import { useQuotesStore } from '@/store/quotes.store'
import DealTab from './components/DealTab.vue'
import DealTab2 from './components/DealTab2.vue'
import dayjs from 'dayjs';
 
const minDate = ref(new Date(new Date().getFullYear(), 0, 1));
const maxDate = ref(new Date());
const showCalendar = ref(false)   // 自定义日期筛选组件
const startTime = ref(dayjs().add(-90, 'd').format('YYYY-MM-DD')) // 默认最近三个月
const endTime = ref(dayjs().format('YYYY-MM-DD'))
 
const quotesStore = useQuotesStore()
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
const allEtfTabIndex = ref(0)
const allEtfListData = ref([])
const interval = ref(null)
const symbolType = ref('forex') //默认查询外汇
const price = ref('')
const tabActive = ref(0)
 
onMounted(async () => {
 
 
})
 
onBeforeMount(() => {
 
})
 
const onRoute = (path) => {
  router.push({
    path,
    query: {
      tabActive: 3
    }
  })
}
 
const onConfirm = (values) => {
  const [start, end] = values;
  showCalendar.value = false;
  startTime.value = dayjs(start).format('YYYY-MM-DD')
  endTime.value = dayjs(end).format('YYYY-MM-DD')
}
 
</script>
<style lang="scss" scoped>
:deep(.van-tabs__nav) {
  background: $selectSymbol_background;
}
 
:deep(.van-tab) {
  font-size: 14px;
  color: $text_color;
  font-weight: 400;
}
 
:deep(.van-tab.van-tab--active) {
  font-weight: 700;
}
 
:deep(.van-button--small) {
  height: 30px;
  width: 70px;
}
 
:deep(.van-calendar) {
  background: #1F233D;
  ;
}
 
:deep(.van-calendar__header-title) {
  color: $text_color;
}
 
:deep(.van-calendar__header-subtitle) {
  color: $text_color;
}
 
:deep(.van-calendar__month-title) {
  color: $text_color;
}
 
:deep(.van-calendar__month-mark) {
  color: rgb(242, 243, 245, 0.1);
}
 
.container-box {
 
  .header {
    position: relative;
    display: flex;
    height: 28px;
    padding: 0 12px;
 
    .flex-l {
      flex: 1;
      display: inline-flex;
 
      .icon {
        display: inline-block;
        width: 24px;
        height: 28px;
        padding: 6px 4px;
 
        img {
          height: 20px;
          width: 20px;
        }
      }
    }
 
    .title {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      flex: 1;
      text-align: center;
      font-weight: 700;
      font-size: 16px;
      line-height: 28px;
      color: $mainTextColor;
    }
 
    .icon-group {
      text-align: right;
 
      .icon {
        display: inline-block;
        width: 28px;
        height: 28px;
        padding: 4px;
        margin-left: 16px;
      }
    }
 
 
  }
 
  .tab-container {
    margin-top: 8px;
  }
 
  .select-date-container {
    margin-top: 8px;
    padding: 0 30px;
    justify-content: space-between;
 
    .flex-l {
      flex: 1;
      display: flex;
      align-items: center;
      font-size: 12px;
 
      .flex-l-item {
        border: 1px solid $border_color;
        border-radius: 2px;
        padding: 2px 8px;
      }
 
      .symbol {
        margin: 0 10px;
      }
    }
 
    .flex-r {
      width: 80px;
      text-align: right;
    }
  }
 
}
</style>