<wxs module="indexof">
function checkFunDic(str, type) {
if (str == '' || !str) {
console.log(type + "功能类型暂无,联系后台处理")
return false
}
if (str.indexOf(type) == -1) {
return false
} else {
return true
}
}
module.exports.checkFunDic = checkFunDic;
</wxs>
---------------------------------------
<view class="fontBold fontSize36" style="width: {{indexof.checkFunDic(item.settingId,'2')?'calc(100% - 120px)':'100%'}};float:left">{{item.title}}</view>
<view wx:if="{{indexof.checkFunDic(item.settingId,'2')}}" class="carType fontSize36">