小程序IOS下载文件

 wx.downloadFile({
      url: 'https://xxxxxx/api/task/contract/dl/',
      success (res) {
        const filePath = res.tempFilePath;
          success: (res) => {
            wx.openDocument({
              filePath: filePath,
              fileType:'pdf',
              showMenu:true,
              success: function (res) {
              console.log('打开文档成功')
              }
            })
          },
      }
    })

 

posted @ 2022-02-11 11:33  MiniDuck  阅读(270)  评论(0编辑  收藏  举报