请问解决了吗,我这边也碰到这个问题,好几个用户反馈,选了图片,显示压缩中,请稍后,然后就没有然后了,其中一个手机型号是华为P9
iphone6 系统版本10 ,无法上传图片- 点击上传图片,拍照上传,确认图片后,加载中然后就没有了,没有上传图片 - 应该是打印出返回的data - "pages/upPoto/main" - 提供一个最简复现 Demo data () { return { imgMaxWidth: 1500, imgMaxHeight: 1500 } }, methods: { getSaoyiSao (id) { var taskid = Number(id) var that = this var FSM = wx.getFileSystemManager() wx.chooseImage({ count: 1, // 默认9 sizeType: ['compressed'], // 指定只能为压缩图,首先进行一次默认压缩 sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有 success: function (photo) { wx.getImageInfo({ src: photo.tempFilePaths[0], success: function (res) { var imgHeight = 0 var imgWidth = 0 var containerRatio = that.imgMaxWidth / that.imgMaxHeight var imgRatio = res.width / res.height if (imgRatio > containerRatio) { imgWidth = that.imgMaxWidth imgHeight = that.imgMaxWidth / imgRatio } else if (imgRatio < containerRatio) { imgHeight = that.imgMaxHeight imgWidth = that.imgMaxHeight * imgRatio } that.cWidth = Math.min(imgWidth, res.width) that.cHeight = Math.min(imgHeight, res.height) var ctx = wx.createCanvasContext('canvas') ctx.drawImage(res.path, 0, 0, that.cWidth, that.cHeight) ctx.draw(false, setTimeout(function () { wx.canvasToTempFilePath({ fileType: 'jpg', canvasId: 'canvas', destWidth: that.cWidth, destHeight: that.cHeight, success: function (res) { FSM.readFile({ filePath: res.tempFilePath, encoding: 'base64', success: function (data) { console.log(data) } }) }, fail: function (res) { console.log(res.errMsg) } }) }, 300)) } }) } }) } }
2020-01-07说的好 鼓掌 [图片]
获取小程序码scene参数32位长度太短了getWXACodeUnlimit获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制。 请求地址 [代码]POST https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN[代码]scene参数长度只支持32位太短了。加长点吧。
2018-11-02