feat(迎新活动): 对接充值奖励接口
This commit is contained in:
parent
210c3a59e4
commit
31c29296b3
@ -473,7 +473,7 @@
|
||||
:contentStyle="`padding: 36.5vw 9vw 18vw;align-items: flex-start;gap: 11vw;`"
|
||||
>
|
||||
<div
|
||||
v-for="(reward, index) in rewardsTop"
|
||||
v-for="(reward, index) in rewardsTop.rewards"
|
||||
style="flex: 1; align-self: stretch; display: flex; flex-direction: column"
|
||||
>
|
||||
<div
|
||||
@ -494,7 +494,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div style="flex: 1; display: flex; justify-content: center; align-items: center">
|
||||
<div style="font-size: 1.2em; color: #fff; font-weight: 600">*7Days</div>
|
||||
<div style="font-size: 1.3em; color: #fff; font-weight: 600">
|
||||
{{ formatRewardDisplay(reward.type, reward) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
@ -1086,9 +1088,11 @@ import { connectToApp } from '@/utils/appConnector.js'
|
||||
import { getPngUrl } from '@/config/imagePaths.js'
|
||||
import { preloadImages } from '@/utils/image/imagePreloader.js'
|
||||
import { handleAvatarImageError, handleRewardImageError } from '@/utils/image/imageHandler.js'
|
||||
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
|
||||
|
||||
import {
|
||||
getRankingListAndMyRanking, // 获取排行榜和当前用户排名
|
||||
getThisWeekRewardsAndGifts, // 获取本周奖励和礼物
|
||||
} from '@/api/activity.js'
|
||||
import {
|
||||
getMyInviteCode, // 获取我的邀请码
|
||||
@ -1133,59 +1137,34 @@ const myInviteIncome = ref({}) //邀请用户收益统计
|
||||
const myInviteUsers = ref([]) //邀请用户列表
|
||||
const bindingUserRewards = ref([]) //绑定用户奖励
|
||||
// 充值奖励
|
||||
const rechargeRewards = ref([
|
||||
Array(3).fill({
|
||||
type: 'GOLD',
|
||||
detailType: 'GOLD',
|
||||
content: '1000',
|
||||
quantity: 0,
|
||||
amount: 1000,
|
||||
sort: 1,
|
||||
}), //用户充值奖励(充值0.99美金)
|
||||
Array(3).fill({
|
||||
type: 'GOLD',
|
||||
detailType: 'GOLD',
|
||||
content: '1000',
|
||||
quantity: 0,
|
||||
amount: 1000,
|
||||
sort: 1,
|
||||
}), //用户充值奖励(充值4.99美金)
|
||||
Array(3).fill({
|
||||
type: 'GOLD',
|
||||
detailType: 'GOLD',
|
||||
content: '1000',
|
||||
quantity: 0,
|
||||
amount: 1000,
|
||||
sort: 1,
|
||||
}), //用户充值奖励(充值9.99美金)
|
||||
])
|
||||
const rechargeRewards = ref(Array(3))
|
||||
|
||||
// 排行奖励
|
||||
const rankingRewards = ref([
|
||||
Array(2).fill({
|
||||
type: 'GOLD',
|
||||
detailType: 'GOLD',
|
||||
content: '1000',
|
||||
quantity: 0,
|
||||
amount: 1000,
|
||||
sort: 1,
|
||||
}), //top1奖励
|
||||
Array(2).fill({
|
||||
type: 'GOLD',
|
||||
detailType: 'GOLD',
|
||||
content: '1000',
|
||||
quantity: 0,
|
||||
amount: 1000,
|
||||
sort: 1,
|
||||
}), //top2奖励
|
||||
Array(2).fill({
|
||||
type: 'GOLD',
|
||||
detailType: 'GOLD',
|
||||
content: '1000',
|
||||
quantity: 0,
|
||||
amount: 1000,
|
||||
sort: 1,
|
||||
}), //top3奖励
|
||||
// Array(2).fill({
|
||||
// type: 'GOLD',
|
||||
// detailType: 'GOLD',
|
||||
// content: '1000',
|
||||
// quantity: 0,
|
||||
// amount: 1000,
|
||||
// sort: 1,
|
||||
// }), //top1奖励
|
||||
// Array(2).fill({
|
||||
// type: 'GOLD',
|
||||
// detailType: 'GOLD',
|
||||
// content: '1000',
|
||||
// quantity: 0,
|
||||
// amount: 1000,
|
||||
// sort: 1,
|
||||
// }), //top2奖励
|
||||
// Array(2).fill({
|
||||
// type: 'GOLD',
|
||||
// detailType: 'GOLD',
|
||||
// content: '1000',
|
||||
// quantity: 0,
|
||||
// amount: 1000,
|
||||
// sort: 1,
|
||||
// }), //top3奖励
|
||||
])
|
||||
|
||||
const Ranking = ref([]) // 原始排行榜
|
||||
@ -1436,7 +1415,7 @@ const getBindingUserRewards = async () => {
|
||||
// 获取排行榜
|
||||
const getRanking = async () => {
|
||||
let data = {
|
||||
activityType: 10,
|
||||
activityType: 14,
|
||||
}
|
||||
const resRanking = await getRankingListAndMyRanking(data)
|
||||
if (resRanking.status && resRanking.body) {
|
||||
@ -1448,6 +1427,26 @@ const getRanking = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取每周奖励列表
|
||||
const getRewardsAndGifts = async () => {
|
||||
const resRewardsAndGifts = await getThisWeekRewardsAndGifts('2029443922744954881')
|
||||
if (resRewardsAndGifts.status && resRewardsAndGifts.body) {
|
||||
rankingRewards.value = resRewardsAndGifts.body.butOneRewards
|
||||
}
|
||||
}
|
||||
|
||||
// 获取充值奖励
|
||||
const getRechargeRewards = async () => {
|
||||
let RewardsId = [['2029448725407711234'], ['2029449081176965121'], ['2029449364032438273']]
|
||||
RewardsId.forEach(async (id, index) => {
|
||||
const resRechargeRewards = await apiGetBindingUserRewards(id)
|
||||
if (resRechargeRewards.status && resRechargeRewards.body) {
|
||||
console.log('resRechargeRewards.body.id', resRechargeRewards.body[`${id}`])
|
||||
rechargeRewards.value[index] = resRechargeRewards.body[`${id}`]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 预加载关键图片
|
||||
const preloadCriticalImages = async () => {
|
||||
const criticalImages = [
|
||||
@ -1490,6 +1489,8 @@ const initData = async () => {
|
||||
getBindingUserRewards(), // 绑定用户奖励
|
||||
|
||||
getRanking(), //获取排行榜
|
||||
getRewardsAndGifts(), //获取每周奖励列表
|
||||
getRechargeRewards(), //获取充值奖励
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user