buttonclass’skblue_bg’data-urlhttps://www.xingtu-group.cn/sjg_xieyi/8_Prove.pdf"data-type"pdf"catchtap’downloadFile’下载</button
downloadFilefunction
consolelog);
let type ecurrentTargetdatasettype
let url ecurrentTargetdataseturl
// switch (type) {
// case “pdf”:
// url += ‘pdf’;
// break;
// case “word”:
// url += ‘docx’;
// break;
// case “excel”:
// url += ‘xlsx’;
// break;
// default:
// url += ‘pptx’;
// break;
// }
wxdownloadFile({
url url
successfunctionres
consolelogres
varPath restempFilePath //返回的文件临时地址,用于后面打开本地预览所用
wxopenDocument({
filePathPath
successfunctionres
consolelog’打开文档成功’
})
},
failfunctionres
consolelogres
})
},