downloadExecl().then(res=>{
const URL = res.data[0];
wx.downloadFile({
header:{
'Content-Type':"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=GBK",
},
url: URL,
success (ress) {
if (ress.statusCode == 200) {
const filePath = ress.tempFilePath;
wx.hideLoading()
wx.openDocument({
filePath: filePath,
fileType: 'xlsx,xls,doc,docx',
showMenu: true,
success: function (response) {
console.log(response, '打开文档成功');
}
});
}
},
fail(error) {
this.$util.Tips({title: '下载失败'})
}
})
})
你好 参考下这个帖子https://developers.weixin.qq.com/community/develop/doc/0008e44007496841ba4722e8651c00?_at=1639129059227