wx.opendocument 程序文件,opendocument怎么打开

发布时间:2023-07-14 00:31:21 作者:netstu86 阅读量:5630

新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx

OBJECT参数说明:

参数 说明 必填 说明 最低版本
filePath String 文件路径,可通过 downFile 获得  
fileType String 文件类型,指定文件类型打开文件,有效值 doc, xls, ppt, pdf, docx, xlsx, pptx 1.4.0
success Function 接口调用成功的回调函数  
fail Function 接口调用失败的回调函数  
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

示例代码

wx.downloadFile({
  url: 'http://example.com/somefile.pdf',
  success: function (res) {
    var filePath = res.tempFilePath
    wx.openDocument({
      filePath: filePath,
      success: function (res) {
        console.log('打开文档成功')
      }
    })
  }
})
***本网站图片,文字之类版权申明,因为网站可以由注册用户自行上传图片或文字,本网站无法鉴别所上传图片或文字的知识版权,如果侵犯,请及时通知我们,本网站将在第一时间及时删除。

我要评论

网友评论


评论时间:2024-04-05 01:00:02

2.网站生成app一键生成器 功能全app开发的团队结构 能全面丰富

回复
秒制作
Catfish(鲶鱼) Blog V 4.7.3