Skip to content

Instantly share code, notes, and snippets.

@xuyazhong
Created March 7, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuyazhong/f481cb9cf3ec66b672716e802b8280d8 to your computer and use it in GitHub Desktop.
Save xuyazhong/f481cb9cf3ec66b672716e802b8280d8 to your computer and use it in GitHub Desktop.
wx.downloadFile({
url: path,
success(res) {
const downloadPath = res.tempFilePath
console.log('downloadPath =>', downloadPath)
wx.openDocument({
filePath: downloadPath,
fileType: 'pdf',
success(res) {
console.log('打开文档成功 =>', res)
},
fail (err) {
console.log('打开失败 =>', err)
}
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment