- FileSystemManager.saveFile在ios报错?
使用FileSystemManager的writeFile后调用saveFile接口后在ios上报错,提示saveFile fail it is not a tempFilePath,在安卓上是没有问题的 基础调试库版本:2.24.1 代码: const fileName = `${formatDate(new Date(),'yyyymmdd')}.xlsx` const path = `${wx.env.USER_DATA_PATH}/${fileName}` console.log('path',path) fs.writeFile({ filePath: path, data: res, success(res) { console.log('writeFile success',res) fs.saveFile({ tempFilePath: path, filePath: path, success(res) { console.log('saveFile success',res,path) _this.tui.toast("保存成功") setTimeout(() => { uni.navigateTo({ url: `./preview?path=${path}&fileName=${fileName}` }) },1000) }, fail(res) { console.log('fail',res) } }); }, fail(err) { console.log('writeFile fail',err) } }) ios上报错截图: [图片]
2022-06-15 - canvasToTempFilePath无法显示照片,是否是调试基础库的问题?
在使用camera拍照后调用draw和canvasToTempFilePath后回调里面可以看到有照片,但是显示在页面上的时候image为空白 开发者工具使用camera拍照后拿到的照片无法显示,真机可以显示 调试基础库为2.12.2 代码片段如下: _this.ctx.takePhoto({ quality: 'high', success: (res) => { let tempImagePath = res.tempImagePath; let cas = wx.createCanvasContext('canvas-' + _this.data.type,this); let picWidth = _this.data.width - 2 * _this.data.gap[_this.data.type], picHeight = _this.data.width - 2 * _this.data.gap[_this.data.type], x, y; if (_this.data.type != 'peo') { x = _this.data.gap[_this.data.type] * 0.625; y = _this.data.gap[_this.data.type] * 0.625; picWidth = picWidth * 1.59 * 0.625; picHeight = picHeight * 0.625; cas.scale(0.625, 0.625); cas.translate(0, _this.data.width); cas.rotate((270 * Math.PI) / 180); cas.drawImage(tempImagePath,0,0,_this.data.width,_this.data.height); } else { x = 0; y = 70; cas.drawImage( tempImagePath, 0, 0, _this.data.width, _this.data.height ); } cas.draw(false, () => { console.log('draw done') setTimeout(() => { wx.canvasToTempFilePath({ canvasId: 'canvas-' + _this.data.type, x: x, y: y, width: picWidth, height: picHeight, destWidth: picWidth * 3, destHeight: picHeight * 3, success: (result) => { console.log('toTempFile done',result) let tempPath = result.tempFilePath, img = 'imgList.' + _this.data.type; if (_this.data.type != 'peo') { _this.ocrIden(_this.data.type, tempPath); } else { _this.setData({ showPoup: false, [img]: tempPath, }); wx.hideLoading({}); } if ( _this.data.imgList.peo && _this.data.imgList.idcardFront && _this.data.imgList.idcardBack ) { _this.setData({ disabled: false, }); } }, fail: (res) => { console.log('fail'); }, }) },1000) } ); }, fail: (err) => { console.log(err); }, });
2020-09-14 - 模板消息能否发给别人让别人接受
请问在小程序中用户1点击按钮,然后用户2点击按钮将消息模板发给用户1能否做到,我在自己做的项目中需要用到,但是在测试中只能给自己发送消息模板,给别人没办法发送消息模板
2017-02-24