图片高度不固定

version/0412
shuxiaoquan 9 months ago
parent c4f287f243
commit 692efa83e4
  1. 8
      pages/activity/newGoods.vue
  2. 8
      pages/activity/newsshop.vue

@ -170,11 +170,11 @@
.firGoods { .firGoods {
width: 100%; width: 100%;
height: 548rpx; height: 510rpx;
background-image: url('https://www.royaum.com.cn/static/newGoods/top.png'); background-image: url('https://www.royaum.com.cn/static/newGoods/top.png');
background-repeat: no-repeat; /* 不重复平铺背景图片 */ background-repeat: no-repeat; /* 不重复平铺背景图片 */
background-position: center; /* 居中显示背景图片 */ background-position: center top; /* 居中显示背景图片 */
background-size: cover; /* 拉伸并填充至元素内部 */ background-size: 100% auto; /* 拉伸并填充至元素内部 */
.topLine { .topLine {
display: flex; display: flex;

@ -12,7 +12,7 @@
<view class="newsshop-bd" v-if="shopList.length>0" v-for="(item,index) in shopList" :key="i"> <view class="newsshop-bd" v-if="shopList.length>0" v-for="(item,index) in shopList" :key="i">
<view class="newsshop-sale"> <view class="newsshop-sale">
<view class="a"> <view class="a">
<image :src="item.col_pic" mode="aspectFill"></image> <image :src="item.col_pic" mode="widthFix"></image>
</view> </view>
<view class="info"> <view class="info">
<view class="li b"> <view class="li b">
@ -159,12 +159,10 @@
.a { .a {
width: 100%; width: 100%;
height: 93rpx; overflow: hidden;
image { image {
background-size: cover; display: block;
width: 100%; width: 100%;
height: 100% !important;
} }
} }

Loading…
Cancel
Save