微信 小程序 官方文档: 小程序 打开pdf 功能
https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.openDocument.html
see_file(e) { //这是打开默认的图纸。就是扫谁的码打开谁的。 wx.downloadFile({ url: baseURL + e.currentTarget.dataset.file, success: function (res) { const filePath = res.tempFilePath wx.openDocument({ filePath: filePath, success: function (res) { console.log('打开pdf图纸成功') } }) } }) }, e.currentTarget.dataset.file, 是pdf的路径。
站长微信:xiaomao0055
站长QQ:14496453