小程序
小游戏
企业微信
微信支付
扫描小程序码分享
wx.downloadFile下载的文件保存到微信聊天记录,选择保存到企业微信,显示0K?怎么解决,直接保存到微信聊天记录又可以,但是保存到企业微信会显示0K
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
本回答由AI生成,可能已过期、失效或不适用于当前情形,请谨慎参考
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
method: 'POST',
data
})
.then((response) => {
uni.hideLoading();
if(response.data.code == 0){
that.orderData.pdfurl = response.data.data.path
that.orderData.pdfname = response.data.data.name
console.log(response.data.data.path)
that.showpdfurl = true
uni.downloadFile({
url: response.data.data.path, // PDF文件的URL
success: function (res) {
if (res.statusCode === 200) {
that.show = false
if (process.env.UNI_PLATFORM === 'h5') {
// 在 H5 平台的代码
uni.showToast({
title: '下载成功',
icon: 'none',
duration: 2000
});
window.open(res.tempFilePath);
}else{
uni.shareFileMessage({
filePath: res.tempFilePath,
fileName: response.data.data.name,
success: () => {
console.log(err, '转发文件成功');
},
fail: (err) => {
console.log(err, '转发文件失败');
}
});
}
} else {
console.error('PDF文件下载失败');
uni.showToast({
title: '下载失败',
icon: 'none',
duration: 2000
});
}
},
fail: function (err) {
console.error('下载失败:' + JSON.stringify(err));
uni.showToast({
title: '下载失败',
icon: 'none',
duration: 2000
});
}
});
}else{
uni.showToast({
title: response.data.msg,
icon: 'none',
duration: 2000
});
}
})