|
|
@@ -35,20 +35,13 @@ export class DiaryViewModel{
|
|
|
YTLog.info(`查询日记列表结果 ${JSON.stringify(result)}`)
|
|
|
this.diaryDataList = result
|
|
|
|
|
|
- let i = 0;
|
|
|
- this.dateList[0] = result[0].diaryDate!
|
|
|
- // for (let index = 0; index < result.length; index++) {
|
|
|
- // if(result[index].diaryDate != this.dateList[i]){
|
|
|
- // this.dateList.push(result[index].diaryDate!)
|
|
|
- // i++;
|
|
|
- // }
|
|
|
- // }
|
|
|
+ let dateList: string[] = [result[0].diaryDate!]
|
|
|
result.forEach(item => {
|
|
|
- if(this.dateList.indexOf(item.diaryDate!) === -1){
|
|
|
- this.dateList.push(item.diaryDate!)
|
|
|
+ if(dateList.indexOf(item.diaryDate!) === -1){
|
|
|
+ dateList.push(item.diaryDate!)
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+ this.dateList = dateList
|
|
|
console.log('title_List ' + JSON.stringify(this.dateList))
|
|
|
}
|
|
|
|