From bd51e0cc1fcf74da017a5e26a79794e097e2bd34 Mon Sep 17 00:00:00 2001
From: hzj <1304805162@qq.com>
Date: Thu, 23 Oct 2025 18:20:21 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E6=8E=A5=E5=8F=A3):=20=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=8F=AF=E6=8F=90=E7=8E=B0=E7=9A=84=E6=B4=BB=E5=8A=A8?=
=?UTF-8?q?=E7=BE=8E=E5=85=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/lottery.js | 12 ++++++++++++
src/views/Activities/Lottery/Lottery.vue | 20 ++++++++++++++++++--
src/views/Wallet/CashOut/CashOut.vue | 24 ++++++++++++++++++++++--
3 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/src/api/lottery.js b/src/api/lottery.js
index c2992d7..e737c6a 100644
--- a/src/api/lottery.js
+++ b/src/api/lottery.js
@@ -116,3 +116,15 @@ export const receiveTickets = async (data) => {
throw error
}
}
+
+// 获取可提现金额
+export const withdrawableAmount = async () => {
+ try {
+ const response = await get(`/activity/lottery/withdraw/amount`)
+ return response
+ } catch (error) {
+ console.error('Failed to fetch get my withdrawable amount:', error)
+ console.error('error:' + error.response.errorMsg)
+ throw error
+ }
+}
diff --git a/src/views/Activities/Lottery/Lottery.vue b/src/views/Activities/Lottery/Lottery.vue
index 09e6282..f40a128 100644
--- a/src/views/Activities/Lottery/Lottery.vue
+++ b/src/views/Activities/Lottery/Lottery.vue
@@ -131,7 +131,9 @@
>
{{ userInfo.userNickname || '' }}
-
Current amount:$1
+
+ Current amount:${{ currentAmount.availableAmount }}
+
Only $9 left to withdraw $10.00
@@ -847,6 +849,7 @@ import {
ActTaskList, // 获取任务列表
receiveTickets, // 领取任务奖励
winnerHistory, //获取历史中奖用户
+ withdrawableAmount, //获取可提现金额
} from '@/api/lottery'
import Barrage from '@/components/Lottery/Barrage.vue'
@@ -877,7 +880,8 @@ const ranking = ref([]) //奖品排名
const activeIndex = ref(-1) // 当前高亮格子
const isRolling = ref(false) // 抽奖状态
-const rollTimes = ref(0) // 当前可抽奖次数
+const rollTimes = ref(0) // 拥有抽奖券量
+const currentAmount = ref(0) //可提现金额
const result = ref([]) // 抽奖结果
const resultShowIndex = ref(0)
const myRecords = ref([]) // 抽奖结果
@@ -1361,6 +1365,16 @@ const getTickets = async () => {
}
}
+//获取拥有的抽奖券
+const getDrawableAmount = async () => {
+ const resDrawableAmount = await withdrawableAmount()
+ if (resDrawableAmount.status && resDrawableAmount.body) {
+ currentAmount.value = resDrawableAmount.body
+ } else {
+ currentAmount.value = 0
+ }
+}
+
//获取任务列表
const getTaskList = async () => {
const resTaskList = await ActTaskList()
@@ -1393,6 +1407,7 @@ const receiveTaskReward = async (code) => {
const resReceive = await receiveTickets(data)
if (resReceive.status && resReceive.body) {
getTaskList() //获取任务列表
+ getTickets() //获取拥有的抽奖券
}
}
@@ -1404,6 +1419,7 @@ onMounted(() => {
getActivityDetail() //获取奖池
getDrawRecords() // 获取中奖记录
getTickets() //获取拥有的抽奖券
+ getDrawableAmount() //获取可提现金额
getTaskList() //获取任务列表
getWinners() //获取历史中奖用户
})
diff --git a/src/views/Wallet/CashOut/CashOut.vue b/src/views/Wallet/CashOut/CashOut.vue
index da024b4..c9d6734 100644
--- a/src/views/Wallet/CashOut/CashOut.vue
+++ b/src/views/Wallet/CashOut/CashOut.vue
@@ -33,8 +33,10 @@
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
"
>
- Available salary:
- 12345645
+ Withdrawable amount:
+ {{
+ currentAmount.availableAmount || 0
+ }}
@@ -188,11 +190,15 @@