- 小程序画布 在iphone15promax上不能画出连续的线
https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.html [图片] iphone15promax不能画出连续的线,只能一段一段的。 [图片]iphone13 可以画出连续的线。 代码如下: //wxml <canvas canvas-id="signCanvas" class="canvasStyle" bindtouchstart="onTouchStart" bindtouchmove="onTouchMove" bindtouchend="onTouchEnd"></canvas> //script Page({ startX: 0, // Starting X coordinate startY: 0, // Starting Y coordinate isDrawing: false, // Flag to check if drawing is happening ctx: null, // Canvas context onLoad: function() { this.ctx = wx.createCanvasContext('signCanvas', this); }, onTouchStart: function(e) { this.isDrawing = true; this.startX = e.touches[0].x; this.startY = e.touches[0].y; }, onTouchMove: function(e) { if (!this.isDrawing) return; let x = e.touches[0].x; let y = e.touches[0].y; this.ctx.moveTo(this.startX, this.startY); this.ctx.lineTo(x, y); this.ctx.stroke(); this.startX = x; this.startY = y; this.ctx.draw(true); // Add true to keep drawing on the same canvas without clearing previous content }, onTouchEnd: function(e) { this.isDrawing = false; }, clearCanvas: function() { this.ctx.clearRect(0, 0, 300, 200); this.ctx.draw(); }, saveCanvas: function() { wx.canvasToTempFilePath({ canvasId: 'signCanvas', success: function(res) { // res.tempFilePath is the temporary file path of the canvas image console.log(res.tempFilePath); // You can save this path or upload the image as needed } }, this); } }); //css .canvasStyle { border: 1px solid #000; /* Basic border for visibility */ width: 300px; /* Width of the canvas */ height: 200px; /* Height of the canvas */ }
03-14 - 小程序调用微信OCR 通用识别 IOS真机报错103 ?(已解决,更新微信到最新版本)
已解决:微信8.0.22导致的。更新到最新版本8.0.23就可以了。 通用识别用了快1年了,今天用户反应识别无响应。 身份证识别没问题,但通用识别会报错。 windows开发者工具通用识别没问题,但是IOS真机通用识别报错。 [图片] 代码: wx.chooseImage({ async success (res) { const tempFilePaths = res.tempFilePaths let ocr_type=1; if(_self.SpecialDrug.cardtype===2)ocr_type=8 let img_url = new wx.serviceMarket.CDN({ type: 'filePath', filePath: res.tempFilePaths[0], }) console.log(ocr_type, img_url) try { wx.showLoading({ title: '加载中', mask: true }) const invokeRes = await wx.serviceMarket.invokeService({ service: 'wx79ac3de8be320b71', api: 'OcrAllInOne', data: { // 用 CDN 方法标记要上传并转换成 HTTP URL 的文件 data_type: 3, img_url, ocr_type }, }) 报错: sale.vue:1365 invokeService fail {message: "invokeService:fail 103 . requestID MLxWDRj8_tTcZ1yLJDZOqQkwzirqocjxOR38_R527Fb8wLO8O7h8lCXvu-U9doTCBVw, error message unknown (callid 0.3930072186727026_1653460060436)", errCode: 103, errMsg: "invokeService:fail 103 . requestID MLxWDRj8_tTcZ1yLJDZOqQkwzirqocjxOR38_R527Fb8wLO8O7h8lCXvu-U9doTCBVw, error message unknown (callid 0.3930072186727026_1653460060436)", requestID: "MLxWDRj8_tTcZ1yLJDZOqQkwzirqocjxOR38_R527Fb8wLO8O7h8lCXvu-U9doTCBVw", line: 2, …}
2022-05-25 - 购买OCR, 提示“系统异常,请稍后再试”
[图片]快2个小时了,一直无法购买
2021-02-04