From 0508a6d9df7eaadd9a92bacbcd4e6427ad6b60aa Mon Sep 17 00:00:00 2001 From: ch Date: Thu, 14 Jul 2022 16:56:49 +0800 Subject: [PATCH] =?UTF-8?q?pref:=E5=9B=BA=E5=AE=9A=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/manifest.json | 16 +--------------- src/pages/webView.vue | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index 0c4b672..1e18c2d 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -121,21 +121,7 @@ "base" : "" }, "devServer" : { - "proxy" : { - "/uc/" : { - // "target" : "https://k8s-horse-gateway.mashibing.cn" - "target" : "http://192.168.10.118:8090" - }, - "/mall/" : { - "target" : "http://192.168.10.118:8090" - }, - "/pay/" : { - "target" : "https://k8s-horse-gateway.mashibing.cn" - }, - "/oss/" : { - "target" : "https://k8s-horse-gateway.mashibing.cn" - } - } + "port" : 8080 }, "optimization" : { "treeShaking" : { diff --git a/src/pages/webView.vue b/src/pages/webView.vue index 3402710..cb381d3 100644 --- a/src/pages/webView.vue +++ b/src/pages/webView.vue @@ -17,8 +17,19 @@ export default { } }, onLoad(){ - this.url = decodeURIComponent(this.$Route.query.url) - console.log(); + this.url = decodeURIComponent(this.$Route.query.url); + }, + onReady() { + var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效 + setTimeout(function() { + let wv = currentWebview.children()[0]; + + wv.addEventListener('loaded',function() { + console.log('xxxxx',wv.getURL()) + console.log(wv.getURL()) //获取url + console.log(wv.getTitle()) //获取标题 + }, false); + }, 1000); //如果是页面初始化调用时,需要延时一下 } } \ No newline at end of file