代码片段:wechatide://minicode/xBrX0lmJ7D2G
percent="{{progressPercent}}" ,progressPercent 在苹果手机上不显示进度条进度。,只有白色背景,安卓正常。
只有在percent = "20" 一个实际数字,苹果手机上才显示进度条的进度。
图片对比:
苹果手机如下:
安卓手机(按需求正常显示):
以下是源码:
| |
//获取进度条加载进度
getProgress:function(){
//页面加载进度条
let that = this;
progress = setInterval(function () {
let showPage = that.data.showPage
let progressPercent = that.data.progressPercent;
if (showPage){
progressPercent = 100
}else{
progressPercent++;
}
//当进度条为100时清除定时任务
if (progressPercent >= 100) {
clearInterval(progress);
}
//并且把当前的进度值设置到progress中
that.setData({
progressPercent: progressPercent
})
});
},
//隐藏进度条动画
progressAnimation:function(){
let that = this;
var animation = wx.createAnimation({
duration: 500,
timingFunction: 'ease',
})
this.animation = animation
animation.opacity(0).height(0).step()
this.setData({
progressAnimation: animation.export()
})
setTimeout(function(){
that.setData({
progressHeight: 0
})
},1000)
|
各路大神帮忙给看看如何解决这一问题,感激!!

getProgress里setInterval函数delay时间写个非0的值就可以了
多谢,昨天试了,真的管用好使!!
代码片段:wechatide://minicode/xBrX0lmJ7D2G
你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
代码片段:wechatide://minicode/xBrX0lmJ7D2G