From 725cf1a287397f16a7e1af09ffa5a50fc6288355 Mon Sep 17 00:00:00 2001 From: 18631081161 <2088094923@qq.com> Date: Wed, 25 Mar 2026 22:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uniapp/pages/index/index.vue | 53 +++++------------------------------- 1 file changed, 7 insertions(+), 46 deletions(-) diff --git a/uniapp/pages/index/index.vue b/uniapp/pages/index/index.vue index 72f2a2f..1391cf6 100644 --- a/uniapp/pages/index/index.vue +++ b/uniapp/pages/index/index.vue @@ -16,6 +16,7 @@ scroll-y refresher-enabled :refresher-triggered="isRefreshing" + :style="{ height: 'calc(100vh - ' + totalNavbarHeight + 'px)' }" @refresherrefresh="onRefresh" > @@ -57,13 +58,9 @@ :key="index" @click="handleCardClick(item)" > - - - 即将上线 - @@ -96,13 +93,9 @@ :class="{ 'more-card--full': moreList.length % 2 === 1 && index === moreList.length - 1 }" @click="handleCardClick(item)" > - - - 即将上线 - @@ -322,8 +315,7 @@ onMounted(() => { // 页面内容 .page-content { - height: calc(100vh - var(--navbar-height, 0px)); - padding-bottom: env(safe-area-inset-bottom); + // 高度通过内联 style 动态计算,不在此处设置 } // Banner轮播 @@ -393,25 +385,9 @@ onMounted(() => { // 卡片区域总宽 = 750rpx - 左右 section-card margin 32rpx*2 - 左右 section-card padding 32rpx*2 = 622rpx width: 299rpx; height: 240rpx; - border-radius: $border-radius-xl; overflow: hidden; flex-shrink: 0; - .coming-soon-tag { - position: absolute; - top: 0; - right: 0; - background-color: rgba(0, 0, 0, 0.3); - padding: 6rpx 20rpx; - border-radius: 0 $border-radius-xl 0 $border-radius-lg; - z-index: 1; - - text { - font-size: $font-size-xs; - color: $text-white; - } - } - .assessment-image { width: 100%; height: 100%; @@ -439,37 +415,22 @@ onMounted(() => { .more-grid { display: flex; flex-wrap: wrap; - gap: $spacing-md; + justify-content: space-between; } .more-card { position: relative; - width: calc(50% - #{$spacing-md} / 2); + width: 48.5%; height: 160rpx; - border-radius: $border-radius-xl; overflow: hidden; box-sizing: border-box; + margin-bottom: $spacing-md; // 奇数个时最后一个占满整行 &--full { width: 100%; } - .coming-soon-tag { - position: absolute; - top: 0; - right: 0; - background-color: rgba(0, 0, 0, 0.3); - padding: 6rpx 20rpx; - border-radius: 0 $border-radius-xl 0 $border-radius-lg; - z-index: 1; - - text { - font-size: $font-size-xs; - color: $text-white; - } - } - &__image { width: 100%; height: 100%;