|
|
@ -26,6 +26,7 @@ Page({ |
|
|
loading: false, |
|
|
loading: false, |
|
|
requesting: false, |
|
|
requesting: false, |
|
|
finished: false, |
|
|
finished: false, |
|
|
|
|
|
dataIndex: 0, |
|
|
taskList: [] |
|
|
taskList: [] |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
@ -82,6 +83,13 @@ Page({ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.data.tabIndex = Number(detail.index) |
|
|
this.data.tabIndex = Number(detail.index) |
|
|
|
|
|
if (!app.globalData.userInfo && Number(detail.index) == 2) { |
|
|
|
|
|
this.data.form.pageNum = 1 |
|
|
|
|
|
this.data.dataIndex = 0 |
|
|
|
|
|
this.setData({ taskList: [], finished: false, requesting: false }) |
|
|
|
|
|
wx.navigateTo({ url: '/pages/login/index' }) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
if(util.isEmpty(this.data.form.searchKey)){ |
|
|
if(util.isEmpty(this.data.form.searchKey)){ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -117,6 +125,7 @@ Page({ |
|
|
searchList = rearchStringList |
|
|
searchList = rearchStringList |
|
|
} |
|
|
} |
|
|
this.data.form.pageNum = 1 |
|
|
this.data.form.pageNum = 1 |
|
|
|
|
|
this.data.dataIndex = 0 |
|
|
this.setData({ taskList: [], loading: true, finished: false, searchList, keyIndex: this.data.keyIndex, focus: false, ['form.searchKey']: detail.value }) |
|
|
this.setData({ taskList: [], loading: true, finished: false, searchList, keyIndex: this.data.keyIndex, focus: false, ['form.searchKey']: detail.value }) |
|
|
this.fetchTaskList() |
|
|
this.fetchTaskList() |
|
|
}, |
|
|
}, |
|
|
@ -143,7 +152,7 @@ Page({ |
|
|
} else if(this.data.tabIndex == 1){ |
|
|
} else if(this.data.tabIndex == 1){ |
|
|
getInformationList(this.data.form).then(result => { |
|
|
getInformationList(this.data.form).then(result => { |
|
|
if (result.data && result.data.records.length) { |
|
|
if (result.data && result.data.records.length) { |
|
|
this.handRespList(result.data) |
|
|
|
|
|
|
|
|
this.handMomentResult(result.data) |
|
|
} else { |
|
|
} else { |
|
|
this.setData({ finished: true, requesting: false, loading: false, tabIndex: this.data.tabIndex }) |
|
|
this.setData({ finished: true, requesting: false, loading: false, tabIndex: this.data.tabIndex }) |
|
|
} |
|
|
} |
|
|
@ -175,6 +184,40 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
handMomentResult: function(data){ |
|
|
|
|
|
var respList = data.records |
|
|
|
|
|
var lastTime = null |
|
|
|
|
|
if(this.data.dataIndex < 2){ |
|
|
|
|
|
// 对返回的消息列表进行处理,将同一天的消息显示在一起
|
|
|
|
|
|
var qrtime = new Date(this.data.form.date).getTime() |
|
|
|
|
|
for (let i = 0; i < respList.length; i++) { |
|
|
|
|
|
if(this.data.dataIndex == 2){ |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
lastTime = respList[i].latestQuoteTime |
|
|
|
|
|
if (lastTime && lastTime.length > 10) { |
|
|
|
|
|
lastTime = lastTime.substring(0, 10) |
|
|
|
|
|
} |
|
|
|
|
|
var itemtime = new Date(lastTime).getTime() |
|
|
|
|
|
if(this.data.dataIndex == 0){ |
|
|
|
|
|
if(itemtime > qrtime){ |
|
|
|
|
|
this.data.dataIndex = 1 |
|
|
|
|
|
respList[i].tipsTime = lastTime |
|
|
|
|
|
} else { |
|
|
|
|
|
this.data.dataIndex = 2 |
|
|
|
|
|
respList[i].tipsTime = this.data.form.date |
|
|
|
|
|
} |
|
|
|
|
|
} else if(this.data.dataIndex == 1 && itemtime <= qrtime){ |
|
|
|
|
|
this.data.dataIndex = 2 |
|
|
|
|
|
respList[i].tipsTime = this.data.form.date |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
let nowList = `taskList[${this.data.taskList.length}]` |
|
|
|
|
|
var num = this.data.form.pageNum |
|
|
|
|
|
var finished = this.data.form.pageNum >= data.pages |
|
|
|
|
|
this.setData({ [nowList]: respList, total: data.total, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false, tabIndex: this.data.tabIndex }) |
|
|
|
|
|
}, |
|
|
handRespList: function(data){ |
|
|
handRespList: function(data){ |
|
|
let nowList = `taskList[${this.data.taskList.length}]` |
|
|
let nowList = `taskList[${this.data.taskList.length}]` |
|
|
var num = this.data.form.pageNum |
|
|
var num = this.data.form.pageNum |
|
|
|