|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="layout" :class="{'layout-white': !false}">
|
|
|
- <div style="height: 12.2666666667vw" v-if="isShowNavBar">
|
|
|
+ <div style="height: 12.2666666667vw">
|
|
|
<van-nav-bar :title="title" left-arrow fixed @click-left="goBackFun">
|
|
|
<template #right>
|
|
|
<slot name="right"></slot>
|
|
@@ -22,11 +22,6 @@ export default {
|
|
|
type: String,
|
|
|
default: '邀请好友得现金',
|
|
|
},
|
|
|
- // 是否强制像是头部
|
|
|
- forceShowNavBar: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
padding: {
|
|
|
type: String,
|
|
|
default: '16px'
|
|
@@ -35,10 +30,6 @@ export default {
|
|
|
type: String,
|
|
|
default: '#F2F4F7'
|
|
|
},
|
|
|
- isRouterBack: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
// 用于内嵌页面,标识为最后一页
|
|
|
isGoBack: {
|
|
|
type: Boolean,
|
|
@@ -53,20 +44,15 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- // 如果是安卓的需要判断一下是否显示h5内置的返回按钮
|
|
|
- // 如果是H5、微信小程序,不需要显示次按钮
|
|
|
+ // 判断是否是App, 活动页app不显示头部,直接使用H5头部
|
|
|
this.isApp = this.$userAgent.isSzx || this.$userAgent.isSzxBrowser
|
|
|
this.isAndroid = this.$userAgent.isAndroid;
|
|
|
this.isIos = this.$userAgent.isIos;
|
|
|
- // if (!this.isApp) return this.visible = false
|
|
|
- // if (this.isApp && this.isAndroid) {
|
|
|
- // this.visible = !!window.native.goneBack
|
|
|
- // // 判断是否有注册goneBack方法,有就调用
|
|
|
- // if(!!window.native.goneBack){
|
|
|
- // console.log('this.visible', this.visible)
|
|
|
- // window.native.goneBack() // 安卓隐藏返回按钮
|
|
|
- // }
|
|
|
- // }
|
|
|
+
|
|
|
+ // 安卓隐藏返回按钮
|
|
|
+ if (this.isApp && this.isAndroid && !!window.native.goneBack) {
|
|
|
+ window.native.goneBack() // 安卓隐藏返回按钮
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
containerStyle() {
|
|
@@ -91,23 +77,6 @@ export default {
|
|
|
bool = isApp && (isAndroid || isIos) ? true : false;
|
|
|
return bool;
|
|
|
},
|
|
|
- isShowNavBar() {
|
|
|
- // 是否是APP
|
|
|
- const isApp = this.isApp;
|
|
|
- const isAndroid = this.isAndroid;
|
|
|
- const isIos = this.$userAgent.isIos;
|
|
|
- const isWx = this.$userAgent.isWx;
|
|
|
- // 如果是App并且是安卓,就不显示头部, ios显示
|
|
|
- // 如果微信小程序环境的,也不显示头部
|
|
|
- // 如果是h5 就显示头部
|
|
|
- let bool = false;
|
|
|
- // bool = isApp ? (isAndroid ? !isAndroid : isIos) : (isWx ? !isWx : !isWx);
|
|
|
-
|
|
|
- bool = (isApp && (isAndroid || !isIos)) || isWx ? false : true;
|
|
|
- // bool = isWx ? false : true;
|
|
|
-
|
|
|
- return bool || this.forceShowNavBar;
|
|
|
- },
|
|
|
},
|
|
|
methods: {
|
|
|
goBackFun() {
|