chore(删除无用活动页面): 黎巴嫩独立日(11月29日上午10点截止)、阿曼国庆(11月25日上午10点截止)
|
Before Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 287 KiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 462 KiB |
|
Before Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 209 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 340 KiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 6.6 MiB |
|
Before Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 918 KiB |
|
Before Width: | Height: | Size: 375 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 199 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 517 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 203 KiB |
@ -45,7 +45,6 @@ const RankingPage = [
|
||||
const ACTIVITIES = [
|
||||
'/recharge-reward', //充值奖励页面
|
||||
|
||||
'/Lebanon-independence-day', //黎巴嫩独立日
|
||||
'/Yemen-independence-day', //也门独立日
|
||||
'/UAE-independence-day', //阿联酋独立日
|
||||
]
|
||||
|
||||
@ -349,18 +349,6 @@ const router = createRouter({
|
||||
component: () => import('../views/Activities/Reward/RechargeReward.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/oman-national-day',
|
||||
name: 'oman-national-day',
|
||||
component: () => import('../views/Activities/Oman/NationalDay/index.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/Lebanon-independence-day',
|
||||
name: 'Lebanon-independence-day',
|
||||
component: () => import('../views/Activities/Lebanon/IndependenceDay/index.vue'),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: '/Yemen-independence-day',
|
||||
name: 'Yemen-independence-day',
|
||||
|
||||
@ -57,8 +57,6 @@ const ACTIVITIES = [
|
||||
'/recharge-reward', //充值奖励页面
|
||||
|
||||
'/activity-game', //活动游戏页面
|
||||
'/oman-national-day', //阿曼国庆日
|
||||
'/Lebanon-independence-day', //黎巴嫩独立日
|
||||
'/Yemen-independence-day', //也门独立日
|
||||
'/UAE-independence-day', //阿联酋独立日
|
||||
'/lucky-champion', //幸运赢家
|
||||
|
||||
@ -408,8 +408,6 @@ class RouteGuard {
|
||||
'/recharge-reward', //充值奖励页面
|
||||
|
||||
'/activity-game', //活动游戏页面
|
||||
'/oman-national-day', //阿曼国庆日
|
||||
'/Lebanon-independence-day', //黎巴嫩独立日
|
||||
'/Yemen-independence-day', //也门独立日
|
||||
'/UAE-independence-day', //阿联酋独立日
|
||||
'/lucky-champion', //幸运赢家
|
||||
|
||||
@ -1,189 +0,0 @@
|
||||
<template>
|
||||
<div style="width: 100%">
|
||||
<div style="position: relative">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="BorderImgUrl"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; position: relative; z-index: 2"
|
||||
/>
|
||||
<!-- 头像 -->
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
:style="{ height: isTopOne ? '55%' : '48%' }"
|
||||
>
|
||||
<div :style="{ width: isTopOne ? '60%' : '58%' }">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="avatarUrl || ''"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; border-radius: 50%; aspect-ratio: 1/1; object-fit: cover"
|
||||
@error="handleAvatarImageError"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 用户名和贡献值 -->
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
"
|
||||
:style="{ height: ranking == '1' ? '45%' : ranking == '2' ? '49%' : '48%' }"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
height: 30%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
>
|
||||
<div style="font-weight: 700" class="showText" :class="isTopOne ? 'top1Text' : 'text'">
|
||||
{{ name }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
border-radius: 40px;
|
||||
box-shadow: 0 0 2.558px 0 rgba(0, 0, 0, 0.4) inset;
|
||||
border: 0.64px solid #ffdf36;
|
||||
padding: 1px 2px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
:style="{
|
||||
width: ranking == '1' ? `60%` : ranking == '2' ? `60%` : `60%`,
|
||||
background:
|
||||
ranking == '1'
|
||||
? `linear-gradient(270deg, #AD1300 0%, #FE280C 50%, #AD1300 100%)`
|
||||
: ranking == '2'
|
||||
? `linear-gradient(270deg, #A3FDF9 0%, #1D7BBD 50%, #A3FDF9 100%)`
|
||||
: `linear-gradient(270deg, #F5EAE4 0%, #F9C29E 50%, #F5EAE4 100%)`,
|
||||
}"
|
||||
>
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block"
|
||||
:style="{ width: isTopOne ? '20%' : '20%' }"
|
||||
/>
|
||||
<div
|
||||
style="font-weight: 590"
|
||||
class="showText"
|
||||
:class="isTopOne ? 'top1Text' : 'text'"
|
||||
:style="{
|
||||
color: ranking == '1' ? `#FFE601` : '#FFF',
|
||||
}"
|
||||
>
|
||||
{{ distributionValue }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { handleAvatarImageError } from '@/utils/imageHandler.js'
|
||||
|
||||
const props = defineProps({
|
||||
isTopOne: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
|
||||
avatarUrl: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
BorderImgUrl: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
|
||||
name: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
distributionValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
ranking: {
|
||||
type: String,
|
||||
default: '1',
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
* {
|
||||
font-family: 'SF Pro';
|
||||
color: black;
|
||||
}
|
||||
|
||||
.showText {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.top1Text {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 0.6em;
|
||||
}
|
||||
|
||||
@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>
|
||||
@ -1,630 +0,0 @@
|
||||
<!-- src/views/Activities/heroesDay/index.vue -->
|
||||
<template>
|
||||
<div class="fullPage">
|
||||
<div class="bg">
|
||||
<!-- 状态栏占位区域(仅在APP中显示) -->
|
||||
<div v-if="isInAppEnvironment" style="height: 30px"></div>
|
||||
|
||||
<!-- 按钮 -->
|
||||
<div style="margin-top: 66vw; display: flex; justify-content: flex-end; align-items: center">
|
||||
<!-- 帮助按钮 -->
|
||||
<img
|
||||
v-smart-img
|
||||
src="../../../../assets/icon/helpAct.png"
|
||||
alt=""
|
||||
style="display: block; position: relative; width: 10%; margin-right: 8px"
|
||||
@click="maskLayerShow = true"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 倒计时 -->
|
||||
<div style="display: flex; justify-content: center; margin-top: 6vw">
|
||||
<div style="width: 35%">
|
||||
<itemCenter :imgUrl="images.timeDayBg">
|
||||
<div style="width: 100%; padding-left: 10%">
|
||||
<div class="timeText" style="width: 38%; display: flex; justify-content: center">
|
||||
{{ Days }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
<div class="timeText timeGap" style="width: 6px"></div>
|
||||
<div style="width: 18%">
|
||||
<itemCenter :imgUrl="images.timeBg">
|
||||
<div class="timeText" style="">{{ Hours }}</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
<div class="timeText timeGap">:</div>
|
||||
<div style="width: 18%">
|
||||
<itemCenter :imgUrl="images.timeBg">
|
||||
<div class="timeText" style="">{{ Minutes }}</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
<div class="timeText timeGap">:</div>
|
||||
<div style="width: 18%">
|
||||
<itemCenter :imgUrl="images.timeBg">
|
||||
<div class="timeText" style="">{{ Second }}</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 每周礼物 -->
|
||||
<div style="display: flex; justify-content: center; margin-top: 10px">
|
||||
<itemCenter :imgUrl="images.giftsBg" :contentStyle="'paddingTop: 5%;'">
|
||||
<div style="width: 85%; display: flex; justify-content: space-around; margin-top: 10%">
|
||||
<div
|
||||
v-for="(gift, index) in gifts"
|
||||
:key="index"
|
||||
style="width: 30%; display: flex; flex-direction: column"
|
||||
>
|
||||
<itemCenter :imgUrl="images.giftItemBg"
|
||||
><img
|
||||
v-smart-img
|
||||
:src="gift.giftPhoto"
|
||||
alt=""
|
||||
width="70%"
|
||||
style="display: block; object-fit: cover"
|
||||
/></itemCenter>
|
||||
<div style="display: flex; justify-content: center; align-items: center; gap: 5px">
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block; width: 25%; aspect-ratio: 1/1"
|
||||
/>
|
||||
<div style="color: rgba(255, 255, 255, 1); font-weight: 590">
|
||||
{{ gift.giftCandy }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
|
||||
<!-- 切换按钮 -->
|
||||
<div style="display: flex; justify-content: space-around">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="rankingShow ? images.rankingBtActive : images.rankingBt"
|
||||
alt=""
|
||||
style="display: block; width: 40%"
|
||||
@click="rankingShow = true"
|
||||
/>
|
||||
<img
|
||||
v-smart-img
|
||||
:src="!rankingShow ? images.rewardBtActive : images.rewardsBt"
|
||||
alt=""
|
||||
style="display: block; width: 40%"
|
||||
@click="rankingShow = false"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 展示内容 -->
|
||||
<div>
|
||||
<!-- Ranking -->
|
||||
<div v-show="rankingShow" style="position: relative; width: 100%">
|
||||
<!-- 背景色 -->
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
inset: 15vw 2% 3vw;
|
||||
background: linear-gradient(180deg, #073320 0%, #0f6847 100%);
|
||||
z-index: 1;
|
||||
"
|
||||
></div>
|
||||
|
||||
<div style="position: relative; z-index: 1">
|
||||
<!-- 前三名 -->
|
||||
<itemCenter
|
||||
:imgUrl="images.RankingMain"
|
||||
:contentStyle="`padding: 20% 5% 0;flex-direction: column;`"
|
||||
>
|
||||
<div>
|
||||
<!-- 第一 -->
|
||||
<div style="display: flex; justify-content: center">
|
||||
<TopUser
|
||||
:BorderImgUrl="images.topOne"
|
||||
:avatarUrl="RankingHasTop3[0].avatar"
|
||||
:name="RankingHasTop3[0].nickname"
|
||||
:distributionValue="RankingHasTop3[0].quantity"
|
||||
style="width: 45%"
|
||||
@click="viewUserInfo(RankingHasTop3[0].userId)"
|
||||
/>
|
||||
</div>
|
||||
<!-- 第二三 -->
|
||||
<div style="display: flex; justify-content: space-between; margin-top: -40%">
|
||||
<TopUser
|
||||
:isTopOne="false"
|
||||
ranking="2"
|
||||
:BorderImgUrl="images.topTwo"
|
||||
:avatarUrl="RankingHasTop3[1].avatar"
|
||||
:name="RankingHasTop3[1].nickname"
|
||||
:distributionValue="RankingHasTop3[1].quantity"
|
||||
style="width: 30%"
|
||||
@click="viewUserInfo(RankingHasTop3[1].userId)"
|
||||
/>
|
||||
<TopUser
|
||||
:isTopOne="false"
|
||||
ranking="3"
|
||||
:BorderImgUrl="images.topThree"
|
||||
:avatarUrl="RankingHasTop3[2].avatar"
|
||||
:name="RankingHasTop3[2].nickname"
|
||||
:distributionValue="RankingHasTop3[2].quantity"
|
||||
style="width: 30%"
|
||||
@click="viewUserInfo(RankingHasTop3[2].userId)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<img
|
||||
v-smart-img
|
||||
:src="images.topPodium"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; margin-top: -5vw"
|
||||
/>
|
||||
</itemCenter>
|
||||
|
||||
<!-- 第四名开始 -->
|
||||
<div v-if="showRanking.length > 0" style="margin-bottom: 6vw">
|
||||
<itemCenter
|
||||
v-for="listItem in showRanking"
|
||||
:imgUrl="images.RankingItem"
|
||||
:contentStyle="`padding: 0 12%`"
|
||||
@click="viewUserInfo(listItem.userId)"
|
||||
>
|
||||
<div style="width: 75%; min-width: 0; display: flex; align-items: center">
|
||||
<div style="color: #edb247; font-weight: 700; width: 10%">
|
||||
{{ listItem?.rank }}
|
||||
</div>
|
||||
<img
|
||||
v-smart-img
|
||||
:src="listItem?.avatar || ''"
|
||||
alt=""
|
||||
style="
|
||||
display: block;
|
||||
width: 20%;
|
||||
margin: 0 2%;
|
||||
aspect-ratio: 1/1;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
"
|
||||
@error="handleAvatarImageError"
|
||||
/>
|
||||
|
||||
<div
|
||||
style="
|
||||
min-width: 0;
|
||||
width: calc(100% - 10% - 24%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
color: #fff;
|
||||
font-weight: 860;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
"
|
||||
class="UserNickname"
|
||||
>
|
||||
{{ listItem?.nickname }}
|
||||
</div>
|
||||
<div style="color: #fff; font-weight: 590" class="UserNickname">
|
||||
ID:{{ listItem?.account }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="flex: 1; min-width: 0; display: flex; align-items: center">
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block; width: 30%; aspect-ratio: 1/1; object-fit: cover"
|
||||
/>
|
||||
<div style="color: #edb247; font-weight: 700" class="UserNickname">
|
||||
{{ listItem?.quantity }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
|
||||
<!-- 底框 -->
|
||||
<img
|
||||
v-smart-img
|
||||
:src="images.RankingBottomBorder"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; margin-top: -22vw; position: relative; z-index: 9"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rewards -->
|
||||
<div
|
||||
v-show="!rankingShow"
|
||||
style="display: flex; flex-direction: column; align-items: center"
|
||||
>
|
||||
<div
|
||||
v-for="(rewardsTop, top) in rewardsList"
|
||||
:key="top"
|
||||
style="position: relative; width: 100%; margin: 10px 0"
|
||||
>
|
||||
<itemCenter
|
||||
:imgUrl="topImg[Number(rewardsTop.rankRange) - 1]"
|
||||
:contentStyle="`display: grid;grid-template-columns: repeat(2, 1fr);gap: 12px;padding: 20vw 8vw 8vw;`"
|
||||
>
|
||||
<div
|
||||
v-for="(reward, rewardIndex) in rewardsTop.rewards"
|
||||
:key="rewardIndex"
|
||||
style="width: 100%"
|
||||
>
|
||||
<itemCenter :imgUrl="images.giftItemBg">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="reward.cover || ''"
|
||||
alt=""
|
||||
width="70%"
|
||||
style="display: block; object-fit: cover"
|
||||
@error="(e) => handleRewardImageError(e, reward.type)"
|
||||
/>
|
||||
</itemCenter>
|
||||
<div
|
||||
style="
|
||||
text-align: center;
|
||||
font-size: 1.2em;
|
||||
font-weight: 900;
|
||||
font-style: italic;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
#fff677 6.36%,
|
||||
#d39f1e 26%,
|
||||
#fff891 49.56%,
|
||||
#ffc93e 70.51%,
|
||||
#ffc 93.64%
|
||||
);
|
||||
background-clip: text;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
"
|
||||
>
|
||||
{{ showDetail(reward.type, reward) }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 我的排名 -->
|
||||
<itemCenter
|
||||
style="position: sticky; inset: 0; z-index: 2"
|
||||
:imgUrl="images.myRankingBg"
|
||||
:contentStyle="`padding: 2% 5% 0`"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 75%;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
"
|
||||
>
|
||||
<!-- 排名 -->
|
||||
<div style="color: #edb247; font-weight: 700; width: 10%">
|
||||
{{ myRanking.rank || 999 }}
|
||||
</div>
|
||||
<!-- 头像 -->
|
||||
<img
|
||||
v-smart-img
|
||||
:src="myRanking.avatar || ''"
|
||||
alt=""
|
||||
style="
|
||||
display: block;
|
||||
width: 25%;
|
||||
aspect-ratio: 1/1;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
margin: 0 12px;
|
||||
"
|
||||
@error="handleAvatarImageError"
|
||||
/>
|
||||
<!-- 名称 -->
|
||||
<div
|
||||
style="
|
||||
min-width: 0;
|
||||
width: calc(100% - 10% - 25%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
font-weight: 860;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
"
|
||||
class="UserNickname"
|
||||
>
|
||||
{{ myRanking.nickname }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 贡献值 -->
|
||||
<div
|
||||
style="flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center"
|
||||
>
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block; width: 30%; aspect-ratio: 1/1; object-fit: cover"
|
||||
/>
|
||||
<div style="color: #edb247; font-weight: 700">
|
||||
{{ myRanking.quantity || 0 }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
|
||||
<!-- 弹窗遮罩层 -->
|
||||
<maskLayer :maskLayerShow="maskLayerShow" @click="maskLayerShow = false">
|
||||
<!-- help弹窗 -->
|
||||
<div style="margin: 20% 0" @click.stop>
|
||||
<img v-smart-img :src="images.helpInfo" alt="" style="display: block; width: 100%" />
|
||||
</div>
|
||||
</maskLayer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isInApp, viewUserInfo } from '@/utils/appBridge.js'
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import itemCenter from '@/components/itemCenter.vue'
|
||||
import TopUser from './components/topUser.vue'
|
||||
import maskLayer from '@/components/MaskLayer.vue'
|
||||
import { getThisWeekRewardsAndGifts, getRankingListAndMyRanking } from '@/api/activity.js'
|
||||
import { connectToApp } from '@/utils/appConnector.js'
|
||||
import { handleAvatarImageError, handleRewardImageError } from '@/utils/imageHandler.js'
|
||||
|
||||
// vite动态批量导入图片
|
||||
const imageModules = import.meta.glob(
|
||||
'@/assets/images/Activities/Lebanon/IndependenceDay/*.{png,jpg,svg}',
|
||||
{
|
||||
eager: true,
|
||||
}
|
||||
)
|
||||
// 生成文件名映射对象(自动移除路径和扩展名)
|
||||
const images = Object.fromEntries(
|
||||
Object.entries(imageModules).map(([path, module]) => {
|
||||
const fileName = path.split('/').pop().split('.')[0]
|
||||
return [fileName, module.default]
|
||||
})
|
||||
)
|
||||
|
||||
const isInAppEnvironment = ref(false) // 检测是否在APP环境中
|
||||
const maskLayerShow = ref(false) //帮助模块
|
||||
|
||||
// 倒计时
|
||||
const Days = ref(0)
|
||||
const Hours = ref(0)
|
||||
const Minutes = ref(0)
|
||||
const Second = ref(0)
|
||||
let timer = null
|
||||
|
||||
// 模块切换展示
|
||||
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图片
|
||||
|
||||
// 处理排行榜小于3人时的情况
|
||||
const RankingHasTop3 = computed(() => {
|
||||
let RankingShow = [...Ranking.value]
|
||||
if (Ranking.value.length < 3) {
|
||||
let addNullUser = Array.from({ length: 3 - Ranking.value.length }, () => ({
|
||||
avatar: '',
|
||||
nickname: '',
|
||||
quantity: '',
|
||||
}))
|
||||
RankingShow.push(...addNullUser)
|
||||
}
|
||||
return RankingShow
|
||||
})
|
||||
|
||||
// 展示用的榜单
|
||||
const showRanking = computed(() => {
|
||||
return Ranking.value.filter((_, index) => index >= 3)
|
||||
// return []
|
||||
})
|
||||
|
||||
// 获取2025年11月29日上午10点的时间戳(北京时间)
|
||||
const getTargetTime = () => {
|
||||
const targetDate = new Date(2025, 10, 29, 10, 0, 0) // 月份从0开始,10代表11月
|
||||
return targetDate.getTime()
|
||||
}
|
||||
|
||||
const targetTime = ref(getTargetTime())
|
||||
|
||||
// 格式化时间
|
||||
const formatTime = (value) => {
|
||||
return value < 10 ? `0${value}` : value
|
||||
}
|
||||
|
||||
// 倒计时
|
||||
const getCountdown = () => {
|
||||
const now = Date.now()
|
||||
let diff = targetTime.value - now
|
||||
|
||||
// 如果已过期,显示全零
|
||||
if (diff <= 0) {
|
||||
Days.value = 0
|
||||
Hours.value = '00'
|
||||
Minutes.value = '00'
|
||||
Second.value = '00'
|
||||
|
||||
// 清除定时器
|
||||
if (timer) {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
const totalSeconds = Math.floor(diff / 1000)
|
||||
Days.value = Math.floor(totalSeconds / (24 * 3600))
|
||||
Hours.value = formatTime(Math.floor((totalSeconds % (24 * 3600)) / 3600))
|
||||
Minutes.value = formatTime(Math.floor((totalSeconds % 3600) / 60))
|
||||
Second.value = formatTime(Math.floor(totalSeconds % 60))
|
||||
}
|
||||
|
||||
// 格式化奖励的展示信息
|
||||
const showDetail = (type, reward) => {
|
||||
let showamount = ['GOLD', 'DIAMOND', 'GIFT', 'FRAGMENTS']
|
||||
if (showamount.includes(type)) {
|
||||
return reward.content
|
||||
} else {
|
||||
return `${reward.quantity}Days`
|
||||
}
|
||||
}
|
||||
|
||||
// 获取排行榜和我的排名
|
||||
const getListAndMy = async () => {
|
||||
let data = {
|
||||
activityType: 5,
|
||||
}
|
||||
const resMyWeekStarRanking = await getRankingListAndMyRanking(data)
|
||||
console.log('resMyWeekStarRanking:', resMyWeekStarRanking)
|
||||
if (resMyWeekStarRanking.status && resMyWeekStarRanking.body) {
|
||||
myRanking.value = resMyWeekStarRanking.body.currentUserRank
|
||||
Ranking.value = resMyWeekStarRanking.body.rankingList
|
||||
}
|
||||
}
|
||||
|
||||
// 获取每周奖励列表和礼物
|
||||
const getRewardsAndGifts = async () => {
|
||||
const resRewardsAndGifts = await getThisWeekRewardsAndGifts('1991057058101104641')
|
||||
if (resRewardsAndGifts.status && resRewardsAndGifts.body) {
|
||||
gifts.value = resRewardsAndGifts.body.gifts
|
||||
rewardsList.value = resRewardsAndGifts.body.butOneRewards
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
const initData = () => {
|
||||
getListAndMy() // 获取排行榜和我的排名
|
||||
getRewardsAndGifts() //获取本周的礼物和奖励列表
|
||||
}
|
||||
|
||||
// 使用工具函数连接APP
|
||||
const connectToAppHandler = async () => {
|
||||
await connectToApp(() => {
|
||||
// 连接成功回调
|
||||
initData() //初始化数据
|
||||
})
|
||||
}
|
||||
|
||||
// 组件挂载时检测环境
|
||||
onMounted(() => {
|
||||
connectToAppHandler()
|
||||
isInAppEnvironment.value = isInApp()
|
||||
|
||||
getCountdown()
|
||||
timer = setInterval(getCountdown, 1000) //倒计时每秒更新
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer) //摧毁计时器
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
* {
|
||||
color: #fff;
|
||||
font-family: 'SF Pro';
|
||||
}
|
||||
|
||||
.fullPage {
|
||||
position: relative;
|
||||
background: #062c18;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
background-image: url(../../../../assets/images/Activities/Lebanon/IndependenceDay/bg.png);
|
||||
background-size: 100% auto;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.timeText {
|
||||
color: #fff;
|
||||
font-weight: 590;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.timeGap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btTitle {
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.topTitle {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.history-name {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.history-time {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.UserNickname {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
@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>
|
||||
@ -1,195 +0,0 @@
|
||||
<template>
|
||||
<div style="width: 100%">
|
||||
<div style="position: relative">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="BorderImgUrl"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; position: relative; z-index: 2"
|
||||
/>
|
||||
<!-- 头像 -->
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
:style="{ height: isTopOne ? '73%' : '68%' }"
|
||||
>
|
||||
<div :style="{ width: isTopOne ? '31%' : '58%' }">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="avatarUrl || ''"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; border-radius: 50%; aspect-ratio: 1/1; object-fit: cover"
|
||||
@error="defaultAvatarUrl"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 用户名和贡献值 -->
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
"
|
||||
:style="{ height: ranking == '1' ? '34%' : ranking == '2' ? '34%' : '34%' }"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
height: 30%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
>
|
||||
<div style="font-weight: 700" class="showText" :class="isTopOne ? 'top1Text' : 'text'">
|
||||
{{ name }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
border-radius: 40px;
|
||||
box-shadow: 0 0 2.558px 0 rgba(0, 0, 0, 0.4) inset;
|
||||
border: 0.64px solid #ffdf36;
|
||||
padding: 1px 2px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
:style="{
|
||||
width: ranking == '1' ? `30%` : ranking == '2' ? `50%` : `50%`,
|
||||
background:
|
||||
ranking == '1'
|
||||
? `linear-gradient(270deg, #AD1300 0%, #FE280C 50%, #AD1300 100%)`
|
||||
: ranking == '2'
|
||||
? `linear-gradient(270deg, #A3FDF9 0%, #1D7BBD 50%, #A3FDF9 100%)`
|
||||
: `linear-gradient(270deg, #F5EAE4 0%, #F9C29E 50%, #F5EAE4 100%)`,
|
||||
}"
|
||||
>
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block"
|
||||
:style="{ width: isTopOne ? '20%' : '15%' }"
|
||||
/>
|
||||
<div
|
||||
style="font-weight: 590"
|
||||
class="showText"
|
||||
:class="isTopOne ? 'top1Text' : 'text'"
|
||||
:style="{
|
||||
color: ranking == '1' ? `#FFE601` : '#FFF',
|
||||
}"
|
||||
>
|
||||
{{ distributionValue }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
isTopOne: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
|
||||
avatarUrl: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
BorderImgUrl: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
|
||||
name: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
distributionValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
|
||||
ranking: {
|
||||
type: String,
|
||||
default: '1',
|
||||
},
|
||||
})
|
||||
|
||||
import defaultAvatar from '@/assets/icon/defaultAvatar.png'
|
||||
|
||||
const defaultAvatarUrl = (e) => {
|
||||
console.log('头像资源出错')
|
||||
e.target.onerror = null //防止循环
|
||||
e.target.src = defaultAvatar
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
* {
|
||||
font-family: 'SF Pro';
|
||||
color: black;
|
||||
}
|
||||
|
||||
.showText {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.top1Text {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 0.6em;
|
||||
}
|
||||
|
||||
@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>
|
||||
@ -1,634 +0,0 @@
|
||||
<!-- src/views/Activities/heroesDay/index.vue -->
|
||||
<template>
|
||||
<div class="fullPage">
|
||||
<!-- 新增的背景图层 -->
|
||||
<div class="background-overlay"></div>
|
||||
|
||||
<div class="bg">
|
||||
<!-- 状态栏占位区域(仅在APP中显示) -->
|
||||
<div v-if="isInAppEnvironment" style="height: 30px"></div>
|
||||
|
||||
<!-- 按钮 -->
|
||||
<div style="margin-top: 80vw; display: flex; justify-content: flex-end; align-items: center">
|
||||
<!-- 帮助按钮 -->
|
||||
<img
|
||||
v-smart-img
|
||||
src="../../../../assets/icon/helpAct.png"
|
||||
alt=""
|
||||
style="display: block; position: relative; width: 10%; margin-right: 8px"
|
||||
@click="maskLayerShow = true"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 倒计时 -->
|
||||
<div style="display: flex; justify-content: center; gap: 4px; margin-top: 1vw">
|
||||
<div style="width: 20%">
|
||||
<itemCenter :imgUrl="images.timeDayBg">
|
||||
<div class="timeText" style="margin-bottom: 20%">{{ Days }}D</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
<div class="timeText timeGap" style="width: 6px"></div>
|
||||
<div style="width: 20%">
|
||||
<itemCenter :imgUrl="images.timeHourBg">
|
||||
<div class="timeText" style="margin-bottom: 20%">{{ Hours }}</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
<div class="timeText timeGap">:</div>
|
||||
<div style="width: 20%">
|
||||
<itemCenter :imgUrl="images.timeMinBg">
|
||||
<div class="timeText" style="margin-bottom: 20%">{{ Minutes }}</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
<div class="timeText timeGap">:</div>
|
||||
<div style="width: 20%">
|
||||
<itemCenter :imgUrl="images.timeSecBg">
|
||||
<div class="timeText" style="margin-bottom: 20%">{{ Second }}</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 每周礼物 -->
|
||||
<div style="display: flex; justify-content: center; margin-top: 10px">
|
||||
<itemCenter :imgUrl="images.giftsBg" :contentStyle="'paddingTop: 10%;'">
|
||||
<div style="width: 85%; display: flex; justify-content: space-around; margin-top: 10%">
|
||||
<div
|
||||
v-for="(gift, index) in gifts"
|
||||
:key="index"
|
||||
style="width: 30%; display: flex; flex-direction: column"
|
||||
>
|
||||
<itemCenter :imgUrl="images.giftItemBg"
|
||||
><img
|
||||
v-smart-img
|
||||
:src="gift.giftPhoto"
|
||||
alt=""
|
||||
width="70%"
|
||||
style="display: block; object-fit: cover"
|
||||
/></itemCenter>
|
||||
<div style="display: flex; justify-content: center; align-items: center; gap: 5px">
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block; width: 25%; aspect-ratio: 1/1"
|
||||
/>
|
||||
<div style="color: rgba(255, 255, 255, 1); font-weight: 590">
|
||||
{{ gift.giftCandy }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
|
||||
<!-- 切换按钮 -->
|
||||
<div style="display: flex; justify-content: space-around">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="rankingShow ? images.rankingBtActive : images.rankingBt"
|
||||
alt=""
|
||||
style="display: block; width: 40%"
|
||||
@click="rankingShow = true"
|
||||
/>
|
||||
<img
|
||||
v-smart-img
|
||||
:src="!rankingShow ? images.rewardBtActive : images.rewardsBt"
|
||||
alt=""
|
||||
style="display: block; width: 40%"
|
||||
@click="rankingShow = false"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 展示内容 -->
|
||||
<div>
|
||||
<!-- Ranking -->
|
||||
<div v-show="rankingShow" style="position: relative; width: 100%">
|
||||
<!-- 背景色 -->
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
inset: 15vw 2% 3vw;
|
||||
background: linear-gradient(180deg, #3b0001 0%, #aa0408 100%);
|
||||
z-index: 1;
|
||||
"
|
||||
></div>
|
||||
<div style="position: relative; z-index: 1">
|
||||
<!-- 前三名 -->
|
||||
<itemCenter :imgUrl="images.RankingMain" :contentStyle="`padding: 25% 7% 10%`">
|
||||
<div style="margin-top: 13%">
|
||||
<!-- 第一 -->
|
||||
<div style="display: flex; justify-content: center">
|
||||
<TopUser
|
||||
:BorderImgUrl="images.topOne"
|
||||
:avatarUrl="RankingHasTop3[0].avatar"
|
||||
:name="RankingHasTop3[0].nickname"
|
||||
:distributionValue="RankingHasTop3[0].quantity"
|
||||
style="width: 85%"
|
||||
@click="viewUserInfo(RankingHasTop3[0].userId)"
|
||||
/>
|
||||
</div>
|
||||
<!-- 第二三 -->
|
||||
<div style="display: flex; justify-content: space-between; margin-top: -5%">
|
||||
<TopUser
|
||||
:isTopOne="false"
|
||||
ranking="2"
|
||||
:BorderImgUrl="images.topTwo"
|
||||
:avatarUrl="RankingHasTop3[1].avatar"
|
||||
:name="RankingHasTop3[1].nickname"
|
||||
:distributionValue="RankingHasTop3[1].quantity"
|
||||
style="width: 40%"
|
||||
@click="viewUserInfo(RankingHasTop3[1].userId)"
|
||||
/>
|
||||
<TopUser
|
||||
:isTopOne="false"
|
||||
ranking="3"
|
||||
:BorderImgUrl="images.topThree"
|
||||
:avatarUrl="RankingHasTop3[2].avatar"
|
||||
:name="RankingHasTop3[2].nickname"
|
||||
:distributionValue="RankingHasTop3[2].quantity"
|
||||
style="width: 40%"
|
||||
@click="viewUserInfo(RankingHasTop3[2].userId)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
|
||||
<!-- 第四名开始 -->
|
||||
<div v-if="showRanking.length > 0" style="margin-bottom: 6vw; margin-top: -10vw">
|
||||
<itemCenter
|
||||
v-for="listItem in showRanking"
|
||||
:imgUrl="images.RankingItem"
|
||||
:contentStyle="`padding: 0 10%`"
|
||||
@click="viewUserInfo(listItem.userId)"
|
||||
>
|
||||
<div style="width: 75%; min-width: 0; display: flex; align-items: center">
|
||||
<div style="color: #edb247; font-weight: 700; width: 10%" class="UserNickname">
|
||||
{{ listItem?.rank }}
|
||||
</div>
|
||||
<img
|
||||
v-smart-img
|
||||
:src="listItem?.avatar || ''"
|
||||
alt=""
|
||||
style="
|
||||
display: block;
|
||||
width: 20%;
|
||||
margin: 0 2%;
|
||||
aspect-ratio: 1/1;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
"
|
||||
@error="defaultAvatarUrl"
|
||||
/>
|
||||
|
||||
<div
|
||||
style="
|
||||
min-width: 0;
|
||||
width: calc(100% - 10% - 24%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
color: #fff;
|
||||
font-weight: 860;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
"
|
||||
class="UserNickname"
|
||||
>
|
||||
{{ listItem?.nickname }}
|
||||
</div>
|
||||
<div style="color: #fff; font-weight: 590" class="UserNickname">
|
||||
ID:{{ listItem?.account }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="flex: 1; min-width: 0; display: flex; align-items: center">
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block; width: 30%; aspect-ratio: 1/1; object-fit: cover"
|
||||
/>
|
||||
<div style="color: #edb247; font-weight: 700" class="UserNickname">
|
||||
{{ listItem?.quantity }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
|
||||
<!-- 底框 -->
|
||||
<img
|
||||
v-smart-img
|
||||
:src="images.RankingBottomBorder"
|
||||
alt=""
|
||||
width="100%"
|
||||
style="display: block; margin-top: -22vw; position: relative; z-index: 9"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rewards -->
|
||||
<div
|
||||
v-show="!rankingShow"
|
||||
style="display: flex; flex-direction: column; align-items: center"
|
||||
>
|
||||
<div
|
||||
v-for="(rewardsTop, top) in rewardsList"
|
||||
:key="top"
|
||||
style="position: relative; width: 100%; margin: 10px 0"
|
||||
>
|
||||
<itemCenter
|
||||
:imgUrl="topImg[Number(rewardsTop.rankRange) - 1]"
|
||||
:contentStyle="`display: grid;grid-template-columns: repeat(2, 1fr);gap: 12px;padding: 30vw 8vw 10vw;`"
|
||||
>
|
||||
<div
|
||||
v-for="(reward, rewardIndex) in rewardsTop.rewards"
|
||||
:key="rewardIndex"
|
||||
style="width: 100%"
|
||||
>
|
||||
<itemCenter :imgUrl="images.giftItemBg">
|
||||
<img
|
||||
v-smart-img
|
||||
:src="reward.cover || ''"
|
||||
alt=""
|
||||
width="70%"
|
||||
style="display: block; aspect-ratio: 1/1"
|
||||
@error="(e) => handleImageError(e, reward.type)"
|
||||
/>
|
||||
</itemCenter>
|
||||
<div
|
||||
style="
|
||||
font-size: 1.1em;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
font-weight: 590;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
{{ showDetail(reward.type, reward) }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 我的排名 -->
|
||||
<itemCenter
|
||||
style="
|
||||
position: sticky;
|
||||
inset: 0;
|
||||
background: linear-gradient(0deg, #6e1116 0%, #6e1116 100%), #d9d9d9;
|
||||
z-index: 2;
|
||||
"
|
||||
:imgUrl="images.myRankingBg"
|
||||
:contentStyle="`padding: 2% 5% 0`"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 75%;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
"
|
||||
>
|
||||
<!-- 排名 -->
|
||||
<div style="color: #edb247; font-weight: 700; width: 10%">
|
||||
{{ myRanking.rank || 999 }}
|
||||
</div>
|
||||
<!-- 头像 -->
|
||||
<img
|
||||
v-smart-img
|
||||
:src="myRanking.avatar || ''"
|
||||
alt=""
|
||||
style="
|
||||
display: block;
|
||||
width: 25%;
|
||||
aspect-ratio: 1/1;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
margin: 0 12px;
|
||||
"
|
||||
@error="defaultAvatarUrl"
|
||||
/>
|
||||
<!-- 名称 -->
|
||||
<div
|
||||
style="
|
||||
min-width: 0;
|
||||
width: calc(100% - 10% - 25%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
font-weight: 860;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
"
|
||||
class="UserNickname"
|
||||
>
|
||||
{{ myRanking.nickname }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 贡献值 -->
|
||||
<div
|
||||
style="flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center"
|
||||
>
|
||||
<img
|
||||
v-smart-img
|
||||
src="/src/assets/icon/coin.png"
|
||||
alt=""
|
||||
style="display: block; width: 30%; aspect-ratio: 1/1; object-fit: cover"
|
||||
/>
|
||||
<div style="color: #edb247; font-weight: 700">
|
||||
{{ myRanking.quantity || 0 }}
|
||||
</div>
|
||||
</div>
|
||||
</itemCenter>
|
||||
|
||||
<!-- 弹窗遮罩层 -->
|
||||
<maskLayer :maskLayerShow="maskLayerShow" @click="maskLayerShow = false">
|
||||
<!-- help弹窗 -->
|
||||
<div style="margin: 20% 0" @click.stop>
|
||||
<img v-smart-img :src="images.helpInfo" alt="" style="display: block; width: 100%" />
|
||||
</div>
|
||||
</maskLayer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isInApp, viewUserInfo } from '@/utils/appBridge.js'
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import itemCenter from '@/components/itemCenter.vue'
|
||||
import TopUser from './components/topUser.vue'
|
||||
import maskLayer from '@/components/MaskLayer.vue'
|
||||
import { getThisWeekRewardsAndGifts, getRankingListAndMyRanking } from '@/api/activity.js'
|
||||
import { connectToApp } from '@/utils/appConnector.js'
|
||||
|
||||
// vite动态批量导入图片
|
||||
const imageModules = import.meta.glob(
|
||||
'@/assets/images/Activities/Oman/NationalDay/*.{png,jpg,svg}',
|
||||
{
|
||||
eager: true,
|
||||
}
|
||||
)
|
||||
// 生成文件名映射对象(自动移除路径和扩展名)
|
||||
const images = Object.fromEntries(
|
||||
Object.entries(imageModules).map(([path, module]) => {
|
||||
const fileName = path.split('/').pop().split('.')[0]
|
||||
return [fileName, module.default]
|
||||
})
|
||||
)
|
||||
|
||||
const isInAppEnvironment = ref(false) // 检测是否在APP环境中
|
||||
const maskLayerShow = ref(false) //帮助模块
|
||||
|
||||
// 倒计时
|
||||
const Days = ref(0)
|
||||
const Hours = ref(0)
|
||||
const Minutes = ref(0)
|
||||
const Second = ref(0)
|
||||
let timer = null
|
||||
|
||||
// 模块切换展示
|
||||
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图片
|
||||
|
||||
// 处理排行榜小于3人时的情况
|
||||
const RankingHasTop3 = computed(() => {
|
||||
let RankingShow = [...Ranking.value]
|
||||
if (Ranking.value.length < 3) {
|
||||
let addNullUser = Array.from({ length: 3 - Ranking.value.length }, () => ({
|
||||
avatar: '',
|
||||
nickname: '',
|
||||
quantity: '',
|
||||
}))
|
||||
RankingShow.push(...addNullUser)
|
||||
}
|
||||
return RankingShow
|
||||
})
|
||||
|
||||
// 展示用的榜单
|
||||
const showRanking = computed(() => {
|
||||
return Ranking.value.filter((_, index) => index >= 3)
|
||||
// return []
|
||||
})
|
||||
|
||||
// 奖励图片资源出错处理
|
||||
const handleImageError = (e, type) => {
|
||||
console.log('图片资源出错')
|
||||
e.target.onerror = null //防止循环
|
||||
if ((type = 'GOLD')) {
|
||||
e.target.src = new URL('/src/assets/icon/coin.png', import.meta.url).href
|
||||
}
|
||||
}
|
||||
|
||||
// 头像资源出错处理
|
||||
const defaultAvatarUrl = (e) => {
|
||||
console.log('头像资源出错')
|
||||
e.target.onerror = null //防止循环
|
||||
e.target.src = new URL('/src/assets/icon/defaultAvatar.png', import.meta.url).href
|
||||
}
|
||||
|
||||
// 获取2025年11月25日上午10点的时间戳(北京时间)
|
||||
const getTargetTime = () => {
|
||||
const targetDate = new Date(2025, 10, 25, 10, 0, 0) // 月份从0开始,10代表11月
|
||||
return targetDate.getTime()
|
||||
}
|
||||
|
||||
const targetTime = ref(getTargetTime())
|
||||
|
||||
// 格式化时间
|
||||
const formatTime = (value) => {
|
||||
return value < 10 ? `0${value}` : value
|
||||
}
|
||||
|
||||
// 倒计时
|
||||
const getCountdown = () => {
|
||||
const now = Date.now()
|
||||
let diff = targetTime.value - now
|
||||
|
||||
// 如果已过期,显示全零
|
||||
if (diff <= 0) {
|
||||
Days.value = 0
|
||||
Hours.value = '00'
|
||||
Minutes.value = '00'
|
||||
Second.value = '00'
|
||||
|
||||
// 清除定时器
|
||||
if (timer) {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
const totalSeconds = Math.floor(diff / 1000)
|
||||
Days.value = Math.floor(totalSeconds / (24 * 3600))
|
||||
Hours.value = formatTime(Math.floor((totalSeconds % (24 * 3600)) / 3600))
|
||||
Minutes.value = formatTime(Math.floor((totalSeconds % 3600) / 60))
|
||||
Second.value = formatTime(Math.floor(totalSeconds % 60))
|
||||
}
|
||||
|
||||
// 格式化奖励的展示信息
|
||||
const showDetail = (type, reward) => {
|
||||
let showamount = ['GOLD', 'DIAMOND', 'GIFT', 'FRAGMENTS']
|
||||
if (showamount.includes(type)) {
|
||||
return reward.content
|
||||
} else {
|
||||
return `${reward.quantity}Days`
|
||||
}
|
||||
}
|
||||
|
||||
// 获取排行榜和我的排名
|
||||
const getListAndMy = async () => {
|
||||
const resMyWeekStarRanking = await getRankingListAndMyRanking(4)
|
||||
console.log('resMyWeekStarRanking:', resMyWeekStarRanking)
|
||||
if (resMyWeekStarRanking.status && resMyWeekStarRanking.body) {
|
||||
myRanking.value = resMyWeekStarRanking.body.currentUserRank
|
||||
Ranking.value = resMyWeekStarRanking.body.rankingList
|
||||
}
|
||||
}
|
||||
|
||||
// 获取每周奖励列表和礼物
|
||||
const getRewardsAndGifts = async () => {
|
||||
const resRewardsAndGifts = await getThisWeekRewardsAndGifts('1990349341287690242')
|
||||
if (resRewardsAndGifts.status && resRewardsAndGifts.body) {
|
||||
gifts.value = resRewardsAndGifts.body.gifts
|
||||
rewardsList.value = resRewardsAndGifts.body.butOneRewards
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
const initData = () => {
|
||||
getListAndMy() // 获取排行榜和我的排名
|
||||
getRewardsAndGifts() //获取本周的礼物和奖励列表
|
||||
}
|
||||
|
||||
// 使用工具函数连接APP
|
||||
const connectToAppHandler = async () => {
|
||||
await connectToApp(() => {
|
||||
// 连接成功回调
|
||||
initData() //初始化数据
|
||||
})
|
||||
}
|
||||
|
||||
// 组件挂载时检测环境
|
||||
onMounted(() => {
|
||||
connectToAppHandler()
|
||||
isInAppEnvironment.value = isInApp()
|
||||
|
||||
getCountdown()
|
||||
timer = setInterval(getCountdown, 1000) //倒计时每秒更新
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer) //摧毁计时器
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
* {
|
||||
color: #fff;
|
||||
font-family: 'SF Pro';
|
||||
}
|
||||
|
||||
.fullPage {
|
||||
position: relative;
|
||||
background: linear-gradient(0deg, #6e1116 0%, #6e1116 100%), #d9d9d9;
|
||||
}
|
||||
|
||||
.background-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: url(../../../../assets/images/Activities/Oman/NationalDay/bgRepeat.png);
|
||||
background-repeat: repeat-y;
|
||||
background-position: top center;
|
||||
background-size: 100% auto;
|
||||
z-index: 0; /* 确保在.bg之下 */
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
background-image: url(../../../../assets/images/Activities/Oman/NationalDay/bg.png);
|
||||
background-size: 100% auto;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.timeText {
|
||||
color: #fff;
|
||||
font-weight: 590;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.timeGap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.btTitle {
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.topTitle {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.history-name {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.history-time {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.UserNickname {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
@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>
|
||||