wx.downloadFile({
url: filePath, //文件路径
header: {},
success: function (res) {
console.log(res)
var filePath = res.tempFilePath;
console.log(filePath);
wx.openDocument({
filePath: filePath,
fileType: type, //文件类型
success: function (res) {
console.log('打开文档成功')
},
fail: function (res) {
console.log(res);
},
complete: function (res) {
console.log(res);
}
})
},
fail: function (res) {
console.log('文件下载失败');
},
complete: function (res) { },
})