微信小程序分列显示数据

效果图

 

wxml代码

<view class='onehandle5'>
      <block wx:for="{{3}}" wx:for-index="k" wx:for-item="item_k" wx:key="key">
        <view class="useage2">{{weatherData.data[item_k].day}}</view>
      </block>
    </view>

    <view class='onehandle5'>
      <block wx:for="{{3}}" wx:for-index="k" wx:for-item="item_k" wx:key="key">
        <view wx:if='{{weatherData.data[item_k].wea_img}}' class="useage2 ">
          <image src='../../images/qq/{{weatherData.data[item_k].wea_img}}.png'></image>
        </view>
      </block>
    </view>

    <view class='onehandle5'>
      <block wx:for="{{3}}" wx:for-index="k" wx:for-item="item_k" wx:key="key">
        <view class="useage2">{{weatherData.data[item_k].tem2}}~{{weatherData.data[item_k].tem1}}</view>
      </block>
    </view>

    <view class='onehandle5'>
      <block wx:for="{{3}}" wx:for-index="k" wx:for-item="item_k" wx:key="key">
        <view class="useage2">{{weatherData.data[item_k].win[0]}}</view>
      </block>
    </view>

    <view class='onehandle5'>
      <block wx:for="{{3}}" wx:for-index="k" wx:for-item="item_k" wx:key="key">
        <view class="useage2">风速{{weatherData.data[item_k].win_speed}}</view>
      </block>
    </view>

wxss代码

.onehandle5 {
  display: flex;
   justify-content: center;
}
.useage2 {
  width: 30%;
  margin: 6rpx 0 6rpx 0;
  height: 107rpx;
  text-align: center;
  border-radius: 15rpx;
  font-size: 30rpx;
}
.useage2 image{
  width:64rpx;
  height: 64rpx;
}

 

posted @ 2019-06-24 10:12  wys`  阅读(1007)  评论(0编辑  收藏  举报