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
// index.ts
// 获取应用实例
const UserMyself = getApp()
 
Page({
  data: {
      reportList:{},
    isShow:false
  },
  getDetail(){
      console.log("detail-myself")
    wx.navigateTo({
        url:'../myself/detail/index'
    })
  },
  logout(){
    wx.removeStorageSync('token')
   wx.reLaunch({
       url:'../../index/index'
   })
  },
  onLoad() {
      wx.request(  
        {
          url:UserMyself.globalData.url+  "/wx/user/myself",
          method:"GET",
          data:{
              id:wx.getStorageSync('id')
          },
          header:{'token':wx.getStorageSync('token')},
          success:(res)=>{
              console.log(res)
              if(res.data.data.pic!=null&&res.data.data.pic!=""){
                res.data.data.pic=UserMyself.globalData.imageUrl+"/img/"+res.data.data.pic
              }
              this.setData({
                reportList:res.data.data
              })
          }
              })
    }
})