补充 又测试了一下 新照片有效 老照片无效
wx.chooseImage调用无效?真机iphone6sp远程调试,能打开相册,选取图片后无反应,成功和失败的回调函数都有日志 但是都没打印出来。确认过微信有图片读取和写入权限。开发者工具能正常使用。 upImage: function () { const that = this wx.chooseImage({ count: 1, // 默认9 sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], // 可以指定来源是相册还是相机,默认二者都有 success: function (res) { console.log(res) // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 const tempFilePaths = res.tempFilePaths; that.setData({ img: tempFilePaths[0] }) // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 var nowTime = util.formatTime(new Date()); //支持多图上传 for (var i = 0; i < res.tempFilePaths.length; i++) { //显示消息提示框 wx.showLoading({ title: '上传中' + (i + 1) + '/' + res.tempFilePaths.length, mask: true }) //上传图片 //你的域名下的/img文件下的/当前年月日文件下的/图片.png //图片路径可自行修改 uploadImage(res.tempFilePaths[i], 'img/' + nowTime + '/', function (result) { that.setData({ "taskitme.wepic": result }) wx.hideLoading(); console.log(that.data.taskitme) }, function (result) { wx.hideLoading() console.log(result) } ) } },fail(res) { console.log(res) } }) },
2020-02-19