需求:打开doc、ppt、pdf等文档
需要先将文章下载到本地-wx.downloadFile,之后再打开-wx.openDocument

wx.downloadFile({
url: 'http://video.317hu.com/917b3140-3da6-47d5-911c-a15462fcdeb2.pdf',
success: function (res) {
var filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
}
})
网友评论