- uni.canvasToTempFilePath生成空白图片是为什么?
const saveAndShareImage = () => { const query = uni.createSelectorQuery(); console.log("query",query); query.select('.snap-shot').boundingClientRect((data) => { console.log("data", data); console.log("draw"); uni.canvasToTempFilePath({ x: data.left, y: data.top, width: data.width, height: data.height, destWidth: data.width * 2, destHeight: data.height * 2, canvasId: 'myCanvas', success: (res) => { console.log("res1", res); tempFilePath.value = res.tempFilePath; console.log("tempFilePath", tempFilePath); uni.setStorageSync('filePath', tempFilePath); uni.showActionSheet({ itemList: ['预览图片', '保存图片'], success: (res) => { console.log("res2", res); if (res.tapIndex === 0) { uni.previewImage({ urls: [tempFilePath.value], }); } else if (res.tapIndex === 1) { uni.saveImageToPhotosAlbum({ filePath: tempFilePath.value, success: () => { uni.showToast({ title: '保存成功', }) }, fail: () => { uni.showToast({ title: '保存失败', }) }, }) } }, fail: (fail) => { console.log("fail", fail); }, }) }, fail: (err) => { console.error('图片生成失败', err) } }) }).exec(); }
10-14 - 微信小程序可以使用高德地图的地图小程序OPENAPI中创建地图的api来实现自定义步行路线的规划嘛?
[图片]
09-13