<view class="info-phone">{{fn.get(phone)}}</view>
<wxs module="fn">
module.exports = {
get: function (phone) {
return phone.slice(0, 3) + '****' + phone.slice(-4)
}
}
</wxs>
<!-- 租房/买房 -->
<van-cell required title="{{from=='find'?'租房/买房':'出租/卖房'}}" is-link
value="{{getRentOrSell.get(dataList.businessType,from)}}"
value-class="{{getRentOrSell.get(dataList.businessType,from)=='请选择'?'no-value':''}}"
bind:click="choseRentOrSell" />
<wxs module="getRentOrSell">
module.exports = {
get: function (value, from) {
if (value) {
if (from == 'find') {
return value == 3 ? '我要租房' : '我要买房'
}
if (from == 'entrust') {
return value == 1 ? '我要出租' : '我要卖房'
}
} else {
return '请选择'
}
}
}
</wxs>
小程序使用wxs语法在花括号里执行略微复杂的语句
最新推荐文章于 2023-02-25 11:29:09 发布