wx.openDocument() API没有反应
发布于 4 年前 作者 chaoxue 1411 次浏览 来自 官方Issues

wx.openDocument()在开发者工具、真机调试、体验版(打开调试)都没有问题,但是在体验版(关闭调试)就没有反应

// 打开顺丰物流价格表
    openShunfengPrice() {
      uni.showLoading({
        mask: true
      })
      uni.downloadFile({
        url: CONSTANT.URL.ASSET + 'pdf/shunfengjiagebiao.pdf',
        success: function(res) {
          let filePath = res.tempFilePath
          console.log(filePath)
          uni.hideLoading()
          uni.openDocument({
            filePath: filePath,
            // fileType: 'pdf',
            success: function(res) {
              // console.log('打开PDF成功')
            }
          })
        },
        fail: function(err) {
          uni.hideLoading()
        }
      })
    },
1 回复
回到顶部