wangxy 3 天之前
父节点
当前提交
059874113a
共有 1 个文件被更改,包括 21 次插入14 次删除
  1. 21 14
      pages/my/sxtkPage.vue

+ 21 - 14
pages/my/sxtkPage.vue

@@ -39,6 +39,7 @@
 		toast,
 		toast,
 		getUserIdentity
 		getUserIdentity
 	} from "@/utils/common";
 	} from "@/utils/common";
+	import * as httpApi from "@/api/pdf.js"
 	import {
 	import {
 		ref
 		ref
 	} from "vue";
 	} from "vue";
@@ -61,20 +62,26 @@
 	}
 	}
 
 
 	function jcConfirm() {
 	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({
 		/* uni.navigateTo({
 			url: '/pages/pdfPage/pdfPage?banben=' + banbenName.value + '&nianji=' + currentNianjiName.value
 			url: '/pages/pdfPage/pdfPage?banben=' + banbenName.value + '&nianji=' + currentNianjiName.value
 		}); */
 		}); */