Commit ef8ef117 by 展昭

mixins setBarHeight

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