chenxiong 3 år sedan
förälder
incheckning
1e76027ab0
1 ändrade filer med 20 tillägg och 0 borttagningar
  1. 20 0
      pages3/polyv/detail.vue

+ 20 - 0
pages3/polyv/detail.vue

@@ -1236,6 +1236,26 @@ export default {
 		},
 		change(index) {
 			this.current = index;
+		},
+		openDocument() {
+			console.log(111)
+			uni.downloadFile({
+			  url: 'https://gw.alipayobjects.com/os/bmw-prod/c134022a-1088-47e2-bb76-a33ec0519101.pdf?spm=a2c4g.11186623.0.0.cf863d1fUcFiPN&file=c134022a-1088-47e2-bb76-a33ec0519101.pdf',
+			  success: function (res) {
+				  console.log(999)
+			    var filePath = res.tempFilePath;
+			    uni.openDocument({
+			      filePath: filePath,
+			      showMenu: true,
+			      success: function (res) {
+			        console.log(res,'打开文档成功');
+			      },
+				  fail:function(err) {
+					  console.log(err)
+				  }
+			    });
+			  }
+			});
 		}
 	}
 };