//生成随机数randomNumBoth(Min, Max) { var Range = Max - Min var Rand = Math.random() var num = Min + Math.round(Rand * Range) //四舍五入 return num }
let that = this;
let datas = [];
for (let i = 0; i < that.merchantList.length; i++) {
let datai = that.randomNumBoth(99,96)
datas.push(datai)
}
console.log(datas)
that.dataArr = datas
<view class="add">{{dataArr[index]}}%的人关注</view>
原文地址:https://www.cnblogs.com/Glant/p/12165814.html
时间: 2024-10-08 13:06:19