| | |
| | | wx.navigateBack() |
| | | }, |
| | | openGroup(e) { |
| | | wx.navigateTo({ |
| | | url: "../../user/group/message/index?id=" + e.currentTarget.id + "&&ban=" + e.currentTarget.dataset.ban + "&&reportId=" + e.currentTarget.dataset.rptid |
| | | }) |
| | | if (wx.getStorageSync('role')==1) { |
| | | wx.navigateTo({ |
| | | url: "../../manager/group/message/index?id=" + e.currentTarget.id |
| | | }) |
| | | }else{ |
| | | wx.navigateTo({ |
| | | url: "../../user/group/message/index?id=" + e.currentTarget.id + "&&ban=" + e.currentTarget.dataset.ban + "&&reportId=" + e.currentTarget.dataset.rptid |
| | | }) |
| | | } |
| | | |
| | | |
| | | }, |
| | | onLoad() { |
| | | var date = new Date() |
| | |
| | | } |
| | | time = date.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + secends |
| | | var lastTime = wx.getStorageSync('time') |
| | | wx.request( |
| | | { |
| | | url: userGroup.globalData.url + "/wx/user/group/list", |
| | | method: "GET", |
| | | data: { |
| | | id: wx.getStorageSync('id'), |
| | | newDate: time, |
| | | lastDate: lastTime |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res.data.data) |
| | | this.setData({ |
| | | groupList: res.data.data |
| | | }) |
| | | } |
| | | }) |
| | | console.log(wx.getStorageSync('role')); |
| | | |
| | | if (wx.getStorageSync('role')==1) { |
| | | wx.request( |
| | | { |
| | | url: userGroup.globalData.url + "/wx/manager/group/list", |
| | | method: "GET", |
| | | data: { |
| | | id: wx.getStorageSync('id'), |
| | | newDate: time, |
| | | lastDate: lastTime |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res.data.data) |
| | | res.data.data.map(item => { |
| | | if (item.time) { |
| | | item.time = item.time.substr(-8) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | groupList: res.data.data |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }else{ |
| | | wx.request( |
| | | { |
| | | url: userGroup.globalData.url + "/wx/user/group/list", |
| | | method: "GET", |
| | | data: { |
| | | id: wx.getStorageSync('id'), |
| | | newDate: time, |
| | | lastDate: lastTime |
| | | }, |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | console.log(res.data.data) |
| | | this.setData({ |
| | | groupList: res.data.data |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }) |