需要做一下关于简历上传并预览简历的功能。简历的上传,我用的是web-view。预览功能使用的是wx.openDocument。但是使用这个API,必须先使用wx.downloadFile进行下载,获取到临时目录,代码如下:
//下载简历
wx.downloadFile({
url: "https://test/test.pdf", //仅为测试接口,并非真实的
success: function (res) {
var filePath = res.tempFilePath
console.log(filePath)
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log("打开文档成功")
console.log(res);
},
fail: