feat(活动接口,游戏活动): 调整接口传参方式、对接游戏活动接口
This commit is contained in:
parent
21ced27aee
commit
8b9f4abcee
@ -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) {
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
// 获取2025年12月5日上午10点的时间戳(北京时间)
|
||||
// 获取2025年12月15日上午0点的时间戳(北京时间)
|
||||
const getTargetTime = () => {
|
||||
const targetDate = new Date(2025, 11, 5, 10, 0, 0) // 月份从0开始,11代表12月
|
||||
const targetDate = new Date(2025, 11, 15, 0, 0, 0) // 月份从0开始,11代表12月
|
||||
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,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user