Commit f76b1f14 by 展昭

tj

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