Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-09-21 16:15:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
060a699e6a446eb10579ff719883dfddac8c8ab5
060a699e
1 parent
ed5fdf92
ref |> 调整早晚报和桌面组件数据和加载逻辑
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
6 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/model/DailyPaperTopicModel.ets
sight_harmony/products/phone/src/main/ets/dailynewspaperformability/NewspaperDataFetcher.ets
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
060a699
...
...
@@ -27,8 +27,7 @@ import { common } from '@kit.AbilityKit';
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent';
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { ColorUtils } from '../../utils/ColorUtils';
import { SpConstants } from 'wdConstant';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
const TAG = 'MorningEveningPaperComponent';
...
...
@@ -129,6 +128,19 @@ export struct MorningEveningPaperComponent {
async aboutToAppear() {
this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string
if (this.dailyPaperTopicPageId.length > 0) {
this.fetchData()
} else {
const dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id + "");
this.dailyPaperTopicPageId = dailyPaperTopicBean.id + "";
this.fetchData()
}
}
}
async fetchData() {
// console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId)
const currentTime = new Date().getTime()
// console.log(TAG, "currentTime = " + currentTime)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
060a699
...
...
@@ -711,7 +711,7 @@ export struct TopNavigationComponentNew {
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id
+ ""
);
ProcessUtils.gotoMorningEveningPaper()
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
...
...
sight_harmony/features/wdComponent/src/main/ets/model/DailyPaperTopicModel.ets
View file @
060a699
...
...
@@ -5,7 +5,7 @@ import { PageRepository } from '../repository/PageRepository';
const TAG = "SearcherAboutDataModel"
class DailyPaperTopicModel {
class DailyPaperTopicModel {
private static instance: DailyPaperTopicModel;
/**
...
...
sight_harmony/products/phone/src/main/ets/dailynewspaperformability/NewspaperDataFetcher.ets
View file @
060a699
...
...
@@ -43,7 +43,9 @@ export class NewspaperDataFetcher {
let contents: ContentDTO[] = compInfo.compList[0].operDataList as ContentDTO[]
if (contents && contents.length) {
data.paperContents = contents.map((contentDTO) => {
data.paperContents = contents.filter((value, index) => {
return index < 4
}).map((contentDTO) => {
let content : FormNewspaperPaperContent = {
title: contentDTO.newsTitle,
coverUrl: contentDTO.coverUrl,
...
...
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
View file @
060a699
...
...
@@ -97,7 +97,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
}
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id
+ ""
);
ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
...
...
Please
register
or
login
to post a comment