Commit d2959102 by 展昭

mixin

parent 4b24982b
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
i { i {
font-style: normal; font-style: normal;
} }
.iosStyle {
background-color: #077AEC;
}
.container { .container {
padding-top: 46px; padding-top: 46px;
} }
......
@base-blue-color:#077AEC;
* { * {
padding: 0; padding: 0;
margin: 0; margin: 0;
...@@ -8,14 +9,16 @@ i { ...@@ -8,14 +9,16 @@ i {
font-style: normal; font-style: normal;
} }
.iosStyle{
background-color: @base-blue-color;
}
.container { .container {
padding-top: 46px; padding-top: 46px;
} }
/*未扣费*/ /*未扣费*/
.no_bill { .no_bill {
color: #077AEC; color: @base-blue-color;
} }
......
const setBarHeight = {
mounted() {
try {
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
null,
function (response) {
console.log("getBarHeight来自 ios/android的回传数据: ", response);
if (response) {
const barHeight = response.statusBarHeight;
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");
}
}
}
export default setBarHeight
\ No newline at end of file
<template> <template>
<div id="showheader" class="header"> <div id="showheader" class="header iosStyle">
<van-nav-bar id="nav" :title="title" left-text left-arrow /> <van-nav-bar id="nav" :title="title" left-text left-arrow />
</div> </div>
</template> </template>
......
<template> <template>
<div id="showheader" class="header" :class="this.top?'iosStyle header-warp':'header-warp'"> <div id="showheader" class="header iosStyle">
<van-nav-bar id="nav" :title="title" left-text left-arrow /> <van-nav-bar id="nav" :title="title" left-text left-arrow />
</div> </div>
</template> </template>
......
...@@ -35,11 +35,13 @@ import { Icon } from "vant"; ...@@ -35,11 +35,13 @@ import { Icon } from "vant";
import { Header } from "@/components"; import { Header } from "@/components";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from "dayjs"; import dayjs from "dayjs";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "会员年费", title: "会员年费",
......
...@@ -159,6 +159,7 @@ import { Icon, Loading } from "vant"; ...@@ -159,6 +159,7 @@ import { Icon, Loading } from "vant";
import { TabHeader } from "@/components"; import { TabHeader } from "@/components";
import * as utils from "../../utils/common"; import * as utils from "../../utils/common";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import setBarHeight from "../../assets/js/setBarHeight.js";
import dayjs from "dayjs"; import dayjs from "dayjs";
export default { export default {
...@@ -166,6 +167,7 @@ export default { ...@@ -166,6 +167,7 @@ export default {
[Icon.name]: Icon, [Icon.name]: Icon,
TabHeader TabHeader
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "人事服务", title: "人事服务",
...@@ -416,36 +418,6 @@ export default { ...@@ -416,36 +418,6 @@ export default {
} }
} }
}, },
getBarHeight() {
try {
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
null,
function(response) {
console.log("getBarHeight来自 ios/android的回传数据: ", response);
if (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("getBarHeight is error");
}
},
closeWebView() { closeWebView() {
try { try {
window.WebViewJavascriptBridge.callHandler( window.WebViewJavascriptBridge.callHandler(
...@@ -468,7 +440,6 @@ export default { ...@@ -468,7 +440,6 @@ export default {
this.globalNavLeftArrowClick(this.navLeftArrowClick); this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.loadPeriodData(); await this.loadPeriodData();
this.payUrl = await this.loadPayUrl(); this.payUrl = await this.loadPayUrl();
this.getBarHeight();
} }
}; };
</script> </script>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
import { Icon } from "vant"; import { Icon } from "vant";
import { HeaderW } from "@/components"; import { HeaderW } from "@/components";
import MescrollMixins from "../../assets/js/MescrollMixins.js"; import MescrollMixins from "../../assets/js/MescrollMixins.js";
import setBarHeight from "../../assets/js/setBarHeight.js";
import MescrollVue from "mescroll.js/mescroll.vue"; import MescrollVue from "mescroll.js/mescroll.vue";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import dayjs from "dayjs"; import dayjs from "dayjs";
...@@ -33,7 +34,7 @@ export default { ...@@ -33,7 +34,7 @@ export default {
[Icon.name]: Icon, [Icon.name]: Icon,
MescrollVue MescrollVue
}, },
mixins: [MescrollMixins], mixins: [MescrollMixins,setBarHeight],
computed: { computed: {
...mapGetters(["getBeginDate"]) ...mapGetters(["getBeginDate"])
}, },
......
...@@ -39,11 +39,13 @@ import { Header } from "@/components"; ...@@ -39,11 +39,13 @@ import { Header } from "@/components";
import { Icon } from "vant"; import { Icon } from "vant";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import dayjs from "dayjs"; import dayjs from "dayjs";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "", title: "",
......
...@@ -36,11 +36,13 @@ import { Header } from "@/components"; ...@@ -36,11 +36,13 @@ import { Header } from "@/components";
import { Icon } from "vant"; import { Icon } from "vant";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from "dayjs"; import dayjs from "dayjs";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "", title: "",
......
...@@ -46,7 +46,12 @@ ...@@ -46,7 +46,12 @@
<i class="title_color">{{hosting.fund.amount|moneyNum}}</i> <i class="title_color">{{hosting.fund.amount|moneyNum}}</i>
</div> </div>
<div class="list_contenter"> <div class="list_contenter">
<div class="list" v-for="(item,index) in hosting.fund.list" :key="index" @click="openDetail(item.detail)"> <div
class="list"
v-for="(item,index) in hosting.fund.list"
:key="index"
@click="openDetail(item.detail)"
>
<div class="list_title"> <div class="list_title">
<div class="title">{{item.cityName}}</div> <div class="title">{{item.cityName}}</div>
<van-icon name="arrow" class="arrow_right" /> <van-icon name="arrow" class="arrow_right" />
...@@ -91,13 +96,14 @@ import { Icon, Popup } from "vant"; ...@@ -91,13 +96,14 @@ import { Icon, Popup } from "vant";
import { Header } from "@/components"; import { Header } from "@/components";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import MescrollVue from "mescroll.js/mescroll.vue"; import MescrollVue from "mescroll.js/mescroll.vue";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon, [Icon.name]: Icon,
[Popup.name]: Popup [Popup.name]: Popup
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
name: "人事托管", name: "人事托管",
......
...@@ -21,11 +21,13 @@ ...@@ -21,11 +21,13 @@
<script> <script>
import { NavBar, Icon } from "vant"; import { NavBar, Icon } from "vant";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
[NavBar.name]: NavBar, [NavBar.name]: NavBar,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "", title: "",
......
...@@ -53,11 +53,13 @@ ...@@ -53,11 +53,13 @@
import { NavBar, Icon } from "vant"; import { NavBar, Icon } from "vant";
import { TabHeader } from "@/components"; import { TabHeader } from "@/components";
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
[Icon.name]: Icon, [Icon.name]: Icon,
TabHeader TabHeader
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "", title: "",
......
...@@ -29,11 +29,13 @@ ...@@ -29,11 +29,13 @@
<script> <script>
import { Icon } from "vant"; import { Icon } from "vant";
import { HeaderW } from "@/components"; import { HeaderW } from "@/components";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
[Icon.name]: Icon, [Icon.name]: Icon,
HeaderW HeaderW
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "资金记录", title: "资金记录",
......
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
<script> <script>
import { Icon } from "vant"; import { Icon } from "vant";
import { Header } from "@/components"; import { Header } from "@/components";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "", title: "",
......
...@@ -39,11 +39,13 @@ import { Icon } from "vant"; ...@@ -39,11 +39,13 @@ import { Icon } from "vant";
import { Header } from "@/components"; import { Header } from "@/components";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from "dayjs"; import dayjs from "dayjs";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "其他事务办理", title: "其他事务办理",
......
...@@ -51,11 +51,13 @@ import { Header } from "@/components"; ...@@ -51,11 +51,13 @@ import { Header } from "@/components";
import { Icon } from "vant"; import { Icon } from "vant";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from "dayjs"; import dayjs from "dayjs";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "", title: "",
......
...@@ -51,11 +51,13 @@ ...@@ -51,11 +51,13 @@
<script> <script>
import { Icon } from "vant"; import { Icon } from "vant";
import { Header } from "@/components"; import { Header } from "@/components";
import setBarHeight from "../../assets/js/setBarHeight.js";
export default { export default {
components: { components: {
Header, Header,
[Icon.name]: Icon [Icon.name]: Icon
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "服务费" title: "服务费"
......
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