小程序多个条件判断

   小程序的多个条件判断:上代码

  < 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-type'>{{RoleArr[AttacheItem.roleType].label}} </ view >
< view class= 'call-name'>{{AttacheItem.userName}} </ view >
< 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-type'>{{RoleArr[AttacheItem.roleType].label}} </ view >
< view class= 'call-name'>{{AttacheItem.userName}} </ view >
< view class= 'call-him' data-number= '{{AttacheItem.phone}}' bindtap= 'callServeice' >联系他 </ view >
</ view >
    
   从上面的代码可以看出来,小程序的if判断也可以支持 ‘与或非’ 的拼接判断 这样就可以多层次进行小程序的判断了,真是美滋滋

猜你喜欢

转载自blog.csdn.net/caoyan0829/article/details/79883512