0
点赞
收藏
分享

微信扫一扫

6、NoSQL的四大分类

yongxinz 2023-08-30 阅读 10
<button data-src="地址" bindtap="previewPDF" class="record-style">pdf名称</button>
.record-style{ margin: 0; margin-top: 15rpx; padding: 0; text-align: left; background: #f2f2f2; font-size: 26rpx; color: #169bd5;}
.record-style::after{ border: 0}
  //查看pdf
  previewPDF(e){
    wx.downloadFile({
      url: e.currentTarget.dataset.src,
      success: function (res) {
        var filePath = res.tempFilePath
        wx.openDocument({
          fileType: 'pdf', // 需要写上文件类型才能预览,不让回找系统应用打开,体验不好
          filePath: filePath,
          success: function (res) {
            console.log('打开文档成功!')
          }
        })
      }
    })
  },
举报

相关推荐

0 条评论