实现1:数字直接累加增加效果
this.numberAnimate(100.34);
numberAnimate(num) {
let n1 = new NumberAnimate({
from: num ? num : 0.00,//开始时的数字
speed: 1000,// 总时间
refreshTime: 100,// 刷新一次的时间
decimals: 2,//小数点后的位数
onUpdate: () => {//更新回调函数
this.setData({
[`communityInfo.user.balanceYC`]: n1.tempValue
});
},
onComplete: () => {//完成回调函数
}
});
},
实现2:类似支付宝的翻转动效(小程序端)
我上传资源了哦 可以直接下载查看
wxAnimateNumber-master