wangxy 2 днів тому
батько
коміт
059874113a
1 змінених файлів з 21 додано та 14 видалено
  1. 21 14
      pages/my/sxtkPage.vue

+ 21 - 14
pages/my/sxtkPage.vue

@@ -39,6 +39,7 @@
 		toast,
 		getUserIdentity
 	} from "@/utils/common";
+	import * as httpApi from "@/api/pdf.js"
 	import {
 		ref
 	} from "vue";
@@ -61,20 +62,26 @@
 	}
 
 	function jcConfirm() {
-		uni.downloadFile({
-		  url: httpUrl.value,
-		  success: function (res) {
-		    var filePath = res.tempFilePath;
-		    uni.openDocument({
-		      filePath: filePath,
-		      showMenu: true,
-		      success: function (res) {
-		        console.log('打开文档成功');
-				jiaocaiRef.value.handleClose();
-		      }
-		    });
-		  }
-		});
+		httpApi.getPDFUrl({
+		  banben:banbenName.value,
+		  nianji:currentNianjiName.value,
+		}).then(res1 => {
+			uni.downloadFile({
+			  url: res1.data,
+			  success: function (res) {
+			    var filePath = res.tempFilePath;
+			    uni.openDocument({
+			      filePath: filePath,
+			      showMenu: true,
+			      success: function (res) {
+			        console.log('打开文档成功');
+					jiaocaiRef.value.handleClose();
+			      }
+			    });
+			  }
+			});
+		})
+	
 		/* uni.navigateTo({
 			url: '/pages/pdfPage/pdfPage?banben=' + banbenName.value + '&nianji=' + currentNianjiName.value
 		}); */