feat(春节活动页面): 补充新的阿语图源

This commit is contained in:
hzj 2026-02-11 18:41:57 +08:00
parent f4edac0757
commit ddedd5aaff
6 changed files with 186 additions and 103 deletions

View File

@ -332,7 +332,7 @@
<!-- 头像 --> <!-- 头像 -->
<img <img
v-smart-img v-smart-img
:src="listItem?.userAvatar || ''" :src="listItem?.avatar || ''"
alt="" alt=""
style=" style="
display: block; display: block;
@ -380,7 +380,7 @@
white-space: nowrap; white-space: nowrap;
" "
> >
{{ listItem?.userName }} {{ listItem?.nickname }}
</div> </div>
</div> </div>
</div> </div>
@ -394,7 +394,7 @@
white-space: nowrap; white-space: nowrap;
" "
> >
{{ listItem?.userName }} {{ listItem?.nickname }}
</div> </div>
</div> </div>
</div> </div>
@ -426,7 +426,7 @@
style="display: block; width: 1.5em; aspect-ratio: 1/1; object-fit: cover" style="display: block; width: 1.5em; aspect-ratio: 1/1; object-fit: cover"
/> />
<div style="color: #ffe601; font-weight: 700" class="Textlittle"> <div style="color: #ffe601; font-weight: 700" class="Textlittle">
{{ listItem?.amount || 0 }} {{ listItem?.quantity || 0 }}
</div> </div>
</div> </div>
</itemCenter> </itemCenter>
@ -444,7 +444,7 @@
<!-- 2套内容 --> <!-- 2套内容 -->
<div class="scroll-content" v-for="value in 2"> <div class="scroll-content" v-for="value in 2">
<div <div
v-for="(item, index) in showRewardsTop10[index].activityRewardProps" v-for="(item, index) in showRewardsTop10[index]?.rewards"
:key="index" :key="index"
style=" style="
align-self: stretch; align-self: stretch;
@ -509,7 +509,7 @@
<!-- 头像 --> <!-- 头像 -->
<img <img
v-smart-img v-smart-img
:src="listItem?.userAvatar || ''" :src="listItem?.avatar || ''"
alt="" alt=""
style=" style="
display: block; display: block;
@ -556,7 +556,7 @@
white-space: nowrap; white-space: nowrap;
" "
> >
{{ listItem?.userName }} {{ listItem?.nickname }}
</div> </div>
</div> </div>
</div> </div>
@ -570,7 +570,7 @@
white-space: nowrap; white-space: nowrap;
" "
> >
{{ listItem?.userName }} {{ listItem?.nickname }}
</div> </div>
</div> </div>
</div> </div>
@ -602,7 +602,7 @@
style="display: block; width: 1.5em; aspect-ratio: 1/1; object-fit: cover" style="display: block; width: 1.5em; aspect-ratio: 1/1; object-fit: cover"
/> />
<div style="color: #ffe601; font-weight: 700" class="Textlittle"> <div style="color: #ffe601; font-weight: 700" class="Textlittle">
{{ listItem?.amount || 0 }} {{ listItem?.quantity || 0 }}
</div> </div>
</div> </div>
</itemCenter> </itemCenter>
@ -610,7 +610,7 @@
</div> </div>
<!-- 触发加载功能 --> <!-- 触发加载功能 -->
<div ref="RankingLoadmore"></div> <!-- <div ref="RankingLoadmore"></div> -->
</div> </div>
<!-- 抽奖模块 --> <!-- 抽奖模块 -->
@ -1482,7 +1482,7 @@
<!-- 头像 --> <!-- 头像 -->
<img <img
v-smart-img v-smart-img
:src="myRanking.userAvatar || ''" :src="myRanking.avatar || ''"
alt="" alt=""
style=" style="
display: block; display: block;
@ -1506,7 +1506,7 @@
text-overflow: ellipsis; text-overflow: ellipsis;
" "
> >
{{ myRanking.userName }} {{ myRanking.nickname }}
</div> </div>
</div> </div>
</div> </div>
@ -1528,7 +1528,7 @@
style="display: block; width: 1.5em; aspect-ratio: 1/1; object-fit: cover" style="display: block; width: 1.5em; aspect-ratio: 1/1; object-fit: cover"
/> />
<div style="color: #ffe601; font-weight: 700"> <div style="color: #ffe601; font-weight: 700">
{{ myRanking.amount || 0 }} {{ myRanking.quantity || 0 }}
</div> </div>
</div> </div>
</itemCenter> </itemCenter>
@ -1799,9 +1799,9 @@ import { useThrottle } from '@/utils/useDebounce'
import { formatRewardDisplay } from '@/utils/rewardFormatter.js' import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
import { getMemberProfile, getUserIdentity } from '@/api/wallet' import { getMemberProfile, getUserIdentity } from '@/api/wallet'
import { getThisWeekRewardsAndGifts, getRankingListAndMyRanking } from '@/api/activity.js'
import { import {
ranklist, // ranklist, //
validActivity, //
activityDetail, // activityDetail, //
myRecharge, // myRecharge, //
activityRewardConfigs, // activityRewardConfigs, //
@ -1827,8 +1827,8 @@ import Barrage from './components/Barrage.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'
// const isLoading = ref(true) //
const isLoading = ref(true) const timeoutId = ref(null) // ID
const { t, locale } = useI18n() const { t, locale } = useI18n()
const router = useRouter() const router = useRouter()
@ -1911,25 +1911,58 @@ const rewardsTop10 = ref([]) // 原前10名奖励列表
const topReward = ref({}) // 10 const topReward = ref({}) // 10
// 10 // 10
const showRewardsTop10 = computed(() => { const showRewardsTop10 = computed(() => {
// rewardsTop10 let newRewardsTop10 = JSON.parse(JSON.stringify(rewardsTop10.value)) // rewardsTop10
let newRewardsTop10 = Array(10).fill({
activityRewardProps: [ for (let index = 0; index < newRewardsTop10.length; index++) {
{ let topRewards = newRewardsTop10[index]
let topUser = RankingHasTop10.value[index]
// 1
if (index === 0) {
topRewards?.rewards.push(
{
cover: new URL('/src/assets/icon/coin.png', import.meta.url).href,
content: `${formatLargeNumber(Number(topUser?.totalNumber || '0') * 0.1)}(10% Points Coins)`,
quantity: 0,
type: 'GIFT',
},
{
cover: '',
content: 'Homepage Ad* 7 days',
quantity: 0,
type: 'GIFT',
},
)
}
// 2
else if (index === 1) {
topRewards?.rewards.push({
cover: new URL('/src/assets/icon/coin.png', import.meta.url).href, cover: new URL('/src/assets/icon/coin.png', import.meta.url).href,
content: t('heartbeat_value_points_4_percent', { content: `${formatLargeNumber(Number(topUser?.totalNumber || '0') * 0.08)}(8% Points Coins)`,
amount: formatLargeNumber(Number('1000') * 0.04),
}),
quantity: 0, quantity: 0,
type: 'GIFT', type: 'GIFT',
}, })
{ }
cover: '', // 3
content: 'Homepage Ad* 7 days', else if (index === 2) {
topRewards?.rewards.push({
cover: new URL('/src/assets/icon/coin.png', import.meta.url).href,
content: `${formatLargeNumber(Number(topUser?.totalNumber || '0') * 0.06)}(6% Points Coins)`,
quantity: 0, quantity: 0,
type: 'GIFT', type: 'GIFT',
}, })
], }
})
// 4-10
else {
topRewards?.rewards.push({
cover: new URL('/src/assets/icon/coin.png', import.meta.url).href,
content: `${formatLargeNumber(Number(topUser?.totalNumber || '0') * 0.04)}(4% Points Coins)`,
quantity: 0,
type: 'GIFT',
})
}
}
return newRewardsTop10 return newRewardsTop10
}) })
@ -2120,7 +2153,7 @@ const transfer = async () => {
const transferData = { const transferData = {
amount: selectedCoin.value.price, amount: selectedCoin.value.price,
acceptUserId: selectedPayee.value?.id, acceptUserId: selectedPayee.value?.id,
activityId: '', activityId: '2006671533988298666',
} }
try { try {
@ -2155,7 +2188,7 @@ const exchangeCoinBt = async () => {
// //
const transferData = { const transferData = {
amount: selectedCoin.value.price, amount: selectedCoin.value.price,
activityId: '', activityId: '2006671533988298666',
} }
try { try {
@ -2285,7 +2318,7 @@ const sweepstakes = async (consecutive = 1) => {
if (rollTimes.value >= consecutive) { if (rollTimes.value >= consecutive) {
isRolling.value = true isRolling.value = true
let data = { let data = {
activityId: '2004471533988167125', activityId: '2006671533988298666',
drawCount: consecutive, drawCount: consecutive,
} }
try { try {
@ -2435,7 +2468,7 @@ const clearPayee = () => {
// //
const getWinners = async () => { const getWinners = async () => {
const resWinners = await winnerHistory() const resWinners = await winnerHistory('2006671533988298666')
if (resWinners.status && resWinners.body) { if (resWinners.status && resWinners.body) {
barrageList.value = resWinners.body barrageList.value = resWinners.body
} }
@ -2459,33 +2492,41 @@ const getUserInfo = async () => {
// //
const getRanking = async () => { const getRanking = async () => {
let data = { let data = {
activityId: '2005571533988298753', activityType: 13,
pageNo: rankingPageNo.value,
pageSize: 20,
} }
const resRanking = await ranklist(data) const resRanking = await getRankingListAndMyRanking(data)
if (resRanking.status && resRanking.body) { if (resRanking.status && resRanking.body) {
myRanking.value = resRanking.body?.currentUser // myRanking.value = resRanking.body?.currentUserRank //
Ranking.value = resRanking.body?.rankingList
if (resRanking.body.topList.length > 0) { getRewardsAndGifts() //
if (resRanking.body.topList.length == 20) {
rankingAdd.value = []
Ranking.value.push(...resRanking.body?.topList)
rankingPageNo.value++
} else {
rankingAdd.value = resRanking.body?.topList
}
}
} else { } else {
Ranking.value = [] Ranking.value = []
myRanking.value = {} myRanking.value = {}
} }
} }
// //
const getRewardsAndGifts = async () => {
const resRewardsAndGifts = await getThisWeekRewardsAndGifts('2020751672412921857')
if (resRewardsAndGifts.status && resRewardsAndGifts.body) {
let tempRewardsTop10 = resRewardsAndGifts.body.butOneRewards
let top4Rewards = JSON.parse(JSON.stringify(tempRewardsTop10[3])) // 4
if (tempRewardsTop10.length < 10) {
let addNullUser = Array.from({ length: 10 - tempRewardsTop10.length }, () => top4Rewards)
tempRewardsTop10.push(...addNullUser)
}
rewardsTop10.value = tempRewardsTop10
console.log('rewardsTop10.value:', rewardsTop10.value)
}
}
//
const getActivityDetail = async () => { const getActivityDetail = async () => {
getDrawableAmount() // getDrawableAmount() //
const resDetail = await activityDetail('67125') const resDetail = await activityDetail('98666')
if (resDetail.status && resDetail.body) { if (resDetail.status && resDetail.body) {
activity.value = resDetail.body activity.value = resDetail.body
} else { } else {
@ -2507,7 +2548,7 @@ const showDetail = (type, reward) => {
// //
const getTickets = async () => { const getTickets = async () => {
const resTickets = await myTickets() const resTickets = await myTickets('2006671533988298666')
if (resTickets.status && resTickets.body) { if (resTickets.status && resTickets.body) {
rollTimes.value = resTickets.body rollTimes.value = resTickets.body
} else { } else {
@ -2517,7 +2558,7 @@ const getTickets = async () => {
// //
const getTotalDrawCount = async () => { const getTotalDrawCount = async () => {
const resTotalDrawCount = await myTotalDrawCount() const resTotalDrawCount = await myTotalDrawCount('2006671533988298666')
if (resTotalDrawCount.status && resTotalDrawCount.body) { if (resTotalDrawCount.status && resTotalDrawCount.body) {
totalDraw.value = resTotalDrawCount.body totalDraw.value = resTotalDrawCount.body
} }
@ -2525,7 +2566,7 @@ const getTotalDrawCount = async () => {
// //
const getDrawableAmount = async () => { const getDrawableAmount = async () => {
const resDrawableAmount = await withdrawableAmount('2004471533988167125') const resDrawableAmount = await withdrawableAmount('2006671533988298666')
if (resDrawableAmount.status && resDrawableAmount.body) { if (resDrawableAmount.status && resDrawableAmount.body) {
currentAmount.value = resDrawableAmount.body currentAmount.value = resDrawableAmount.body
} }
@ -2543,7 +2584,7 @@ const getTaskList = async () => {
const getConfigsBadgeInfo = async () => { const getConfigsBadgeInfo = async () => {
let data = { let data = {
activityType: 'USER_RECHARGE_DRAW', activityType: 'USER_RECHARGE_DRAW',
activityId: '2005571533988298753', activityId: '2006671533988298666',
} }
const resConfigsBadge = await rewardConfigsBadge(data) const resConfigsBadge = await rewardConfigsBadge(data)
if (resConfigsBadge.status && resConfigsBadge.body) { if (resConfigsBadge.status && resConfigsBadge.body) {
@ -2553,7 +2594,7 @@ const getConfigsBadgeInfo = async () => {
// //
const getDrawRecords = async () => { const getDrawRecords = async () => {
const resDrawRecords = await drawRecords() const resDrawRecords = await drawRecords('98666')
if (resDrawRecords.status && resDrawRecords.body) { if (resDrawRecords.status && resDrawRecords.body) {
myRecords.value = resDrawRecords.body?.records || [] myRecords.value = resDrawRecords.body?.records || []
} }
@ -2579,7 +2620,7 @@ const receiveTaskReward = async (code) => {
const receiveRechargeBadge = async (rewards) => { const receiveRechargeBadge = async (rewards) => {
let data = { let data = {
activityType: rewards.activityType, activityType: rewards.activityType,
activityId: '2005571533988298753', activityId: '2006671533988298666',
ruleId: rewards.ruleId, ruleId: rewards.ruleId,
} }
try { try {
@ -2616,11 +2657,21 @@ const preloadCriticalImages = async () => {
await preloadImages(criticalImages) await preloadImages(criticalImages)
} }
//
const preloadOtherImages = async () => {
const criticalImages = []
await preloadImages(criticalImages)
}
// //
const completePreloading = async () => { const completePreloading = async () => {
try { try {
// //
await Promise.all([initData(), preloadCriticalImages()]) await Promise.all([
// initData(),
preloadCriticalImages(),
])
} catch (error) { } catch (error) {
console.error('预加载过程中发生错误:', error) console.error('预加载过程中发生错误:', error)
} finally { } finally {
@ -2643,23 +2694,41 @@ const startCountdown = () => {
timer = setInterval(getCountdown, 1000) // timer = setInterval(getCountdown, 1000) //
} }
// // //
const debouceGetRanking = useThrottle(() => { // const debouceGetRanking = useThrottle(() => {
getRanking() // // getRanking() //
}, 1000) // }, 1000)
// IntersectionObserver // // IntersectionObserver
const observer = new IntersectionObserver((entries) => { // const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => { // entries.forEach((entry) => {
if (entry.intersectionRatio > 0 && rankingTotal.value.length != 0) { // if (entry.intersectionRatio > 0 && rankingTotal.value.length != 0) {
console.log('触发RankingLoadmore加载') // console.log('RankingLoadmore')
debouceGetRanking() // debouceGetRanking()
// }
// })
// })
//
const startTimeoutCheck = () => {
timeoutId.value = setTimeout(() => {
if (isLoading.value) {
console.warn('⏰ 预加载超时,正在刷新页面...')
window.location.reload() //
} }
}) }, 20000) // 20
}) }
//
const clearTimeoutCheck = () => {
if (timeoutId.value) {
clearTimeout(timeoutId.value)
timeoutId.value = null
}
}
// //
onMounted(() => { onMounted(async () => {
console.log('route.query.activeAction:', route.query.activeAction) console.log('route.query.activeAction:', route.query.activeAction)
if (route.query.activeAction == 'incomeShow') { if (route.query.activeAction == 'incomeShow') {
handleBt('withdrawal') handleBt('withdrawal')
@ -2667,18 +2736,25 @@ onMounted(() => {
handleBt('ranking') handleBt('ranking')
} }
connectToAppHandler() //
startTimeoutCheck()
await connectToAppHandler()
initData()
startCountdown() // startCountdown() //
// preloadOtherImages() //
if (RankingLoadmore.value) {
console.log('监控加载模块') // //
observer.observe(RankingLoadmore.value) // if (RankingLoadmore.value) {
} // console.log('')
// observer.observe(RankingLoadmore.value)
// }
}) })
onUnmounted(() => { onUnmounted(() => {
clearTimeoutCheck() //
clearInterval(timer) // clearInterval(timer) //
}) })
</script> </script>

View File

@ -263,7 +263,7 @@ const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
// //
const getImgName = (filename) => { const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename return currentLangType.value === 'ar' ? `${filename}_ar` : filename
} }
const props = defineProps({ const props = defineProps({

View File

@ -139,7 +139,7 @@ const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
// //
const getImgName = (filename) => { const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename return currentLangType.value === 'ar' ? `${filename}_ar` : filename
} }
// //

View File

@ -67,7 +67,14 @@
<div>{{ $t('user_id_prefix') }} {{ myRechargeRecode?.account }}</div> <div>{{ $t('user_id_prefix') }} {{ myRechargeRecode?.account }}</div>
<!-- 总充值 --> <!-- 总充值 -->
<div style="display: flex; justify-content: space-between; align-items: center"> <div
style="
display: flex;
justify-content: space-between;
align-items: center;
white-space: nowrap;
"
>
<div> <div>
{{ t('Accumulated recharge') }}:${{ {{ t('Accumulated recharge') }}:${{
formatRechargeAmount(myRechargeRecode?.totalAmount) formatRechargeAmount(myRechargeRecode?.totalAmount)
@ -170,20 +177,20 @@
<img <img
v-if="rewardsTop.claimStatus == -1" v-if="rewardsTop.claimStatus == -1"
class="grayscale-container" class="grayscale-container"
:src="imageUrl('receiveBt')" :src="imageUrl(getImgName('receiveBt'))"
alt="" alt=""
style="width: 40vw; display: block; object-fit: cover" style="width: 40vw; display: block; object-fit: cover"
/> />
<img <img
v-if="rewardsTop.claimStatus == 0" v-if="rewardsTop.claimStatus == 0"
:src="imageUrl('receiveBt')" :src="imageUrl(getImgName('receiveBt'))"
alt="" alt=""
style="width: 40vw; display: block; object-fit: cover" style="width: 40vw; display: block; object-fit: cover"
@click="receiveReward(rewardsTop)" @click="receiveReward(rewardsTop)"
/> />
<img <img
v-if="rewardsTop.claimStatus == 1" v-if="rewardsTop.claimStatus == 1"
:src="imageUrl('receivedBt')" :src="imageUrl(getImgName('receivedBt'))"
alt="" alt=""
style="width: 40vw; display: block; object-fit: cover" style="width: 40vw; display: block; object-fit: cover"
/> />
@ -283,7 +290,7 @@ const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
// //
const getImgName = (filename) => { const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename return currentLangType.value === 'ar' ? `${filename}_ar` : filename
} }
const rechargehidden = ref(true) // const rechargehidden = ref(true) //
@ -299,12 +306,12 @@ const formatRechargeAmount = (amount) => {
} }
const topImg = ref([ const topImg = ref([
imageUrl('rechargeReward100'), imageUrl(getImgName('rechargeReward100')),
imageUrl('rechargeReward500'), imageUrl(getImgName('rechargeReward500')),
imageUrl('rechargeReward1000'), imageUrl(getImgName('rechargeReward1000')),
imageUrl('rechargeReward3000'), imageUrl(getImgName('rechargeReward3000')),
imageUrl('rechargeReward5000'), imageUrl(getImgName('rechargeReward5000')),
imageUrl('rechargeReward10000'), imageUrl(getImgName('rechargeReward10000')),
]) // top ]) // top
// //

View File

@ -143,10 +143,10 @@
<!-- 抽奖信息 --> <!-- 抽奖信息 -->
<div style="width: 100%; height: 5vw; display: flex; justify-content: space-between"> <div style="width: 100%; height: 5vw; display: flex; justify-content: space-between">
<!-- 拥有抽奖券 --> <!-- 拥有抽奖券 -->
<div>{{ $t('remaining_lottery_tickets') }}: {{ tickets }}</div> <div style="font-weight: 700">{{ $t('remaining_lottery_tickets') }}: {{ tickets }}</div>
<!-- 获取抽奖券 --> <!-- 获取抽奖券 -->
<div @click="showTaskList">{{ $t('how_to_get_ticket') }}</div> <div style="font-weight: 700" @click="showTaskList">{{ $t('how_to_get_ticket') }}</div>
</div> </div>
<!-- 抽奖按钮 --> <!-- 抽奖按钮 -->
@ -195,7 +195,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 4vw; gap: 2vw;
" "
@click="sweepstakes(10)" @click="sweepstakes(10)"
> >
@ -594,7 +594,7 @@
:class="['coin-item', { selected: selectedCoin?.id == coin.id }]" :class="['coin-item', { selected: selectedCoin?.id == coin.id }]"
> >
<img v-smart-img src="/src/assets/icon/coin.png" alt="" style="width: 40%" /> <img v-smart-img src="/src/assets/icon/coin.png" alt="" style="width: 40%" />
<div style="font-size: 0.7em">{{ coin.amount }} coins x1</div> <div style="direction: ltr; font-size: 0.7em">{{ coin.amount }} coins x1</div>
<div style="font-weight: 500; color: #fff">${{ coin.price }}</div> <div style="font-weight: 500; color: #fff">${{ coin.price }}</div>
</div> </div>
</div> </div>
@ -746,7 +746,7 @@ const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
// //
const getImgName = (filename) => { const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename return currentLangType.value === 'ar' ? `${filename}_ar` : filename
} }
const props = defineProps({ const props = defineProps({

View File

@ -1373,14 +1373,14 @@ const preloadOtherImages = async () => {
imageUrl('rankingRewardTop4Bg'), imageUrl('rankingRewardTop4Bg'),
// //
imageUrl('receiveBt'), imageUrl(getImgName('receiveBt')),
imageUrl('receivedBt'), imageUrl(getImgName('receivedBt')),
imageUrl('rechargeReward100'), imageUrl(getImgName('rechargeReward100')),
imageUrl('rechargeReward500'), imageUrl(getImgName('rechargeReward500')),
imageUrl('rechargeReward1000'), imageUrl(getImgName('rechargeReward1000')),
imageUrl('rechargeReward3000'), imageUrl(getImgName('rechargeReward3000')),
imageUrl('rechargeReward5000'), imageUrl(getImgName('rechargeReward5000')),
imageUrl('rechargeReward10000'), imageUrl(getImgName('rechargeReward10000')),
] ]
await preloadImages(criticalImages) await preloadImages(criticalImages)