Browse Source

style(components): 调整视频弹窗和首页组件的样式

统一使用视窗单位替代固定像素值,提高响应式适配能力
移除冗余的平板设备轮播图样式和搜索框边距
优化推荐列表图片显示模式为aspectFill
main
前端-胡立永 1 day ago
parent
commit
23bdbea206
2 changed files with 10 additions and 41 deletions
  1. +1
    -1
      pages/components/VideoPopup.vue
  2. +9
    -40
      pages/index/home.vue

+ 1
- 1
pages/components/VideoPopup.vue View File

@ -18,7 +18,7 @@
:show-fullscreen-btn="true" :show-fullscreen-btn="true"
:show-play-btn="true" :show-play-btn="true"
:show-center-play-btn="true" :show-center-play-btn="true"
style="width: 100%; height: 400rpx; border-radius: 8rpx;"
style="width: 100%; height: 55vw; border-radius: 8rpx;"
@error="onVideoError" @error="onVideoError"
@play="onVideoPlay" @play="onVideoPlay"
@pause="onVideoPause" @pause="onVideoPause"


+ 9
- 40
pages/index/home.vue View File

@ -10,7 +10,7 @@
<view class="header"> <view class="header">
<view class="search-container" @click="goSearch"> <view class="search-container" @click="goSearch">
<uv-search placeholder="请输入要查询的内容" :show-action="false" shape="round" bg-color="#f5f5f5" color="#666" <uv-search placeholder="请输入要查询的内容" :show-action="false" shape="round" bg-color="#f5f5f5" color="#666"
height="38" margin="0 200rpx 0 0" placeholderColor="#c6c6c6"></uv-search>
height="38" placeholderColor="#c6c6c6"></uv-search>
</view> </view>
</view> </view>
@ -23,8 +23,8 @@
<view v-if="activeTab == 0"> <view v-if="activeTab == 0">
<view class="swiper-container" :class="{ 'tablet-swiper': isTablet }"> <view class="swiper-container" :class="{ 'tablet-swiper': isTablet }">
<uv-swiper :list="bannerList" keyName="image" :height="swiperConfig.height" <uv-swiper :list="bannerList" keyName="image" :height="swiperConfig.height"
:radius="swiperConfig.radius" :previousMargin="swiperConfig.previousMargin"
:nextMargin="swiperConfig.nextMargin" :displayMultipleItems="swiperConfig.displayMultipleItems"
radius="2vw"
height="30.6vw"
indicator indicatorInactiveColor="#fff" :loading="false" indicatorMode="dot" indicator indicatorInactiveColor="#fff" :loading="false" indicatorMode="dot"
indicatorActiveColor="#F95A01" :autoplay="true" :interval="4000" :circular="true" indicatorActiveColor="#F95A01" :autoplay="true" :interval="4000" :circular="true"
@click="onBannerClick"></uv-swiper> @click="onBannerClick"></uv-swiper>
@ -107,7 +107,7 @@
<view class="recommend-list"> <view class="recommend-list">
<view @click="goPlan(item.id, item.type)" v-for="(item, index) in recommendList" :key="index" <view @click="goPlan(item.id, item.type)" v-for="(item, index) in recommendList" :key="index"
class="recommend-item"> class="recommend-item">
<image :src="item.img" mode="widthFix" class="recommend-image"></image>
<image :src="item.img" mode="aspectFill" class="recommend-image"></image>
</view> </view>
</view> </view>
</view> </view>
@ -454,6 +454,8 @@ export default {
background: #fff; background: #fff;
min-height: 100vh; min-height: 100vh;
padding-bottom: 80rpx; padding-bottom: 80rpx;
// max-width: 750px;
// margin: 0 auto;
} }
// //
@ -474,38 +476,6 @@ export default {
margin: 20rpx; margin: 20rpx;
border-radius: 12rpx; border-radius: 12rpx;
overflow: hidden; overflow: hidden;
//
&.tablet-swiper {
margin: 30rpx 0;
border-radius: 16rpx;
//
:deep(.uv-swiper) {
.swiper-slide {
transition: all 0.3s ease;
transform-origin: center;
//
&:not(.swiper-slide-active) {
transform: scale(0.9);
opacity: 0.7;
}
//
&.swiper-slide-active {
transform: scale(1);
opacity: 1;
z-index: 2;
}
}
//
.uv-swiper__indicator {
bottom: -40rpx;
}
}
}
} }
// //
@ -799,16 +769,15 @@ export default {
.recommend-item { .recommend-item {
width: 100%; width: 100%;
margin-bottom: 48rpx; margin-bottom: 48rpx;
border-radius: 32rpx;
overflow: hidden;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.recommend-image { .recommend-image {
width: 100%; width: 100%;
height: 200rpx;
height: 25vw;
// height: 30.6vw;
border-radius: 32rpx;
} }
} }
} }


Loading…
Cancel
Save