liyubing

fix:

1) 人民号-关注页进行刷新会出现空白页
... ... @@ -25,6 +25,7 @@ import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentio
import { CardParser } from '../CardParser'
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
import PageFollowHelper from '../../viewmodel/PageFollowHelper';
import { MineFollowListItem } from '../../viewmodel/MineFollowListItem';
const TAG = 'PeopleShipMainComponent';
... ... @@ -228,12 +229,10 @@ export struct PeopleShipMainComponent {
this.followList = []
this.getRmhRecommendInfo(resolve)
} else {
this.followList = []
this.followList.push(...followInfo.list)
this.attentionList = []
this.currentPage = 1
this.loadTime = DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
this.getAttentionContentListData(resolve)
this.getAttentionContentListData(resolve,followInfo)
}
} else {
this.followList = []
... ... @@ -273,7 +272,7 @@ export struct PeopleShipMainComponent {
}
// 获取关注
private async getAttentionContentListData(resolve?: (value: string | PromiseLike<string>) => void) {
private async getAttentionContentListData(resolve?: (value: string | PromiseLike<string>) => void,myFollowInfor?:MineFollowListItem) {
if (this.isLoading && this.currentPage != 1) {
if (resolve) {
resolve('')
... ... @@ -291,11 +290,9 @@ export struct PeopleShipMainComponent {
} else {
this.hasMore = false;
}
if (this.currentPage == 1) {
this.attentionList = []
}
//批量查询各类型内容动态数据接口
this.checkContentInteractData(listData.list, resolve)
this.checkContentInteractData(listData.list, resolve,myFollowInfor)
} else {
this.hasMore = false;
this.resolveEnd(true, resolve)
... ... @@ -307,7 +304,7 @@ export struct PeopleShipMainComponent {
}
// 批量查询各类型内容动态数据接口
private async checkContentInteractData(list: ContentDTO[], resolve?: (value: string | PromiseLike<string>) => void) {
private async checkContentInteractData(list: ContentDTO[], resolve?: (value: string | PromiseLike<string>) => void,myFollowInfor?:MineFollowListItem) {
// 批量查询内容当前用户点赞、收藏状态
try {
// 获取列表数据
... ... @@ -324,6 +321,15 @@ export struct PeopleShipMainComponent {
let listData = await PeopleShipMainViewModel.getContentInteractInfo(params)
Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`)
this.resolveEnd(true, resolve)
if (this.currentPage == 1) {
this.attentionList = []
this.followList = []
}
if(myFollowInfor){
this.followList.push(...myFollowInfor.list)
}
list.forEach((element: ContentDTO) => {
// 获取 interactData 数据
if (listData && listData.length > 0) {
... ...