优化提现手续费动态配置

This commit is contained in:
wangqiao
2025-10-08 22:22:54 +08:00
parent 89f3b9679d
commit 3f3ea878b9
4 changed files with 46 additions and 4 deletions

View File

@ -164,3 +164,17 @@ export const cancelSocialBind = (params: { type: number; openid: string }) => {
export const userLogout = () => { export const userLogout = () => {
return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/member/user/unregister-user', {}) return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/member/user/unregister-user', {})
} }
/**
* 获取钱包配置
*/
export const getWalletConfig = () => {
return useDollarFetchRequest.get<
IResponse<{
rechargeRate: number
commissionRate: number
withdrawRateOfRecharge: number
withdrawRateOfEarn: number
}>
>('/prod-api/app-api/pay/wallet/get-config', {})
}

View File

@ -21,7 +21,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="text-12px color-red"> <div class="text-12px color-red">
提示:收益金币提现正常收取平台手续费3%如需将充值金币提现选择全部提现选项因涉及充值赠送金额将收取155高额手续费如果恶意套利提现将提现审核不通过! 提示:收益金币提现正常收取平台手续费{{ walletConfig?.withdrawRateOfEarn }}%如需将充值金币提现选择全部提现选项因涉及充值赠送金额将收取{{ walletConfig?.withdrawRateOfRecharge }}%高额手续费如果恶意套利提现将提现审核不通过!
</div> </div>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
@ -33,6 +33,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getWalletConfig } from '~/api/personal-center/index'
const dialogVisible = defineModel('modelValue', { const dialogVisible = defineModel('modelValue', {
default: false, default: false,
}) })
@ -44,6 +45,18 @@
const handleClose = (done: () => void) => { const handleClose = (done: () => void) => {
done() done()
} }
const walletConfig = ref<{
rechargeRate: number
commissionRate: number
withdrawRateOfRecharge: number
withdrawRateOfEarn: number
}>()
onMounted(() => {
getWalletConfig().then((res) => {
walletConfig.value = res.data
})
})
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -1,18 +1,20 @@
import { useFetch } from '#app' import { useFetch } from '#app'
import type { UseFetchOptions } from '#app' import type { UseFetchOptions } from '#app'
import { isArray } from '~/utils/utils' import { isArray } from '~/utils/utils'
import useUserStore from '~/stores/user'
const useServerRequest = async <T>(url: string, opts?: UseFetchOptions<T, unknown>) => { const useServerRequest = async <T>(url: string, opts?: UseFetchOptions<T, unknown>) => {
const token = useToken() const token = useToken()
const runtimeConfig = useRuntimeConfig() const runtimeConfig = useRuntimeConfig()
const userStore = useUserStore()
const defaultOptions: UseFetchOptions<unknown> = { const defaultOptions: UseFetchOptions<unknown> = {
baseURL: runtimeConfig.public.apiBase, baseURL: runtimeConfig.public.apiBase,
onRequest({ options }) { onRequest({ options }) {
options.headers = options.headers || {} options.headers = options.headers || {}
if (token.value) { if (token.value || userStore.token) {
options.headers.set('Authorization', `Bearer ${token.value}`) options.headers.set('Authorization', `Bearer ${token.value || userStore.token}`)
} }
}, },
onResponse({ response }) { onResponse({ response }) {

View File

@ -17,7 +17,14 @@
<!-- 分页 --> <!-- 分页 -->
<div class="pagination mt-15px"> <div class="pagination mt-15px">
<el-pagination v-model:current-page="query.pageNo" :page-size="10" :total="result.total" background layout="prev, pager, next, jumper" /> <el-pagination
v-model:current-page="query.pageNo"
:page-size="10"
:total="result.total"
background
layout="prev, pager, next, jumper"
@current-change="handeClickCurrent"
/>
</div> </div>
</template> </template>
@ -51,6 +58,12 @@
} }
} }
getTradeRecords() getTradeRecords()
// 点击分页
const handeClickCurrent = (pageNo: number) => {
query.pageNo = pageNo
getTradeRecords()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-pagination) { :deep(.el-pagination) {