修改引导页、活动列表自适应样式

This commit is contained in:
zhouyanli
2026-05-18 17:48:43 +08:00
parent 8ee170f78b
commit aa5453c0be
6 changed files with 285 additions and 236 deletions

View File

@@ -1,9 +1,9 @@
<template>
<view class="container">
<view class="status_bar"></view>
<view class="status-bar"></view>
<!-- 顶部标题栏 固定 -->
<view class="top-bar">
<uni-nav-bar left-icon="left" title="活动列表" backgroundColor="none" :border="false"
<uni-nav-bar left-icon="left" title="活动列表" backgroundColor="none" :border="false" :statusBar="false"
@clickLeft="narBack" />
</view>
@@ -11,9 +11,8 @@
<scroll-view class="scroll-container" scroll-y="true" @scrolltolower="loadMoreData"
:lower-threshold="100">
<!-- 顶部图片 -->
<view class="topImg">
<image src="http://47.104.199.163:9090/images/home/banner.png"
style="width: 100%;height:100%;"></image>
<view class="top-img">
<image class="banner-img" src="http://47.104.199.163:9090/images/home/banner.png" mode="aspectFill"></image>
</view>
<!-- 选项卡 -->
@@ -62,12 +61,11 @@
</view>
<view class="activity-info">
<view class="u-demo-block__content ">
<view class="u-demo-block__content">
<up-row justify="space-between" customStyle="margin-bottom: 10px">
<up-col span="4">
<view class="info-image-left">
<image :src="activity.coverImage"
style="width: 100%;height: 100%;"></image>
<image :src="activity.coverImage" style="width: 100%;height: 100%;"></image>
</view>
</up-col>
<up-col span="8">
@@ -218,7 +216,7 @@ const getActivityListData = async (pageNum = 1) => {
if (res.code === 200) {
const list = res.rows || []
total.value = res.total || 0
// 第一页覆盖数据,下一页追加数据
if (pageNum === 1) {
displayedActivities.value = list
@@ -336,9 +334,12 @@ watch(() => myFilter.value, () => {
padding: 0;
}
.status_bar {
/* 状态栏 - 自适应设备状态栏高度 */
.status-bar {
/* height: var(--status-bar-height); */
height: 46px;
width: 100%;
flex-shrink: 0;
}
/* 顶部标题 固定 */
@@ -353,35 +354,42 @@ watch(() => myFilter.value, () => {
flex: 1;
width: 100%;
overflow-y: auto;
padding: 0 40rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.topImg {
/* 顶部图片 */
.top-img {
width: 100%;
height: 280rpx;
margin: 20rpx 0;
}
.banner-img {
width: 100%;
height: 100%;
border-radius: 16rpx;
}
/* 顶部选项卡 */
.tabs-container {
display: flex;
top: 0;
z-index: 10;
margin-bottom: 20rpx
margin-bottom: 20rpx;
}
.tab-item {
flex: 1;
display: flex;
text-align: center;
padding: 20rpx 0;
padding: 20rpx 32rpx;
font-size: 32rpx;
color: #666;
position: relative;
}
.tab-item.active {
color: #007AFF;
color: #2F77FD;
font-weight: 500;
}
@@ -391,8 +399,9 @@ watch(() => myFilter.value, () => {
left: 50%;
transform: translateX(-50%);
width: 120rpx;
height: 6rpx;
background-color: #007AFF;
height: 8rpx;
background: linear-gradient(to bottom, #2F77FD, #CEDFFF);
/* background-color: #2F77FD; */
border-radius: 4rpx;
}
@@ -400,7 +409,7 @@ watch(() => myFilter.value, () => {
.filter-container {
background-color: #fff;
padding: 20rpx 0;
border-bottom: 1px solid #eee;
border-bottom: 1rpx solid #eee;
}
.filter-scroll {
@@ -410,7 +419,7 @@ watch(() => myFilter.value, () => {
.filter-buttons {
display: inline-flex;
padding: 0 30rpx;
padding: 0 10rpx;
}
.filter-btn {
@@ -421,7 +430,9 @@ watch(() => myFilter.value, () => {
color: #666;
background-color: #f8f8f8;
border-radius: 25rpx;
border: 1px solid #eee;
border: 1rpx solid #eee;
white-space: nowrap;
flex-shrink: 0;
}
.filter-btn.active {
@@ -441,9 +452,9 @@ watch(() => myFilter.value, () => {
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
/* box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05); */
position: relative;
border: 1px solid #e1e1e1;
border: 1rpx solid #e1e1e1;
}
/* 活动状态标签 */
@@ -471,6 +482,7 @@ watch(() => myFilter.value, () => {
font-size: 22rpx;
border-radius: 20rpx;
z-index: 1;
background-color: rgba(0, 122, 255, 0.08);
}
.signed-badge text {
@@ -479,9 +491,10 @@ watch(() => myFilter.value, () => {
/* 活动信息 */
.activity-info {
margin-top: 10rpx;
padding-top: 50rpx;
}
/* 活动信息 */
.info-image-left {
width: 170rpx;
height: 220rpx;
@@ -491,15 +504,19 @@ watch(() => myFilter.value, () => {
font-size: 30rpx;
font-weight: 500;
color: #222;
margin-bottom: 30rpx;
margin-bottom: 20rpx;
line-height: 1.4;
padding-right: 100rpx;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.activity-detail {
display: flex;
align-items: flex-start;
margin-bottom: 20rpx;
margin-bottom: 16rpx;
color: #999;
font-size: 24rpx;
line-height: 1.4;
@@ -520,25 +537,27 @@ watch(() => myFilter.value, () => {
flex: 1;
font-size: 20rpx;
}
.detail-text-address{
.detail-text-address {
flex: 1;
font-size: 22rpx;
}
/* 操作按钮 */
.action-buttons {
margin-top: 30rpx;
margin-top: 20rpx;
display: flex;
justify-content: flex-end;
}
.action-btn {
padding: 0px 26rpx;
height: 50rpx;
line-height: 50rpx;
font-size: 22rpx;
border-radius: 10rpx;
padding: 0 26rpx;
height: 56rpx;
line-height: 56rpx;
font-size: 24rpx;
border-radius: 28rpx;
margin: 0;
min-width: 140rpx;
}
.signup-btn {
@@ -618,4 +637,4 @@ watch(() => myFilter.value, () => {
margin-top: 20rpx;
margin-bottom: 10rpx;
}
</style>
</style>