Commit aa9a537b by 展昭

getBarHeight

parent ac466d69
......@@ -6,11 +6,8 @@
i {
font-style: normal;
}
.iosStyle {
padding-top: 44px;
}
.container {
padding-top: 90px;
padding-top: 46px;
}
/*未扣费*/
.no_bill {
......
@top:44px;
* {
padding : 0;
margin : 0;
padding: 0;
margin: 0;
list-style: none;
}
......@@ -10,11 +8,9 @@ i {
font-style: normal;
}
.iosStyle {
padding-top: @top;
}
.container {
padding-top: 46px+@top;
padding-top: 46px;
}
/*未扣费*/
......
......@@ -45,14 +45,11 @@ function initJsBridge(readyCallback) {
// 调用注册方法 原生调用JS
connectWebViewJavascriptBridge(function (bridge) {
if (isAndroid) {
bridge.init('reloadTXLContact', function (data, responseCallback) {
bridge.init('getbarheight', function (data, responseCallback) {
responseCallback('received from native data:', data);
});
}
bridge.registerHandler('reloadTXLContact', function (data, responseCallback) {
responseCallback('received from native data:' + data);
});
readyCallback();
});
}
......
......@@ -52,9 +52,14 @@ Vue.prototype.setPageNavState = function () {
}
};
const VConsole = require('vconsole')
const my_console = new VConsole();
new Vue({
store,
router,
......
......@@ -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() {
try {
window.WebViewJavascriptBridge.callHandler(
......@@ -438,6 +468,7 @@ export default {
this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.loadPeriodData();
this.payUrl = await this.loadPayUrl();
this.getBarHeight();
}
};
</script>
......@@ -487,8 +518,6 @@ export default {
.header_content {
height: 122px;
.fund {
margin-top:30px;
width: 50%;
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