<text style="{{item.batStyle}}" class="battery">电量:{{item.battery}}%</text>
success: function(res) { const carList = res.data.list; for (let i = 0; i < carList.length; i++){ if (carList[i].battery < 21){ carList[i].batStyle = "color:red"; } } that.setData({ carList: res.data.list, }) that.setData({ leader: res.data.leader, }) if (res.data.list.length>0){ that.setData({ back:"" }) } }