feat(提现功能): 调整接口

This commit is contained in:
hzj 2025-10-24 14:37:26 +08:00
parent b742a60c69
commit ee63c21490
3 changed files with 19 additions and 15 deletions

View File

@ -1,7 +1,7 @@
import { get, post } from '../utils/http.js'
// 获取排行榜
export const ranklist = async (applicationId) => {
export const ranklist = async () => {
try {
const response = await get(`/activity/lottery/rank-list`)
return response
@ -118,9 +118,9 @@ export const receiveTickets = async (data) => {
}
// 获取可提现金额
export const withdrawableAmount = async () => {
export const withdrawableAmount = async (activityId) => {
try {
const response = await get(`/activity/lottery/withdraw/amount`)
const response = await get(`/activity/lottery/withdraw/amount?activityId=${activityId}`)
return response
} catch (error) {
console.error('Failed to fetch get my withdrawable amount:', error)

View File

@ -872,6 +872,7 @@ const barrageList = ref([])
//
const activity = ref({}) //
const activityCode = ref('') //
const userInfo = ref({}) //
const userIdentity = ref({}) //
@ -972,7 +973,7 @@ const searchPayee = () => {
//
const goToWithdraw = () => {
router.push('/cash-out')
router.push({ path: '/cash-out', query: { activityCode: activityCode.value } })
}
//
@ -1342,11 +1343,12 @@ const getRanking = async () => {
//
const getActivityDetail = async () => {
const resvalidActivity = await validActivity() //
console.log('id:', resvalidActivity.body?.id)
console.log('id2:', JSON.stringify(resvalidActivity.body))
if (resvalidActivity.body?.activityCode) {
const resDetail = await activityDetail(resvalidActivity.body?.activityCode)
activityCode.value = resvalidActivity.body.activityCode || ''
getDrawableAmount() //
const resDetail = await activityDetail(activityCode.value)
if (resDetail.status && resDetail.body) {
activity.value = resDetail.body
} else {
@ -1365,9 +1367,9 @@ const getTickets = async () => {
}
}
//
//
const getDrawableAmount = async () => {
const resDrawableAmount = await withdrawableAmount()
const resDrawableAmount = await withdrawableAmount(activityCode.value)
if (resDrawableAmount.status && resDrawableAmount.body) {
currentAmount.value = resDrawableAmount.body
} else {
@ -1391,7 +1393,7 @@ const getDrawRecords = async () => {
}
}
//
//
const getWinners = async () => {
const resWinners = await winnerHistory()
if (resWinners.status && resWinners.body) {
@ -1423,7 +1425,6 @@ onMounted(() => {
getActivityDetail() //
getDrawRecords() //
getTickets() //
getDrawableAmount() //
getTaskList() //
getWinners() //
})

View File

@ -194,8 +194,11 @@ import {
} from '@/api/lottery'
import { setApplyInfo, getApplyInfo } from '@/utils/applyStore.js'
import { ref, onMounted, computed, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const activityCode = route.query.activityCode || ''
const maskLayerShow = ref(false)
const currentAmount = ref(0) //
@ -219,7 +222,7 @@ const gotoKYC = () => {
const CashOut = () => {
if (hasBankCard.value) {
try {
const resApply = withdrawApply(getApplyInfo())
const resApply = withdrawApply({ ...getApplyInfo(), activityId: activityCode })
if (resApply.status) {
setApplyInfo()
router.go(-1)
@ -237,9 +240,9 @@ const Receive = () => {
maskLayerShow.value = false
}
//
//
const getDrawableAmount = async () => {
const resDrawableAmount = await withdrawableAmount()
const resDrawableAmount = await withdrawableAmount(activityCode)
if (resDrawableAmount.status && resDrawableAmount.body) {
currentAmount.value = resDrawableAmount.body
} else {