|
@@ -62,7 +62,9 @@
|
|
|
<input-action-sheet
|
|
|
:visible="showDepositInput"
|
|
|
title="Enter the USD amount to be deposited"
|
|
|
+ :desc="depositDesc"
|
|
|
position="absolute"
|
|
|
+ @onInput="onDepositAmountInput"
|
|
|
@cancel="cancelDeposit"
|
|
|
@confirm="confirmDeposit"></input-action-sheet>
|
|
|
</div>
|
|
@@ -81,6 +83,7 @@ import VHead from '@/view/popup/components/head.vue'
|
|
|
import currencySelect from "@/view/components/currency-select.vue";
|
|
|
import inputActionSheet from "@/view/components/input-action-sheet.vue";
|
|
|
import { getBit } from "@/uilts/help";
|
|
|
+import { payCalcFee } from "@/http/pay";
|
|
|
|
|
|
let currenciesData = ref([]);
|
|
|
let currencyInfo = ref({
|
|
@@ -98,6 +101,10 @@ let enableWithdraw = ref(1);
|
|
|
|
|
|
let showDepositInput = ref(false);
|
|
|
|
|
|
+let reqCalcIng = false;
|
|
|
+let depositDesc = ref('');
|
|
|
+let finalAmountData = ref({});
|
|
|
+
|
|
|
|
|
|
|
|
|
const selectCurrency = (params) => {
|
|
@@ -260,21 +267,40 @@ const cancelDeposit = () => {
|
|
|
}
|
|
|
|
|
|
const confirmDeposit = (params) => {
|
|
|
- let {inputVal} = params;
|
|
|
+ if(reqCalcIng) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
showDepositInput.value = false;
|
|
|
+ depositDesc.value = '';
|
|
|
|
|
|
- // chrome.tabs.getCurrent(tab =>{
|
|
|
- // console.log(tab);
|
|
|
- let achPayInfo = {
|
|
|
- amountValue: inputVal
|
|
|
- };
|
|
|
- let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
|
|
|
- setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
|
|
|
+ let achPayInfo = {
|
|
|
+ amountValue: finalAmountData.value.finalAmountValue
|
|
|
+ };
|
|
|
+ let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
|
|
|
+ setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
|
|
|
|
|
|
- chrome.tabs.create({
|
|
|
- url: guideUrl
|
|
|
- });
|
|
|
- // })
|
|
|
+ chrome.tabs.create({
|
|
|
+ url: guideUrl
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const onDepositAmountInput = async (params = {}) => {
|
|
|
+ let {inputVal} = params;
|
|
|
+ reqCalcIng = true;
|
|
|
+ let res = await payCalcFee({
|
|
|
+ params: {
|
|
|
+ amountValue: inputVal,
|
|
|
+ currencyCode: currencyInfo.value.currencyCode,
|
|
|
+ payChannel: 'ach',
|
|
|
+ },
|
|
|
+ });
|
|
|
+ reqCalcIng = false;
|
|
|
+ if(res.code == 0) {
|
|
|
+ let {feeAmountValue, feeDesc} = res.data;
|
|
|
+ finalAmountData.value = res.data;
|
|
|
+ depositDesc.value = `Charge Fee:${feeAmountValue} USD(${feeDesc})`;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
@@ -301,6 +327,7 @@ onMounted(() => {
|
|
|
showSendBtn.value = true;
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
|