feat(新接口): 获取可提现的活动美元
This commit is contained in:
parent
00b79cdcc8
commit
bd51e0cc1f
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +131,9 @@
|
||||
>
|
||||
{{ userInfo.userNickname || '' }}
|
||||
</div>
|
||||
<div style="font-weight: 600">Current amount:$1</div>
|
||||
<div style="font-weight: 600">
|
||||
Current amount:${{ currentAmount.availableAmount }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: end; font-weight: 400; font-size: 0.8em">
|
||||
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() //获取历史中奖用户
|
||||
})
|
||||
|
||||
@ -33,8 +33,10 @@
|
||||
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25);
|
||||
"
|
||||
>
|
||||
<span style="font-weight: 510; font-size: 0.8em">Available salary: </span>
|
||||
<span style="font-weight: 700; color: #333">12345645</span>
|
||||
<span style="font-weight: 510; font-size: 0.8em">Withdrawable amount: </span>
|
||||
<span style="font-weight: 700; color: #333">{{
|
||||
currentAmount.availableAmount || 0
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -188,11 +190,15 @@
|
||||
<script setup>
|
||||
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||
import maskLayer from '@/components/MaskLayer.vue'
|
||||
import {
|
||||
withdrawableAmount, //获取可提现金额
|
||||
} from '@/api/lottery'
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
|
||||
const maskLayerShow = ref(false)
|
||||
const currentAmount = ref(0) //可提现金额
|
||||
|
||||
const bankCardInfo = ref({
|
||||
// id: '',
|
||||
@ -223,6 +229,20 @@ const CashOut = () => {
|
||||
const Receive = () => {
|
||||
maskLayerShow.value = false
|
||||
}
|
||||
|
||||
//获取拥有的抽奖券
|
||||
const getDrawableAmount = async () => {
|
||||
const resDrawableAmount = await withdrawableAmount()
|
||||
if (resDrawableAmount.status && resDrawableAmount.body) {
|
||||
currentAmount.value = resDrawableAmount.body
|
||||
} else {
|
||||
currentAmount.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDrawableAmount() //获取可提现金额
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user