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

View File

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

View File

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