Hbuilderx+vue2+微信小程序 预览pdf

javascript 复制代码
gotoPDF(pdfName) {
	uni.showLoading({
		title: 'loading'
			});
			wx.downloadFile({
				url: `http://211.153.55.36:4426/${pdfName}.pdf`,   // 服务器上的pdf文件地址
				success: function(res) {
					const filePath = res.tempFilePath
					wx.openDocument({
						filePath: filePath,
						fileType: 'pdf',
						showMenu: true,
						success: function(res) {
							uni.hideLoading()
							console.log('打开文档成功')
						},
						fail: function(err) {
							uni.hideLoading()
							console.log('fail:' + JSON.stringify(err));
						},
					})
				}
			})				
}
相关推荐
我是伪码农1 分钟前
小程序100-125
开发语言·小程序·php
开开心心就好1 小时前
用户推荐的文件解锁与强制操作工具
安全·智能手机·pdf·scala·音视频·symfony·1024程序员节
shuaiqinke17 小时前
分享噪音测试分贝仪 精准测噪 数据直观超实用
pdf
NiceCloud喜云21 小时前
Claude API PDF 文档问答实战:从原生解析到分页引用的完整方案
java·服务器·前端·网络·数据库·人工智能·pdf
咖啡八杯1 天前
微信小程序人脸认证1.0迁移2.0
后端·微信小程序
xshirleyl1 天前
微信小程序开发week8-慕尚花坊项目
微信小程序·小程序
admin and root1 天前
Claude+Trae大模型 配置Chrome MCP联动Yakit自动化渗透测试
微信小程序·渗透测试·自动化·攻防演练·ai安全·claude code·ai自动化渗透测试
code_li2 天前
小程序上线需要的资质证书汇总
小程序·上线·发布·资质
hnxaoli2 天前
统信小程序(十三)循环键鼠操作程序
python·小程序
i查拉图斯特拉如是2 天前
使用workbuddy 30分钟搭建微信小程序
微信小程序·小程序