<template>
<div class="activity-content">
<div class="one">
<div class="bx">
<div class="m_b-41">
<div class="title m_b-10">{{ $t('v2New69') }}</div>
<div class="text">{{ $t('v2New70') }}</div>
</div>
<div class="item-content">
<div class="item m_b-16">
<div>
<div class="text1 m_b-14">{{ $t('v2New71') }}</div>
<div class="item-title m_b-14">
{{ '$' + $formatNumberToKMBTQ(userData.totalActivityReward) }}
</div>
<div class="number">
<div class="m_r-8">{{ $t('v2New72') }}</div>
<div class="right">
{{ '+' + $truncToFixed(userData.last24hActivityReward, 2)
}}<img
class="w-13 h-13"
src="@/assets/images/new/Arrow-up.png"
/>
</div>
</div>
</div>
</div>
<div class="item bgu">
<div>
<div class="text1 m_b-14">{{ $t('v2New73') }}</div>
<div class="item-title m_b-14">
{{ $formatNumberToKMBTQ(userData.userCount) }}
</div>
<div class="number">
<div class="m_r-8">{{ $t('v2New72') }}</div>
<div class="right">
{{
'+' +
$formatMoney(userData.last24hUserCount) +
$t('v2New74')
}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="carousel">
<div class="carousel-inner" :style="{ width: carouselWidth }">
<div
class="item"
v-for="(item, index) in extendedCarouselList"
:key="index"
:style="{ minWidth: itemWidth }"
>
<img src="@/assets/images/new/aaa.png" alt="" />
<div>
{{ $t('v2New75') + item.nickname + $t('v2New76') }}
<span>{{
$formatMoney($truncToFixed(item.rewardAmount, 2)) + ' USDT !'
}}</span>
</div>
</div>
</div>
</div>
<div class="two">
<div class="bx gradientRamp-border">
<div class="top">
<img
class="w-36 h-36 m_r-10"
:src="user.avatar || defaultImgUrl"
alt=""
/>
{{ user.nickname }}
</div>
<div class="bottom">
<div class="left">
<div class="f_a_i-center m_b-16">
<img
class="w-20 h-20 m_r-10"
src="@/assets/images/new/eeee.png"
alt=""
/>
<div class="title">{{ $t('v2New77') }}</div>
</div>
<div class="title-money">
{{
$formatMoney($truncToFixed(user.totalUnclaimedAmount, 2)) +
' USDT'
}}
</div>
</div>
<div class="middle left">
<div class="f_a_i-center m_b-16">
<img
class="w-20 h-20 m_r-10"
src="@/assets/images/new/Frame 2147223273.png"
alt=""
/>
<div class="title">{{ $t('v2New78') }}</div>
</div>
<div class="underline text1">
{{ user.joinedOngoingActivityCount + $t('v2New79') }}
</div>
</div>
<Button
bR="12"
guang
fS="14"
paddingLR="22"
paddingTB="9"
:text="$t('v2New80')"
rightArrow
@click="$router.push('/competition')"
></Button>
</div>
</div>
</div>
<div class="three">
<div class="bx">
<CommonVantTabs :list="tabsList" @tabsClick="handleClick">
<template #0>
<Activity
@updateActivityList="updateActivityList"
:list="userData.availableActivityList"
:marginTop="'m_t-36'"
></Activity>
</template>
<template #1>
<Activity
@updateActivityList="updateFinishList"
:list="finish"
:marginTop="'m_t-36'"
></Activity>
<div class="p_t-20 f_j_c-center" ref="section" v-if="finish.length">
<div
v-show="loadingDataShow"
@click="loadingDataJia"
class="loading-data"
>
{{ $t('v2New302') }}
</div>
<div
v-show="!loadingDataShow"
@click="loadingDataJian"
class="loading-data"
>
{{ $t('v2New303') }}
</div>
<!-- <Pagination
:current-page="page.pageNo"
:page-size="page.pageSize"
:pageSizes="[6, 12, 18]"
:total-items="page.total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/> -->
</div>
</template>
</CommonVantTabs>
</div>
</div>
<div class="four">
<div class="bx">
<div class="top">
<div class="title">{{ $t('v2New83') }}</div>
<div class="right f_a_i-center" @click="$router.push('/flow')">
{{ $t('v2New84') }}
<img
class="w-24 h-24 m_l-10"
src="@/assets/images/new/arrow-narrow-right-blue.png"
alt=""
/>
</div>
</div>
<div class="bottom">
<div class="item">
<img src="@/assets/images/new/Frame 2147223269.png" alt="" />
<div class="step">Step 1</div>
<div class="text">
{{ $t('v2New85') }}<br />
{{ $t('v2New86') }}
</div>
</div>
<img
class="w-36 h-36 right-arrow"
src="@/assets/images/new/Double Alt Arrow Right.png"
alt=""
/>
<div class="item">
<img
class="i-2"
src="@/assets/images/new/Frame 2147223270.png"
alt=""
/>
<div class="step">Step 2</div>
<div class="text">
{{ $t('v2New87') }}<br />
{{ $t('v2New88') }}
</div>
</div>
<img
class="w-36 h-36 right-arrow"
src="@/assets/images/new/Double Alt Arrow Right.png"
alt=""
/>
<div class="item">
<img
class="i-3"
src="@/assets/images/new/Frame 2147223271.png"
alt=""
/>
<div class="step">Step 3</div>
<div class="text">
{{ $t('v2New89') }}<br />
{{ $t('v2New90') }}
</div>
</div>
<img
class="w-36 h-36 right-arrow"
src="@/assets/images/new/Double Alt Arrow Right.png"
alt=""
/>
<div class="item">
<img
class="i-4"
src="@/assets/images/new/Frame 2147223272.png"
alt=""
/>
<div class="step">Step 4</div>
<div class="text">
{{ $t('v2New91') }}
</div>
</div>
</div>
</div>
</div>
<div class="five">
<div class="bx">
<div class="title2 m_b-10">{{ $t('v2New92') }}</div>
<div class="text1 m_b-36">{{ $t('v2New93') }}</div>
<div class="bottom">
<div class="box m_b-16">
<div class="top">
<div class="f_a_i-center">
<img
class="w-23 h-24 m_r-4"
src="@/assets/images/new/image.png"
alt=""
/>
{{ $t('v2New94') }}
</div>
<div class="data">{{ $t('v2New95') }}</div>
</div>
<div class="list" v-show="userData.popularCryptoList.length">
<div
class="list-item"
v-for="(item, index) in userData.popularCryptoList"
:key="index"
>
<div class="f_a_i-center">
<img
class="w-24 h-24 m_r-10"
style="border-radius: 50%;"
:src="item.icon ? item.icon : defaultSymbolImgUrl"
alt=""
/>
{{ item.code }}
</div>
<div class="value">
{{ '$' + $formatNumberToKMBTQ(item.tradingVolume) }}
</div>
</div>
</div>
<EmptyNoData
v-show="!userData.popularCryptoList.length"
></EmptyNoData>
</div>
<div class="box box2">
<div class="top">
<div class="f_a_i-center">
<img
class="w-23 h-24 m_r-4"
src="@/assets/images/new/image 81.png"
alt=""
/>
{{ $t('v2New96') }}
</div>
<div class="data">{{ $t('v2New97') }}</div>
</div>
<div class="list" v-show="userData.popularUserList.length">
<div
class="list-item"
v-for="(item, index) in userData.popularUserList"
:key="index"
>
<div class="f_a_i-center">
<img
class="w-36 h-36 m_r-10"
:src="item.avatar || defaultImgUrl"
alt=""
/>
{{ item.nickname }}
</div>
<div
class="value"
:style="
item.profitRate < 0 ? 'color: #FF4848;' : 'color: #00D059;'
"
>
{{
(item.profitRate >= 0 ? '+' : '') +
$formatMoney($truncToFixed(item.profitRate, 2)) +
'%'
}}
</div>
</div>
</div>
<EmptyNoData
v-show="!userData.popularUserList.length"
></EmptyNoData>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
// import All from '@/views/modules/activity/components/all'
// import My from '@/views/modules/activity/components/my'
import { mapState } from 'vuex'
import {
Button,
Activity,
Pagination,
EmptyNoData,
CommonVantTabs,
} from '@/components'
import { activityHomepageData, profile2, finishedActivities } from '@/api/api'
export default {
components: { Button, Activity, Pagination, EmptyNoData, CommonVantTabs },
data() {
return {
loadingDataShow: true,
// activeName: 'first',
userData: {
userCount: 0,
last24hUserCount: 0,
totalActivityReward: 0,
last24hActivityReward: 0,
rewardFeedList: [],
availableActivityList: [],
popularCryptoList: [],
popularUserList: [],
},
tabsList: [
{
title: this.$t('v2New81'),
value: '0',
},
{
title: this.$t('v2New82'),
value: '1',
},
],
user: {
email: '',
totalUnclaimedAmount: 0,
active: 0,
joinedOngoingActivityCount: 0,
},
finish: [],
page: {
pageNo: 1,
pageSize: 10,
total: 0,
},
}
},
computed: {
...mapState(['userInfo', 'language']),
extendedCarouselList() {
return [...this.userData.rewardFeedList, ...this.userData.rewardFeedList] // 重复数组
},
carouselWidth() {
return `${this.extendedCarouselList.length * 270}px` // 根据实际项目宽度计算
},
itemWidth() {
return this.language === 'en' ? '350px' : '270px' // 每个项目的宽度
},
},
created() {
if (this.userInfo.accessToken) {
this.profile2()
}
this.activityHomepageData()
},
methods: {
handleClick(name) {
if (name == 1) return this.finishedActivities()
this.activityHomepageData()
},
updateActivityList() {
this.activityHomepageData()
},
updateFinishList() {
this.finishedActivities()
},
async activityHomepageData() {
try {
const res = await activityHomepageData()
this.userData = res.data
} catch (error) {}
},
loadingDataJia() {
this.page.pageSize += 10
this.finishedActivities().then(() => {
if (this.finish.length === this.page.total) {
this.loadingDataShow = false
}
})
},
loadingDataJian() {
this.page.pageSize = 10
this.loadingDataShow = true
this.finishedActivities().then(() => {
this.$refs.section.scrollIntoView({ behavior: 'smooth' });
})
},
async finishedActivities() {
try {
const res = await finishedActivities({
pageNo: this.page.pageNo,
pageSize: this.page.pageSize,
})
this.finish = res.data
this.page.total = res.total
} catch (error) {}
},
handleCurrentChange(val) {
this.page.pageNo = val
this.finishedActivities()
},
handleSizeChange(val) {
this.page.pageSize = val
this.page.pageNo = 1
this.finishedActivities()
},
async profile2() {
try {
const res = await profile2()
this.user = res.data
} catch (error) {}
},
},
}
</script>
<style lang="scss" scoped>
.activity-content {
// padding-bottom: 100px;
.bx {
// width: 1200px;
}
.one {
width: 100%;
// height: 491px;
box-sizing: border-box;
background: url('@/assets/images/new/Frame 2147223274.png') no-repeat;
background-size: 100% 100%;
padding-top: 156px;
// margin: 0 auto;
padding-bottom: 38.53px;
.bx {
// width: 1200px;
display: flex;
flex-direction: column;
align-items: center;
// justify-content: space-between;
// box-sizing: border-box;
.title {
// height: 73px;
font-family: 'PingFang SC';
font-size: 32px;
font-style: normal;
font-weight: 600;
line-height: 100%; /* 40px */
background: linear-gradient(
180deg,
#fff 0%,
rgba(255, 255, 255, 0.7) 100%
);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.text {
// height: 49px;
font-family: 'PingFang SC';
font-weight: 400;
font-size: 14px;
color: #c8c8d0;
line-height: 18px;
text-align: left;
font-style: normal;
text-transform: none;
}
.item-content {
display: flex;
flex-direction: column;
align-items: center;
}
.item {
position: relative;
width: 347px;
height: 169.235px;
box-sizing: border-box;
background: #0b0d21;
border-radius: 10.181px;
// border: 1px solid rgba(255, 255, 255, 0.12);
padding: 30.5px;
background: url('@/assets/images/new/Frame 2147223258.png') no-repeat;
background-size: 100% 100%;
.item-title {
color: #fff;
font-family: D-DIN;
font-size: 44.117px;
font-style: normal;
font-weight: 700;
// line-height: 100%; /* 52px */
}
.number {
display: flex;
align-items: center;
.left {
color: #c8c8d0;
font-family: 'PingFang SC';
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
.right {
color: #00d059;
font-family: D-DIN;
font-size: 12px;
font-style: normal;
font-weight: 700;
line-height: 140%; /* 19.6px */
display: flex;
align-items: center;
}
}
}
.bgu {
background: url('@/assets/images/new/Frame 2147223257.png') no-repeat;
background-size: 100% 100%;
}
}
}
.carousel {
overflow: hidden;
width: 100%;
height: 48px;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.1);
display: flex;
align-items: center;
.carousel-inner {
display: flex;
animation: slide 100s linear infinite; /* 根据需要调整速度 */
}
@keyframes slide {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%); /* 向左移动一半的宽度 */
}
}
.item {
// min-width: 250px; /* 根据每个项的实际宽度进行调整 */
display: flex;
align-items: center;
// margin-left: 36px;
img {
width: 16px;
height: 16px;
margin-right: 4px;
}
div {
color: #fff;
font-family: 'PingFang SC';
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
span {
color: #00d059;
}
}
}
.two {
// padding: 100px 120px;
padding-top: 39px;
.gradientRamp-border {
width: 347px;
// height: 227px;
margin: 0 auto;
// box-sizing: border-box;
background: #0b0d21; /* 背景颜色 */
padding: 24px 16px;
border-radius: 12px;
.top {
position: relative; /* 确保内容在伪元素之上 */
z-index: 2; /* 确保内容在最上层 */
color: #fff; /* 确保文字颜色可见 */
padding-bottom: 24px;
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
display: flex;
align-items: center;
font-family: 'PingFang SC';
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 142.857% */
letter-spacing: 0.56px;
img {
border-radius: 50%;
}
}
.bottom {
position: relative;
z-index: 2;
padding-top: 24px;
// display: flex;
// justify-content: space-between;
// align-items: center;
.left {
margin-bottom: 36px;
.title {
color: #c8c8d0;
font-family: 'PingFang SC';
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 125% */
letter-spacing: 0.56px;
}
.title-money {
color: #fff;
font-family: D-DIN;
font-size: 36px;
font-style: normal;
font-weight: 700;
line-height: 36px; /* 100% */
}
}
.middle {
.underline {
font-size: 16px;
color: #3860ff;
// text-decoration-line: underline;
// text-decoration-style: solid;
// text-decoration-skip-ink: none;
// text-decoration-thickness: auto;
// text-underline-offset: auto;
// text-underline-position: from-font;
// cursor: pointer;
}
}
}
}
}
.three {
padding: 70px 0;
}
.four {
.bx {
// height: 451px;
width: 347px;
margin: 0 auto;
background: #0b0d21;
box-sizing: border-box;
border-radius: 28px 28px 28px 28px;
border: 1px solid rgba(255, 255, 255, 0.08);
padding: 24px 16px;
.top {
display: flex;
justify-content: space-between;
align-items: center;
// padding: 0 14px;
margin-bottom: 10px;
.title {
font-family: 'PingFang SC';
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: 140%; /* 56px */
}
.right {
color: var(--primary-color);
font-family: 'PingFang SC';
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: normal;
cursor: pointer;
}
}
.bottom {
display: flex;
flex-direction: column;
align-items: center;
.item {
// width: 257px;
// height: 285px;
box-sizing: border-box;
display: flex;
flex-direction: column;
// justify-content: space-between;
align-items: center;
img {
width: 140px;
height: 140px;
// margin-bottom: 10px;
}
.i-2 {
width: 145px;
height: 191px;
}
.i-3 {
width: 162px;
height: 162px;
}
.i-4 {
width: 176px;
height: 176px;
}
.step {
color: #c8c8d0;
text-align: center;
font-family: 'PingFang SC';
font-size: 16px;
font-style: normal;
font-weight: 600;
line-height: normal;
margin-bottom: 10px;
}
.text {
color: #c8c8d0;
text-align: center;
font-family: 'PingFang SC';
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 166.667% */
margin-bottom: 16px;
}
}
// .right-arrow {
// margin-top: -20px;
// }
}
}
}
.five {
padding: 76px 0;
.bx {
display: flex;
flex-direction: column;
align-items: center;
.title2 {
background: linear-gradient(
180deg,
#fff 0%,
rgba(255, 255, 255, 0.7) 100%
);
font-size: 32px;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.text1 {
font-size: 14px;
}
.bottom {
display: flex;
flex-direction: column;
align-items: center;
.box {
width: 347px;
height: 607px;
box-sizing: border-box;
padding: 28px 0;
border-radius: 25px;
border: 1px solid rgba(255, 255, 255, 0.12);
background: linear-gradient(
180deg,
rgba(56, 96, 255, 0.2) 0%,
rgba(1, 5, 16, 0) 40.15%
);
.top {
padding: 0 24px;
width: 100%;
// height: 56px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: flex-end;
color: #fff;
font-family: 'PingFang SC';
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: 140%; /* 30.8px */
margin-bottom: 20px;
.data {
color: #c8c8d0;
font-feature-settings: 'ss01' on, 'cv01' on, 'cv11' on;
font-family: 'PingFang SC';
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 12px; /* 100% */
padding-top: 0px;
}
}
.list {
max-height: 480px; /* 设置最大高度 */
overflow-y: auto; /* 允许垂直滚动 */
padding: 0 24px;
/* 隐藏滚动条 */
scrollbar-width: none; /* Firefox */
&::-webkit-scrollbar {
display: none; /* Chrome, Safari 和 Opera */
}
.list-item {
width: 100%;
height: 48px;
box-sizing: border-box;
color: #fff;
font-family: 'PingFang SC';
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 140%; /* 19.6px */
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
.value {
color: #fff;
font-family: D-DIN;
font-size: 14px;
font-style: normal;
font-weight: 700;
line-height: 140%; /* 19.6px */
}
img {
border-radius: 50%;
}
}
.list-item:hover {
border-radius: 12px;
background: rgba(255, 255, 255, 0.08);
}
}
}
.box2 {
background: linear-gradient(
180deg,
rgba(255, 86, 96, 0.2) 0%,
rgba(1, 5, 16, 0) 40.15%
);
.list-item {
height: 56px !important;
}
}
}
}
}
// &.first-active {
// background: url('@/assets/images/deal/bg@2x.png') no-repeat;
// background-size: 100% 100%;
// ::v-deep .el-tabs__header {
// margin-left: 150px;
// margin-right: 150px;
// }
// }
// ::v-deep .el-tabs__nav-scroll {
// display: flex;
// justify-content: center;
// }
// ::v-deep .el-tabs__header {
// margin-bottom: 50px;
// }
.loading-data {
color: var(--primary-color);
}
}
</style>
<div class="carousel">
<div class="carousel-inner" :style="{ width: carouselWidth }">
<div
class="item"
v-for="(item, index) in extendedCarouselList"
:key="index"
:style="{ minWidth: itemWidth }"
>
<img src="@/assets/images/new/aaa.png" alt="" />
<div>
{{ $t('v2New75') + item.nickname + $t('v2New76') }}
<span>{{
$formatMoney($truncToFixed(item.rewardAmount, 2)) + ' USDT !'
}}</span>
</div>
</div>
</div>
</div>这一段滚动在手机端网页上不会滚动,只显示数据,而且过一会数据也不见了