// index.ts
|
// 获取应用实例
|
const userGroup = getApp()
|
|
Page({
|
data: {
|
groupList: []
|
},
|
openGroup(e){
|
console.log(e)
|
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()
|
var month = date.getMonth() + 1
|
var day = date.getDate()
|
var hours=date.getHours()
|
var minutes=date.getMinutes()
|
var secends=date.getSeconds()
|
var time
|
if (month < 10) {
|
month = "0" + month
|
}
|
if (day < 10) {
|
day = "0" + day
|
}
|
if (minutes < 10) {
|
minutes = "0" + minutes
|
}
|
if (hours < 10) {
|
hours = "0" + hours
|
}
|
if (secends < 10) {
|
secends = "0" + secends
|
}
|
time = date.getFullYear() + "-" + month + "-" + day + " " + hours+":"+minutes+":"+secends
|
console.log(time)
|
console.log("lastDate",wx.getStorageSync('time'))
|
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
|
})
|
}
|
|
})
|
|
|
}
|
})
|