Commit 61d4dfe0 by 展昭

tj

parent cf7f0fa5
Showing with 24 additions and 24 deletions
...@@ -46,20 +46,6 @@ Vue.prototype.setPageNavState = function () { ...@@ -46,20 +46,6 @@ Vue.prototype.setPageNavState = function () {
console.log("setPageNavState来自 ios/android的回传数据: ", response); console.log("setPageNavState来自 ios/android的回传数据: ", response);
} }
); );
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
null,
function (response) {
console.log("main getBarHeight来自 ios/android的回传数据: ", response);
if (response) {
response = JSON.parse(response);
const barHeight = response.statusBarHeight;
console.log('barHeight=', barHeight);
localStorage.setItem('barHeight', barHeight);
}
}
);
}); });
} catch (err) { } catch (err) {
console.log("main setPageNavState is error,err=", err); console.log("main setPageNavState is error,err=", err);
......
...@@ -419,16 +419,31 @@ export default { ...@@ -419,16 +419,31 @@ export default {
} }
}, },
setBarHeight() { setBarHeight() {
const barHeight = localStorage.getItem("barHeight"); window.WebViewJavascriptBridge.callHandler("getBarHeight", null, function(
const conHeight = 46 + barHeight; response
console.log("mixins barHeight=", barHeight); ) {
document console.log("billindex getBarHeight来自 ios/android的回传数据: ", response);
.getElementsByClassName("iosStyle")[0] if (response) {
.setAttribute("style", "padding-top:" + barHeight + "px !important"); response = JSON.parse(response);
const barHeight = response.statusBarHeight;
localStorage.setItem("barHeight", barHeight);
const conHeight = 46 + barHeight;
console.log("billindex barHeight=", barHeight);
document
.getElementsByClassName("iosStyle")[0]
.setAttribute(
"style",
"padding-top:" + barHeight + "px !important"
);
document document
.getElementsByClassName("container")[0] .getElementsByClassName("container")[0]
.setAttribute("style", "padding-top:" + conHeight + "px !important"); .setAttribute(
"style",
"padding-top:" + conHeight + "px !important"
);
}
});
}, },
closeWebView() { closeWebView() {
try { try {
...@@ -453,7 +468,6 @@ export default { ...@@ -453,7 +468,6 @@ export default {
this.globalNavLeftArrowClick(this.navLeftArrowClick); this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.loadPeriodData(); await this.loadPeriodData();
this.payUrl = await this.loadPayUrl(); this.payUrl = await this.loadPayUrl();
console.log("mounted barHeight=", barHeight);
} }
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment