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
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
<template>
  <section class="pb-fix">
    <div class="container-box">
      <header class="header">
        <div class="flex-l">
          <div class="icon back">
            <van-icon name="arrow-left" size="20" @click="onRoute('/quotes/openTrade')" />
          </div>
          <span class="title">{{ t('历史委托') }}</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="近7日" />
          <van-tab title="近30日" />
          <van-tab title="自定义" />
        </van-tabs>
        <div class="select-date-container flex" v-if="tabActive === 2">
          <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>
        <HistoricalEntrustTab ref="tabRef" :tabActive="tabActive" :startTime="startTime" :endTime="endTime" />
      </section>
    </div>
  </section>
</template>
    
<script setup>
import { ref, onMounted, onBeforeMount } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { _getQuotes } from '@/service/quotes.api'
import { useI18n } from 'vue-i18n'
import HistoricalEntrustTab from './components/HistoricalEntrustTab.vue'
import dayjs from 'dayjs';
 
const { t } = useI18n()
const router = useRouter()
const tabRef = ref()
const tabActive = ref(0)
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'))
 
onMounted(async () => {
 
 
})
 
onBeforeMount(() => {
 
})
 
const onRoute = (path) => {
  router.push({
    path,
    query: {
      tabActive: 3
    }
  })
}
const onConfirm = (prop) => {
  startTime.value = dayjs(prop[0]).format('YYYY-MM-DD')
  endTime.value = dayjs(prop[1]).format('YYYY-MM-DD')
  tabRef.value.getOrderList()
  showCalendar.value = false
}
 
</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;
}
 
 
.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>