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
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
236
237
<template>
  <div id="cryptos">
    <div id="MiningPoolFinanceHistory" class="MiningPoolFinanceHistory">
      <assets-head :title="$t('历史')" :back-func="() => {
        $router.push({
          path: '/cryptos/funds',
          query: {
            tab: 3,
            index: type, // 0: 查看理财订单 1: 矿机
            type: 'cryptos'
          }
        })
      }"></assets-head>
      <van-tabs v-model:active="active" ref="tabs" @change="onchange">
        <van-tab :title="$t('购买')">
          <div class="mainBackground h-2"></div>
          <van-pull-refresh :pulling-text="$t('下拉即可刷新')" :loosing-text="$t('释放即可刷新')" :loading-text="$t('加载中')"
            v-model="isLoading" @refresh="onRefresh">
            <van-list v-model:loading="loading" :finished="finished" @load="onLoad" :loading-text="$t('加载中')">
              <div v-for="(item, index) in list" :key="'buy' + index">
                <div class="box-border px-8">
                  <div class="flex justify-between items-center h-28 text-32 font-normal">
                    <div class="text-grey">{{ $t('时间') }}</div>
                    <div class="textColor"> {{ item.create_time }}</div>
                  </div>
                  <div class="flex justify-between items-center h-28 text-32 font-normal">
                    <div class="text-grey">{{ $t('数量') }}</div>
                    <div class="textColor">{{ item.amount }}&nbsp;USDT</div>
                  </div>
                  <div class="flex justify-between items-center h-28 text-32 font-normal">
                    <div class="text-grey">{{ $t('周期') }}</div>
                    <div class="textColor"> {{ item.cycle == 0 ? $t('无限期') : item.cycle + $t('天') }}</div>
                  </div>
                  <div class="flex justify-between items-center h-28 text-32 font-normal">
                    <div class="text-grey">{{ $t('累计收益') }}</div>
                    <div class="textColor" :class="item.profit / 1 > 0 ? 'text-green' : 'text-red'"> {{ item.profit }}
                    </div>
                  </div>
 
                </div>
                <div class="diviLine h-3"></div>
              </div>
            </van-list>
          </van-pull-refresh>
        </van-tab>
        <van-tab :title="$t('赎回')">
          <div class="mainBackground h-2"></div>
          <van-pull-refresh :pulling-text="$t('下拉即可刷新')" :loosing-text="$t('释放即可刷新')" :loading-text="$t('加载中')"
            v-model:loading="isLoading" @refresh="onRefresh">
            <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('没有更多了')" @load="onLoad">
              <div class="flex justify-center">
                <financial-list :list="list" :btnShow="false" :type="type" :goBack="true"></financial-list>
              </div>
            </van-list>
          </van-pull-refresh>
 
        </van-tab>
        <van-tab :title="$t('利息')">
          <div class="mainBackground h-2"></div>
          <van-pull-refresh :pulling-text="$t('下拉即可刷新')" :loosing-text="$t('释放即可刷新')" :loading-text="$t('加载中')"
            v-model="isLoading" @refresh="onRefresh">
            <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('没有更多了')" @load="onLoad">
              <div v-for="(item, index) in list" :key="'interest' + index">
                <div class="flex justify-between items-center h-36 px-8">
                  <div class="flex items-center">
                    <img v-if="item.amount / 1 > 0 ? false : true" src="@/assets/image/assets-center/out.png" alt=""
                      class="w-11 h-11 mr-8">
                    <img v-else src="@/assets/image/assets-center/in.png" alt="" class="w-11 h-11 mr-8">
                    <div class="flex flex-col">
                      <div class="mb-4 text-32 font-normal textColor">{{ $t('利息数量') }}(USDT)</div>
                      <div class="text-grey text-28">{{ item.createTimeStr }}</div>
                    </div>
                  </div>
                  <div class="text-32" :class="item.amount / 1 > 0 ? 'text-green' : 'text-red'">{{ item.amount }}</div>
                </div>
                <div class="diviLine h-2"></div>
              </div>
            </van-list>
          </van-pull-refresh>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>
 
<script>
import { Tab, Tabs, Icon, List, PullRefresh, Button } from 'vant';
import assetsHead from '@/components/Transform/assets-head/index.vue';
 
import { getfinacialProductsBought, getMachineBought } from '@/service/financialManagement.api.js';
import { _fundRecord } from '@/service/fund.api';
import financialList from "@/components/Transform/assetsCenter/financialList.vue";
export default {
  name: "FinancialHistory",
  components: {
    [Tab.name]: Tab,
    [Tabs.name]: Tabs,
    [Icon.name]: Icon,
    [List.name]: List,
    [Button.name]: Button,
    [PullRefresh.name]: PullRefresh,
    assetsHead,
    financialList
  },
  data() {
    return {
      type: 0, // 是普通理财历史  1 是矿池理财历史
      isLoading: false, // 下拉刷新LOADING
      loading: false,
      finished: false,
      page: 1,
      active: 0,
      list: [],
    }
  },
  methods: {
    handleGoOrderDetail(item) {
      if (this.type === 0) {
        this.$router.push({
          path: '/cryptos/financialOrder',
          query: {
            ...item,
            showBtn: this.active === 0,
            goBack: true
          }
        })
      } else {
        this.$router.push({
          path: '/cryptos/miningMachineOrder',
          query: {
            ...item,
            showBtn: this.active === 0,
            goBack: true
          }
        })
      }
    },
    onRefresh() {
      console.log('refresh')
      this.init()
    },
    onLoad() {
      this.get()
    },
    onchange() {
      this.init()
    },
    init() {
      this.page = 1
      this.list = []
      this.get()
    },
    get() {
      if (this.type === 0) { // 普通理财历史
        if (this.active === 0) {
          getfinacialProductsBought({
            page_no: this.page,
            state: '1'
          }).then(res => { // 已购理财产品
            this.handleData(res)
          })
        } else if (this.active === 1) {
          getfinacialProductsBought({
            page_no: this.page,
            state: '2'
          }).then(res => {  // 已赎回理财产品
            this.handleData(res)
          })
        } else {
          _fundRecord('finance', this.page, 'finance_profit').then(res => { // 利息
            this.handleData(res)
          })
        }
      } else {  // 矿机理财历史
        if (this.active === 0) {
          getMachineBought({
            page_no: this.page,
            state: '1'
          }).then(res => { // 已购理财产品
            this.handleData(res)
          })
        } else if (this.active === 1) {
          getMachineBought({
            page_no: this.page,
            state: '2'
          }).then(res => {  // 已赎回理财产品
            this.handleData(res)
          })
        } else {
          _fundRecord('miner', this.page, 'miner_profit').then(res => { // 利息
            this.handleData(res)
          })
        }
      }
    },
    handleData(data) {
      this.isLoading = false;
      console.log(data)
      this.list = this.list.concat(data)
      this.loading = false
      if (data.length < 10) {
        this.finished = true
      }
      this.page++
    }
  },
  created() {
    if (this.$route.query.tab) {
      this.active = this.$route.query.tab
    }
    if (this.$route.query.type) {
      this.type = this.$route.query.type / 1
    }
  },
  mounted() {
  },
}
</script>
 
<style lang="scss" scoped>
#cryptos {
  font-size: 30px;
 
  .MiningPoolFinanceHistory {
    width: 100%;
    box-sizing: border-box;
 
    :deep(.van-tabs__nav) {
      background-color: $main_background;
    }
 
    :deep(.van-tab--active) {
      color: $text_color;
    }
  }
}
</style>