feat(活动接口,游戏活动): 调整接口传参方式、对接游戏活动接口

This commit is contained in:
hzj 2025-11-28 18:34:24 +08:00
parent 21ced27aee
commit 8b9f4abcee
4 changed files with 42 additions and 11 deletions

View File

@ -1,9 +1,8 @@
import { get, post } from '../utils/http.js'
// 获取排行榜和我的排名
export const getRankingListAndMyRanking = async (activityType) => {
export const getRankingListAndMyRanking = async (data) => {
try {
let data = { activityType }
const response = await post(`/ranking/list`, data)
return response
} catch (error) {

View File

@ -437,7 +437,6 @@ const rankingShow = ref(true) //排行榜
const Ranking = ref([]) //
const myRanking = ref({}) //
const rewardsList = ref([]) //
const gifts = ref([]) //
const topImg = ref([images.top1RewardBg, images.top2RewardBg, images.top3RewardBg]) // top
@ -468,6 +467,9 @@ const handleImageError = (e, type) => {
if ((type = 'GOLD')) {
e.target.src = new URL('/src/assets/icon/coin.png', import.meta.url).href
}
if ((type = 'DOLLARS')) {
e.target.src = new URL('/src/assets/icon/dollar.png', import.meta.url).href
}
}
//
@ -477,9 +479,9 @@ const defaultAvatarUrl = (e) => {
e.target.src = new URL('/src/assets/icon/defaultAvatar.png', import.meta.url).href
}
// 202512510
// 202512150
const getTargetTime = () => {
const targetDate = new Date(2025, 11, 5, 10, 0, 0) // 01112
const targetDate = new Date(2025, 11, 15, 0, 0, 0) // 01112
return targetDate.getTime()
}
@ -519,7 +521,7 @@ const getCountdown = () => {
//
const showDetail = (type, reward) => {
let showamount = ['GOLD', 'DIAMOND', 'GIFT', 'FRAGMENTS']
let showamount = ['GOLD', 'DIAMOND', 'GIFT', 'FRAGMENTS', 'DOLLARS']
if (showamount.includes(type)) {
return reward.content
} else {
@ -529,7 +531,12 @@ const showDetail = (type, reward) => {
//
const getListAndMy = async () => {
const resMyWeekStarRanking = await getRankingListAndMyRanking(5)
let data = {
activityType: 1068,
cycleType: 3,
cycleKey: '202511',
}
const resMyWeekStarRanking = await getRankingListAndMyRanking(data)
console.log('resMyWeekStarRanking:', resMyWeekStarRanking)
if (resMyWeekStarRanking.status && resMyWeekStarRanking.body) {
myRanking.value = resMyWeekStarRanking.body.currentUserRank
@ -539,10 +546,29 @@ const getListAndMy = async () => {
//
const getRewardsAndGifts = async () => {
const resRewardsAndGifts = await getThisWeekRewardsAndGifts('1991057058101104641')
const resRewardsAndGifts = await getThisWeekRewardsAndGifts('1994334094730010626')
if (resRewardsAndGifts.status && resRewardsAndGifts.body) {
gifts.value = resRewardsAndGifts.body.gifts
rewardsList.value = resRewardsAndGifts.body.butOneRewards
if (rewardsList.value[0]) {
rewardsList.value[0].rewards.push({
type: 'DOLLARS',
content: 50,
})
}
if (rewardsList.value[1]) {
rewardsList.value[1].rewards.push({
type: 'DOLLARS',
content: 30,
})
}
if (rewardsList.value[2]) {
rewardsList.value[2].rewards.push({
type: 'DOLLARS',
content: 10,
})
}
}
}

View File

@ -517,7 +517,10 @@ const showDetail = (type, reward) => {
//
const getListAndMy = async () => {
const resMyWeekStarRanking = await getRankingListAndMyRanking(5)
let data = {
activityType: 5,
}
const resMyWeekStarRanking = await getRankingListAndMyRanking(data)
console.log('resMyWeekStarRanking:', resMyWeekStarRanking)
if (resMyWeekStarRanking.status && resMyWeekStarRanking.body) {
myRanking.value = resMyWeekStarRanking.body.currentUserRank

View File

@ -524,7 +524,10 @@ const showDetail = (type, reward) => {
//
const getListAndMy = async () => {
const resMyWeekStarRanking = await getRankingListAndMyRanking(6)
let data = {
activityType: 6,
}
const resMyWeekStarRanking = await getRankingListAndMyRanking(data)
console.log('resMyWeekStarRanking:', resMyWeekStarRanking)
if (resMyWeekStarRanking.status && resMyWeekStarRanking.body) {
myRanking.value = resMyWeekStarRanking.body.currentUserRank