wx.openDocument() API没有反应

发布于 6 年前作者 chaoxue1732 次浏览最后编辑 6 年前来自 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 回复
ming88
ming881 楼4 年前

你好,这种情况可以检查下域名是否已经配置:https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html