onProgressUpdate 获取不了进度 可以下载
发布于 4 年前 作者 ghao 14202 次浏览 来自 官方Issues
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo

const  downloadTask= wx.downloadFile({

url: url,

success: function (res) {

wx.hideLoading();

console.log(res);

wx.saveVideoToPhotosAlbum({

filePath: res.tempFilePath,

success: function (res) {

wx.showModal({

title: ‘下载成功’,

content: ‘视频已保存至您的手机’,

})

}

})

}

});

downloadTask.onProgressUpdate((res) => {

if (res.progress === 100) {

this.setData({

progress: ‘’

});

} else {

this.setData({

progress: res.progress + ‘M’

});

}

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部