feat(古尔邦节): 对接房间榜接口
This commit is contained in:
parent
6d19da0518
commit
bc817d4bed
@ -47,3 +47,17 @@ export const getMyRanking = async (type, dateType) => {
|
|||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取房间贡献总榜
|
||||||
|
export const getRoomContributionTotalRank = async (data) => {
|
||||||
|
try {
|
||||||
|
const response = await get(
|
||||||
|
`/room/contribution/total-rank?startDate=${data.startDate}&endDate=${data.endDate}&size=${data.size}`,
|
||||||
|
)
|
||||||
|
return response
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to fetch room contribution total rank:', error)
|
||||||
|
console.error('error:' + error.response.errorMsg)
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -275,7 +275,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 抽奖区域下层:单抽和十连抽按钮,内部后续可替换抽奖券图标 -->
|
<!-- 抽奖区域下层:单抽和5连抽按钮,内部后续可替换抽奖券图标 -->
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -288,6 +288,7 @@
|
|||||||
>
|
>
|
||||||
<itemCenter
|
<itemCenter
|
||||||
:imgUrl="imageUrl('draw1Bt')"
|
:imgUrl="imageUrl('draw1Bt')"
|
||||||
|
:class="{ 'collect-action-disabled': !canLotteryRewardDraw(1) }"
|
||||||
style="width: 38vw; margin: 0; padding: 0"
|
style="width: 38vw; margin: 0; padding: 0"
|
||||||
contentStyle="padding: 0; align-items: flex-end;padding: 0 0 2vw"
|
contentStyle="padding: 0; align-items: flex-end;padding: 0 0 2vw"
|
||||||
@click="handleLotteryDraw(1)"
|
@click="handleLotteryDraw(1)"
|
||||||
@ -301,9 +302,10 @@
|
|||||||
</itemCenter>
|
</itemCenter>
|
||||||
<itemCenter
|
<itemCenter
|
||||||
:imgUrl="imageUrl('draw5BtBg')"
|
:imgUrl="imageUrl('draw5BtBg')"
|
||||||
|
:class="{ 'collect-action-disabled': !canLotteryRewardDraw(5) }"
|
||||||
style="width: 38vw; margin: 0; padding: 0"
|
style="width: 38vw; margin: 0; padding: 0"
|
||||||
contentStyle="padding: 0; align-items: flex-end;padding: 0 0 2vw"
|
contentStyle="padding: 0; align-items: flex-end;padding: 0 0 2vw"
|
||||||
@click="handleLotteryDraw(10)"
|
@click="handleLotteryDraw(5)"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-smart-img
|
v-smart-img
|
||||||
@ -617,9 +619,7 @@
|
|||||||
alt=""
|
alt=""
|
||||||
style="width: 6vw; display: block"
|
style="width: 6vw; display: block"
|
||||||
/>
|
/>
|
||||||
<span style="color: #fff; font-size: 1em; font-weight: 700">
|
<span style="color: #fff; font-size: 1em; font-weight: 700"> *1 </span>
|
||||||
*1
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</itemCenter>
|
</itemCenter>
|
||||||
</div>
|
</div>
|
||||||
@ -965,6 +965,7 @@
|
|||||||
:valueIconUrl="coinIcon"
|
:valueIconUrl="coinIcon"
|
||||||
:avatar-square="isRoomRankingSection"
|
:avatar-square="isRoomRankingSection"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@click="gotoRankingTarget(rankingTop3[1])"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 1.5; min-width: 0">
|
<div style="flex: 1.5; min-width: 0">
|
||||||
@ -977,6 +978,7 @@
|
|||||||
:valueIconUrl="coinIcon"
|
:valueIconUrl="coinIcon"
|
||||||
:avatar-square="isRoomRankingSection"
|
:avatar-square="isRoomRankingSection"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@click="gotoRankingTarget(rankingTop3[0])"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 1; min-width: 0">
|
<div style="flex: 1; min-width: 0">
|
||||||
@ -989,6 +991,7 @@
|
|||||||
:valueIconUrl="coinIcon"
|
:valueIconUrl="coinIcon"
|
||||||
:avatar-square="isRoomRankingSection"
|
:avatar-square="isRoomRankingSection"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@click="gotoRankingTarget(rankingTop3[2])"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1001,6 +1004,7 @@
|
|||||||
:imgUrl="imageUrl('RankingItem')"
|
:imgUrl="imageUrl('RankingItem')"
|
||||||
:contentStyle="`padding: 0 8vw`"
|
:contentStyle="`padding: 0 8vw`"
|
||||||
style="width: 100%; margin: 0 0 5vw; padding: 0"
|
style="width: 100%; margin: 0 0 5vw; padding: 0"
|
||||||
|
@click="gotoRankingTarget(listItem)"
|
||||||
>
|
>
|
||||||
<div style="flex: 1; min-width: 0; display: flex; align-items: center; gap: 2vw">
|
<div style="flex: 1; min-width: 0; display: flex; align-items: center; gap: 2vw">
|
||||||
<div style="color: #fff; font-size: 1.5em; font-weight: 700">
|
<div style="color: #fff; font-size: 1.5em; font-weight: 700">
|
||||||
@ -1284,6 +1288,7 @@ import { useLangStore } from '@/stores/lang'
|
|||||||
import { getPngUrl } from '@/config/imagePaths.js'
|
import { getPngUrl } from '@/config/imagePaths.js'
|
||||||
import { preloadImages, preloadImagesIdle } from '@/utils/image/imagePreloader.js'
|
import { preloadImages, preloadImagesIdle } from '@/utils/image/imagePreloader.js'
|
||||||
import { showError } from '@/utils/toast.js'
|
import { showError } from '@/utils/toast.js'
|
||||||
|
import { gotoRoom, viewUserInfo } from '@/utils/appBridge.js'
|
||||||
import { handleRewardImageError } from '@/utils/image/imageHandler.js'
|
import { handleRewardImageError } from '@/utils/image/imageHandler.js'
|
||||||
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
|
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
|
||||||
import {
|
import {
|
||||||
@ -1295,11 +1300,13 @@ import {
|
|||||||
apiPostCardCombine,
|
apiPostCardCombine,
|
||||||
apiPostCardDraw,
|
apiPostCardDraw,
|
||||||
apiPostCardRedeem,
|
apiPostCardRedeem,
|
||||||
|
apiPostCardRewardDraw,
|
||||||
} from '@/api/activity.js'
|
} from '@/api/activity.js'
|
||||||
import { ActTaskList, activityDetail, receiveTickets } from '@/api/lottery'
|
import { ActTaskList, activityDetail, receiveTickets } from '@/api/lottery'
|
||||||
import { getThisWeekRewardsAndGifts } from '@/api/topList.js'
|
import { getThisWeekRewardsAndGifts } from '@/api/topList.js'
|
||||||
import { getMemberProfile } from '@/api/wallet'
|
import { getMemberProfile } from '@/api/wallet'
|
||||||
import { getMyWeekStarRanking, getWeekStarRanking } from '@/api/weeklyStar.js'
|
import { getMyWeekStarRanking, getWeekStarRanking } from '@/api/weeklyStar.js'
|
||||||
|
import { getRoomContributionTotalRank } from '@/api/ranking.js'
|
||||||
import BackgroundLayer from '@/components/BackgroundLayer.vue'
|
import BackgroundLayer from '@/components/BackgroundLayer.vue'
|
||||||
import itemCenter from '@/components/itemCenter.vue'
|
import itemCenter from '@/components/itemCenter.vue'
|
||||||
import MaskLayer from '@/components/MaskLayer.vue'
|
import MaskLayer from '@/components/MaskLayer.vue'
|
||||||
@ -1313,6 +1320,11 @@ const coinIcon = new URL('../../../assets/icon/Azizi/coin.png', import.meta.url)
|
|||||||
const gulbenActivityId = '1001'
|
const gulbenActivityId = '1001'
|
||||||
const kingQueenGiftTemplateId = '1966020557831610370'
|
const kingQueenGiftTemplateId = '1966020557831610370'
|
||||||
const weeklyStarPageSize = 10
|
const weeklyStarPageSize = 10
|
||||||
|
const roomRankingParams = {
|
||||||
|
startDate: '20260518',
|
||||||
|
endDate: '20260524',
|
||||||
|
size: 20,
|
||||||
|
}
|
||||||
|
|
||||||
const isLoading = ref(true)
|
const isLoading = ref(true)
|
||||||
const activeTopTab = ref(pageConfig.modules.tabs.defaultValue)
|
const activeTopTab = ref(pageConfig.modules.tabs.defaultValue)
|
||||||
@ -1325,7 +1337,6 @@ const isCardRedeeming = ref(false)
|
|||||||
const activeLotteryPoolIndex = ref(0)
|
const activeLotteryPoolIndex = ref(0)
|
||||||
const activeCollectGameIndex = ref(0)
|
const activeCollectGameIndex = ref(0)
|
||||||
const ruleShow = ref(false)
|
const ruleShow = ref(false)
|
||||||
const activityId = ref(gulbenActivityId)
|
|
||||||
const activityCode = ref(pageConfig.activity.activityCode || '')
|
const activityCode = ref(pageConfig.activity.activityCode || '')
|
||||||
const activity = ref({})
|
const activity = ref({})
|
||||||
const Days = ref(0)
|
const Days = ref(0)
|
||||||
@ -1334,15 +1345,15 @@ const Minutes = ref('00')
|
|||||||
const Seconds = ref('00')
|
const Seconds = ref('00')
|
||||||
const weeklyGifts = ref([
|
const weeklyGifts = ref([
|
||||||
{
|
{
|
||||||
giftPhoto: getPngUrl(pageConfig.assetPath, 'redeemRGift'),
|
giftPhoto: getPngUrl(pageConfig.assetPath, 'redeemR2001'),
|
||||||
giftCandy: 0,
|
giftCandy: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
giftPhoto: getPngUrl(pageConfig.assetPath, 'redeemSRLamb'),
|
giftPhoto: getPngUrl(pageConfig.assetPath, 'redeemSR2011'),
|
||||||
giftCandy: 0,
|
giftCandy: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
giftPhoto: getPngUrl(pageConfig.assetPath, 'redeemSSRGoat'),
|
giftPhoto: getPngUrl(pageConfig.assetPath, 'redeemSSR2021'),
|
||||||
giftCandy: 0,
|
giftCandy: 0,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
@ -1626,6 +1637,14 @@ const activeLotteryTicketImage = computed(
|
|||||||
() => activeLotteryPoolMode.value.ticketImage || 'ticketR',
|
() => activeLotteryPoolMode.value.ticketImage || 'ticketR',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const activeLotteryTicketCount = computed(() =>
|
||||||
|
getTicketRemainingCount(activeLotteryPoolMode.value.poolType),
|
||||||
|
)
|
||||||
|
|
||||||
|
const canLotteryRewardDraw = (drawCount) => {
|
||||||
|
return activeLotteryTicketCount.value >= drawCount
|
||||||
|
}
|
||||||
|
|
||||||
const activeLotteryPrizeRows = computed(() => {
|
const activeLotteryPrizeRows = computed(() => {
|
||||||
const prizes = activeLotteryPrizes.value
|
const prizes = activeLotteryPrizes.value
|
||||||
const rows = []
|
const rows = []
|
||||||
@ -1699,15 +1718,15 @@ const cardDrawTicketCount = computed(() => getTicketRemainingCount('CARD'))
|
|||||||
const maskLayerShow = computed(() => ruleShow.value)
|
const maskLayerShow = computed(() => ruleShow.value)
|
||||||
|
|
||||||
const weeklyStarRankingType = computed(() => {
|
const weeklyStarRankingType = computed(() => {
|
||||||
|
return pageConfig.activity.personalRankActivityType || 'THIS_WEEK'
|
||||||
|
})
|
||||||
|
|
||||||
|
const activeRankingLoadKey = computed(() => {
|
||||||
if (isRoomRankingSection.value) {
|
if (isRoomRankingSection.value) {
|
||||||
return (
|
return `room-${roomRankingParams.startDate}-${roomRankingParams.endDate}-${roomRankingParams.size}`
|
||||||
pageConfig.activity.roomRankActivityType ||
|
|
||||||
pageConfig.activity.personalRankActivityType ||
|
|
||||||
'THIS_WEEK'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pageConfig.activity.personalRankActivityType || 'THIS_WEEK'
|
return `personal-${weeklyStarRankingType.value}`
|
||||||
})
|
})
|
||||||
|
|
||||||
const personalRewardActivityType = computed(() => {
|
const personalRewardActivityType = computed(() => {
|
||||||
@ -1740,12 +1759,12 @@ const isPersonalRewardSection = computed(() => {
|
|||||||
|
|
||||||
const fallbackPersonalRewardTops = computed(() => {
|
const fallbackPersonalRewardTops = computed(() => {
|
||||||
const rewardImages = [
|
const rewardImages = [
|
||||||
'redeemRGift',
|
'redeemR2001',
|
||||||
'redeemRGoat',
|
'redeemR2002',
|
||||||
'redeemRLamp',
|
'redeemR2003',
|
||||||
'redeemRLight',
|
'redeemR2004',
|
||||||
'redeemRMoon',
|
'redeemR2005',
|
||||||
'redeemSRLamb',
|
'redeemSR2011',
|
||||||
]
|
]
|
||||||
|
|
||||||
return Array.from({ length: 3 }, (_, topIndex) => ({
|
return Array.from({ length: 3 }, (_, topIndex) => ({
|
||||||
@ -1804,10 +1823,6 @@ const showTarget = (task) => {
|
|||||||
return `${task.taskName}(${task.currentValue}/${task.targetValue})`
|
return `${task.taskName}(${task.currentValue}/${task.targetValue})`
|
||||||
}
|
}
|
||||||
|
|
||||||
const taskActivityId = computed(() => {
|
|
||||||
return activityId.value || gulbenActivityId
|
|
||||||
})
|
|
||||||
|
|
||||||
const getActivityDetail = async () => {
|
const getActivityDetail = async () => {
|
||||||
if (!activityCode.value) {
|
if (!activityCode.value) {
|
||||||
activity.value = {}
|
activity.value = {}
|
||||||
@ -1817,19 +1832,17 @@ const getActivityDetail = async () => {
|
|||||||
const resDetail = await activityDetail(activityCode.value)
|
const resDetail = await activityDetail(activityCode.value)
|
||||||
if (resDetail.status && resDetail.body) {
|
if (resDetail.status && resDetail.body) {
|
||||||
activity.value = resDetail.body
|
activity.value = resDetail.body
|
||||||
activityId.value = resDetail.body.id || resDetail.body.activityId || activityId.value
|
|
||||||
} else {
|
} else {
|
||||||
activity.value = {}
|
activity.value = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTaskList = async () => {
|
const getTaskList = async () => {
|
||||||
const activityId = taskActivityId.value
|
if (!gulbenActivityId) {
|
||||||
if (!activityId) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const resTaskList = await ActTaskList(activityId)
|
const resTaskList = await ActTaskList(gulbenActivityId)
|
||||||
if (resTaskList.status && resTaskList.body) {
|
if (resTaskList.status && resTaskList.body) {
|
||||||
taskList.value = resTaskList.body
|
taskList.value = resTaskList.body
|
||||||
}
|
}
|
||||||
@ -2002,14 +2015,13 @@ const initData = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const receiveTaskReward = async (code) => {
|
const receiveTaskReward = async (code) => {
|
||||||
const activityId = taskActivityId.value
|
if (!gulbenActivityId || !code) {
|
||||||
if (!activityId || !code) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resReceive = await receiveTickets({
|
const resReceive = await receiveTickets({
|
||||||
activityId,
|
activityId: gulbenActivityId,
|
||||||
taskCode: code,
|
taskCode: code,
|
||||||
})
|
})
|
||||||
if (resReceive.status && resReceive.body) {
|
if (resReceive.status && resReceive.body) {
|
||||||
@ -2101,6 +2113,7 @@ const normalizeWeeklyStarRankingItem = (item = {}, index = 0) => {
|
|||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
rank: item.rank || item.ranking || (index === null ? '' : index + 1),
|
rank: item.rank || item.ranking || (index === null ? '' : index + 1),
|
||||||
|
userId: item.userId || item.id || '',
|
||||||
userAvatar: item.userAvatar || '',
|
userAvatar: item.userAvatar || '',
|
||||||
userName: item.userName || item.userNickname || item.nickname || '',
|
userName: item.userName || item.userNickname || item.nickname || '',
|
||||||
amount: item.amount ?? item.quantity ?? item.total ?? 0,
|
amount: item.amount ?? item.quantity ?? item.total ?? 0,
|
||||||
@ -2109,6 +2122,24 @@ const normalizeWeeklyStarRankingItem = (item = {}, index = 0) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const normalizeRoomContributionRankingItem = (item = {}, index = 0) => {
|
||||||
|
const profile = item.userProfile || {}
|
||||||
|
const specialAccount = profile.ownSpecialId?.account || ''
|
||||||
|
const fallbackAccount = profile.account || ''
|
||||||
|
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
rank: item.rank ?? (index === null ? '' : index + 1),
|
||||||
|
userId: profile.id || item.userId || '',
|
||||||
|
roomId: profile.inRoomId || '',
|
||||||
|
userAvatar: profile.userAvatar || profile.roomIcon || '',
|
||||||
|
userName: profile.userNickname || profile.account || '',
|
||||||
|
amount: item.totalFormat || item.total || 0,
|
||||||
|
account: specialAccount || fallbackAccount,
|
||||||
|
specialAccount,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
if (userInfo.value?.id) {
|
if (userInfo.value?.id) {
|
||||||
return userInfo.value
|
return userInfo.value
|
||||||
@ -2186,8 +2217,62 @@ const getPersonalRanking = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadPersonalRankingSection = async () => {
|
const getRoomContributionRanking = async () => {
|
||||||
const rankingType = weeklyStarRankingType.value
|
if (rankingLoading.value || !rankingHasMore.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rankingLoading.value = true
|
||||||
|
|
||||||
|
try {
|
||||||
|
const resRanking = await getRoomContributionTotalRank(roomRankingParams)
|
||||||
|
|
||||||
|
if (resRanking.status && resRanking.body) {
|
||||||
|
const records = Array.isArray(resRanking.body.rankList) ? resRanking.body.rankList : []
|
||||||
|
ranking.value = records.map((item, index) =>
|
||||||
|
normalizeRoomContributionRankingItem(item, index),
|
||||||
|
)
|
||||||
|
rankingAdd.value = []
|
||||||
|
myRanking.value = resRanking.body.current
|
||||||
|
? normalizeRoomContributionRankingItem(resRanking.body.current, null)
|
||||||
|
: {}
|
||||||
|
rankingHasMore.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ranking.value = []
|
||||||
|
rankingAdd.value = []
|
||||||
|
myRanking.value = {}
|
||||||
|
rankingHasMore.value = false
|
||||||
|
} finally {
|
||||||
|
rankingLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCurrentRankingList = async () => {
|
||||||
|
if (isRoomRankingSection.value) {
|
||||||
|
await getRoomContributionRanking()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await getPersonalRanking()
|
||||||
|
}
|
||||||
|
|
||||||
|
const gotoRankingTarget = (rankingItem = {}) => {
|
||||||
|
if (isRoomRankingSection.value) {
|
||||||
|
console.log('[GulbenFestival] Room Rank click roomId:', rankingItem.roomId, rankingItem)
|
||||||
|
gotoRoom(rankingItem.roomId)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isPersonalRankingSection.value) {
|
||||||
|
console.log('[GulbenFestival] Personal Rank click userId:', rankingItem.userId, rankingItem)
|
||||||
|
viewUserInfo(rankingItem.userId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const loadRankingSection = async () => {
|
||||||
|
const rankingType = activeRankingLoadKey.value
|
||||||
|
|
||||||
if (rankingLoaded.value && loadedRankingType.value === rankingType) {
|
if (rankingLoaded.value && loadedRankingType.value === rankingType) {
|
||||||
observeRankingLoadmore()
|
observeRankingLoadmore()
|
||||||
@ -2203,10 +2288,14 @@ const loadPersonalRankingSection = async () => {
|
|||||||
rankingHasMore.value = true
|
rankingHasMore.value = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const loaders = [getMyPersonalRanking(), getPersonalRanking()]
|
const loaders = isRoomRankingSection.value
|
||||||
|
? [getRoomContributionRanking()]
|
||||||
|
: [getMyPersonalRanking(), getPersonalRanking()]
|
||||||
|
|
||||||
if (isPersonalRankingSection.value) {
|
if (isPersonalRankingSection.value) {
|
||||||
loaders.unshift(getWeeklyGifts())
|
loaders.unshift(getWeeklyGifts())
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all(loaders)
|
await Promise.all(loaders)
|
||||||
observeRankingLoadmore()
|
observeRankingLoadmore()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -2285,17 +2374,29 @@ const startLotteryAnimation = (resultIndex) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 抽奖接口占位:后续对接接口时在这里替换成 drawOnce / drawTen 的真实请求。
|
// 奖励池抽奖:消耗当前奖池奖励票,成功后刷新第一层三种票券数量。
|
||||||
const requestLotteryDraw = async (drawCount) => {
|
const requestLotteryDraw = async (drawCount) => {
|
||||||
|
const resRewardDraw = await apiPostCardRewardDraw({
|
||||||
|
activityId: gulbenActivityId,
|
||||||
|
ticketType: activeLotteryPoolMode.value.poolType,
|
||||||
|
drawCount,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (resRewardDraw.status) {
|
||||||
|
await getCardTicketList()
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
drawCount,
|
drawCount,
|
||||||
prizeIndex: Math.min(3, activeLotteryPrizes.value.length - 1),
|
prizeIndex: Math.min(3, activeLotteryPrizes.value.length - 1),
|
||||||
results: [],
|
results: resRewardDraw.body || [],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleLotteryDraw = async (drawCount = 1) => {
|
const handleLotteryDraw = async (drawCount = 1) => {
|
||||||
if (isLotteryRolling.value) {
|
if (isLotteryRolling.value || !canLotteryRewardDraw(drawCount)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2303,8 +2404,13 @@ const handleLotteryDraw = async (drawCount = 1) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const drawResult = await requestLotteryDraw(drawCount)
|
const drawResult = await requestLotteryDraw(drawCount)
|
||||||
|
if (!drawResult) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const resultIndex = getLotteryResultIndex(drawResult)
|
const resultIndex = getLotteryResultIndex(drawResult)
|
||||||
await startLotteryAnimation(resultIndex)
|
await startLotteryAnimation(resultIndex)
|
||||||
|
} catch (error) {
|
||||||
|
showError(error.errorMsg)
|
||||||
} finally {
|
} finally {
|
||||||
isLotteryRolling.value = false
|
isLotteryRolling.value = false
|
||||||
}
|
}
|
||||||
@ -2425,7 +2531,7 @@ watch(
|
|||||||
isRankingSection,
|
isRankingSection,
|
||||||
(enabled) => {
|
(enabled) => {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
loadPersonalRankingSection()
|
loadRankingSection()
|
||||||
} else if (rankingObserver) {
|
} else if (rankingObserver) {
|
||||||
rankingObserver.disconnect()
|
rankingObserver.disconnect()
|
||||||
}
|
}
|
||||||
@ -2433,6 +2539,12 @@ watch(
|
|||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(activeRankingLoadKey, () => {
|
||||||
|
if (isRankingSection.value) {
|
||||||
|
loadRankingSection()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
isPersonalRewardSection,
|
isPersonalRewardSection,
|
||||||
(enabled) => {
|
(enabled) => {
|
||||||
@ -2456,7 +2568,7 @@ onMounted(() => {
|
|||||||
rankingHasMore.value &&
|
rankingHasMore.value &&
|
||||||
!rankingLoading.value
|
!rankingLoading.value
|
||||||
) {
|
) {
|
||||||
getPersonalRanking()
|
getCurrentRankingList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -19,24 +19,21 @@ export const pageConfig = {
|
|||||||
background: [
|
background: [
|
||||||
'barrageBg',
|
'barrageBg',
|
||||||
'cardBackBg',
|
'cardBackBg',
|
||||||
'draw5BtBg',
|
|
||||||
'draw1Bt',
|
'draw1Bt',
|
||||||
|
'draw5BtBg',
|
||||||
'GameDrawBtBg',
|
'GameDrawBtBg',
|
||||||
'Gameticket',
|
'Gameticket',
|
||||||
'gameTitleR',
|
'gameTitleR',
|
||||||
'gameTitleSR',
|
'gameTitleSR',
|
||||||
'gameTitleSSR',
|
'gameTitleSSR',
|
||||||
'giftBg',
|
'giftBg',
|
||||||
|
'helpBt',
|
||||||
'leftBt',
|
'leftBt',
|
||||||
'lotteryPrizeActiveBg',
|
'lotteryPrizeActiveBg',
|
||||||
'lotteryPrizeBg',
|
'lotteryPrizeBg',
|
||||||
'moduleActiveBg',
|
'moduleActiveBg',
|
||||||
'moduleBg',
|
'moduleBg',
|
||||||
'redeemRGift',
|
'RankingItem',
|
||||||
'redeemRGoat',
|
|
||||||
'redeemRLamp',
|
|
||||||
'redeemRLight',
|
|
||||||
'redeemRMoon',
|
|
||||||
'redeemR2001',
|
'redeemR2001',
|
||||||
'redeemR2002',
|
'redeemR2002',
|
||||||
'redeemR2003',
|
'redeemR2003',
|
||||||
@ -45,13 +42,11 @@ export const pageConfig = {
|
|||||||
'redeemSR2011',
|
'redeemSR2011',
|
||||||
'redeemSR2012',
|
'redeemSR2012',
|
||||||
'redeemSR2013',
|
'redeemSR2013',
|
||||||
'redeemSRLamb',
|
|
||||||
'redeemSRScroll',
|
|
||||||
'redeemSRTurkey',
|
|
||||||
'redeemSSR2021',
|
'redeemSSR2021',
|
||||||
'redeemSSR2022',
|
'redeemSSR2022',
|
||||||
'redeemSSRGoat',
|
'RewardTop1',
|
||||||
'redeemSSRLamb',
|
'RewardTop2',
|
||||||
|
'RewardTop3',
|
||||||
'ruleActivity',
|
'ruleActivity',
|
||||||
'ruleInfoBg',
|
'ruleInfoBg',
|
||||||
'taskBtGo',
|
'taskBtGo',
|
||||||
@ -62,16 +57,25 @@ export const pageConfig = {
|
|||||||
'ticketR',
|
'ticketR',
|
||||||
'ticketSR',
|
'ticketSR',
|
||||||
'ticketSSR',
|
'ticketSSR',
|
||||||
'RankingItem',
|
|
||||||
'RewardTop1',
|
|
||||||
'RewardTop2',
|
|
||||||
'RewardTop3',
|
|
||||||
'top1',
|
'top1',
|
||||||
'top2',
|
'top2',
|
||||||
'top3',
|
'top3',
|
||||||
'vip1',
|
'vip1',
|
||||||
|
'vip2',
|
||||||
|
'vip3',
|
||||||
|
'vip4',
|
||||||
|
'vip5',
|
||||||
|
'vip6',
|
||||||
'userLevel1Bg',
|
'userLevel1Bg',
|
||||||
|
'userLevel2Bg',
|
||||||
|
'userLevel3Bg',
|
||||||
|
'userLevel4Bg',
|
||||||
|
'userLevel5Bg',
|
||||||
'wealthLevel1Bg',
|
'wealthLevel1Bg',
|
||||||
|
'wealthLevel2Bg',
|
||||||
|
'wealthLevel3Bg',
|
||||||
|
'wealthLevel4Bg',
|
||||||
|
'wealthLevel5Bg',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user