小程序多个条件判断

357 阅读1分钟
<view wx:for="{{myattacheArr}}" wx:key="{{id}}" wx:for-item="AttacheItem" class='call-attache'
 
wx:if="{{AttacheItem.personnelType[0]==0 && RoleArr[AttacheItem.roleType].label !='渠道经理'&& appBindPhone==1}}" >

<view class='call-him' data-number='{{AttacheItem.phone}}' bindtap='callServeice' >联系他</view>
 
</view>
 
 
<view wx:for="{{myattacheArr}}" wx:key="{{id}}" wx:for-item="AttacheItem" class='call-attache'
 
wx:if="{{RoleArr[AttacheItem.roleType].label =='渠道经理'&& appBindPhone==0}}" >
 
<view class='call-him' data-number='{{AttacheItem.phone}}' bindtap='callServeice' >联系他</view>
 
</view>

从上面的代码可以看出来,小程序的if判断也可以支持 ‘与或非’ 的拼接判断 这样就可以多层次进行小程序的判断了,真是美滋滋