diff --git a/components/entrustOrderList/entrustOrderList.vue b/components/entrustOrderList/entrustOrderList.vue index 93e03ae..a436c29 100644 --- a/components/entrustOrderList/entrustOrderList.vue +++ b/components/entrustOrderList/entrustOrderList.vue @@ -2,7 +2,7 @@ - + {{ i18n.Position }} {{ i18n.Closed }} @@ -23,7 +23,7 @@ {{ i18n.close }} - + @@ -48,41 +48,42 @@ {{item.fee}} {{ i18n.StsPrice }} {{item.lossStopPrice}} - + - + {{ i18n.StopLimit }} - + {{ i18n.CurrentPrice }} {{marketDetail.close}} - {{ i18n.ROE }} - - - {{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}% + + {{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}% - + {{ i18n.ExpectProfit }} {{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}} 0 - + {{ i18n.close }} - + @@ -90,10 +91,11 @@ {{item.closedPrice}} {{ i18n.ROE }} - - - {{getValue(item.profitAmount/item.bondAmount)}}% - + + + {{getValue(item.profitAmount/item.bondAmount)}}% + {{ i18n.PL }} @@ -105,13 +107,13 @@ - {{ i18n.PL }} - 0 + 0 @@ -155,13 +157,13 @@ - - - + + + + :title="i18n.Margincall" :content='i18n.WarmTipsText' @confirm="stopConfirm" + @cancel="stopModalShowZui = false" confirmColor="#00E8A2" cancelColor="#96959E"> {{ i18n.AmountTrue }} @@ -175,7 +177,7 @@ - + @@ -237,7 +239,7 @@ closeModalShow: false, stopModalShow: false, type: 1, - stopModalShowZui:false, + stopModalShowZui: false, test: 0, dealList: [{ dealType: 'long' @@ -291,23 +293,35 @@ }, methods: { // 获取百分比位数 - getValue(e){ - let data = e*100 - data = parseFloat(data.toPrecision(10)) - data = String(data) - return data.substring(0, data.indexOf(".") + 3); + getValue(e) { + let data = e * 100 + data = parseFloat(data) + data = String(data) + if (data.indexOf(".") != -1) { + return data.substring(0, data.indexOf(".") + 3); + } else { + return data + } + }, + // 获取位数 getPrice(s) { - var i=s; + var i = s; /* js 数字精度问题 */ - i = parseFloat(i.toPrecision(10)) + i = parseFloat(i) i = String(i) - return i.substring(0, i.indexOf(".") + 5); + // return i.substring(0, i.indexOf(".") + 5); + if (i.indexOf(".") != -1) { + return i.substring(0, i.indexOf(".") + 5); + } else { + return i + } + }, - + stopModalChange() { if (this.stopLimitData.direction === 'buy') { if (this.styValue) @@ -341,14 +355,14 @@ this.loss = 0 }, // 设置保证金 - Margincall(i){ - this.stopLimitData = i - this.stopModalShowZui=true - this.styValue = 0; - this.stsValue = 0; - this.profit = 0 - this.loss = 0 - }, + Margincall(i) { + this.stopLimitData = i + this.stopModalShowZui = true + this.styValue = 0; + this.stsValue = 0; + this.profit = 0 + this.loss = 0 + }, // 获取撤销订单 closeItem(item, i) { this.itemData = item @@ -380,7 +394,7 @@ * @param {*} type */ onChangeType(type = 0) { - this.list=[]; + this.list = []; this.type = type if (this.type == 0) { this.status = 'undone' @@ -429,7 +443,7 @@ * stop确认弹窗 */ stopConfirm() { - if(this.stopModalShow){ + if (this.stopModalShow) { if (this.styValue < 0 || this.stsValue < 0) { uni.showToast({ title: this.i18n.lessThan, @@ -451,8 +465,8 @@ }, 800) }); } - - if(this.stopModalShowZui){ + + if (this.stopModalShowZui) { if (this.styValue < 0) { uni.showToast({ title: this.i18n.lessThan, @@ -472,9 +486,9 @@ this.getContractOrderList() }, 800) }); - + } - + }, /** * styValue值变化 @@ -530,10 +544,11 @@ + // window.open(res.msg, '_blank'); + uni.navigateTo({ + url:'/pages/recharge/outPage?url='+res.msg + }) + // #endif + } + if (res.code == 1) { + uni.$u.toast(res.msg) + } + setTimeout(() => { + this.getRechargeInfo() + }, 1200) + }) + }, + // 获取选择充值的钱 + getAmount(t, i) { + this.onlineInfo.tranAmt = t + }, + // 获取充值类型 + getCoinType(t, i) { + this.onlineInfo.payType = t.payType + }, + radioChange(e) { + console.log(e); + this.coin = e.enname + this.coinCode = e.code + //#ifdef H5 + this.message = this.i18n.message.replace('{rechargeMinAmount}', e.rechargeMinAmount).replaceAll('{enname}',e.enname) + console.log(this.message) + console.log(this.i18n.message.replace('{rechargeMinAmount}', e.rechargeMinAmount)) + //#endif + //#ifdef APP-PLUS + let message1 = this.i18n.message.replace('{rechargeMinAmount}', e.rechargeMinAmount) + this.message = message1.replace('{enname}',e.enname) + //#endif + if (!e.address) { + let coinInfo = { + coinCode: e.code + } + // 返回的币种没有充值地址就用接口传code换取虚拟币充值地址 + api.rechargeAddress(coinInfo).then(res => { + this.coinAddress = res.address + this.qr = QR.createQrCodeImg(this.coinAddress) + }) + } else { + this.coinAddress = e.address + this.qr = QR.createQrCodeImg(this.coinAddress) + } + }, + // 获取二维码 + getQr(e) { + this.qr = QR.createQrCodeImg(e) + }, + getRechargeInfo(e) { + api.rechargeConfig({ + type: this.pageState + }).then(res => { + this.reInfo = res + if (this.pageState == 'crypto') { + // if (this.reInfo.coins[0].address) { + // this.coinAddress = this.reInfo.coins[0].address + // let img = this.reInfo.coins[0].address + // this.coin = this.$i18n.PleaseChooseCoin + // this.coinCode = this.reInfo.coins[0].code + // this.getQr(img) + this.coinAddress = this.i18n.PleaseChooseCoin; + this.coin = this.i18n.PleaseChooseCoin + this.qr = QR.createQrCodeImg(this.i18n.PleaseChooseCoin) + this.message = this.i18n.message.replace('{rechargeMinAmount}', '').replaceAll( + '{enname}', '') + // } else { + // let coinInfo = { + // coinCode: this.reInfo.coins[0].code + // } + // // 返回的币种没有充值地址就用接口传code换取虚拟币充值地址 + // api.rechargeAddress(coinInfo).then(res => { + // this.coinAddress = res.address + // this.qr = this.getQr(this.coinAddress) + // this.rechargeMinAmount = res.rechargeMinAmount + // this.enname = res.enname + // }) + // } + } else { + this.reInfo.fastAmount = this.reInfo.fastAmount.split(',') + this.onlineInfo.tranAmt = this.reInfo.fastAmount[0] + this.onlineInfo.payType = this.reInfo.payTypes[0].payType + // + this.inputText=this.reInfo.payTypes[0] + } + + + }) + }, + goto(page) { + // console.log(page); + let url = ''; + switch (page) { + case 'rechargeRecord': + url = '/pages/recharge/rechargeRecord' + break; + default: + break; + } + if (url) { + // console.log(url); + uni.navigateTo({ + url, + }); + } + + }, + USDTRadioChange(e) { + + console.log(e); + }, + + copyAddress(value = "") { + console.log(value) + uniCopy({ + content: value, + success: (res) => { + uni.showToast({ + title: this.i18n.CopySuccess, + duration: 3000, + }) + }, + error: (e) => { + uni.showToast({ + title: e, + icon: 'none', + duration: 2000, + }) + } + }) + }, + + }, + } + + + \ No newline at end of file diff --git a/static/recharge/ic_link.png b/static/recharge/ic_link.png new file mode 100644 index 0000000..9e3021b Binary files /dev/null and b/static/recharge/ic_link.png differ diff --git a/static/recharge/img_add.png b/static/recharge/img_add.png new file mode 100644 index 0000000..66ff931 Binary files /dev/null and b/static/recharge/img_add.png differ diff --git a/utils/api.js b/utils/api.js index de5dbfd..48e99af 100644 --- a/utils/api.js +++ b/utils/api.js @@ -6,7 +6,7 @@ const api = { rechargeAddress: (params) => Vue.prototype.$axios.post('/api/recharge/rechargeAddress',params),//获取对应数字币种的充值地址 recharge: (params) => Vue.prototype.$axios.post('/api/recharge/recharge',params),//法币在线充值下单 rechargeList: (params) => Vue.prototype.$axios.post('/api/recharge/rechargeList',params),//充值记录 - uploadImg: (params) => Vue.prototype.$axios.post('/api/user/uploadImg',params),//充值记录 + uploadImg: (params) => Vue.prototype.$axios.post('/api/user/uploadImg1',params),//充值记录 //--------------------------------- withdraw提现 --------------------------------- diff --git a/utils/axios.js b/utils/axios.js index bd150fb..5c60d32 100644 --- a/utils/axios.js +++ b/utils/axios.js @@ -29,7 +29,7 @@ service.interceptors.request.use( // mask: true // }) } - console.log(config.url) + console.log(config.data) if (config.url.indexOf("/api/index/register") !== -1 || config.url.indexOf("/api/user/login") !== -1 || config.url.indexOf("/api/user/forgotPassword") !== -1 || diff --git a/utils/language/en_US.js b/utils/language/en_US.js index 6891bd8..6514ca0 100644 --- a/utils/language/en_US.js +++ b/utils/language/en_US.js @@ -194,6 +194,7 @@ export default { Record: 'Record', CoinRecharge: 'Coin Recharge', CashRecharge: 'Cash Recharge ', + OfflineRecharge: 'Offline Recharge', PleaseChooseCoin: 'Please choose coin', CoinDepositAddress: 'Coin deposit address', CopyAddress: 'Copy address', @@ -215,6 +216,25 @@ export default { Pickup: 'Pick up', USDTRate: 'USDT Rate', USDT: 'USDT', + FillTransactionInformation:'Fill in transaction information', + Buy:'BUY', + Minimal:'Minimal', + Pay:'PAY', + MarketPrice:'Market price', + TransactionDetails:'Transaction details', + BankAccountTransfer:'Bank Account Transfer', + TransferInfoTip:'Please transfer to the following bank account', + StandardBank:'Standard bank', + BankAccountNo:'Bank Account No', + BankAccount:'Bank Account', + PaymentAmount:'Payment Amount', + TransactionConfirmation:'Transaction confirmation', + PayerName:'Payer Name', + ProofPayment:'Proof of payment', + TransferUploadTip:'Please upload your proof of payment after the bank account transfer is completed.', + Copy: 'Copy', + SubmitSuccess: 'Submit success', + }, //mine diff --git a/utils/language/vi_VN.js b/utils/language/vi_VN.js index 41a6a63..73f639e 100644 --- a/utils/language/vi_VN.js +++ b/utils/language/vi_VN.js @@ -191,6 +191,7 @@ export default { Record: 'Ghi lại', CoinRecharge: 'nạp tiền kỹ thuật số', CashRecharge: 'nạp tiền', + OfflineRecharge: 'Nạp tiền ngoại tuyến', PleaseChooseCoin: 'Vui lòng chọn đơn vị tiền tệ', CoinDepositAddress: 'Địa chỉ gửi tiền', CopyAddress: 'sao chép địa chỉ', @@ -211,6 +212,24 @@ export default { Pickup: 'cất đi', USDTRate: 'Tỷ giá hối đoái USDT', USDT: 'USDT', + FillTransactionInformation:'Điền thông tin giao dịch', + Buy:'Mua', + Minimal:'Tối thiểu', + Pay:'Trả', + MarketPrice:'Giá thị trường', + TransactionDetails:'Chi tiết giao dịch', + BankAccountTransfer:'Chuyển khoản Ngân hàng', + TransferInfoTip:'Vui lòng chuyển vào tài khoản ngân hàng sau', + StandardBank:'Ngân hàng', + BankAccountNo:'Số tài khoản ngân hàng', + BankAccount:'Tài khoản Ngân hàng', + PaymentAmount:'Số tiền thanh toán', + TransactionConfirmation:'Xác nhận Giao dịch', + PayerName:'Tên người trả tiền', + ProofPayment:'Bằng chứng thanh toán', + TransferUploadTip:'Vui lòng tải lên bằng chứng thanh toán của bạn sau khi chuyển khoản ngân hàng hoàn tất.', + Copy: 'sao chép', + SubmitSuccess: 'Gửi thành công', }, //mine diff --git a/utils/language/zh_TW.js b/utils/language/zh_TW.js index c361cdf..a5570ec 100644 --- a/utils/language/zh_TW.js +++ b/utils/language/zh_TW.js @@ -196,6 +196,7 @@ export default { Record: '記錄', CoinRecharge: '數字貨幣充值', CashRecharge: '現金充值', + OfflineRecharge: '線下充值', PleaseChooseCoin: '請選擇幣種', CoinDepositAddress: '充幣地址', CopyAddress: '複製地址', @@ -217,6 +218,24 @@ export default { Pickup: '收起', USDTRate: 'USDT 匯率', USDT: 'USDT', + FillTransactionInformation:'填寫交易信息', + Buy:'買', + Minimal:'最小', + Pay:'支付', + MarketPrice:'市場價格', + TransactionDetails:'交易詳情', + BankAccountTransfer:'銀行賬戶轉賬', + TransferInfoTip:'請轉賬到以下銀行賬戶', + StandardBank:'銀行', + BankAccountNo:'銀行帳號', + BankAccount:'銀行賬戶', + PaymentAmount:'支付金額', + TransactionConfirmation:'交易確認', + PayerName:'付款人姓名', + ProofPayment:'付款證明', + TransferUploadTip:'請在銀行賬戶轉賬完成後上傳您的付款證明。', + Copy: '複製', + SubmitSuccess: '提交成功', }, //mine @@ -336,7 +355,7 @@ export default { EditBankInformation: '修改銀行信息', AddBankInformation: '添加銀行信息', FirstName: '真實姓名', - enterName: '請輸入你的真實姓名', + enterName: '請輸入您的真實姓名', Account: '帳戶', enterAccount: '請輸入您的賬戶', enterIdNumber: '請輸入您的身份證號碼',