逐福科技
177-371-24501(同微信)

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

2022-04-21 管理员

新开页面打开文档,支持格式: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('打开文档成功')
      }
    })
  }
})
上一篇:微信小程序wx.seekBackgroundAudio控制音乐播放进度
下一篇:小程序开发wx.removeSavedFile删除本地存储的文件
相关资讯 Releva ntnews
解决方案 Solutions
相关热点 Hot spot
郑州快速建站:网站的站内优化怎么做
  1. 我们的优势
  2. 我们的实力
  3. 选择我们的理由
咨询电话(微信同号)

177-371-24501(同微信)

豫ICP备17049932号

Copyright © 2017-2022 版权所有 追风建站 Rights Reserved 技术支持:酷微科技

电话咨询 在线咨询 服务项目 SEO优化