|
@@ -42,7 +42,6 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- visible: true,
|
|
|
isApp: null,
|
|
|
isAndroid: null,
|
|
|
};
|
|
@@ -52,20 +51,15 @@ export default {
|
|
|
// 如果是H5、微信小程序,不需要显示次按钮
|
|
|
this.isApp = this.$userAgent.isSzx || this.$userAgent.isSzxBrowser
|
|
|
this.isAndroid = this.$userAgent.isAndroid;
|
|
|
- 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() // 安卓隐藏返回按钮
|
|
|
- }
|
|
|
- // setTimeout(()=>{
|
|
|
- // console.log('window.native.goneBack', window.native.goneBack)
|
|
|
- // console.log(' !!window.native.goneBack', !!window.native.goneBack)
|
|
|
- // this.visible && window.native.goneBack() // 安卓隐藏返回按钮
|
|
|
- // }, 100)
|
|
|
- }
|
|
|
+ // 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() // 安卓隐藏返回按钮
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
computed: {
|
|
|
containerStyle() {
|
|
@@ -95,9 +89,9 @@ export default {
|
|
|
},
|
|
|
isShowNavBar() {
|
|
|
// 是否是APP
|
|
|
- // const isApp = this.$userAgent.isSzx || this.$userAgent.isSzxBrowser;
|
|
|
- // const isAndroid = this.$userAgent.isAndroid;
|
|
|
- // const isIos = this.$userAgent.isIos;
|
|
|
+ const isApp = this.isApp;
|
|
|
+ const isAndroid = this.isAndroid;
|
|
|
+ const isIos = this.$userAgent.isIos;
|
|
|
const isWx = this.$userAgent.isWx;
|
|
|
// 如果是App并且是安卓,就不显示头部, ios显示
|
|
|
// 如果微信小程序环境的,也不显示头部
|
|
@@ -105,10 +99,9 @@ export default {
|
|
|
let bool = false;
|
|
|
// bool = isApp ? (isAndroid ? !isAndroid : isIos) : (isWx ? !isWx : !isWx);
|
|
|
|
|
|
- // bool = (isApp && (isAndroid || isIos)) || isWx ? false : true;
|
|
|
- bool = isWx ? false : true;
|
|
|
+ bool = (isApp && (isAndroid || isIos)) || isWx ? false : true;
|
|
|
+ // bool = isWx ? false : true;
|
|
|
|
|
|
- // console.log()
|
|
|
return bool || this.forceShowNavBar;
|
|
|
},
|
|
|
|