| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- /**
- * Wallet / Recharge API module
- * 钱包充值配置等相关接口
- */
- import { http } from '~/utils/request'
- import type { NextVOWalletRecordVo, ResultVOString, WalletRechargeConfigVO, WalletRechargeOrderStateVo, WalletRecordDTO, WalletWithdrawApplyDTO, WalletWithdrawCalculateVo, WalletWithdrawInfoVo, WalletWithdrawRealNameAuthDTO, WalletWithdrawRealInfoAuthApplyVo, WalletWithdrawRealInfoAuthStatusVo } from '~/types/api'
- export const walletApi = {
- /**
- * 获取浏览器端钱包充值配置
- * 对应后端接口:POST /wallet/recharge/browser/goldCoin/config
- */
- getRechargeConfig() {
- return http.post<WalletRechargeConfigVO>('/wallet/recharge/browser/goldCoin/config')
- },
- /**
- * 提交浏览器端钱包充值
- * 对应后端接口:POST /wallet/recharge/browser/submit
- * @param id 充值档位 ID(后端返回的 items.id)
- */
- submitRecharge(id: string, uri: string) {
- return http.post<ResultVOString>('/wallet/recharge/browser/submit', { id, uri })
- },
- /**
- * 查询充值订单状态
- * 对应后端接口:POST /wallet/recharge/checkOrderState
- * @param orderNo 订单号(后端接口字段为 id)
- */
- checkRechargeOrderState(orderNo: string) {
- return http.post<WalletRechargeOrderStateVo>('/wallet/recharge/checkOrderState', { id: orderNo })
- },
- /**
- * 钱包流水-金币
- * 对应后端接口:POST /wallet/record/goldCoin
- */
- recordGoldCoin(data: WalletRecordDTO) {
- return http.post<NextVOWalletRecordVo>('/wallet/record/goldCoin', data)
- },
- /**
- * 钱包流水-钻石
- * 对应后端接口:POST /wallet/record/diamond
- */
- recordDiamond(data: WalletRecordDTO) {
- return http.post<NextVOWalletRecordVo>('/wallet/record/diamond', data)
- },
- /**
- * 钱包流水-金豆
- * 对应后端接口:POST /wallet/record/bean
- */
- recordBean(data: WalletRecordDTO) {
- return http.post<NextVOWalletRecordVo>('/wallet/record/bean', data)
- },
- /**
- * 提现实名认证
- * 对应后端接口:POST /wallet/withdraw/realNameAuth
- * @param data 身份证和银行卡信息
- */
- submitWithdrawRealNameAuth(data: WalletWithdrawRealNameAuthDTO) {
- return http.post<WalletWithdrawRealInfoAuthApplyVo>('/wallet/withdraw/realNameAuth', data)
- },
- /**
- * 获得提现实名认证状态
- * 对应后端接口:POST /wallet/withdraw/getRealNameAuthStatus
- */
- getWithdrawRealNameAuthStatus() {
- return http.post<WalletWithdrawRealInfoAuthStatusVo>('/wallet/withdraw/getRealNameAuthStatus')
- },
- /**
- * 获取金豆提现信息
- * 对应后端接口:POST /wallet/withdraw/info
- * 按后端要求使用 application/x-www-form-urlencoded
- */
- getWithdrawInfo() {
- return http.post<WalletWithdrawInfoVo>('/wallet/withdraw/info')
- },
- /**
- * 金豆提现计算
- * 对应后端接口:POST /wallet/withdraw/calculate
- */
- withdrawCalculate(amount: number) {
- return http.post<WalletWithdrawCalculateVo>('/wallet/withdraw/calculate', { amount })
- },
- /**
- * 金豆提现申请提交
- * 对应后端接口:POST /wallet/withdraw/submit
- */
- withdrawSubmit(data: WalletWithdrawApplyDTO) {
- return http.post<Record<string, never>>('/wallet/withdraw/submit', data)
- },
- }
|