小程序
小游戏
企业微信
微信支付
扫描小程序码分享
windows 10 微信小程序 uploadTask.onProgressUpdate失效
手机端及mac端都是正常的,但是windows下就是不进onProgressUpdate。
麻烦看一下
另外windows小程序目前还有很多兼容问题,不知道官方有没有兼容手册啊。。pc的真机调试也没法打开,样式问题都没法调试。
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
function addMedia(lid, rid, type, image, fnExec = function () { }, moderation = 0) { //send to the server console.log('addmedia' , image) user.getUser(function (userData) { var upload1 = wx.uploadFile({ url: app.globalData.urlApi + '/index.php?option=com_goexpatsapi&object=media&action=add&listing_id=' + lid + '&review_id=' + rid + '&type=' + type + '&code=' + userData.wechatId + '&moderation=' + moderation + '&api=' + app.globalData.appGoexpats[app.globalData.currentIndexApi].api, filePath: image, name: 'file', success: function (res) { console.log('success', res) var data = JSON.parse(res.data) if (data.success == false) { app.modalError(data.message) } console.log('upload1', upload1) fnExec(upload1) } }) }) } function queueAddImage(lid, rid, type, images, i, fnExec = function () { }, moderation = 0) { if (i == 0) { app.loading() } console.log(i, images) if (i < images.length) { addMedia(lid, rid, type, images[i], q => { console.log('q', q) q.onProgressUpdate(res => { app.loading(false) console.log('time', res) if (res.progress == 100) { var j = i + 1 wx.showToast({ title: j + '/' + images.length + ' ' + '100%', icon: 'loading', duration: 5000, mask: true }) queueAddImage(lid, rid, type, images, j, fnExec, moderation) } else { var c = i + 1 wx.showToast({ title: c + '/' + images.length + ' ' + res.progress + '%', icon: 'loading', duration: 5000, mask: true }) } }) }, moderation) } else { setTimeout(() => { wx.hideToast() fnExec() }, 750); } }
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
请具体描述问题出现的流程,并提供微信版本号和能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
function addMedia(lid, rid, type, image, fnExec = function () { }, moderation = 0) { //send to the server console.log('addmedia' , image) user.getUser(function (userData) { var upload1 = wx.uploadFile({ url: app.globalData.urlApi + '/index.php?option=com_goexpatsapi&object=media&action=add&listing_id=' + lid + '&review_id=' + rid + '&type=' + type + '&code=' + userData.wechatId + '&moderation=' + moderation + '&api=' + app.globalData.appGoexpats[app.globalData.currentIndexApi].api, filePath: image, name: 'file', success: function (res) { console.log('success', res) var data = JSON.parse(res.data) if (data.success == false) { app.modalError(data.message) } console.log('upload1', upload1) fnExec(upload1) } }) }) } function queueAddImage(lid, rid, type, images, i, fnExec = function () { }, moderation = 0) { if (i == 0) { app.loading() } console.log(i, images) if (i < images.length) { addMedia(lid, rid, type, images[i], q => { console.log('q', q) q.onProgressUpdate(res => { app.loading(false) console.log('time', res) if (res.progress == 100) { var j = i + 1 wx.showToast({ title: j + '/' + images.length + ' ' + '100%', icon: 'loading', duration: 5000, mask: true }) queueAddImage(lid, rid, type, images, j, fnExec, moderation) } else { var c = i + 1 wx.showToast({ title: c + '/' + images.length + ' ' + res.progress + '%', icon: 'loading', duration: 5000, mask: true }) } }) }, moderation) } else { setTimeout(() => { wx.hideToast() fnExec() }, 750); } }
请具体描述问题出现的流程,并提供微信版本号和能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。