wangliang_wd

feat:增加早晚信息流缓存,优化我的收藏

... ... @@ -4,7 +4,8 @@ import {
PageInfoBean,
ContentDTO,
contentListParams,
InteractDataDTO, TopicInfo
InteractDataDTO, TopicInfo,
CompInfoBean
} from 'wdBean';
import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index';
import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
... ... @@ -137,8 +138,6 @@ export struct MorningEveningPaperComponent {
let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) //"25091"
this.pageInfoBean = pageInfoBean;
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.title = this.pageInfoBean?.topicInfo?.title
this.setComponentTitle()
this.topicInfo = this.pageInfoBean?.topicInfo
... ... @@ -158,6 +157,17 @@ export struct MorningEveningPaperComponent {
this.setComponentBgColor(coverUrl)
// this.compInfoBean = compInfoBean
//信息流缓存
let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string
let compInfoBean = {} as CompInfoBean
if (BeanString.length > 0) {
compInfoBean = JSON.parse(BeanString)
}else {
SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId)
compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean))
}
console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
if (compInfoBean?.compList[0]) {
this.compListItem = compInfoBean?.compList[0]
... ... @@ -180,6 +190,11 @@ export struct MorningEveningPaperComponent {
this.progressVal = Math.floor(position * 100 / duration);
}
this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true
if (BeanString.length > 0) {
compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean))
}
} catch (exception) {
this.isContentFailed = true
... ...
... ... @@ -20,6 +20,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel
@Entry
@Component
struct MyCollectionListPage {
//RmhTitle组件刷新需要设置 该界面为用户主页,所以不需要刷新操作
@Provide pageShow: number = -1
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
... ... @@ -60,6 +63,7 @@ struct MyCollectionListPage {
}
onPageShow(){
this.pageShow = Math.random()
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
}
... ...