修改展示页的样式

This commit is contained in:
zheng020 2026-05-15 19:01:49 +08:00 committed by zerosaturation
parent ff24cd55cd
commit 2c2e707971
3 changed files with 87 additions and 17 deletions

View File

@ -30,6 +30,12 @@
@tap="handleExhibitionCardTap(item, index)"> @tap="handleExhibitionCardTap(item, index)">
<image class="card-image" :src="item.cover_url || '/static/nft/placeholder.png'" <image class="card-image" :src="item.cover_url || '/static/nft/placeholder.png'"
mode="aspectFill"></image> mode="aspectFill"></image>
<!-- 领取收益按钮 -->
<view class="claim-reward-btn" v-if="isRewardClaimable(item.id)">
<image class="claim-crystal-icon" src="/static/square/shuijingtubiao.png" mode="aspectFit">
</image>
<view @tap.stop="handleClaimReward(item, index)" class="claim-btn-text">领取收益</view>
</view>
<image class="card-frame" src="/static/square/gerenzhongxincangpinkuang.png" mode="aspectFill"> <image class="card-frame" src="/static/square/gerenzhongxincangpinkuang.png" mode="aspectFill">
</image> </image>
<!-- 点赞数 --> <!-- 点赞数 -->
@ -40,7 +46,8 @@
</view> </view>
</view> </view>
<!-- 倒计时背景 --> <!-- 倒计时背景 -->
<view class="countdown-background" :style="getCountdownBackgroundStyle(index)"> <view class="countdown-background" v-if="!isRewardClaimable(item.id)"
:style="getCountdownBackgroundStyle(index)">
<!-- 倒计时文字 --> <!-- 倒计时文字 -->
<text class="countdown-text"> <text class="countdown-text">
{{ formatCountdown(item.id) }} {{ formatCountdown(item.id) }}
@ -268,6 +275,12 @@ const goToAssetDetail = (id) => {
// //
const cardTapTimers = {}; const cardTapTimers = {};
//
const handleClaimReward = (item, _index) => {
console.log('领取收益:', item);
uni.showToast({ title: '收益已领取', icon: 'success' });
};
const handleExhibitionCardTap = (item, index) => { const handleExhibitionCardTap = (item, index) => {
if (cardTapTimers[item.id]) { if (cardTapTimers[item.id]) {
// //
@ -360,6 +373,12 @@ const formatCountdown = (itemId) => {
return `${h}:${m}:${s}`; return `${h}:${m}:${s}`;
}; };
//
const isRewardClaimable = (itemId) => {
const countdown = countdowns.value[itemId];
return countdown && countdown.expired;
};
// //
const getCountdownBackgroundStyle = () => { const getCountdownBackgroundStyle = () => {
return { return {
@ -680,6 +699,50 @@ onShow(() => {
z-index: 2; z-index: 2;
} }
/* 领取收益按钮 */
.claim-reward-btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 88%;
height: 92%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
z-index: 10;
background: rgba(0, 0, 0, 0.6);
border-radius: 16rpx;
gap: 8rpx;
}
.claim-crystal-icon {
width: 50%;
height: 50%;
position: absolute;
top: 50%;
transform: translateY(-50%)
}
.claim-btn-text {
background: linear-gradient(to bottom right,
#F0E4B1 0%,
#F08399 50%,
#B94E73 100%);
border-radius: 24rpx;
padding: 8rpx 20rpx;
box-shadow:
0 4rpx 12rpx rgba(255, 143, 158, 0.2),
inset 0 2rpx 4rpx rgba(255, 255, 255, 0.4);
font-size: 22rpx;
color: #fff;
font-weight: 600;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
position: absolute;
bottom: 24rpx;
}
.card-user-tag { .card-user-tag {
position: absolute; position: absolute;
bottom: 56rpx; bottom: 56rpx;

View File

@ -1,23 +1,17 @@
<template> <template>
<view class="theme-banner"> <view class="theme-banner">
<!-- 背景图 - 使用懒加载 --> <!-- 背景图 - 使用懒加载 -->
<image <image v-if="bannerImage" :src="bannerImage" class="banner-bg" mode="aspectFill" :lazy-load="true" />
v-if="bannerImage"
:src="bannerImage"
class="banner-bg"
mode="aspectFill"
:lazy-load="true"
/>
<!-- 内容层 --> <!-- 内容层 -->
<view class="banner-content" @tap="handleBannerClick"> <view class="banner-content" @tap="handleBannerClick">
<!-- 上半部分标题区域 --> <!-- 上半部分标题区域 -->
<view class="title-section"> <view class="title-section">
<view class="subtitle-row"> <view class="subtitle-row">
<text class="subtitle-text">{{'「'+ title +'」' }}</text> <text class="subtitle-text">{{ '「' + title + '」' }}</text>
<!-- 如果确实需要过时数据警告可以保留否则可隐藏 --> <!-- 如果确实需要过时数据警告可以保留否则可隐藏 -->
<view v-if="isStaleData" class="stale-indicator"> <view v-if="isStaleData" class="stale-indicator">
<text class="stale-icon"></text> <text class="stale-icon"></text>
@ -28,9 +22,9 @@
<!-- 下半部分右下角数字 --> <!-- 下半部分右下角数字 -->
<view class="footer-section"> <view class="footer-section">
<text class="progress-text">{{ formattedCurrent }} / {{ formattedTarget }}</text> <text class="progress-text">当前进度<text class="current-value">{{ formattedCurrent }}</text> / {{ formattedTarget }}</text>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -131,7 +125,7 @@ const progressPercent = computed(() => {
font-size: 64rpx; font-size: 64rpx;
font-weight: 900; font-weight: 900;
color: #fff; color: #fff;
text-shadow: text-shadow:
0 0 10rpx rgba(255, 255, 255, 0.8), 0 0 10rpx rgba(255, 255, 255, 0.8),
0 4rpx 8rpx rgba(0, 0, 0, 0.5); 0 4rpx 8rpx rgba(0, 0, 0, 0.5);
line-height: 1.2; line-height: 1.2;
@ -178,13 +172,26 @@ const progressPercent = computed(() => {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: flex-end; align-items: flex-end;
} }
.progress-text { .progress-text {
font-size: 32rpx; font-size: 24rpx;
color: #fff; color: #fff;
text-shadow: 0 0 8rpx rgba(255, 255, 255, 0.6); text-shadow: 0 0 8rpx rgba(255, 255, 255, 0.6);
font-family: 'yt', sans-serif; font-family: 'yt', sans-serif;
background-image: url('@/static/rank/activity-support-icon/beijingkuang.png');
background-size: cover;
background-position: center;
padding: 0.8rpx 24rpx;
border-radius: 40rpx;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.6);
}
.current-value {
color: #FFD700;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.6);
} }
.progress-bar { .progress-bar {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB