收藏
回答

调用wx.openDocument来打开.xlsx的excel文件不生效?

这两天在小程序上开了个附件下载的功能,开发过程中调试、二维码预览、体验版附件下载都是成功的,上线之后用PC打开小程序下载附件却只会跳出一个“打开文档”,看控制台打印的返回结果也没有报错,这是什么情况?附上代码:

wx.downloadFile({
                        url: url,
                        filePath: newPath,
                        successfunction (res{
                            const filePath = res.tempFilePath;
                            wx.openDocument({
                                filePath: newPath,
                                showMenutrue,
                                fileType'xlsx',
                                successfunction (res{
                                    console.log(res)
                                }
                            })
                        },
                        failfunction (res{
                            wx.showToast({
                                title: res,
                                icon'error',
                                duration2000
                            })
                            wx.hideLoading();
                        },
                        completefunction (res{
                            wx.showToast({
                                title: res,
                                icon'error',
                                duration2000
                            })
                        }
                    })
回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    2022-08-26

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2022-08-26
    有用
    回复
登录 后发表内容