交易所前端蓝色ui, 4.5 jiem
jhzh
2024-04-08 67357c691325dc3cf743267f1ef0e1f5c93d7528
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
import request from "@/request";
import axios from "axios";
import { compress } from 'image-conversion';
import { BASE_URL } from "@/config";
import { signatureGenerate } from "@/utils/signatureUtil"
 
// 图片上传
export const _uploadImage = (file, callback) => {
    const { timestamp, signature } = signatureGenerate()
    let comp = 0.6
    if (file.file.size > 512 * 1024) {
        comp = 0.2
    }
    // Toast.loading()
    return new Promise((resolve, reject) => {
        compress(file.file, comp).then(res => {
            const formData = new FormData()
            formData.append('file', res)
            axios.post(`${BASE_URL}public/uploadimg!execute.action`,
                formData,
                {
                    timeout: 15000,
                    headers:
                    {
                        "Content-Type": "multipart/form-data",
                        'tissuePaper': timestamp,
                        'sign': signature
                    },
                    onDownloadProgress: (progressEvent) => {
                        if (progressEvent.lengthComputeable) {
                            callback(((progressEvent.loaded / progressEvent.total) * 100).toFixed(2))
                        }
                    }
                }).then(res => {
                    // Toast.clear()
                    const { code, data } = res.data
                    if (code / 1 === 0) {
                        resolve(data)
                    }
                }).catch(err => {
                    // Toast.clear()
                    reject(err)
                })
        })
    })
}
 
// 申请认证
export const _applyIdentify = data => {
    return request({
        url: '/api/kyc!apply.action',
        method: 'GET',
        loading: true,
        duration: 0,
        params: {
            nationality: data.countryName, // 国籍
            idname: data.idname || 'id/passpost', // 证件名称
            idnumber: data.idnumber, // 证件号码
            name: data.name, // 姓名
            idimg_1: data.frontFile.length && data.frontFile[0].resURL || '',
            idimg_2: data.reverseFile.length && data.reverseFile[0].resURL || '',
            idimg_3: data.fileList.length && data.fileList[0].resURL || ''
        }
    })
}
 
// 认证信息
export const _getIdentify = () => {
    return request({
        url: '/api/kyc!get.action',
        method: 'GET'
    })
}
 
// =================   闪兑 ================
 
 
export const _getWallet = () => {
    return request({
        url: '/api/wallet!get.action',
        loading: false,
        method: 'GET'
    })
}
 
//闪兑
export const _getAllWallet = () => {
    return request({
        url: '/api/wallet!getAll.action',
        loading: false,
        method: 'GET'
    })
}
 
 
// 初始化接口
export const _initExchange = () => {
    return request({
        url: '/api/exchangeapplyorder!view.action',
        method: 'GET'
    })
}
 
// 闪兑
export const _exchange = (params) => {
    return request({
        url: '/api/exchangeapplyorder!buy_and_sell.action',
        method: 'GET',
        loading: true,
        params: {
            volume: params.volume, // 数量
            symbol: params.symbol.toLowerCase(), // 闪兑币
            symbol_to: params.symbol_to.toLowerCase(), // 闪兑后的币
            session_token: params.session_token //
        }
    })
}
 
// 汇率
export const _exchangeRage = (params) => {
    return request({
        url: '/api/exchangeapplyorder!buy_and_sell_fee.action',
        method: 'GET',
        params: {
            symbol: params.symbol.toLowerCase(), // 闪兑币
            symbol_to: params.symbol_to.toLowerCase(), // 闪兑后的币
            volume: params.volume || 1 // 闪兑数量
        }
    })
}
 
// 闪兑历史
export const _exchangeHistory = page_no => {
    return request({
        url: '/api/exchangeapplyorder!list.action',
        method: 'GET',
        params: {
            page_no
        }
    })
}
 
// 获取质押余额
export const _getBalance = () => {
    return request({
        url: '/api/dapp!getbalance.action',
        method: "GET"
    })
}
 
// 提现初始化参数
export const _initWidthdrawl = (eth) => {
    return request({
        url: '/api/dapp!exchange_fee.action',
        method: "GET",
        params: {
            eth
        }
    })
}
 
// 提现申请
export const _widthdrawl = (eth) => {
    return request({
        url: '/api/dapp!exchange.action',
        method: "GET",
        loading: true,
        params: {
            eth
        }
    })
}
 
// 交易记录
export const _records = (action = 'exchange', page_no = 1) => { // transfer
    return request({
        url: '/api/dapp!logs.action',
        method: "GET",
        loading: false,
        params: {
            action,
            page_no
        }
    })
}
 
 
// 充值详情
export const _rechargeDetail = (order_no) => {
    return request({
        url: "api/rechargeBlockchain!get.action",
        method: "get",
        params: {
            order_no
        }
    })
}
 
// 提现详情
export const _withdrawDetail = (order_no) => {
    return request({
        url: "api/withdraw!get.action",
        method: "get",
        params: {
            order_no
        }
    })
}
 
// 帐变记录
export const _fundRecord = (category = 'exchange', page_no = 1, contentType = '') => {
    return request({
        url: "api/moneylog!list.action",
        method: "get",
        params: {
            category,
            page_no,
            contentType
        }
    })
}