1.新增获取充值/提现配置接口/api/finance/depositWithdrawConfig
2.优化充值和提现方式
This commit is contained in:
@@ -87,16 +87,37 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { FormInstance, FormItemRule } from 'element-plus'
|
||||
import { inject, reactive, useTemplateRef } from 'vue'
|
||||
import { inject, onMounted, reactive, ref, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
const config = useConfig()
|
||||
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||
const baTable = inject('baTable') as baTable
|
||||
const { t } = useI18n()
|
||||
|
||||
const payCurrencies = ['MYR', 'CNY', 'USD', 'USDT', 'VND', 'THB', 'SGD', 'IDR']
|
||||
const payCurrencies = ref<string[]>(['MYR', 'CNY', 'USD', 'USDT', 'VND', 'THB', 'SGD', 'IDR'])
|
||||
|
||||
async function loadPayCurrencies() {
|
||||
try {
|
||||
const res = await createAxios({
|
||||
url: '/admin/config.DepositTier/currencyOptions',
|
||||
method: 'GET',
|
||||
})
|
||||
const listRaw = (res as anyObj)?.data?.list
|
||||
if (Array.isArray(listRaw)) {
|
||||
const list = listRaw
|
||||
.map((x: unknown) => (typeof x === 'string' ? x.trim().toUpperCase() : ''))
|
||||
.filter((x: string) => x !== '')
|
||||
if (list.length > 0) {
|
||||
payCurrencies.value = Array.from(new Set(list))
|
||||
}
|
||||
}
|
||||
} catch (_e) {
|
||||
// 下拉拉取失败时保持内置兜底列表,避免阻断表单编辑
|
||||
}
|
||||
}
|
||||
|
||||
function positiveAmountRule(msg: string): FormItemRule {
|
||||
return {
|
||||
@@ -143,6 +164,10 @@ const rules = reactive({
|
||||
amount: [positiveAmountRule(t('config.depositTier.rule_platform_base'))],
|
||||
bonus_amount: [nonNegAmountRule(t('config.depositTier.rule_bonus'))],
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadPayCurrencies()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user