| | |
| | | <div class="px-4 mt-6"> |
| | | <van-button class="w-full" type="primary" @click="submit">{{ |
| | | $t('submit') |
| | | }}</van-button> |
| | | }}</van-button> |
| | | </div> |
| | | <fx-popup v-model:show="showPopup" :payInfo="payInfo" @close="closeOrder" :fee="fee" :rate="rate" |
| | | :fiatValue="fiatValue" :volume_last="volume_last"></fx-popup> |
| | |
| | | <script setup> |
| | | import fxCountryList from '@/components/fx-country-list/index.vue' |
| | | import fxPopup from '@/components/fx-popup/confirm-order.vue' |
| | | import { _getCurrencyList, _getPaymentMethod } from '@/service/trade.api.js' |
| | | import { _getCurrencyList, _getPaymentMethod, _getSyspara } from '@/service/trade.api.js' |
| | | import { ref, watch, onMounted } from 'vue' |
| | | import { _getSessionToken } from '@/service/recharge.api' |
| | | import { _withdrawFee } from '@/service/withdraw.api' |
| | |
| | | } |
| | | }) |
| | | actions.value = currencies.value |
| | | getSysparaByFiat() |
| | | }) |
| | | |
| | | _getSessionToken({}).then((res) => { |
| | |
| | | }) |
| | | const fiatValue = ref('') |
| | | const rate = ref(1) |
| | | |
| | | const payType = ref('') |
| | | const amount = ref('') |
| | | const router = useRouter() |
| | | const showPopup = ref(false) |
| | | const fee = ref(0) |
| | | const volume_last = ref(0) |
| | | const minXE = ref(100) // 最小提交限额 |
| | | |
| | | // 获取系统参数 |
| | | const getSysparaByFiat = async () => { |
| | | // 获取 usd 提现最低限额 |
| | | const code = "withdraw_limit" |
| | | |
| | | try { |
| | | const res = await _getSyspara({ code }) |
| | | console.log('系统参数获取成功:', res) |
| | | // 这里可以根据返回的数据进行相应处理 |
| | | minXE.value = res.withdraw_limit |
| | | return res |
| | | } catch (error) { |
| | | console.error('获取系统参数失败:', error) |
| | | } |
| | | } |
| | | |
| | | const openRecord = () => { |
| | | setStorage('recordId', 3) |
| | |
| | | fee.value = res.fee |
| | | volume_last.value = res.volume_last |
| | | } else { |
| | | fee.value = res.fee * rate.value |
| | | fee.value = Math.ceil(res.fee * rate.value * 1000) / 1000 |
| | | volume_last.value = amount.value - fee.value |
| | | } |
| | | |
| | |
| | | fiatValue.value = value.name |
| | | rate.value = value.rate |
| | | show.value = false |
| | | // 切换法币时,watch 会自动触发调用接口 |
| | | } |
| | | const onSelect1 = (value, index) => { |
| | | active.value = index |
| | |
| | | showToast(t('enterWithdrawalAmount')) |
| | | return |
| | | } |
| | | if (amount.value < (Math.ceil(minXE.value * rate.value * 100) / 100)) { |
| | | showToast(t('提现不得小于限额') + ' ' + (Math.ceil(minXE.value * rate.value * 100) / 100)) |
| | | return |
| | | } |
| | | if (!payType.value) { |
| | | showToast(t('selectWithdrawalMethod')) |
| | | return |