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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// index.ts
// 获取应用实例
const manager = getApp<IAppOption>()
 
Page({
    data: {
        isShow: false,
        userInfo: {},
        hasUserInfo: false,
        canIUse: wx.canIUse('button.open-type.getUserInfo'),
        canIUseGetUserProfile: false,
        canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
    },
    // 事件处理函数
    bindViewTap() {
        wx.navigateTo({
            url: '../logs/logs',
        })
    },
    onLoad() {
        console.log('66666666666666666666666');
        
      this.getToken()
    },
    getToken(){
        wx.request({
            url: manager.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)
               }})
    },
    getReport() {
        wx.navigateTo({
            url: '../manager/report/index'
        })
    },
    getGroup(){
        console.log("group")
        wx.navigateTo({
            url:'../manager/group/index'
        })
    }
    ,getCause(){
        console.log("cause")
        wx.navigateTo({
            url:'../manager/cause/index'
        })
    }
    ,getAudi(){
        console.log("myself")
        wx.navigateTo({
            url:'../manager/myself/index'
        })
    }
})