wangxy 1 هفته پیش
والد
کامیت
9f26b31f3d
1فایلهای تغییر یافته به همراه12 افزوده شده و 5 حذف شده
  1. 12 5
      pages/admin/Hetong/Hetong.vue

+ 12 - 5
pages/admin/Hetong/Hetong.vue

@@ -51,14 +51,21 @@
 
 	function goUpPage() {
 		uni.navigateBack()
-	}
 
-	onLoad(() => {
-		init()
+	onLoad(({id}) => {
+		init(id)
 	})
 
-	function init() {
-		httpApi.getHetongLast().then(res => {
+	function init(id) {
+		
+		if (id) {
+			uni.showToast({
+				title: '数据异常,请确认路径是否完整'
+			})
+			return;
+		}
+		
+		httpApi.getHetongLast({id}).then(res => {
 			info.value = res.data;
 			pdfUrl1.value = `/hybrid/html/web/viewer.html?file=${encodeURIComponent(res.data.pdfUrl)}`;
 			// let pdfUrl2 = `https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURIComponent(res.data.pdfUrl)}`