wx:if

<!--pages/index39/index39.wxml-->
<page>
<view class='box'>

<block wx:for="{{box}}" wx:for-index="box_map">
<view class='nr'>

<view class='left'>
<image src='{{item.src}}'></image>
</view>

<view class='xianmian' wx:if="{{box_map == 0}}">
<text>限免</text>
</view>

<view class='right'>
<text class='text1'>{{item.text1}}</text>
<text class='text2'>{{item.text2}}</text>
</view>

</view>
</block>
</view>

</page>
/* pages/index39/index39.wxss */

page {
width: 750rpx;
background: #fff;
}

page .box .nr {
width: 750rpx;
height: 170rpx;
justify-content: space-between;
display: flex;
flex-direction: row;
}

page .box .nr .left {
width: 90rpx;
height: 90rpx;
background: rgba(66, 198, 171, 1);
border-radius: 8rpx;
margin: 40rpx 30rpx;
}

page .box .nr .left image {
width: 50rpx;
height: 50rpx;
display: block;
margin: 20rpx auto;
}

page .box .nr .right {
width: 580rpx;
border-bottom: 1px solid #ddd;
margin-top: 40rpx;
}

page .box .nr:last-child {
padding-bottom: 100rpx;
}

page .box .nr .right .text1 {
display: block;
height: 30rpx;
font-size: 30rpx;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(51, 51, 51, 1);
line-height: 30rpx;
}

page .box .nr .right .text2 {
display: block;
height: 25rpx;
font-size: 24rpx;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(153, 153, 153, 1);
line-height: 25rpx;
margin-top: 30rpx;
}

page .box .nr {
position: relative;
}

page .box .nr .xianmian {
position: absolute;
top: 30rpx;
right: 30rpx;
width: 120rpx;
height: 50rpx;
border: 1rpx solid rgba(27, 188, 155, 1);
border-radius: 8rpx;
font-size: 24rpx;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(27, 188, 155, 1);
line-height: 50rpx;
text-align: center;
}
posted @ 2018-09-01 15:22  小小小小小前端  阅读(190)  评论(0编辑  收藏  举报