|
|
@@ -229,7 +229,7 @@ const doDepositWarning = () => {
|
|
|
const e = moment(endTime.value, 'HH:mm')
|
|
|
if (n.isSameOrAfter(s) && n.isBefore(e)) {
|
|
|
/// 提交
|
|
|
- formSubmit()
|
|
|
+ formSubmit(hideLoading)
|
|
|
} else {
|
|
|
dialog({
|
|
|
title: t('common.tips'),
|
|
|
@@ -239,8 +239,6 @@ const doDepositWarning = () => {
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
hideLoading(t('banksign.wallet.deposit.failedtogetservertime'), 'fail')
|
|
|
- }).finally(() => {
|
|
|
- hideLoading()
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
@@ -253,67 +251,67 @@ const onCopy = (status: boolean) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const formSubmit = () => {
|
|
|
- fullloading((hideLoading) => {
|
|
|
- const obj: { [key: string]: unknown } = Object.create({})
|
|
|
- configs.value.forEach((e) => {
|
|
|
- if (e.value) {
|
|
|
- obj[e.fieldcode] = e.value
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (channel_code.value != 'autobank') {
|
|
|
- const hybrid: { [key: string]: unknown } = Object.create({})
|
|
|
- // 拓展信息
|
|
|
- hybrid['channel_code'] = channel_code.value
|
|
|
- if (channel_code.value != 'scb') {
|
|
|
- hybrid['bank_code'] = bank_code.value
|
|
|
- }
|
|
|
- if (channel_code.value === 'chillpay') {
|
|
|
- const personinfo: { [key: string]: unknown } = Object.create({})
|
|
|
- personinfo['phone_number'] = phone_number.value
|
|
|
- hybrid['person_info'] = personinfo
|
|
|
- }
|
|
|
- obj['hybrid'] = hybrid
|
|
|
+const formSubmit = (hideLoading: () => void) => {
|
|
|
+ const obj: { [key: string]: unknown } = Object.create({})
|
|
|
+ configs.value.forEach((e) => {
|
|
|
+ if (e.value) {
|
|
|
+ obj[e.fieldcode] = e.value
|
|
|
}
|
|
|
- obj['certificate_photo_url'] = certificate_photo_url.value
|
|
|
-
|
|
|
- // 请求是否结束
|
|
|
- let isComplete = false
|
|
|
- const complete = () => {
|
|
|
- isComplete = true
|
|
|
-
|
|
|
- // 追踪入金结果
|
|
|
- trackEvent('Purchase', {
|
|
|
- currency: formData.Currency,
|
|
|
- value: formData.Amount,
|
|
|
- })
|
|
|
+ })
|
|
|
|
|
|
- dialog({
|
|
|
- message: i18n.global.t('banksign.wallet.deposit.submitsuccess')
|
|
|
- }).then(() => {
|
|
|
- openComponent('inoutapply')
|
|
|
- })
|
|
|
+ if (channel_code.value != 'autobank') {
|
|
|
+ const hybrid: { [key: string]: unknown } = Object.create({})
|
|
|
+ // 拓展信息
|
|
|
+ hybrid['channel_code'] = channel_code.value
|
|
|
+ if (channel_code.value != 'scb') {
|
|
|
+ hybrid['bank_code'] = bank_code.value
|
|
|
+ }
|
|
|
+ if (channel_code.value === 'chillpay') {
|
|
|
+ const personinfo: { [key: string]: unknown } = Object.create({})
|
|
|
+ personinfo['phone_number'] = phone_number.value
|
|
|
+ hybrid['person_info'] = personinfo
|
|
|
}
|
|
|
+ obj['hybrid'] = hybrid
|
|
|
+ }
|
|
|
+ obj['certificate_photo_url'] = certificate_photo_url.value
|
|
|
|
|
|
- // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
|
|
|
- const t = setTimeout(() => complete(), 2000)
|
|
|
- formData.extendInfo = JSON.stringify(obj)
|
|
|
+ // 请求是否结束
|
|
|
+ let isComplete = false
|
|
|
+ const complete = () => {
|
|
|
+ isComplete = true
|
|
|
+ hideLoading()
|
|
|
|
|
|
- onSubmit().then(() => {
|
|
|
- if (!isComplete) {
|
|
|
- complete()
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- if (!isComplete) {
|
|
|
- dialog(i18n.global.t('common.submitfailure') + err).then(() => {
|
|
|
- formData.Amount = undefined
|
|
|
- })
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- window.clearTimeout(t)
|
|
|
- hideLoading()
|
|
|
+ // 追踪入金结果
|
|
|
+ trackEvent('Purchase', {
|
|
|
+ currency: formData.Currency,
|
|
|
+ value: formData.Amount,
|
|
|
})
|
|
|
+
|
|
|
+ dialog({
|
|
|
+ message: i18n.global.t('banksign.wallet.deposit.submitsuccess')
|
|
|
+ }).then(() => {
|
|
|
+ openComponent('inoutapply')
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 请求等待可能会超过30秒导致请求超时,所以2秒内没回应直接提示成功
|
|
|
+ const t = setTimeout(() => complete(), 2000)
|
|
|
+ formData.extendInfo = JSON.stringify(obj)
|
|
|
+
|
|
|
+ onSubmit().then(() => {
|
|
|
+ if (!isComplete) {
|
|
|
+ complete()
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ hideLoading()
|
|
|
+
|
|
|
+ if (!isComplete) {
|
|
|
+ dialog(i18n.global.t('common.submitfailure') + err).then(() => {
|
|
|
+ formData.Amount = undefined
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ window.clearTimeout(t)
|
|
|
})
|
|
|
}
|
|
|
|