Authored by 陈峰

兼容老版本android不能返回的问题

... ... @@ -5,7 +5,7 @@
<layout-body>
<header-box slot="header" class="home-header">
<span slot="left">
<i class="icon icon-back go-back-btn" @click="goBack"></i>
<i class="icon icon-back go-back-btn" v-if="showBack" @click="goBack"></i>
</span>
<span slot="title" class="logo">
... ... @@ -54,14 +54,15 @@ export default {
return {
homeSlider: false,
searchSlider: false,
loadComponent: false
loadComponent: false,
showBack: false
};
},
asyncData({store}) {
return store.dispatch(FETCH_HOME_REQUEST);
},
computed: {
...mapState(['channel'])
...mapState(['channel', 'yoho'])
},
methods: {
homeSliderSwitch() {
... ... @@ -121,6 +122,22 @@ export default {
ResourceBox
},
async mounted() {
if (this.yoho.env.isAndroid) {
let appVersion = this.$cookie.get('app_version');
if (appVersion && typeof appVersion === 'string') {
let versions = appVersion.split('.');
if (versions.length === 3 &&
(+versions[0] > 6 ||
(+versions[0] === 6 && +versions[1] > 5) ||
(+versions[0] === 6 && +versions[1] === 5 && +versions[2] > 1))) {
this.showBack = true;
}
}
} else {
this.showBack = true;
}
setTimeout(() => {
this.loadComponent = true;
this.$store.dispatch(FETCH_CHANNEL_REQUEST, {gender: 'men'});
... ...