1
lxf
2025-06-23 1e47b1681854ea564215482fb3b2d73934fa3edc
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<template>
  <div id="cryptos">
    <div class="loanHistory">
      <assets-head :title="$t('借贷记录')" />
      <!--      Tab区域-->
      <div class="tabMenu flex justify-start items-center">
        <div class="tabList">
          <div class="tab" :class="item.id === activeTabIndex ? 'activeTab' : ''" v-for="item in tabMenuList"
            :key="item.id" @click="changeTab(item)">
            <span>{{ item.menuName }}</span>
          </div>
        </div>
      </div>
      <!--   container -->
      <div class="container px-32">
        <!--      列表区域-->
        <div v-if="loanOrderList && loanOrderList.length > 0">
          <div class="historyData flex justify-between py-40 border-b-grey textColor" v-for="item in loanOrderList"
            :key="item.id">
            <div class="left">
              <!--            <div class="mb-30">{{ $t('借贷人') }}: 张三</div>-->
              <div class="mb-30">
                <span>{{ $t('借款金额') }}: </span>
                <span :class="item.status === 5 ? 'text-red' : 'text-green'">{{ item.status === 5 ? '-' : '+' + item.quota
                }} {{
  item.symbol }}</span>
              </div>
              <div class="mb-30">{{ $t('备注') }}: {{ item.reason }}</div>
              <div v-if="item.state === 2">{{ $t('剩余天数') }}: {{ item.remainQuota }}</div>
            </div>
            <div class="right text-center text-white">
              <div class="loanBtn mb-20" @click="$router.push('customerService')" v-if="item.state === 2">{{ $t('申请还款') }}
              </div>
              <div class="loanBtn mb-20" :style="{ background: loanBgText(item.state) }" v-else>{{ loanText(item.state) }}
              </div>
              <div class="loanBtn" style="background: #00a7ee;" @click="getLoanDetail(item.id)">{{ $t('详情') }}</div>
            </div>
          </div>
        </div>
        <!--      无数据-->
        <div class="flex items-center flex-col" style="margin-top: 198px" v-else>
          <div class="noDataImg mb-24 ">
            <img src="@/assets/image/loan/noData.png" alt="nodData" />
          </div>
          <p class="textColor1">{{ $t('暂无数据') }}</p>
        </div>
      </div>
 
      <van-popup v-model:show="isDetail" class="w-full rounded-2xl" style="width: 94%">
        <div class="px-32 bg-white py-40">
          <div class="text-center font-36 font-700 py-20">
            {{ $t('订单详情') }}
          </div>
          <div class="loanList">
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('期望借款金额') }}</span>
              </div>
              <div class="flex align-center">
                <!--            <input class="font-600 textColor border-none text-right mr-14 mainBackground" v-model="loanAmount"  disabled="disabled" @input="inputAmunt" />-->
                <span class="mr-14 font-600 ">{{ loanData.quota || 0 }}</span>
                <span class="font-600 ">USDT</span>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('还款周期') }}</span>
              </div>
              <div class="flex align-center text-right">
                <div class="font-600 ">
                  <span>{{ loanData.term }} {{ $t('Day') }}</span>
                </div>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('日利率') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600">{{ loanData.dailyRate * 1 * 100 || 0 }}%</span>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('还款方式') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600 text-right">{{ $t('到期一次还款') }}</span>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('利息') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600">{{ loanData.totalInterest || 0 }} USDT</span>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('放款机构') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600">{{ loanData.lendingName }}</span>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey">
              <div>
                <span class="grayText">{{ $t('状态') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600" :style="{ color: loanBgText(loanData.state) }">{{ loanText(loanData.state)
                }}</span>
              </div>
            </div>
            <div class="flex justify-between py-30 border-b-grey" v-if="loanData.state === 2">
              <div>
                <span class="grayText">{{ $t('剩余天数') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600">{{ loanData.remainQuota }}</span>
              </div>
            </div>
            <div class="flex justify-between py-30">
              <div>
                <span class="grayText">{{ $t('订单时间') }}</span>
              </div>
              <div class="flex align-center">
                <span class="font-600">{{ dataTimeEx(loanData.createTime) }}</span>
              </div>
            </div>
          </div>
        </div>
      </van-popup>
    </div>
  </div>
</template>
 
<script>
import AssetsHead from "@/components/Transform/assets-head/index.vue";;
import { _loanOrderList, _loanOrderDetail } from "@/service/fund.api"
import { Popup } from "vant";
import { dataTimeEx } from '@/utils/utis'
export default {
  name: "loanHistory",
  mounted() {
    this.getLoanOrderList()
  },
  methods: {
    //订单详情
    getLoanDetail(orderNo) {
      _loanOrderDetail(orderNo).then(res => {
        this.loanData = res
        this.isDetail = true
      })
    },
    getLoanOrderList() {
      _loanOrderList().then(res => {
        this.loanOrderList = res.sort((a, b) => b.createTime - a.createTime)
        this.loanAllOrderList = this.loanOrderList
      })
    },
    loanBgText(val) {
      const bg = { '0': '#BBA635', '1': '#bba635', '2': '#00a7ee', '3': '#E35461', '4': '#b0b4bc', }
      // console.log('this.btnBg',bg[val])
      return bg[val]
    },
    loanText(val) {
      const loanStatus = { '1': this.$t('审批中'), '3': this.$t('审批失败'), '2': this.$t('还款中'), '4': this.$t('已逾期'), '5': this.$t('已还款'), }
      return loanStatus[val] || this.$t('审批中')
    },
    changeTab(item) {
      this.activeTabIndex = item.id
      if (item.id === 0) {
        this.loanOrderList = this.loanAllOrderList
      } else {
        this.loanOrderList = this.loanAllOrderList.filter(data => data.state === item.id)
      }
    }
  },
  computed: {
  },
  data() {
    return {
      activeTabIndex: 0,
      isData: true,
      loanStatus: 0,
      btnBg: '',
      tabMenuList: [
        { id: 0, menuName: this.$t('全部') },
        { id: 1, menuName: this.$t('审批中') },
        { id: 3, menuName: this.$t('审批失败') },
        { id: 2, menuName: this.$t('还款中') },
        { id: 5, menuName: this.$t('已还款') },
      ],
      loanOrderList: [],
      loanAllOrderList: [],
      isDetail: false, //详情弹窗
      loanData: {},
      dataTimeEx,//时间戳格式化
    }
  },
  components: {
    AssetsHead,
    [Popup.name]: Popup
  }
}
</script>
 
<style scoped lang="scss">
@import "@/assets/init.scss";
 
#cryptos {
  .loanHistory {
    width: 100%;
    box-sizing: border-box;
  }
 
  //隐藏滚动条
  .tabMenu::-webkit-scrollbar {
    display: none
  }
 
  .tabMenu {
    border-top: 1px solid $border_color;
    border-bottom: 1px solid $border_color;
    padding: 30px;
    overflow: auto hidden;
    touch-action: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
 
    .tabList {
      white-space: nowrap;
      padding-right: 30px;
      touch-action: auto;
 
      .tab {
        display: inline-block;
        color: #999999;
        height: 60px;
        line-height: 60px;
        text-align: center;
        transition: .5s;
        margin-right: 52px;
        border-radius: 34px;
        touch-action: auto;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        border: 1px solid transparent;
 
        &.ani {
          transform: translate3d(0, 0, 0);
        }
      }
    }
 
    .activeTab {
      border-radius: 32px;
      padding: 0 36px;
      -webkit-backface-visibility: hidden !important;
      backface-visibility: hidden !important;
      border: 1px solid $active_line !important;
      color: $color_main !important;
    }
  }
 
  .noDataImg {
    width: 165px;
    height: 160px;
 
    img {
      width: 100%;
      height: 100%;
    }
  }
 
  .loanBtn {
    padding: 14px 30px;
    background: #004aee;
    border-radius: 10px;
  }
}
</style>