******HTML********
<view class=‘imageListCss’ wx:for="{{imageList}}" >
<block wx:if="{{index%2===0}}" >
<image class=“ImageLeft” mode=“aspectFit” src="{{item}}" background-size=“cover”></image>
</block>
<block wx:else>
<image class=“ImageRight” mode=“aspectFit” src="{{item}}" background-size=“cover”></image>
</block>
</view>
*********CSS**********
.imageListCss {
width: 750rpx;
display: flex;
flex-direction:row;
justify-content:flex-start;
align-items:center;
}
.ImageLeft {
width: 50%;
}
.ImageRight {
width: 50%;
}
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*这什么这里没办法一行输出两个图片,wx:for出来后全面都是每行输出一个图。
<view class=‘imageListCss’>
<block wx:for="{{imageList}}">
<block wx:if="{{index%2===0}}">
<image class=“ImageLeft” mode=“aspectFit” src="{{item}}" background-size=“cover”></image>
</block>
<block wx:else>
<image class=“ImageRight” mode=“aspectFit” src="{{item}}" background-size=“cover”></image>
</block>
</block>
</view>