zj
2024-06-03 96140d8eb2531144828dffe2ad8c19d0d9431009
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
<template>
    <div class="pledgeLoanOrderDetail">
        <assets-head :title="$t('订单详情')"></assets-head>
        <div class="px-32 pt-54 tabBackground pb-100">
            <div class="skyColor font-44" :class="{'redColor':obj.state==3 ,'red': obj.state == 4,'text-grey':obj.state==2,'skyColor':obj.state==1}">{{obj.state?fixState(obj.state):'--'}}</div>
            <div class="font-32 mt-40 text-grey">{{$t('总负债')}}</div>
            <div class="mt-20 flex textColor items-center">
                <span class="mr-10 font-40">{{obj.debtAmount!==''? obj.debtAmount:'--'}}&nbsp;USDT</span>
                <div class="skyBg rounded ml-22 text-black px-26 py-8 font-28" v-if="obj.state == 1|| obj.state == 4" @click="toRepayment(obj.id,obj.debtAmount,obj.interestAmount,obj.loanAmount)">{{$t('还款')}}</div>
            </div>
            <div class="pb-100">
                <div class="flex mt-32">
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('贷款币种')}}</div>
                        <div class="font-40 mt-20 textColor">{{obj.loanCurrency?obj.loanCurrency.toUpperCase():'--'}}</div>
                    </div>
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('总借款')}}</div>
                        <div class="font-40 mt-20 textColor"><span class="mr-10">{{obj.loanAmount}}</span>USDT</div>
                    </div>
                </div>
                <div class="flex mt-32">
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('总利息')}}</div>
                        <div class="font-40 mt-20 textColor">{{obj.interestAmount === ''? '--':obj.interestAmount}}&nbsp;USDT</div>
                    </div>
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('时利率')}}/{{$t('天利率')}}</div>
                        <div class="font-40 mt-20 textColor"><span class="mr-10">{{obj.hourlyRate*100 || '--'}}%</span>/{{obj.hourlyRate?obj.hourlyRate*24*100:'--'}}%</div>
                    </div>
                </div>
                <div class="flex mt-32" v-if="obj.state==1 || obj.state==4">
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('质押率')}}</div>
                        <div class="font-40 mt-20 textColor">{{obj.pledgeRate!==''?(obj.pledgeRate*10000/100).toFixed(2):'--'}}%</div>
                    </div>
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('强平价格')}}({{obj.pledgeCurrency?obj.pledgeCurrency.toUpperCase():'--'}}/USDT)</div>
                        <div class="font-40 mt-20 textColor"><span class="mr-10">{{obj.closeOut || '--'}}</span></div>
                    </div>
                </div>
            </div>
            <div class="pt-82 pb-82 border-t-color" v-if="obj.state==4">
                <div class="flex mt-32" >
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('滞纳金')}}</div>
                        <div class="font-40 mt-20 textColor">{{obj.overdueAmount!==''?obj.overdueAmount:'--'}}&nbsp;USDT</div>
                    </div>
                    <div class="flex-1">
                        <div class="font-32 text-grey">{{$t('总滞纳金利率')}}</div>
                        <div class="font-40 mt-20 textColor"><span class="mr-10">{{obj.overdueRate!==''?(obj.overdueRate*1000/100).toFixed(2):'--' }}%</span></div>
                    </div>
                </div>
            </div>
            <div class="pt-82 border-t-color" >
                <div class="mb-44">
                    <div class="flex justify-between font-32 mb-44">
                        <span class="text-grey">{{ $t('订单号') }}</span>
                        <span class="textColor">{{obj.orderNo || '--'}}</span>
                    </div>
                    <div class="flex justify-between font-32 mb-44">
                        <span class="text-grey">{{$t('借款时间')}}</span>
                        <span class="textColor">{{obj.createTime || '--'}}</span>
                    </div>
                    <div class="flex justify-between font-32 mb-44">
                        <span class="text-grey">{{ $t('到期时间') }}</span>
                        <span class="textColor">{{obj.expireTime || '--'}}</span>
                    </div>
                    <div class="flex justify-between font-32 mb-44 items-center" @click="$router.push(`/pledgeRecord?id=${id}`)">
                        <span class="skyColor mr-14">{{$t('质押记录')}}</span>
                        <img src="@/assets/image/skyMore.png" alt="" class="w-32 h-32" />
                    </div>
                </div>
            </div>
            <div class="btnBox mt-144 flex items-center justify-between" v-if="obj.state==1">
                <div class="skyBorder h-96 box-border skyColor font-30 w-360 flex items-center rounded-lg justify-center" @click="toAddpledge(obj.id,obj.pledgeCurrency)">{{$t('新增质押')}}</div>
                <div class="skyBg h-96 box-border font-30 w-360 items-center rounded-lg flex items-center justify-center" @click="toRenew(obj.id,obj.pledgeCurrency)">{{$t('续借')}}</div>
            </div>
        </div>
    </div>
</template>
 
<script>
import assetsHead from "@/components/assets-head";
import Axios from "@/API/pledgeLoan.js";
    export default {
        props: {
 
        },
        components: {
            assetsHead
        },
        data(){
            return {
                id:'',
                obj:{
                    closeOut:'',
                    createTime:'',
                    debtAmount:'',
                    expireTime:'',
                    hourlyRate:'',
                    interestAmount:'',
                    loanAmount:'',
                    loanCurrency:'',
                    orderNo:'',
                    overdueAmount:'',
                    overdueRate:'',
                    pledgeRate:'',
                    state:'',
                    pledgeCurrency:'',
                }
            }
        },
        mounted(){
            this.id = this.$route.query.id
            this.getOrder();
        },
        methods: {
            getOrder() {
                Axios.getOrder({
                    loanOrderId: this.id
                }).then(res => {
                  this.obj = res.data
                })
            },
            fixState(state){
                let string = ''
                if (state == 1) {
                    string = this.$t('计息中')
                } else if (state == 2) {
                    string = this.$t('已结清')
                } else if (state == 3) {
                    string = this.$t('强平结清')
                } else if (state == 4) {
                    string = this.$t('已逾期')
                }
                return string
            },
            toRepayment(id, debtAmount, interestAmount, loanAmount) {
                this.$router.push({ path: '/repayment', query: { id, debtAmount, interestAmount, loanAmount } })
            },
            toAddpledge(id, pledgeCurrency){
                this.$router.push({ path: '/addPledge', query: { id, pledgeCurrency }})
            },
            toRenew(id, pledgeCurrency){
                this.$router.push({ path: '/pledgeLoanRenew', query: { id, pledgeCurrency } })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
.pledgeLoanOrderDetail{
    width: 100%;
    box-sizing: border-box;
}
.skyColor{
    color: #13D3EB;
}
.skyBorder{
    border: 1px solid #13D3EB;
}
.skyBg{
    background: #13D3EB;
}
.redColor {
    color: #E35461;
}
.red {
    color: #FF0000;
}
.yellowColor{
    color: #F5C425;
}
</style>