odc.xiaohui
2023-05-12 4b48bacef8646cee8b66f5e10b0ed7124534e93e
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
// index.ts
// 获取应用实例
const userReport = getApp()
 
Page({
    data: {
        reportList: [],
        isShow: false
    },
    // 事件处理函数
    bindViewTap() {
        wx.navigateTo({
            url: '../logs/logs',
        })
    },
    getDetail(e) {
        let url = '../report/detail/index?id=' + e.currentTarget.id
        if (e.currentTarget.dataset.word == 2) {
            url = '../report/submitReport/index?id=' + e.currentTarget.id
        }
        wx.navigateTo({
            url
        })
    },
    report() {
        wx.navigateTo({
            url: '../report/submitReport/index'
        })
    },
    onLoad() {
        wx.request(
            {
                url: userReport.globalData.url + "/wx/user/cause",
                method: "GET",
                header: { 'token': wx.getStorageSync('token') },
                data: {
                    id: wx.getStorageSync('id')
                },
                success: (res) => {
                    this.setData({
                        reportList: res.data.data
                    })
                }
            })
    }
})