l***@huiqutuan.net
l***@huiqutuan.net
  • 发布:2025-01-21 18:26
  • 更新:2025-01-21 18:26
  • 阅读:117

uni-app app复制文本后生成canvas保存图片分享到微信剪切板内容没有了 怎么解决

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 14.6.1

HBuilderX类型: 正式

HBuilderX版本号: 4.36

手机系统: iOS

手机系统版本号: iOS 18

手机厂商: 苹果

手机机型: 12 por

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

this.$refs.painter.render(this.poster).then(() => {
uni.setClipboardData({
data: 123,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'none'
})
this.$refs.painter.canvasToTempFilePath({
fileType: "png",
// 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
pathType: 'url',
quality: 1,
success: (res) => {
if (type == 'wx') {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 2,
imageUrl: res.tempFilePath,
success: function (res) {
console.log("success:" + JSON.stringify(res));
}
})
} else {
uni.share({
provider: "weixin",
scene: "WXSceneTimeline",
type: 2,
imageUrl: res.tempFilePath,
success: function (res) {
console.log("success:" + JSON.stringify(res));
}
})
}
}
})
}
})
})

操作步骤:

uni-app app复制文本后生成canvas图片分享到微信剪切板内容没有了

预期结果:

uni-app app复制文本后生成canvas图片分享到微信剪切板有内容

实际结果:

uni-app app复制文本后生成canvas图片分享到微信剪切板内容没有了

bug描述:

uni-app app复制文本后生成canvas图片分享到微信剪切板内容没有了 怎么解决

2025-01-21 18:26 负责人:无 分享
已邀请:

要回复问题请先登录注册