Commit 87661af2 by 展昭

del more mixins and setbarHeight function

parent 6981bc8d
const setBarHeight = {
beforeMount() {
mounted() {
const barHeight = localStorage.getItem('barHeight');
const conHeight = 46 + barHeight;
console.log('mixins barHeight=', barHeight);
document
.getElementsByClassName("iosStyle")[0]
.setAttribute("style", "padding-top:" + barHeight + "px !important");
const dom = document.getElementsByClassName("iosStyle")[0];
if (dom) {
dom.setAttribute("style", "padding-top:" + barHeight + "px !important");
}
document
.getElementsByClassName("container")[0]
.setAttribute("style", "padding-top:" + conHeight + "px !important");
const dom2 = document.getElementsByClassName("container")[0];
if (dom) {
dom2.setAttribute("style", "padding-top:" + conHeight + "px !important");
}
}
}
......
......@@ -434,21 +434,23 @@ export default {
localStorage.setItem("barHeight", barHeight);
const conHeight = 46 + barHeight;
console.log("billindex barHeight=", barHeight);
document
.getElementsByClassName("iosStyle")[0]
.setAttribute(
const dom = document.getElementsByClassName("iosStyle")[0];
if (dom) {
dom.setAttribute(
"style",
"padding-top:" + barHeight + "px !important"
);
}
document
.getElementsByClassName("container")[0]
.setAttribute(
const dom2 = document.getElementsByClassName("container")[0];
if (dom) {
dom2.setAttribute(
"style",
"padding-top:" + conHeight + "px !important"
);
}
}
}
);
});
},
......
......@@ -53,13 +53,13 @@
import { NavBar, Icon } from "vant";
import { TabHeader } from "@/components";
import { mapActions } from "vuex";
import setBarHeight from "../../assets/js/setBarHeight.js";
//import setBarHeight from "../../assets/js/setBarHeight.js";
export default {
components: {
[Icon.name]: Icon,
TabHeader
},
mixins: [setBarHeight],
//mixins: [setBarHeight],
data() {
return {
title: "",
......@@ -115,12 +115,30 @@ export default {
}
);
},
setBarHeight() {
const barHeight = localStorage.getItem("barHeight");
const conHeight = 46 + barHeight;
console.log("mixins barHeight=", barHeight);
const dom = document.getElementsByClassName("iosStyle")[0];
if (dom) {
dom.setAttribute("style", "padding-top:" + barHeight + "px !important");
}
const dom2 = document.getElementsByClassName("container")[0];
if (dom) {
dom2.setAttribute(
"style",
"padding-top:" + conHeight + "px !important"
);
}
},
navLeftArrowClick() {
this.$router.go(-1);
}
},
async mounted() {
this.setPageNavState();
this.setBarHeight();
this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.getData();
//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