html52.com
我爱小程序-开发者交流社区

安卓调openDocument报document viewer already starting?

       })
              }
            })
          }
      }
  })
  }
安卓某款手机,vivo x23执行下边这个代码,报上图这样的错误?

安卓某款手机,vivo x23执行下边这个代码,报上图这样的错误?

 openFile = (url:string, name:string) => {
    const manage = Taro.getFileSystemManager()
    Taro.downloadFile({
      url, // 可以是后台返回的地址。这里写的是死的
      success: function (res{
          let savePath = Taro.env.USER_DATA_PATH + '/' + name
          if (res.statusCode == 200) {
            manage.saveFile({
              tempFilePath: res.tempFilePath,
              filePath: savePath,
              success:function(res2){
                console.log('savedFilePath = ', (res2 as any).savedFilePath)
                Taro.openDocument({
                  filePath: (res2 as any).savedFilePath,
                  success: function (res3{
                      console.log('打开文档成功', res3)
                      Taro.hideLoading()
                  },
                  fail: (e) => {
                      console.log(e);
                      Taro.hideLoading()
                  }
              })
              }
            })
          }
      }
  })
  }

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付