diff --git a/pages.json b/pages.json index dc8398d..7e0a6e2 100644 --- a/pages.json +++ b/pages.json @@ -509,6 +509,15 @@ } } + ,{ + "path" : "pages/hcWebView/hcWebView", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + } ], "tabBar": { "color": "#272636", diff --git a/pages/hcWebView/hcWebView.vue b/pages/hcWebView/hcWebView.vue new file mode 100644 index 0000000..ba4b5c2 --- /dev/null +++ b/pages/hcWebView/hcWebView.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/pages/mall/mall.vue b/pages/mall/mall.vue index a13c56a..e22e688 100644 --- a/pages/mall/mall.vue +++ b/pages/mall/mall.vue @@ -1,6 +1,6 @@ @@ -12,36 +12,41 @@ url: '' } }, + mounted() { + // #ifdef H5 + window.addEventListener("message",this.reciveMessage); + // #endif + }, onLoad() { this.url = conf.mallUrl; }, - onReady() { - var that = this; - var height = 0; //定义动态的高度变量,如高度为定值,可以直接写 - var statusBarHeight = 0; - uni.getSystemInfo({ - //成功获取的回调函数,返回值为系统信息 - success: (sysinfo) => { - height = sysinfo.windowHeight - that.$navHeight - sysinfo.statusBarHeight; //自行修改,自己需要的高度 - statusBarHeight = sysinfo.statusBarHeight; - }, - complete: () => {} - }); + // onReady() { + // var that = this; + // var height = 0; //定义动态的高度变量,如高度为定值,可以直接写 + // var statusBarHeight = 0; + // uni.getSystemInfo({ + // //成功获取的回调函数,返回值为系统信息 + // success: (sysinfo) => { + // height = sysinfo.windowHeight - that.$navHeight - sysinfo.statusBarHeight; //自行修改,自己需要的高度 + // statusBarHeight = sysinfo.statusBarHeight; + // }, + // complete: () => {} + // }); - var pages = getCurrentPages(); - var page = pages[pages.length - 1]; + // var pages = getCurrentPages(); + // var page = pages[pages.length - 1]; - var currentWebview = page.$getAppWebview(); //页面栈最顶层就是当前webview + // var currentWebview = page.$getAppWebview(); //页面栈最顶层就是当前webview - setTimeout(function() { - var wv = currentWebview.children()[0]; - wv.setStyle({ //设置web-view距离顶部的距离以及自己的高度,单位为px - top: that.$navHeight + statusBarHeight, - height: height - }) - }, 500); //如页面初始化调用需要写延迟 - }, + // setTimeout(function() { + // var wv = currentWebview.children()[0]; + // wv.setStyle({ //设置web-view距离顶部的距离以及自己的高度,单位为px + // top: that.$navHeight + statusBarHeight, + // height: height + // }) + // }, 500); //如页面初始化调用需要写延迟 + // }, methods: { reciveMessage: function(event) { console.log('商城回传的参数', event);