This commit is contained in:
77
2024-03-31 23:50:43 +08:00
parent 2bebd96f82
commit 28a70dc261
2 changed files with 15 additions and 6 deletions

View File

@@ -65,6 +65,7 @@
:placeholder="$t('app.pleaseWithdrawalAmount')"
/>
<van-field
v-if="openWithdrawCode"
v-model="withdrawCode"
:label="$t('app.withdrawCode')"
:placeholder="$t('app.withdrawCode')"
@@ -77,10 +78,11 @@ import {onMounted, reactive, ref} from "vue";
import {showConfirmDialog, showToast} from "vant";
import {useUserStore} from "@/store/modules/user";
import {useRouter} from "vue-router";
import {getBorrowWithdraw, getCustomerInfo, getStepBorrow} from "@/api";
import { getBorrowWithdraw, getCustomerInfo, getSetting, getStepBorrow } from '@/api';
import {resetData} from "@/utils/dataUtil";
import {getAssetsImages, px2vw} from "../../../utils";
import { useI18n } from 'vue-i18n';
import { getDefaultLocal } from '@/api/system/user';
const defaultCoinUnit = localStorage.getItem('defaultCoinUnit')
@@ -88,6 +90,7 @@ const router = useRouter()
const userStore = useUserStore()
const { t } = useI18n()
const openWithdrawCode = ref(false);
const withdrawalShow = ref(false);
const withdrawAmount = ref(0);
const withdrawCode = ref('');
@@ -169,8 +172,9 @@ const withdrawalBtn = () => {
}
const saveUserInfoBtn = () => {
if (withdrawCode.value) {
if (!withdrawCode.value && openWithdrawCode.value) {
showToast(t('app.enter') + t('app.withdrawCode'))
} else {
getBorrowWithdraw({
withdrawAmount: withdrawAmount.value,
withdrawCode: withdrawCode.value,
@@ -180,8 +184,6 @@ const saveUserInfoBtn = () => {
path: '/serveList'
})
})
} else {
showToast(t('app.enter') + t('app.withdrawCode'))
}
// showConfirmDialog({
// title: '提示',
@@ -195,10 +197,17 @@ const saveUserInfoBtn = () => {
// });
}
const _getSetting = () => {
getSetting().then(res => {
openWithdrawCode.value = res.openWithdrawCode
})
}
onMounted(() => {
_getCustomerInfo()
_getStepBorrow()
_getSetting()
})
</script>