1.图片宽高比不变,同时,图片充满容器宽
<image style="width:100%;" mode='aspectFit' src='/images/slide.jpg'></image>
2.我把 swiper 的 width 设定成了屏幕的95%宽度, 如果想宽度也自适应的话请改成 width:{ {width*2}}rpx
[html]
<swiper class='advertising2' indicator-dots="true" style='height:{
{height*2 +80}}rpx;width:95%;' autoplay="true" interval="4000" duration="1000">
<swiper-item wx:for="{
{advertising2}}" wx:key="">
<view class='store'>{
{item.title}}</view> <!-- store的高度加内外边距为80rpx,所以在swiper的高度加上80rpx -->
<view>
<image style='height:{
{height*2}}rpx;width:100%;' mode="" src="