Commit aa9a537b by 展昭

getBarHeight

parent ac466d69
...@@ -6,11 +6,8 @@ ...@@ -6,11 +6,8 @@
i { i {
font-style: normal; font-style: normal;
} }
.iosStyle {
padding-top: 44px;
}
.container { .container {
padding-top: 90px; padding-top: 46px;
} }
/*未扣费*/ /*未扣费*/
.no_bill { .no_bill {
......
@top:44px;
* { * {
padding : 0; padding: 0;
margin : 0; margin: 0;
list-style: none; list-style: none;
} }
...@@ -10,11 +8,9 @@ i { ...@@ -10,11 +8,9 @@ i {
font-style: normal; font-style: normal;
} }
.iosStyle {
padding-top: @top;
}
.container { .container {
padding-top: 46px+@top; padding-top: 46px;
} }
/*未扣费*/ /*未扣费*/
......
...@@ -45,14 +45,11 @@ function initJsBridge(readyCallback) { ...@@ -45,14 +45,11 @@ function initJsBridge(readyCallback) {
// 调用注册方法 原生调用JS // 调用注册方法 原生调用JS
connectWebViewJavascriptBridge(function (bridge) { connectWebViewJavascriptBridge(function (bridge) {
if (isAndroid) { if (isAndroid) {
bridge.init('reloadTXLContact', function (data, responseCallback) { bridge.init('getbarheight', function (data, responseCallback) {
responseCallback('received from native data:', data); responseCallback('received from native data:', data);
}); });
} }
bridge.registerHandler('reloadTXLContact', function (data, responseCallback) {
responseCallback('received from native data:' + data);
});
readyCallback(); readyCallback();
}); });
} }
......
...@@ -52,9 +52,14 @@ Vue.prototype.setPageNavState = function () { ...@@ -52,9 +52,14 @@ Vue.prototype.setPageNavState = function () {
} }
}; };
const VConsole = require('vconsole') const VConsole = require('vconsole')
const my_console = new VConsole(); const my_console = new VConsole();
new Vue({ new Vue({
store, store,
router, router,
......
...@@ -416,6 +416,36 @@ export default { ...@@ -416,6 +416,36 @@ export default {
} }
} }
}, },
getBarHeight() {
try {
initJsBridge(() => {
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
{},
function(response) {
console.log("来自 ios/android的回传数据: ", response);
const barHeight = response;
const conHeight = 46 + response;
document
.getElementsByClassName("iosStyle")[0]
.setAttribute(
"style",
"padding-top:" + barHeight + "px !important"
);
document
.getElementsByClassName("container")[0]
.setAttribute(
"style",
"padding-top:" + conHeight + "px !important"
);
}
);
});
} catch (err) {
console.log("setPageNavState is error");
}
},
closeWebView() { closeWebView() {
try { try {
window.WebViewJavascriptBridge.callHandler( window.WebViewJavascriptBridge.callHandler(
...@@ -438,6 +468,7 @@ export default { ...@@ -438,6 +468,7 @@ 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();
this.getBarHeight();
} }
}; };
</script> </script>
...@@ -487,8 +518,6 @@ export default { ...@@ -487,8 +518,6 @@ export default {
.header_content { .header_content {
height: 122px; height: 122px;
.fund { .fund {
margin-top:30px;
width: 50%; width: 50%;
float: left; float: left;
} }
......
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