feat(新页面): 春节活动

This commit is contained in:
hzj 2026-02-06 17:25:12 +08:00
parent 0228bf17ee
commit 182cc0565b
10 changed files with 3761 additions and 6 deletions

View File

@ -372,17 +372,23 @@ const router = createRouter({
// 限时活动
{
path: '/login-reward',
name: 'login-reward',
component: () => import('../views/Activities/LoginReward/index.vue'),
path: '/activities/spring-festival',
name: 'spring-festival',
component: () => import('../views/Activities/SpringFestival/index.vue'),
meta: { requiresAuth: true },
}, //2026年xxxxxx结束
}, //2026年2月16日上午5点结束
{
path: '/lucky-dollars-season3',
name: 'lucky-dollars-season3',
component: () => import('../views/Activities/LuckyDollars/Season3/index.vue'),
meta: { requiresAuth: true },
}, //2026年2月16日上午5点结束
{
path: '/login-reward',
name: 'login-reward',
component: () => import('../views/Activities/LoginReward/index.vue'),
meta: { requiresAuth: true },
}, //2026年xxxxxx结束
{
path: '/jack-pot',
name: 'jack-pot',

View File

@ -58,8 +58,9 @@ const ACTIVITIES = [
INVITATION_PAGES.INVITE_USER, //邀请新用户(邀请码)
'/recharge-reward', //充值奖励
'/login-reward', // 登录奖励
'/activities/spring-festival', // 春节游戏打榜
'/lucky-dollars-season3', // 水果游戏打榜
'/login-reward', // 登录奖励
'/jack-pot', // 水果游戏打榜
'/new-year', // 新年抽奖
]

View File

@ -409,8 +409,9 @@ class RouteGuard {
'/invitation-to-register', //邀请新用户注册页面
'/recharge-reward', //充值奖励
'/activities/spring-festival', // 春节游戏打榜
'/lucky-dollars-season3', // 水果游戏打榜
'/login-reward', // 登录奖励
'/lucky-dollars-season3', //水果游戏打榜
'/jack-pot', //水果游戏打榜
'/new-year', //新年抽奖
]

View File

@ -0,0 +1,232 @@
<template>
<div></div>
</template>
<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { connectToApp } from '@/utils/appConnector.js'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { setDocumentDirection } from '@/locales/i18n'
import { viewUserInfo } from '@/utils/appBridge.js'
import { useLangStore } from '@/stores/lang'
import { getPngUrl } from '@/config/imagePaths.js'
import { preloadImages } from '@/utils/imagePreloader.js'
import { showError, showSuccess } from '@/utils/toast.js'
import { handleAvatarImageError, handleRewardImageError } from '@/utils/imageHandler.js'
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
import { useSpringFestival } from '@/stores/springFestival'
import { storeToRefs } from 'pinia'
import BackgroundLayer from '@/components/BackgroundLayer.vue'
import itemCenter from '@/components/itemCenter.vue'
import maskLayer from '@/components/MaskLayer.vue'
//
const isLoading = ref(true)
const { t, locale } = useI18n()
const router = useRouter()
const route = useRoute()
const springFestivalStore = useSpringFestival()
const {
//
lotteryRewards, //
tickets, //
userInfo, //
userIdentity, //
currentEarnings, //
taskList, //
//
lotteryRanking, //
addLotteryRanking, //
myLotteryRanking, //
//
rankingRewards, //
//
rechargeRanking, //
addRechargeRanking, //
myRechargeRanking, //
//
RechargeRewards, //
resultShow,
result, //
drawRecordShow,
myRecords, //
receiveRecordShow,
receiveRecord, //
helpShow, //
} = storeToRefs(springFestivalStore)
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
// OSSURL
const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename
}
//
const openPopup = (type) => {
closedPopup(false) //
switch (type) {
case 'help':
helpShow.value = true
break
default:
break
}
}
//
const closedPopup = (clear = true) => {
helpShow.value = false
//
if (clear) {
}
}
//
const initData = async () => {
await Promise.all([])
}
//
const preloadCriticalImages = async () => {
const criticalImages = []
await preloadImages(criticalImages)
}
//
const completePreloading = async () => {
try {
//
await Promise.all([initData(), preloadCriticalImages()])
} catch (error) {
console.error('预加载过程中发生错误:', error)
} finally {
//
isLoading.value = false
}
}
// 使APP
const connectToAppHandler = async () => {
await connectToApp(() => {
//
completePreloading() //
})
}
onMounted(() => {
// connectToAppHandler()
})
onUnmounted(() => {})
</script>
<style lang="scss" scoped>
* {
color: #fff;
}
.fullPage {
position: relative;
background: #142c24;
}
.bg {
width: 100vw;
min-height: 100vh;
position: relative;
z-index: 1;
}
.background-overlay {
position: absolute;
inset: 236vw 0 0;
background-image: var(--bg2-url);
background-repeat: repeat-y;
background-position: top center;
background-size: 100% auto;
z-index: 0; /* 确保在.bg之下 */
}
/* 添加加载动画样式 */
.loading-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666;
}
.loading-spinner {
width: 32px;
height: 32px;
border: 3px solid #f3f3f3;
border-top: 3px solid #f59e0b;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 12px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.scrollY::-webkit-scrollbar {
display: none;
}
[dir='rtl'] .flipImg {
transform: scaleX(-1);
}
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 12px;
}
}
@media screen and (min-width: 768px) {
* {
font-size: 24px;
}
}
@media screen and (min-width: 1024px) {
* {
font-size: 32px;
}
}
</style>

View File

@ -0,0 +1,232 @@
<template>
<div></div>
</template>
<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { connectToApp } from '@/utils/appConnector.js'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { setDocumentDirection } from '@/locales/i18n'
import { viewUserInfo } from '@/utils/appBridge.js'
import { useLangStore } from '@/stores/lang'
import { getPngUrl } from '@/config/imagePaths.js'
import { preloadImages } from '@/utils/imagePreloader.js'
import { showError, showSuccess } from '@/utils/toast.js'
import { handleAvatarImageError, handleRewardImageError } from '@/utils/imageHandler.js'
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
import { useSpringFestival } from '@/stores/springFestival'
import { storeToRefs } from 'pinia'
import BackgroundLayer from '@/components/BackgroundLayer.vue'
import itemCenter from '@/components/itemCenter.vue'
import maskLayer from '@/components/MaskLayer.vue'
//
const isLoading = ref(true)
const { t, locale } = useI18n()
const router = useRouter()
const route = useRoute()
const springFestivalStore = useSpringFestival()
const {
//
lotteryRewards, //
tickets, //
userInfo, //
userIdentity, //
currentEarnings, //
taskList, //
//
lotteryRanking, //
addLotteryRanking, //
myLotteryRanking, //
//
rankingRewards, //
//
rechargeRanking, //
addRechargeRanking, //
myRechargeRanking, //
//
RechargeRewards, //
resultShow,
result, //
drawRecordShow,
myRecords, //
receiveRecordShow,
receiveRecord, //
helpShow, //
} = storeToRefs(springFestivalStore)
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
// OSSURL
const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename
}
//
const openPopup = (type) => {
closedPopup(false) //
switch (type) {
case 'help':
helpShow.value = true
break
default:
break
}
}
//
const closedPopup = (clear = true) => {
helpShow.value = false
//
if (clear) {
}
}
//
const initData = async () => {
await Promise.all([])
}
//
const preloadCriticalImages = async () => {
const criticalImages = []
await preloadImages(criticalImages)
}
//
const completePreloading = async () => {
try {
//
await Promise.all([initData(), preloadCriticalImages()])
} catch (error) {
console.error('预加载过程中发生错误:', error)
} finally {
//
isLoading.value = false
}
}
// 使APP
const connectToAppHandler = async () => {
await connectToApp(() => {
//
completePreloading() //
})
}
onMounted(() => {
// connectToAppHandler()
})
onUnmounted(() => {})
</script>
<style lang="scss" scoped>
* {
color: #fff;
}
.fullPage {
position: relative;
background: #142c24;
}
.bg {
width: 100vw;
min-height: 100vh;
position: relative;
z-index: 1;
}
.background-overlay {
position: absolute;
inset: 236vw 0 0;
background-image: var(--bg2-url);
background-repeat: repeat-y;
background-position: top center;
background-size: 100% auto;
z-index: 0; /* 确保在.bg之下 */
}
/* 添加加载动画样式 */
.loading-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666;
}
.loading-spinner {
width: 32px;
height: 32px;
border: 3px solid #f3f3f3;
border-top: 3px solid #f59e0b;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 12px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.scrollY::-webkit-scrollbar {
display: none;
}
[dir='rtl'] .flipImg {
transform: scaleX(-1);
}
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 12px;
}
}
@media screen and (min-width: 768px) {
* {
font-size: 24px;
}
}
@media screen and (min-width: 1024px) {
* {
font-size: 32px;
}
}
</style>

View File

@ -0,0 +1,232 @@
<template>
<div></div>
</template>
<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { connectToApp } from '@/utils/appConnector.js'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { setDocumentDirection } from '@/locales/i18n'
import { viewUserInfo } from '@/utils/appBridge.js'
import { useLangStore } from '@/stores/lang'
import { getPngUrl } from '@/config/imagePaths.js'
import { preloadImages } from '@/utils/imagePreloader.js'
import { showError, showSuccess } from '@/utils/toast.js'
import { handleAvatarImageError, handleRewardImageError } from '@/utils/imageHandler.js'
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
import { useSpringFestival } from '@/stores/springFestival'
import { storeToRefs } from 'pinia'
import BackgroundLayer from '@/components/BackgroundLayer.vue'
import itemCenter from '@/components/itemCenter.vue'
import maskLayer from '@/components/MaskLayer.vue'
//
const isLoading = ref(true)
const { t, locale } = useI18n()
const router = useRouter()
const route = useRoute()
const springFestivalStore = useSpringFestival()
const {
//
lotteryRewards, //
tickets, //
userInfo, //
userIdentity, //
currentEarnings, //
taskList, //
//
lotteryRanking, //
addLotteryRanking, //
myLotteryRanking, //
//
rankingRewards, //
//
rechargeRanking, //
addRechargeRanking, //
myRechargeRanking, //
//
RechargeRewards, //
resultShow,
result, //
drawRecordShow,
myRecords, //
receiveRecordShow,
receiveRecord, //
helpShow, //
} = storeToRefs(springFestivalStore)
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
// OSSURL
const imageUrl = (filename) => getPngUrl('Activities/SpringFestival/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `filename_ar` : filename
}
//
const openPopup = (type) => {
closedPopup(false) //
switch (type) {
case 'help':
helpShow.value = true
break
default:
break
}
}
//
const closedPopup = (clear = true) => {
helpShow.value = false
//
if (clear) {
}
}
//
const initData = async () => {
await Promise.all([])
}
//
const preloadCriticalImages = async () => {
const criticalImages = []
await preloadImages(criticalImages)
}
//
const completePreloading = async () => {
try {
//
await Promise.all([initData(), preloadCriticalImages()])
} catch (error) {
console.error('预加载过程中发生错误:', error)
} finally {
//
isLoading.value = false
}
}
// 使APP
const connectToAppHandler = async () => {
await connectToApp(() => {
//
completePreloading() //
})
}
onMounted(() => {
// connectToAppHandler()
})
onUnmounted(() => {})
</script>
<style lang="scss" scoped>
* {
color: #fff;
}
.fullPage {
position: relative;
background: #142c24;
}
.bg {
width: 100vw;
min-height: 100vh;
position: relative;
z-index: 1;
}
.background-overlay {
position: absolute;
inset: 236vw 0 0;
background-image: var(--bg2-url);
background-repeat: repeat-y;
background-position: top center;
background-size: 100% auto;
z-index: 0; /* 确保在.bg之下 */
}
/* 添加加载动画样式 */
.loading-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666;
}
.loading-spinner {
width: 32px;
height: 32px;
border: 3px solid #f3f3f3;
border-top: 3px solid #f59e0b;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 12px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.scrollY::-webkit-scrollbar {
display: none;
}
[dir='rtl'] .flipImg {
transform: scaleX(-1);
}
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 12px;
}
}
@media screen and (min-width: 768px) {
* {
font-size: 24px;
}
}
@media screen and (min-width: 1024px) {
* {
font-size: 32px;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,322 @@
<!-- 告白墙弹幕 -->
<template>
<div
style="position: relative; width: 100%; height: 32vw; overflow: hidden; pointer-events: none"
>
<!-- 双行弹幕轨道 -->
<div
v-for="(track, index) in visibleTracks"
:key="index"
style="position: absolute; width: 100%; height: 50px"
:style="{ top: `calc(${index} * 16vw)` }"
>
<div
v-for="item in track"
:key="item.id"
class="barrage-item"
style="
position: absolute;
border-radius: 26px;
padding: 8px;
display: flex;
align-items: center;
gap: 2vw;
backdrop-filter: blur(1px);
"
:style="getBarrageStyle(item)"
@animationend="handleAnimationEnd(item.id)"
>
<!-- 情侣头像 -->
<div
style="
position: relative;
display: flex;
align-items: center;
gap: 2vw;
"
>
<!-- 爱心图形 -->
<div
style="
position: absolute;
inset: 0;
display: flex;
justify-content: center;
align-items: center;
"
>
<img
:src="imageUrl('coupleSign')"
alt=""
style="width: 5vw; display: block; object-fit: cover"
/>
</div>
<!-- 发送人 -->
<img
v-smart-img
:src="item.senderAvatar || ''"
alt=""
style="
width: 8vw;
border-radius: 50%;
display: block;
aspect-ratio: 1/1;
object-fit: cover;
"
@error="handleAvatarImageError"
/>
<!-- 接收人 -->
<img
v-smart-img
:src="item.receiverAvatar || ''"
alt=""
style="
width: 8vw;
border-radius: 50%;
display: block;
aspect-ratio: 1/1;
object-fit: cover;
"
@error="handleAvatarImageError"
/>
</div>
<div
style="
white-space: nowrap;
font-weight: 700;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-image: linear-gradient(
180deg,
#fff9a9 26.92%,
#ed7d0a 52.08%,
#fffab5 73.08%
);
"
>
{{ item.content }}
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { getPngUrl } from '@/config/imagePaths.js'
import { handleAvatarImageError } from '@/utils/imageHandler.js'
const { locale, t } = useI18n()
// OSSURL
const imageUrl = (filename) => getPngUrl('Ranking/Couple/', filename)
const props = defineProps({
barrageList: {
type: Array,
required: true,
default: () => [],
},
maxItems: {
type: Number,
default: 4, //
},
loopInterval: {
type: Number,
default: 2000, // (ms)
},
})
const tracks = ref([[], []]) //
const idCounter = ref(0) // ID
const currentIndex = ref(0) //
//
const visibleTracks = computed(() => tracks.value.filter((track) => track.length > 0))
//
const getBarrageStyle = (item) => {
const isRTL = locale.value === 'ar'
return {
animationDuration: `${item.duration}s`,
animationDelay: `${item.delay}s`,
'--start-pos': `${item.startPos}px`,
borderRadius: '200px',
background: 'linear-gradient(180deg, #FFACBB 0%, rgba(255, 172, 187, 0.00) 58.38%), #FF4768',
boxShadow:
'0 1px 4.5px 0 rgba(0, 0, 0, 0.10), -1px 0 5px 0 rgba(255, 255, 255, 0.70) inset, -3.5px 0 7.5px 0 rgba(255, 255, 255, 0.20) inset, 1px 0 5px 0 rgba(255, 255, 255, 0.70) inset, 3.5px 0 7.5px 0 rgba(255, 255, 255, 0.20) inset',
// RTL
...(isRTL
? {
right: '0',
left: 'auto',
transform: 'translateX(-100vw)',
}
: {
left: '0',
right: 'auto',
transform: 'translateX(100vw)',
}),
}
}
//
const generateBarrageProps = (item) => {
const textLength = item.content.length
return {
duration: Math.min(5 + textLength * 0.1, 10), // 0.28
startPos: 0, //
}
}
//
const addToTrack = (item) => {
//
const trackIndex = tracks.value.reduce(
(minIndex, track, index) => (track.length < tracks.value[minIndex].length ? index : minIndex),
0,
)
if (tracks.value[trackIndex].length < props.maxItems) {
tracks.value[trackIndex].push({
...item,
id: idCounter.value++, //
delay: 0, // 0-4
...generateBarrageProps(item),
})
}
}
//
const cleanCompleted = () => {
tracks.value.forEach((track) => {
for (let i = track.length - 1; i >= 0; i--) {
if (track[i].completed) {
track.splice(i, 1)
}
}
})
}
//
const handleAnimationEnd = (id) => {
tracks.value.forEach((track) => {
const item = track.find((item) => item.id === id)
if (item) item.completed = true
})
}
//
const getNextBarrage = () => {
if (props.barrageList.length === 0) return null
const item = props.barrageList[currentIndex.value] //
currentIndex.value = (currentIndex.value + 1) % props.barrageList.length //0
return { ...item } //
}
//
let barrageInterval = null
//
const startBarrage = () => {
barrageInterval = setInterval(() => {
cleanCompleted() //
const nextBarrage = getNextBarrage() //
if (nextBarrage) {
addToTrack(nextBarrage) //
}
}, props.loopInterval)
}
onMounted(() => {
startBarrage() //
})
onUnmounted(() => {
clearInterval(barrageInterval) //
})
//
watch(
() => props.barrageList,
(newList) => {
currentIndex.value = 0 //
clearInterval(barrageInterval) //
//
if (newList.length !== 0) {
startBarrage() //
}
},
{ deep: true },
)
</script>
<style scoped>
/* 样式保持不变(同之前版本) */
.barrage-item {
will-change: transform;
animation: moveLeft linear forwards;
}
@keyframes moveLeft {
0% {
transform: translateX(100vw);
}
100% {
transform: translateX(-100%);
}
}
/* RTL支持 - 镜像弹幕动画 */
[dir='rtl'] .barrage-item {
animation: moveRight linear forwards;
}
@keyframes moveRight {
0% {
transform: translateX(-100vw);
}
100% {
transform: translateX(100%);
}
}
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 14px;
}
}
@media screen and (min-width: 768px) {
* {
font-size: 24px;
}
}
@media screen and (min-width: 1024px) {
* {
font-size: 32px;
}
}
</style>

View File

@ -0,0 +1,472 @@
<template>
<div style="width: 100%">
<itemCenter :imgUrl="BorderImgUrl" :flip="true" :contentStyle="`display:block;`">
<!-- 第一名 -->
<div v-if="isTopOne" style="width: 98vw; height: 80%; position: relative">
<!-- 查看个人信息按钮 -->
<div style="position: absolute; z-index: 2; inset: 0; display: flex">
<!-- 情侣1 -->
<div
style="flex: 1; min-width: 0; align-self: stretch"
@click="viewUserInfo(rankingItem.userId)"
></div>
<!-- 情侣1 -->
<div
style="flex: 1; min-width: 0; align-self: stretch"
@click="viewUserInfo(rankingItem.cpUserId)"
></div>
</div>
<!-- 头像 -->
<div
style="
position: absolute;
z-index: -1;
top: 12vw;
left: 0;
width: 100%;
height: 25vw;
display: flex;
justify-content: center;
align-items: center;
gap: 14vw;
"
>
<!-- 情侣1头像 -->
<img
:src="rankingItem.userAvatar"
alt=""
style="
display: block;
width: 25vw;
object-fit: cover;
aspect-ratio: 1/1;
border-radius: 50%;
"
@error="handleAvatarImageError"
@click="viewUserInfo(rankingItem.userId)"
/>
<!-- 情侣2头像 -->
<img
:src="rankingItem.cpUserAvatar"
alt=""
style="
display: block;
width: 25vw;
object-fit: cover;
aspect-ratio: 1/1;
border-radius: 50%;
"
@error="handleAvatarImageError"
@click="viewUserInfo(rankingItem.cpUserId)"
/>
</div>
<!-- 顶部距离 -->
<div style="height: 22vw"></div>
<!-- 贡献值 -->
<div style="height: 17vw; display: flex; justify-content: center; align-items: center">
<div style="color: #fff; font-weight: 700">
{{ rankingItem.total }}
</div>
</div>
<!-- 名称 -->
<div
style="
margin-top: -1vw;
height: 5vw;
display: flex;
justify-content: center;
align-items: center;
"
>
<div style="width: 76vw; display: flex; align-items: center; gap: 2vw">
<!-- 情侣1名称 -->
<div
style="
flex: 1;
min-width: 0;
display: flex;
justify-content: center;
align-items: center;
"
>
<div
style="
padding: 0 20%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.9em;
font-weight: 600;
"
>
{{ rankingItem.userNickname || '' }}
</div>
</div>
<!-- 情侣2名称 -->
<div
style="
flex: 1;
min-width: 0;
display: flex;
justify-content: center;
align-items: center;
"
>
<div
style="
padding: 0 20%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.9em;
font-weight: 600;
"
>
{{ rankingItem.cpUserNickname || '' }}
</div>
</div>
</div>
</div>
</div>
<!-- 第二三名 -->
<div v-else style="height: 65%; padding: 0 7%; display: flex; align-items: center">
<!-- 排名 -->
<itemCenter
style="width: 9vw"
class="rankingBg"
:imgUrl="imageUrl(`top${ranking}RankingBg`)"
:flip="true"
:contentStyle="``"
>
<img :src="imageUrl(`num${ranking}`)" alt="" style="width: 3vw; display: block" />
</itemCenter>
<!-- 头像 -->
<div style="width: 36vw; position: relative">
<!-- 查看个人信息按钮 -->
<div style="position: absolute; z-index: 2; inset: 0; display: flex">
<!-- 情侣1 -->
<div
style="flex: 1; min-width: 0; align-self: stretch"
@click="viewUserInfo(rankingItem.userId)"
></div>
<!-- 情侣1 -->
<div
style="flex: 1; min-width: 0; align-self: stretch"
@click="viewUserInfo(rankingItem.cpUserId)"
></div>
</div>
<!-- 内容 -->
<itemCenter
style="width: 100%; z-index: 1"
:imgUrl="imageUrl(`top${ranking}Frame`)"
:contentStyle="`z-index: -1;`"
>
<div
style="
width: 100%;
padding: 3vw 5vw;
height: 80%;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<!-- 情侣1头像 -->
<img
:src="rankingItem.userAvatar"
alt=""
style="
display: block;
min-width: 0;
width: 10.5vw;
object-fit: cover;
aspect-ratio: 1/1;
border-radius: 50%;
"
@error="handleAvatarImageError"
/>
<!-- 情侣2头像 -->
<img
:src="rankingItem.cpUserAvatar"
alt=""
style="
display: block;
min-width: 0;
width: 10.5vw;
object-fit: cover;
aspect-ratio: 1/1;
border-radius: 50%;
"
@error="handleAvatarImageError"
/>
</div>
</itemCenter>
</div>
<!-- 名称 -->
<div
style="
flex: 1;
min-width: 0;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
gap: 1vw;
"
>
<div style="width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap">
{{ rankingItem.userNickname || '' }}
</div>
<div style="width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap">
{{ rankingItem.cpUserNickname || '' }}
</div>
</div>
<!-- 贡献 -->
<div style="width: auto; min-width: 0; display: flex; align-items: center">
<img
:src="imageUrl('distribution')"
alt=""
style="width: 10vw; display: block; object-fit: cover"
/>
<div style="font-weight: 700">{{ rankingItem.total || '0' }}</div>
</div>
</div>
<!-- 奖励 -->
<div class="reward-wrapper">
<div style="height: 100%; display: flex; align-items: center; overflow: hidden">
<!-- 滚动容器 -->
<div class="scroll-wrapper">
<!-- 2套内容 -->
<div class="scroll-content" v-for="value in 2">
<div
v-for="(item, index) in rewards.activityRewardProps"
:key="index"
style="align-self: stretch; display: flex; align-items: center; padding: 0 1vw"
@click="clickReward(item)"
>
<!-- 预览图 -->
<img
v-if="item.cover != ''"
:src="item.cover"
alt=""
style="min-width: 0; display: block; width: 10vw; object-fit: cover"
/>
<div style="min-width: 0; color: #fff; white-space: nowrap">
{{ formatRewardDisplay(item.type, item) }}
</div>
</div>
</div>
</div>
</div>
</div>
</itemCenter>
</div>
</template>
<script setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useLangStore } from '@/stores/lang'
import { useI18n } from 'vue-i18n'
import { getPngUrl } from '@/config/imagePaths.js'
import { setUserInfo } from '@/utils/userStore.js'
import { viewUserInfo } from '@/utils/appBridge.js'
import { connectToApp } from '@/utils/appConnector.js'
import { preloadImages } from '@/utils/imagePreloader.js'
import { formatUTCCustom } from '@/utils/utcFormat.js'
import { showError, showSuccess } from '@/utils/toast.js'
import { handleAvatarImageError, handleRewardImageError } from '@/utils/imageHandler.js'
import { useThrottle } from '@/utils/useDebounce.js'
import { useCoupleStore } from '@/stores/couple'
import { storeToRefs } from 'pinia'
import { formatRewardDisplay } from '@/utils/rewardFormatter.js'
import itemCenter from '@/components/itemCenter.vue'
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
const coupleStore = useCoupleStore()
const langStore = useLangStore()
//
const currentLangType = computed(() => {
return langStore.selectedLang?.type || 'en'
})
// OSSURL
const imageUrl = (filename) => getPngUrl('Ranking/Couple/', filename)
//
const getImgName = (filename) => {
return currentLangType.value === 'ar' ? `${filename}_ar` : filename
}
const {
topRewardShow, //
topReward, //
} = storeToRefs(coupleStore)
const props = defineProps({
ranking: {
type: String,
default: '0',
},
rankingItem: {
type: Object,
default: () => ({}),
},
rewards: {
type: Object,
default: () => ({}),
},
})
const BorderImgUrl = computed(() => {
switch (props.ranking) {
case '1':
return imageUrl('top1')
case '2':
return imageUrl('top2-3')
case '3':
return imageUrl('top2-3')
default:
return imageUrl('top2-3')
}
})
//
const isTopOne = computed(() => {
return props.ranking === '1'
})
//
const clickReward = (item) => {
topReward.value = item //
topRewardShow.value = true //
}
</script>
<style lang="scss" scoped>
* {
color: #fff;
}
.showText {
color: #fff;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.top1Text {
font-size: 0.75em;
}
.text {
font-size: 0.6em;
}
.reward-wrapper {
position: absolute;
bottom: 0;
left: 15vw;
right: 4vw;
height: 13.5vw;
}
[dir='rtl'] .reward-wrapper {
left: 4vw;
right: 15vw;
}
.scroll-wrapper {
display: flex;
width: fit-content;
}
.scroll-content {
display: flex;
align-items: center;
}
@keyframes scroll-left {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%);
}
}
@keyframes scroll-right {
0% {
transform: translateX(0);
}
100% {
transform: translateX(50%);
}
}
[dir='ltr'] .scroll-content {
margin-left: 4vw;
}
[dir='rtl'] .scroll-content {
margin-left: auto;
margin-right: 4vw;
}
[dir='ltr'] .scroll-wrapper {
animation: scroll-left 8s linear infinite;
will-change: transform;
}
[dir='rtl'] .scroll-wrapper {
animation: scroll-right 8s linear infinite;
will-change: transform;
}
@media screen and (max-width: 360px) {
* {
font-size: 10px;
}
}
@media screen and (min-width: 360px) {
* {
font-size: 16px;
}
}
@media screen and (min-width: 768px) {
* {
font-size: 24px;
}
}
@media screen and (min-width: 1024px) {
* {
font-size: 32px;
}
}
</style>

File diff suppressed because it is too large Load Diff