feat: 样式的调整

This commit is contained in:
2025-08-05 22:02:10 +08:00
parent 680ac8fd38
commit aedc71903d
3 changed files with 25 additions and 7 deletions

View File

@@ -85,7 +85,7 @@
min-height: fit-content;
/* 安卓键盘适配 - 使用相对定位配合adjustPan */
position: relative;
z-index: 1000;
z-index: 1;
transition: padding-bottom 0.3s ease;
/* 确保输入区域始终可见 */
transform: translateZ(0);

View File

@@ -31,7 +31,7 @@
</view>
<!-- 底部退出按钮 -->
<button class="logout-btn" @click="handleLogout">退出登录</button>
<text class="logout-btn" @click="handleLogout">退出登录</text>
</view>
</template>
@@ -140,8 +140,11 @@ const handleLogout = () => {
}
.logout-btn {
width: 90%;
margin: 80rpx auto;
display: flex;
align-items: center;
justify-content: center;
height: 42px;
margin-top: 40px;
background-color: #fff;
color: #333;
border-radius: 8rpx;

View File

@@ -4,7 +4,7 @@
<view class="container-scroll">
<view class="mk-card-item" v-for="(item) in commodityDTO.commodityList" :key="item.commodityName">
<!-- <view class="card-badge">超值推荐</view> -->
<image class="card-img" :src="item.commodityIcon" mode="widthFix" />
<image class="card-img" :src="item.commodityIcon" mode="aspectFill" />
<view class="card-content">
<view class="card-title-column">
<text class="card-title">{{ item.commodityName }}</text>
@@ -72,7 +72,7 @@
flex-direction: column;
align-items: start;
width: 188px;
height: 244px;
// height: 244px;
background-color: #ffffff;
border-radius: 10px;
margin-right: 8px;
@@ -94,27 +94,42 @@
width: 188px;
height: 114px;
border-radius: 10px;
object-fit: cover; /* 确保图片不变形,保持比例裁剪 */
flex-shrink: 0; /* 防止图片被压缩 */
}
.card-content {
box-sizing: border-box;
box-sizing: border-box;
padding: 10px 12px 0 12px;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: start;
width: 100%;
flex: 1; /* 让内容区域占据剩余空间 */
overflow: hidden; /* 防止内容溢出 */
}
.card-title-column {
display: flex;
align-items: start;
flex-direction: column;
width: 100%;
}
.card-title {
font-size: 16px;
font-weight: bold;
color: #222;
width: 100%;
/* 限制标题最多显示两行 */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.4;
max-height: 2.8em; /* 2行的高度 */
}
.card-tags {