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
yangchenggong1_wd
2024-03-19 17:57:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
70d20fe89a485fdaec655bbd8957ae794dd52c22
70d20fe8
1 parent
6c7a9b1c
预约本地数据
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
10 deletions
PeopleDaily_Harmony/entry/src/main/ets/pages/TestPage.ets
PeopleDaily_Harmony/entry/src/main/resources/rawfile/appointment_list_data.json
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/AppointmentListUI.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/model/MinePageDatasModel.ets
PeopleDaily_Harmony/entry/src/main/ets/pages/TestPage.ets
View file @
70d20fe
@Entry
@Component
struct TestPage {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/entry/src/main/resources/rawfile/appointment_list_data.json
0 → 100644
View file @
70d20fe
{
"code"
:
"0"
,
"data"
:
{
"list"
:
[{
"appStyle"
:
"15"
,
"imageUrl"
:
[
"https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20231204/image/live/563cc8ce1ecc43b288f6cf60da66579c.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
],
"liveId"
:
20000007348
,
"planStartTime"
:
"2023-12-05 15:26:10"
,
"relId"
:
"500000017021"
,
"relType"
:
1
,
"startTime"
:
""
,
"status"
:
"wait"
,
"title"
:
"视界运营位加权-加权中删除"
},
{
"appStyle"
:
"null"
,
"imageUrl"
:
[
"https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20230914/image/display/9af825a00abf490d8a8698f4fc079447.jpg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
],
"liveId"
:
20000007492
,
"planStartTime"
:
"2024-01-12 20:00:00"
,
"relId"
:
"500000020284"
,
"relType"
:
1
,
"startTime"
:
""
,
"status"
:
"wait"
,
"title"
:
"QA|汉阴县凤堰古梯田"
},
{
"appStyle"
:
"null"
,
"imageUrl"
:
[
"https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20230915/image/display/e908748c62a44109bbb7214f3fed458c.jpg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
],
"liveId"
:
20000007493
,
"planStartTime"
:
"2024-01-12 20:00:00"
,
"relId"
:
"500000020286"
,
"relType"
:
1
,
"startTime"
:
""
,
"status"
:
"wait"
,
"title"
:
"二十四节气-夏至"
},
{
"appStyle"
:
"null"
,
"imageUrl"
:
[
"https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20240118/image/display/732d6166103d4d2f9fbf512b128a3486.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
],
"liveId"
:
20000007495
,
"planStartTime"
:
"2024-01-18 10:51:33"
,
"relId"
:
"500000030122"
,
"relType"
:
1
,
"startTime"
:
""
,
"status"
:
"wait"
,
"title"
:
"01181050文字直播没有预告片"
},
{
"appStyle"
:
"null"
,
"imageUrl"
:
[
"https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20240127/image/live/6359d000bba24812b7ca1765bb106a49.png?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
],
"liveId"
:
20000007519
,
"planStartTime"
:
"2024-02-27 18:18:16"
,
"relId"
:
"500000034054"
,
"relType"
:
1
,
"startTime"
:
""
,
"status"
:
"wait"
,
"title"
:
"错搞民宿33"
},
{
"appStyle"
:
"15"
,
"imageUrl"
:
[
"https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20240228/image/live/e6998ab547af472dbc19ba2fd68959b9.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
],
"liveId"
:
20000007521
,
"planStartTime"
:
"2024-02-28 19:01:50"
,
"relId"
:
"500000034162"
,
"relType"
:
1
,
"startTime"
:
""
,
"status"
:
"wait"
,
"title"
:
"保存编辑弹幕开关"
}],
"pageNum"
:
1
,
"pageSize"
:
20
,
"totalCount"
:
6
},
"message"
:
"Success"
,
"requestId"
:
"65289f1217934cffb7587ff4d6ce4689"
,
"success"
:
true
,
"timestamp"
:
1710555152344
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/AppointmentListUI.ets
View file @
70d20fe
...
...
@@ -58,7 +58,7 @@ export struct AppointmentListUI{
getNewPageData(){
this.isLoading = true
if(this.hasMore){
MinePageDatasModel.getAppointmentListData("20",`${this.curPageNum}`).then((value)=>{
MinePageDatasModel.getAppointmentListData("20",`${this.curPageNum}`
,getContext(this)
).then((value)=>{
if (!this.data || value.list.length == 0){
this.hasMore = false
}else{
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/model/MinePageDatasModel.ets
View file @
70d20fe
...
...
@@ -6,7 +6,7 @@ import { HttpUrlUtils } from '../network/HttpUrlUtils';
import HashMap from '@ohos.util.HashMap';
import { ResponseDTO, WDHttp } from 'wdNetwork';
import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
import { Logger } from 'wdKit';
import { Logger
, ResourcesUtils
} from 'wdKit';
const TAG = "MinePageDatasModel"
/**
...
...
@@ -90,12 +90,13 @@ class MinePageDatasModel{
return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url, headers)
};
getAppointmentListData(pageSize:string,pageNum:string): Promise<MineAppointmentListItem> {
getAppointmentListData(pageSize:string,pageNum:string
,context?: Context
): Promise<MineAppointmentListItem> {
return new Promise<MineAppointmentListItem>((success, error) => {
Logger.info(TAG, `getAppointmentList start`);
this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => {
if (!navResDTO) {
error("page data invalid");
success(this.getAppointmentListDataLocal(context))
return
}
Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
...
...
@@ -103,11 +104,24 @@ class MinePageDatasModel{
success(navigationBean);
}).catch((err: Error) => {
Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
// error(err);
success(this.getAppointmentListDataLocal(context))
})
})
}
async getAppointmentListDataLocal(context?: Context): Promise<MineAppointmentListItem> {
Logger.info(TAG, `getBottomNavDataMock start`);
let compRes: ResponseDTO<MineAppointmentListItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineAppointmentListItem>>('appointment_list_data.json', context);
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return null
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
}
}
const minePageDatasModel = MinePageDatasModel.getInstance()
...
...
Please
register
or
login
to post a comment