|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="j-container" :class="{'transparent-header': headerInfo.transparentHeader}">
|
|
<div class="j-container" :class="{'transparent-header': headerInfo.transparentHeader}">
|
|
- <div class="j-header jy-app-header" v-if="!weixinBrowser" :class="{hideBorder: headerInfo.hideBorder}">
|
|
|
|
|
|
+ <div class="j-header jy-app-header" v-if="showHeader" :class="{hideBorder: headerInfo.hideBorder, 'h5-header': $envs.inH5}">
|
|
<van-icon class="header-left" :style="headerInfo.actionLeftStyle" :class="{ hide: headerInfo.actionLeftHide }" name="arrow-left" @click="goBack" />
|
|
<van-icon class="header-left" :style="headerInfo.actionLeftStyle" :class="{ hide: headerInfo.actionLeftHide }" name="arrow-left" @click="goBack" />
|
|
<span class="header-title" :style="headerInfo.titleStyle">{{ headerInfo.title }}</span>
|
|
<span class="header-title" :style="headerInfo.titleStyle">{{ headerInfo.title }}</span>
|
|
<span class="header-right" :style="headerInfo.actionRightStyle" @click="actionRight">{{ headerInfo.actionRightText }}</span>
|
|
<span class="header-right" :style="headerInfo.actionRightStyle" @click="actionRight">{{ headerInfo.actionRightText }}</span>
|
|
@@ -44,6 +44,7 @@ export default class Layout extends Vue {
|
|
protected clearLayoutConfig!: any
|
|
protected clearLayoutConfig!: any
|
|
|
|
|
|
useConf = false
|
|
useConf = false
|
|
|
|
+ $envs: any
|
|
|
|
|
|
@Watch('$route.path')
|
|
@Watch('$route.path')
|
|
onRouterChange () {
|
|
onRouterChange () {
|
|
@@ -51,8 +52,9 @@ export default class Layout extends Vue {
|
|
// console.log('headerConfig', this.conf)
|
|
// console.log('headerConfig', this.conf)
|
|
}
|
|
}
|
|
|
|
|
|
- get weixinBrowser () {
|
|
|
|
- return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
|
|
|
|
|
|
+ get showHeader () {
|
|
|
|
+ const { inApp, inH5 } = (this.$envs) as any
|
|
|
|
+ return inApp || inH5
|
|
}
|
|
}
|
|
|
|
|
|
get conf () {
|
|
get conf () {
|
|
@@ -128,6 +130,10 @@ export default class Layout extends Vue {
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
background: #fff;
|
|
background: #fff;
|
|
font-family: "Avenir", Helvetica, Arial, sans-serif;
|
|
font-family: "Avenir", Helvetica, Arial, sans-serif;
|
|
|
|
+ &.h5-header {
|
|
|
|
+ height: 40px;
|
|
|
|
+ padding: 0 12px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
&.hideBorder {
|
|
&.hideBorder {
|
|
&::after {
|
|
&::after {
|