Commit f76b1f14 by 展昭

tj

parent ad53c917
Showing with 34 additions and 39 deletions
...@@ -32,20 +32,36 @@ FastClick.prototype.focus = function (targetElement) { ...@@ -32,20 +32,36 @@ FastClick.prototype.focus = function (targetElement) {
Vue.prototype.setPageNavState = function () { Vue.prototype.setPageNavState = function () {
try { try {
initJsBridge(() => { initJsBridge(() => {
// window.WebViewJavascriptBridge.callHandler( window.WebViewJavascriptBridge.callHandler(
// "setPageNavState", "setPageNavState",
// { {
// isShowClose: false, isShowClose: false,
// isShowBack: false, isShowBack: false,
// isCloseLeft: false, isCloseLeft: false,
// isShowTitle: false, isShowTitle: false,
// isShowNav: false, isShowNav: false,
// isCloseWebView: false isCloseWebView: false
// }, },
// function (response) { function (response) {
// 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) {
......
...@@ -420,36 +420,15 @@ export default { ...@@ -420,36 +420,15 @@ export default {
} }
}, },
getBarHeight() { getBarHeight() {
try { const barHeight = localStorage.get('barHeight');
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
null,
function(response) {
console.log("getBarHeight来自 ios/android的回传数据: ", response);
if (response) {
response = JSON.parse(response);
console.log("response=", response);
const barHeight = response.statusBarHeight;
const conHeight = 46 + barHeight; const conHeight = 46 + barHeight;
document document
.getElementsByClassName("iosStyle")[0] .getElementsByClassName("iosStyle")[0]
.setAttribute( .setAttribute("style", "padding-top:" + barHeight + "px !important");
"style",
"padding-top:" + barHeight + "px !important"
);
document document
.getElementsByClassName("container")[0] .getElementsByClassName("container")[0]
.setAttribute( .setAttribute("style", "padding-top:" + conHeight + "px !important");
"style",
"padding-top:" + conHeight + "px !important"
);
}
}
);
} catch (err) {
console.log("getBarHeight is error,err=", err);
}
}, },
closeWebView() { closeWebView() {
try { try {
...@@ -470,7 +449,7 @@ export default { ...@@ -470,7 +449,7 @@ export default {
}, },
async mounted() { async mounted() {
this.setPageNavState(); this.setPageNavState();
this.getBarHeight(); //this.getBarHeight();
this.globalNavLeftArrowClick(this.navLeftArrowClick); this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.loadPeriodData(); await this.loadPeriodData();
this.payUrl = await this.loadPayUrl(); this.payUrl = await this.loadPayUrl();
......
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