xusd
7 days ago 998218675eb243d43912c203174a6b72b299c0f8
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// components/tabbarPage/index.js
const $$ = require('../../utils/util');
const app = getApp();
 
Component({
    /**
     * 组件的初始数据
     */
    data: {
        mediate: $$.url.img + 'mediate.png',
        mediate_active: $$.url.img + 'mediate-active.png',
        active: 0,
        loginVisible: !!app.globalData.token,
        moreFunctionVisible: false,
        moreFunctionList: [
            {
                title: '找调解组员',
                subTitle: '专业的调解员为您快速解忧',
                icon: `${$$.url.img}mediator.png`,
                url: '../../pages/findAdjust/index?type=1',
                key: '3',
            },
            {
                title: '找调解组织',
                subTitle: '身边的调解组织为您解忧',
                icon: `${$$.url.img}organization.png`,
                url: '../../pages/findAdjust/index?type=2',
                key: '2',
      },
      // TODO:协助调解是“调解员端”功能,在当事人小程序中暂时隐藏
            // {
            //     title: '协助调解',
            //     subTitle: '参与到外部调解并提供帮助',
            //     icon: `${$$.url.img}assistMediate.png`,
            //     url: '../../pages/assistMediate/index',
            //     key: '5',
            // },
            {
                title: '我的司法确认',
                subTitle: '查询司法确认受理进度',
                icon: `${$$.url.img}judicial-confirmation.png`,
                url: '../../pages/myJudicialConfirmation/index',
                key: '1',
            },
            {
                title: '个人中心',
                subTitle: '实名认证,完善个人信息',
                icon: `${$$.url.img}me-center.png`,
                url: '../../pages/me/index',
                key: '4',
            },
        ],
    },
 
    pageLifetimes: {
        show: function () {
            if (app.globalData.token && !this.data.loginVisible) {
                this.setData({ loginVisible: true });
            }
            if (!app.globalData.token) {
                this.setData({ loginVisible: false });
            }
        },
    },
 
    /**
     * 组件的方法列表
     */
    methods: {
        // 退出登录
        loginOut() {
            this.setData({ loginVisible: false });
        },
        // 更多功能进入
        _handleGoPage(e) {
            let url = e.currentTarget.dataset.url;
            let key = e.currentTarget.dataset.key;
            if (['2', '3', '4'].includes(key) && $$.userTest('login')) {
                wx.navigateTo({
                    url: url,
                });
            }
            if (['1', '5'].includes(key) && $$.userTest('all')) {
                wx.navigateTo({
                    url: url,
                });
            }
        },
        // 切换tab
        _handleChangeTab(event) {
            if (event.detail === 1) {
                this._handleMaskVisible();
                return false;
            }
            if (event.detail === 2 && !this.data.loginVisible) {
                wx.navigateTo({ url: '../../pages/login/index' });
                return false;
            }
            if (event.detail === 3) {
                if ($$.userTest('all')) {
                    wx.navigateTo({ url: '../../pages/myMediate/index' });
                }
            }
        },
        // 关闭mask
        _handleMaskVisible() {
            this.setData({ moreFunctionVisible: !this.data.moreFunctionVisible });
        },
    },
});