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
| <template>
| <view class="newIndex">
| <uni-nav-bar backgroundColor='#000' color='#fff' statusBar :border='false' fixed :title="title" />
| <u-loading-page :loading="loading"></u-loading-page>
| <agencyPage v-if="isShow" ref="agencyPage"></agencyPage>
| <myInfor v-if="!isShow"></myInfor>
| <tabBar v-if="showTabBar" @handleChangeTabe='handleChangeTabe' :currIndex='currIndex'></tabBar>
| </view>
| </template>
| <script>
| import agencyPage from '@/pages/actionChange/agencyPage/index.vue'
| import myInfor from '@/pages/actionChange/myInfor/index.vue'
| import tabBar from '@/pages/actionChange/components/commonUserTabBar.vue'
| export default {
| data() {
| return {
| isShow: true,
| loading: true,
| showTabBar: true,
| token: '',
| currIndex: '0',
| title: '首页'
| }
| },
| components: {
| agencyPage,
| myInfor,
| tabBar
| },
| onLoad(option) {},
| onReady() {},
| onShow() {
| this.currIndex = '0'
| this.showTabBar = true
| },
| async mounted() {
| //等待登录成功
| await this.$onLaunched
| this.token = uni.getStorageSync('tonken')
| console.log('indextoken', this.token)
| this.loading = false
| this.getData()
| uni.$on('currIndex', data => {
| console.log('currIndexOn', data)
| this.currIndex = data.data.index
| this.showTabBar = data.data.showTabBar
| this.$refs.agencyPage.getContaminateList()
| })
| },
| methods: {
| getData() {
| console.log('indextokengetContaminateList')
| this.$refs.agencyPage.getContaminateList()
| },
| handleChangeTabe(index) {
| if (index === 2) {
| this.isShow = false
| this.title = '我的'
| }
| if (index === 0) {
| this.isShow = true
| this.$nextTick(() => {
| this.getData()
| })
| }
| if (index === 1) {
| uni.navigateTo({
| url: '/pages/actionChange/newPage/index'
| })
| this.showTabBar = false
| }
| }
| }
| }
| </script>
| <style></style>
|
|