index-page.vue
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
<LayoutApp :show-back="false" :title="title">
<div class="body">
<div class="content">
<router-view></router-view>
</div>
<div class="footer">
<Tabs :value="tabIndex" @click="onClick"></Tabs>
</div>
</div>
</LayoutApp>
</template>
<script>
import Tabs from './components/tabs';
export default {
name: 'IndexPage',
props: ['tabIndex', 'title'],
components: {
Tabs
},
methods: {
onClick(index) {
switch (index) {
case 0: {
this.go('ChannelPage');
break;
}
case 1: {
this.go('CategoryPage');
break;
}
case 2: {
this.$yoho.auth({
refer: '/xianyu/index/news'
}).then((res) => {
if(res) {
this.go('NewsPage');
}
})
break;
}
case 3: {
this.$yoho.auth({
refer: '/xianyu/index/mine'
}).then((res) => {
if(res) {
this.go('MinePage');
}
})
break;
}
default: {
this.go('ChannelPage');
}
}
},
go(name) {
this.$router.replace({
name
});
}
}
};
</script>
<style lang="scss" scoped>
* {
transition: none !important;
transform: none !important;
}
.body {
display: flex;
flex-direction: column;
height: 100%;
}
.content {
flex: 1;
overflow: hidden;
background-color: white;
position: relative;
}
.footer {
border-top: 1px solid #eee;
height: 100px;
width: 100%;
background-color: white;
}
</style>