安瑾然
2023-03-23 f68f67f34857085d627cc2acdcfe714eb8bbdcb5
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
// index.ts
// 获取应用实例
const user = getApp()
 
Page({
    data: {
        swcurrent: 0,
        isShow: false,
        userInfo: {},
        causeList: [],
        images: []
    },
    // 事件处理函数
    bindViewTap() {
        wx.navigateTo({
            url: '../logs/logs',
        })
    },
 
 
    onLoad() {
        wx.request({
            url: user.globalData.url+"/wx/login",
            data: {
                "phone": wx.getStorageSync('phone'),
            },
            method: "GET",
            success: (res) => {
                wx.setStorageSync('token', res.data.data.token)
                wx.setStorageSync('role', res.data.data.role)
                wx.setStorageSync('id', res.data.data.id)
                wx.setStorageSync('card',res.data.data.time)
 
                wx.request(
                    {
                        url: user.globalData.url + "/wx/publicity?size=" + "4",
                        method: "GET",
                        header: { 'token': wx.getStorageSync('token') },
                        success: (res) => {
        
                            res.data.data.map(i => {
                                if (i.photoStr != null) {
                                    i.photoStr = i.photoStr.split(",").map(i => user.globalData.imageUrl + "/img/" + i),
                                        this.data.images = i.photoStr
                                }
                            })
                            this.setData({
                                causeList: res.data.data,
                            })
        
        
                        }
                    })
               }})
        if (wx.getStorageSync('info') == '') {
            wx.redirectTo({
                url: '../user/loginInfo/index'
            })
        }
       
    },
    getReport() {
        wx.navigateTo({
            url: '../user/report/index'
        })
    },
    getPublicty() {
        console.log("publicty")
        wx.navigateTo({
            url: '../user/pubulicty/index'
        })
    },
    getGroup() {
        console.log("group")
        wx.navigateTo({
            url: '../user/group/index'
        })
    },
    getCause() {
        console.log("cause")
        wx.navigateTo({
            url: '../manager/cause/index'
        })
    },
    getAudi() {
        console.log("myself")
        wx.navigateTo({
            url: '../user/myself/index'
        })
    },
    more() {
        console.log("myself")
        wx.navigateTo({
            url: '../user/pubulicty/index'
        })
    }
})