优化首页、场馆、折扣页面卡片布局及宽屏适配
- 首页:banner限制最大高度300px,页面支持滚动 - 场馆/折扣:卡片结构统一,地址和距离合并容器靠右对齐 - 卡片宽度自适应屏幕,间距统一margin 12px - card-name填充容器,超长截断
This commit is contained in:
@@ -22,13 +22,15 @@
|
|||||||
<view class="card-info">
|
<view class="card-info">
|
||||||
<text class="card-name">{{ item.name }}</text>
|
<text class="card-name">{{ item.name }}</text>
|
||||||
<text class="card-category">{{ item.category }}</text>
|
<text class="card-category">{{ item.category }}</text>
|
||||||
|
<view class="card-bottom">
|
||||||
<text class="card-address">{{ item.address }}</text>
|
<text class="card-address">{{ item.address }}</text>
|
||||||
</view>
|
|
||||||
<view class="card-distance" v-if="item.distance !== null">
|
<view class="card-distance" v-if="item.distance !== null">
|
||||||
<u-icon name="map" color="#999999" size="24"></u-icon>
|
<u-icon name="map" color="#999999" size="24"></u-icon>
|
||||||
<text class="distance-text">{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
<text class="distance-text">{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view v-if="hasScrolled" class="nomore-area">
|
<view v-if="hasScrolled" class="nomore-area">
|
||||||
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="''" :nomore-text="'我也是有底线的'" />
|
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="''" :nomore-text="'我也是有底线的'" />
|
||||||
</view>
|
</view>
|
||||||
@@ -178,7 +180,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.list-area {
|
.list-area {
|
||||||
padding: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.venue-card {
|
.venue-card {
|
||||||
@@ -187,11 +188,10 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid #f2f2f7;
|
border: 1px solid #f2f2f7;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
width: 702rpx;
|
padding: 12px;
|
||||||
padding: 24px 12px;
|
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
box-shadow: 0 2px 3px #f2f2f7;
|
box-shadow: 0 2px 3px #f2f2f7;
|
||||||
margin-bottom: 12px;
|
margin: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-img {
|
.card-img {
|
||||||
@@ -206,12 +206,18 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-name {
|
.card-name {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-category {
|
.card-category {
|
||||||
@@ -220,14 +226,22 @@ export default {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 8px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.card-address {
|
.card-address {
|
||||||
|
flex: 1;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #727272;
|
color: #727272;
|
||||||
margin-top: 8px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
max-width: 200px;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-distance {
|
.card-distance {
|
||||||
|
|||||||
@@ -102,11 +102,17 @@
|
|||||||
.page {
|
.page {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
overflow: hidden;
|
overflow-y: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.banner {
|
||||||
|
width: 100%;
|
||||||
|
max-height: 300px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.banner-img {
|
.banner-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
+21
-7
@@ -22,13 +22,15 @@
|
|||||||
<view class="card-info">
|
<view class="card-info">
|
||||||
<text class="card-name">{{ item.name }}</text>
|
<text class="card-name">{{ item.name }}</text>
|
||||||
<text class="card-category">{{ item.category }}</text>
|
<text class="card-category">{{ item.category }}</text>
|
||||||
|
<view class="card-bottom">
|
||||||
<text class="card-address">{{ item.address }}</text>
|
<text class="card-address">{{ item.address }}</text>
|
||||||
</view>
|
|
||||||
<view class="card-distance" v-if="item.distance !== null">
|
<view class="card-distance" v-if="item.distance !== null">
|
||||||
<u-icon name="map" color="#999999" size="24"></u-icon>
|
<u-icon name="map" color="#999999" size="24"></u-icon>
|
||||||
<text class="distance-text">{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
<text class="distance-text">{{ item.distance < 1 ? Math.round(item.distance * 1000) + 'm' : Math.round(item.distance) + 'km' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view v-if="hasScrolled" class="nomore-area">
|
<view v-if="hasScrolled" class="nomore-area">
|
||||||
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="''" :nomore-text="'我也是有底线的'" />
|
<u-loadmore :status="loadStatus" :loading-text="'加载中...'" :loadmore-text="''" :nomore-text="'我也是有底线的'" />
|
||||||
</view>
|
</view>
|
||||||
@@ -178,7 +180,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.list-area {
|
.list-area {
|
||||||
padding: 12px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.venue-card {
|
.venue-card {
|
||||||
@@ -187,11 +188,10 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid #f2f2f7;
|
border: 1px solid #f2f2f7;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
width: 702rpx;
|
padding: 12px;
|
||||||
padding: 24px 12px;
|
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
box-shadow: 0 2px 3px #f2f2f7;
|
box-shadow: 0 2px 3px #f2f2f7;
|
||||||
margin-bottom: 12px;
|
margin: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-img {
|
.card-img {
|
||||||
@@ -206,12 +206,18 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-name {
|
.card-name {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-category {
|
.card-category {
|
||||||
@@ -220,14 +226,22 @@ export default {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 8px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.card-address {
|
.card-address {
|
||||||
|
flex: 1;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #727272;
|
color: #727272;
|
||||||
margin-top: 8px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
max-width: 200px;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-distance {
|
.card-distance {
|
||||||
|
|||||||
Reference in New Issue
Block a user