wangxy 2 days ago
parent
commit
6864462f4e
1 changed files with 15 additions and 2 deletions
  1. 15 2
      pages/pdfPage/pdfPage.vue

+ 15 - 2
pages/pdfPage/pdfPage.vue

@@ -31,11 +31,24 @@
 	}
 
   function handleDownload() {
-    ssRef.value.toDownload({
+    uni.downloadFile({
+      url: httpUrl.value,
+      success: function (res) {
+        var filePath = res.tempFilePath;
+        uni.openDocument({
+          filePath: filePath,
+          showMenu: true,
+          success: function (res) {
+            console.log('打开文档成功');
+          }
+        });
+      }
+    });
+    /*ssRef.value.toDownload({
       type:2,
       src: httpUrl.value,
 
-    })
+    })*/
   }
 
 	function getPostMessage() {