lichengjun

Merge remote-tracking branch 'origin/main' into main

# Conflicts:
#	PeopleDaily_Harmony/wdComponent/src/main/ets/Index.ets
#	PeopleDaily_Harmony/wdComponent/src/main/ets/components/PageComponent.ets
#	PeopleDaily_Harmony/wdComponent/src/main/ets/repository/bean/ContentDTO.ets
Showing 96 changed files with 2944 additions and 657 deletions

Too many changes to show.

To preserve performance only 96 of 96+ files are displayed.

  1 +import { ColumnPageComponent } from 'wdComponent';
  2 +
  3 +import { Logger } from 'wdKit';
  4 +
  5 +const TAG = 'ColumnPage';
  6 +
  7 +/**
  8 + * 二级栏目页面,显示展排数据(comp list)
  9 + */
  10 +@Entry
  11 +@Component
  12 +struct ColumnPage {
  13 + aboutToAppear() {
  14 + Logger.info(TAG, `aboutToAppear `);
  15 + }
  16 +
  17 + aboutToDisappear() {
  18 + Logger.info(TAG, 'aboutToDisappear');
  19 + }
  20 +
  21 + onPageShow() {
  22 + Logger.info(TAG, 'onPageShow');
  23 + }
  24 +
  25 + onPageHide() {
  26 + Logger.info(TAG, 'onPageHide');
  27 + }
  28 +
  29 + onBackPress() {
  30 + Logger.info(TAG, 'onBackPress');
  31 + }
  32 +
  33 + build() {
  34 + Column() {
  35 + // TODO 跳转获取id
  36 + ColumnPageComponent({ pageId: "20011", channelId: "2001"});
  37 + }
  38 + }
  39 +}
1 { 1 {
2 "src": [ 2 "src": [
3 "pages/Index", 3 "pages/Index",
4 - "pages/MainPage" 4 + "pages/MainPage",
  5 + "pages/ColumnPage"
5 ] 6 ]
6 } 7 }
@@ -1636,4 +1636,4 @@ @@ -1636,4 +1636,4 @@
1636 "requestId":"", 1636 "requestId":"",
1637 "success":true, 1637 "success":true,
1638 "timestamp":1702881464711 1638 "timestamp":1702881464711
1639 -}  
  1639 +}
1 -  
2 export { PageViewModel } from "./viewmodel/PageViewModel" 1 export { PageViewModel } from "./viewmodel/PageViewModel"
3 2
4 -export { EmptyComponent } from "./components/EmptyComponent" 3 +export { EmptyComponent } from "./components/view/EmptyComponent"
  4 +
  5 +export { DemoPreviewerComponent } from "./components/DemoPreviewerComponent"
  6 +
  7 +export { ErrorComponent } from "./components/view/ErrorComponent"
5 8
6 -export { ErrorComponent } from "./components/ErrorComponent" 9 +export { LoadingComponent } from "./components/view/LoadingComponent"
7 10
8 -export { LoadingComponent } from "./components/LoadingComponent" 11 +export { PageComponent } from "./components/page/PageComponent"
9 12
10 -export { PageComponent } from "./components/PageComponent" 13 +export { BottomNavigationComponent } from "./components/page/BottomNavigationComponent"
11 14
12 -export { BottomNavigationComponent } from "./components/BottomNavigationComponent" 15 +export { TopNavigationComponent } from "./components/page/TopNavigationComponent"
13 16
14 -export { TopNavigationComponent } from "./components/TopNavigationComponent" 17 +export { LabelComponent } from "./components/view/LabelComponent"
15 18
16 -export { LabelComponent } from "./components/LabelComponent" 19 +export { SmallVideoCardComponent } from "./components/view/SmallVideoCardComponent"
17 20
18 -export { SmallVideoCardComponent } from "./components/SmallVideoCardComponent" 21 +export { BannerComponent } from "./components/view/BannerComponent"
  22 +
  23 +export { ColumnPageComponent } from "./components/page/ColumnPageComponent"
19 24
20 export { TriPicCardComponent } from "./components/TriPicCardComponent" 25 export { TriPicCardComponent } from "./components/TriPicCardComponent"
21 26
22 -export { BigPicCardComponent } from "./components/BigPicCardComponent"  
  27 +export { BigPicCardComponent } from "./components/BigPicCardComponent"
  28 +
  1 +import { CommonConstants, CompStyle } from 'wdConstant';
  2 +import { CompDTO } from '../repository/bean/CompDTO';
  3 +import { BannerComponent } from './view/BannerComponent';
  4 +import { LabelComponent } from './view/LabelComponent';
  5 +import { TitleAbbrComponent } from './view/TitleAbbrComponent';
  6 +import { TitleAllComponent } from './view/TitleAllComponent';
  7 +import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
  8 +import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/HorizontalStrokeCardThreeTwoRadioForTwoComponent';
  9 +import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
  10 +
  11 +/**
  12 + * comp适配器.
  13 + */
  14 +@Component
  15 +export struct CompParser {
  16 + compDTO: CompDTO = {} as CompDTO;
  17 + compIndex: number = 0;
  18 +
  19 + build() {
  20 + this.componentBuilder(this.compDTO, this.compIndex);
  21 + }
  22 +
  23 + @Builder
  24 + componentBuilder(compDTO: CompDTO, compIndex: number) {
  25 + if (compDTO.compStyle === CompStyle.Label_03) {
  26 + LabelComponent({ compDTO: compDTO })
  27 + } else if (compDTO.compStyle === CompStyle.Title_Abbr_01) {
  28 + TitleAbbrComponent({ compDTO: compDTO })
  29 + } else if (compDTO.compStyle === CompStyle.Title_All_01) {
  30 + TitleAllComponent({ compDTO: compDTO })
  31 + } else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) {
  32 + BannerComponent({ compDTO: compDTO })
  33 + } else {
  34 + // todo:组件未实现 / Component Not Implemented
  35 + Text(compDTO.compStyle)
  36 + .width(CommonConstants.FULL_PARENT)
  37 + .padding(10)
  38 + // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle
  39 + }
  40 + }
  41 +}
  1 +import { CompDTO } from '../repository/bean/CompDTO';
  2 +import { ContentDTO } from '../repository/bean/ContentDTO';
  3 +
  4 +const FULL_PARENT: string = '100%';
  5 +const COLUMNS_TEMPLATE_ONE: string = '1fr';
  6 +const COLUMNS_TEMPLATE_TWO: string = '1fr 1fr';
  7 +const COLUMNS_TEMPLATE_THREE: string = '1fr 1fr 1fr';
  8 +const COLUMNS_TEMPLATE_FOUR: string = '1fr 1fr 1fr 1fr';
  9 +const COLUMNS_TEMPLATE_SIX: string = '1fr 1fr 1fr 1fr 1fr 1fr';
  10 +
  11 +const TAG = 'DemoPreviewerComponent';
  12 +
  13 +/**
  14 + * xxxx 布局及功能说明
  15 + *
  16 + * 【查看ArkUI预览效果】在线参考文档:
  17 + * https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/previewer-0000001054328973-V3#section146052489820
  18 + */
  19 +@Entry
  20 +@Component
  21 +export struct DemoPreviewerComponent {
  22 + @State compDTO: CompDTO = {
  23 + compStyle: 'compStyle3',
  24 + operDataList: [
  25 + {
  26 + title: 'title0',
  27 + description: "description0",
  28 + coverUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg'
  29 + } as ContentDTO,
  30 + {
  31 + title: 'title1 title1 title1 title1 title1 title1 title1 title1 title1',
  32 + description: "description1",
  33 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240104/image/display/c4a9b526e0994d1bbd3ac8450f5cfc6c.jpg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  34 + } as ContentDTO,
  35 + {
  36 + title: 'title2',
  37 + description: "description2",
  38 + "coverUrl": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231206/image/live/bbe6d821e92b48919d90c7dadfd1f05a.jpg?x-oss-process=image/resize,l_850/auto-orient,1/quality,q_95/format,jpg",
  39 + } as ContentDTO,
  40 + {
  41 + title: 'title3',
  42 + description: "description3",
  43 + coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231109/image/live/102e6eb9356b4ef19405b04c1f6ff875.png?x-oss-process=image/resize,l_850/auto-orient,1/quality,q_95/format,jpg'
  44 + } as ContentDTO,
  45 + {
  46 + title: 'title4',
  47 + description: "description4",
  48 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/62bdbbb35dbd45689e00790c81f04c4b.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  49 + } as ContentDTO,
  50 + {
  51 + title: 'title5',
  52 + description: "description5",
  53 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/f79bbaa5a33b4bd88176071c4f797ff6.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  54 + } as ContentDTO,
  55 + {
  56 + title: 'title6',
  57 + description: "description6",
  58 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/2c1d917009584ce2bb4a35cbb3a860a0.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  59 + } as ContentDTO,
  60 + {
  61 + title: 'title7',
  62 + description: "description7",
  63 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231222/image/display/117dc516ca5c42d5843c0d32050c9fc6.jpeg?x-oss-process=image/resize,w_240/quality,q_90/format,jpg",
  64 + } as ContentDTO,
  65 + {
  66 + title: 'title8',
  67 + description: "description8",
  68 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231228/image/display/90a2db4077d44a1f887f068fc659d977.jpeg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  69 + } as ContentDTO
  70 + ]
  71 + } as CompDTO
  72 +
  73 + aboutToAppear() {
  74 + // this.compDTO = {
  75 + // compStyle: 'compStyle3',
  76 + // operDataList: [
  77 + // {
  78 + // title: 'title0',
  79 + // description: "description0",
  80 + // coverUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg'
  81 + // } as ContentDTO
  82 + // ]
  83 + // } as CompDTO
  84 +
  85 + this.compDTO.operDataList[0].title = 'title_first_0'
  86 + }
  87 +
  88 + build() {
  89 + Grid() {
  90 + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
  91 + GridItem() {
  92 + this.gridItemView(item, index)
  93 + }
  94 + }, (item: ContentDTO, index: number) => JSON.stringify(item))
  95 + }
  96 + .height(FULL_PARENT)
  97 + .margin({ top: 10, bottom: 10, left: $r('app.float.main_margin'), right: $r('app.float.main_margin') })
  98 + .columnsTemplate(COLUMNS_TEMPLATE_TWO)
  99 + .columnsGap(4)
  100 + .rowsGap(2)
  101 + }
  102 +
  103 + /**
  104 + * 布局描述
  105 + *
  106 + * @param ContentDTO item 组件项
  107 + * @param index
  108 + */
  109 + @Builder
  110 + gridItemView(item: ContentDTO, index: number) {
  111 + Column() {
  112 + Image(item.coverUrl)
  113 + .width(FULL_PARENT)// .aspectRatio(3 / 4) // 宽/高比:纵向
  114 + // .aspectRatio(1 / 1) // 宽/高比:正方形
  115 + .aspectRatio(16 / 9)// 宽/高比:横向
  116 + .margin({ top: 8 })
  117 + .borderRadius(10)
  118 +
  119 + Text(item.title)
  120 + .width(FULL_PARENT)
  121 + .margin({ top: 4, left: 2, right: 2, bottom: 4 })
  122 + .backgroundColor(Color.White)
  123 + .fontWeight(FontWeight.Bold)// .textAlign(TextAlign.Center)
  124 + .fontSize($r('app.float.font_size_12'))
  125 + .fontColor('#808080')
  126 + .maxLines(1)
  127 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  128 + }
  129 + .width(FULL_PARENT)
  130 + .backgroundColor(Color.Yellow)
  131 + .justifyContent(FlexAlign.Center)
  132 + .onClick(() => {
  133 + console.info(TAG, `gridItemView onClick, index: ${index}`);
  134 + // MGRouterRule.jumpWithAction(item.action)
  135 + })
  136 + }
  137 +}
  1 +import { CommonConstants } from 'wdConstant';
  2 +import { CompDTO } from '../repository/bean/CompDTO';
  3 +import { CompUtils } from '../utils/CompUtils';
  4 +
  5 +@Component
  6 +export struct HeadPictureCardComponent {
  7 + @State compDTO: CompDTO = {} as CompDTO
  8 +
  9 + build() {
  10 + Stack() {
  11 + Image(this.compDTO.backgroundImgUrl)
  12 + .width(CommonConstants.FULL_WIDTH)
  13 + .height(CommonConstants.FULL_HEIGHT)
  14 + Row()
  15 + .width(CommonConstants.FULL_WIDTH)
  16 + .height(59)
  17 + .linearGradient({
  18 + colors:[
  19 + ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
  20 + ]
  21 + })
  22 + Row() {
  23 + Text(CompUtils.getLabelTitle(this.compDTO.extraData))
  24 + .width(CommonConstants.FULL_WIDTH)
  25 + .height(CommonConstants.FULL_HEIGHT)
  26 + .fontColor(Color.White)
  27 + .fontSize($r('app.float.normal_text_size'))
  28 + .fontWeight(FontWeight.Bold)
  29 + }
  30 + .height(25)
  31 + .margin({left: 12, bottom: 10, right: 12})
  32 + }
  33 + .alignContent(Alignment.Bottom)
  34 + }
  35 +}
1 -import { CommonConstants, CompStyle, ViewType } from 'wdConstant';  
2 -import { LazyDataSource, Logger } from 'wdKit';  
3 -import { CompDTO } from '../repository/bean/CompDTO';  
4 -import PageViewModel from '../viewmodel/PageViewModel';  
5 -import { EmptyComponent } from './EmptyComponent';  
6 -import { ErrorComponent } from './ErrorComponent';  
7 -import { LabelComponent } from './LabelComponent';  
8 -import { LoadingComponent } from './LoadingComponent';  
9 -import { TitleAbbrComponent } from './TitleAbbrComponent';  
10 -import { TitleAllComponent } from './TitleAllComponent';  
11 -import { BigPicCardComponent } from './BigPicCardComponent';  
12 -import { TriPicCardComponent } from './TriPicCardComponent';  
13 -  
14 -const TAG = 'PageComponent';  
15 -  
16 -@Component  
17 -export struct PageComponent {  
18 - @State viewType: number = ViewType.LOADED;  
19 - // Group数据及子组件数据  
20 - @State compList: LazyDataSource<CompDTO> = new LazyDataSource();  
21 - @State currentTopNavSelectedIndex: number = 0;  
22 - @State pageId: string = "";  
23 - @State channelId: string = "";  
24 -  
25 - // @Link @Watch('onChange') paIndex:number  
26 -  
27 - build() {  
28 - if (this.viewType == ViewType.LOADING) {  
29 - LoadingComponent()  
30 - } else if (this.viewType == ViewType.ERROR) {  
31 - ErrorComponent()  
32 - } else if (this.viewType == ViewType.EMPTY) {  
33 - EmptyComponent()  
34 - } else {  
35 - List() {  
36 - LazyForEach(this.compList, (compDTO: CompDTO, compIndex: number) => {  
37 - ListItem() {  
38 - Column() {  
39 - this.componentBuilder(compDTO, compIndex)  
40 - }  
41 - }  
42 - })  
43 - }  
44 - .cachedCount(5)  
45 - .height(CommonConstants.FULL_PARENT)  
46 - }  
47 - }  
48 -  
49 - @Builder  
50 - componentBuilder(compDTO: CompDTO, compIndex: number) {  
51 - if (compDTO.compStyle === CompStyle.Label_03) {  
52 - LabelComponent({ compDTO: compDTO })  
53 - } else if (compDTO.compStyle === CompStyle.Title_Abbr_01) {  
54 - TitleAbbrComponent({ compDTO: compDTO })  
55 - } else if (compDTO.compStyle === CompStyle.Title_All_01) {  
56 - TitleAllComponent({ compDTO: compDTO })  
57 - } else if (compDTO.compStyle === "2") {  
58 - BigPicCardComponent({ compDTO: compDTO })  
59 - } else if (compDTO.compStyle === "4") {  
60 - TriPicCardComponent({ compDTO: compDTO })  
61 - } else {  
62 - // todo:组件未实现 / Component Not Implemented  
63 - Text(compDTO.compStyle)  
64 - .width(CommonConstants.FULL_PARENT)  
65 - .padding(10)  
66 - // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle  
67 - }  
68 - }  
69 -  
70 - async aboutToAppear() {  
71 - Logger.info(TAG, `aboutToAppear, this.pageId: ${this.viewType} this.currentTopNavSelectedIndex: ${this.currentTopNavSelectedIndex}`);  
72 - // if (this.currentTopNavSelectedIndex === 1) { // 顶导tab的第0个item是【热点】,第1个item是【推荐】  
73 - // this.compList.replaceAll()  
74 - // let pageDto = await PageViewModel.getPageData2(getContext(this))  
75 - // if (pageDto && pageDto.compList) {  
76 - // this.compList.push(...pageDto.compList)  
77 - // }  
78 - // } else {  
79 - // let pageDto = await PageViewModel.getPageData1(getContext(this))  
80 - // if (pageDto && pageDto.compList) {  
81 - // this.compList.push(...pageDto.compList)  
82 - // }  
83 - // }  
84 -  
85 - // if (this.currentTopNavSelectedIndex != 1) { // 顶导tab的第0个item是【热点】,第1个item是【推荐】  
86 - // return  
87 - // }  
88 - Logger.debug(TAG,'lllllalalal: ' + this.pageId+' , ' + this.channelId);  
89 - let pageDto = await PageViewModel.getPageData(this.pageId, this.pageId, this.channelId)  
90 - if (pageDto && pageDto.compList) {  
91 - this.compList.push(...pageDto.compList)  
92 - }  
93 - }  
94 -}  
95 -  
1 import { BottomNavi, CommonConstants } from 'wdConstant'; 1 import { BottomNavi, CommonConstants } from 'wdConstant';
2 import { Logger } from 'wdKit'; 2 import { Logger } from 'wdKit';
3 import { TopNavigationComponent } from './TopNavigationComponent'; 3 import { TopNavigationComponent } from './TopNavigationComponent';
4 -import { BottomNavDTO } from '../repository/bean/BottomNavDTO';  
5 -import { UIUtils } from '../repository/UIUtils'; 4 +import { BottomNavDTO } from '../../repository/bean/BottomNavDTO';
  5 +import { UIUtils } from '../../repository/UIUtils';
6 import { MinePageComponent } from './MinePageComponent'; 6 import { MinePageComponent } from './MinePageComponent';
7 -import PageViewModel from '../viewmodel/PageViewModel'; 7 +import PageViewModel from '../../viewmodel/PageViewModel';
8 8
9 const TAG = 'BottomNavigationComponent'; 9 const TAG = 'BottomNavigationComponent';
10 10
@@ -31,7 +31,7 @@ export struct BottomNavigationComponent { @@ -31,7 +31,7 @@ export struct BottomNavigationComponent {
31 31
32 async aboutToAppear() { 32 async aboutToAppear() {
33 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`); 33 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`);
34 - let bottomNav = await PageViewModel.getBottomNavData() 34 + let bottomNav = await PageViewModel.getBottomNavData(getContext(this))
35 if (bottomNav && bottomNav.bottomNavList != null) { 35 if (bottomNav && bottomNav.bottomNavList != null) {
36 Logger.info(TAG, `aboutToAppear, bottomNav.length: ${bottomNav.bottomNavList.length}`); 36 Logger.info(TAG, `aboutToAppear, bottomNav.length: ${bottomNav.bottomNavList.length}`);
37 this.bottomNavList = bottomNav.bottomNavList 37 this.bottomNavList = bottomNav.bottomNavList
  1 +import { PageComponent } from './PageComponent';
  2 +
  3 +const TAG = 'ColumnPageComponent';
  4 +
  5 +/**
  6 + * 二级栏目页面,展排数据
  7 + */
  8 +@Component
  9 +export struct ColumnPageComponent {
  10 + @State currentTopNavSelectedIndex: number = 0;
  11 + pageId: string = "";
  12 + channelId: string = "";
  13 +
  14 + build() {
  15 + PageComponent({
  16 + currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
  17 + navIndex: this.currentTopNavSelectedIndex,
  18 + pageId: this.pageId,
  19 + channelId: this.channelId,
  20 + });
  21 +
  22 + }
  23 +}
  24 +
  1 +import { RefreshConstants } from '../../utils/RefreshConstants';
  2 +import { RefreshLayoutBean } from './RefreshLayoutBean';
  3 +
  4 +/**
  5 + * Custom layout to show refresh or load.
  6 + */
  7 +@Component
  8 +export default struct CustomLayout {
  9 + @ObjectLink refreshBean: RefreshLayoutBean;
  10 +
  11 + build() {
  12 + Row() {
  13 + Image(this.refreshBean.imageSrc)
  14 + .width(RefreshConstants.RefreshLayout_IMAGE_WIDTH)
  15 + .height(RefreshConstants.RefreshLayout_IMAGE_HEIGHT)
  16 +
  17 + Text(this.refreshBean.textValue)
  18 + .margin({
  19 + left: RefreshConstants.RefreshLayout_TEXT_MARGIN_LEFT,
  20 + bottom: RefreshConstants.RefreshLayout_TEXT_MARGIN_BOTTOM
  21 + })
  22 + .fontSize(RefreshConstants.RefreshLayout_TEXT_FONT_SIZE)
  23 + .textAlign(TextAlign.Center)
  24 + }
  25 + .clip(true)
  26 + .width(RefreshConstants.FULL_WIDTH)
  27 + .justifyContent(FlexAlign.Center)
  28 + .height(this.refreshBean.heightValue)
  29 + }
  30 +}
  1 +import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
  2 +import { RefreshLayoutBean } from './RefreshLayoutBean';
  3 +
  4 +/**
  5 + * The load more layout component.
  6 + */
  7 +@Component
  8 +export default struct LoadMoreLayout {
  9 + @ObjectLink refreshBean: RefreshLayoutBean;
  10 +
  11 + build() {
  12 + Column() {
  13 + if (this.refreshBean.isVisible) {
  14 + CustomRefreshLoadLayout({
  15 + refreshBean: new RefreshLayoutBean(this.refreshBean.isVisible,
  16 + this.refreshBean.imageSrc, this.refreshBean.textValue, this.refreshBean.heightValue)
  17 + })
  18 + } else {
  19 + CustomRefreshLoadLayout({
  20 + refreshBean: new RefreshLayoutBean(this.refreshBean.isVisible,
  21 + this.refreshBean.imageSrc, this.refreshBean.textValue, 0)
  22 + })
  23 + }
  24 + }
  25 + }
  26 +}
  1 +import { RefreshConstants } from '../../utils/RefreshConstants'
  2 +
  3 +/**
  4 + * The No more data layout component.
  5 + */
  6 +@Component
  7 +export default struct NoMoreLayout {
  8 + build() {
  9 + Row() {
  10 + Text($r('app.string.footer_text'))
  11 + .margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING })
  12 + .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
  13 + .textAlign(TextAlign.Center)
  14 + }
  15 + .width(RefreshConstants.FULL_WIDTH)
  16 + .justifyContent(FlexAlign.Center)
  17 + .height(RefreshConstants.CUSTOM_LAYOUT_HEIGHT)
  18 + }
  19 +}
  1 +import { CommonConstants, ViewType } from 'wdConstant';
  2 +import { Logger } from 'wdKit';
  3 +import { CompDTO } from '../../repository/bean/CompDTO';
  4 +import PageViewModel from '../../viewmodel/PageViewModel';
  5 +import { EmptyComponent } from '../view/EmptyComponent';
  6 +import { ErrorComponent } from '../view/ErrorComponent';
  7 +import PageModel from '../../viewmodel/PageModel';
  8 +import { listTouchEvent } from '../../utils/PullDownRefresh';
  9 +import RefreshLayout from './RefreshLayout';
  10 +import { RefreshLayoutBean } from './RefreshLayoutBean';
  11 +import NoMoreLayout from './NoMoreLayout';
  12 +import LoadMoreLayout from './LoadMoreLayout';
  13 +import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
  14 +import { CompParser } from '../CompParser';
  15 +
  16 +const TAG = 'PageComponent';
  17 +
  18 +@Component
  19 +export struct PageComponent {
  20 + @State private pageModel: PageModel = new PageModel();
  21 + navIndex: number = 0;
  22 + pageId: string = "";
  23 + channelId: string = "";
  24 + @Link @Watch('onChange') currentTopNavSelectedIndex: number
  25 +
  26 + build() {
  27 + Column() {
  28 + if (this.pageModel.viewType == ViewType.LOADING) {
  29 + // LoadingComponent()
  30 + this.LoadingLayout()
  31 + } else if (this.pageModel.viewType == ViewType.ERROR) {
  32 + ErrorComponent()
  33 + } else if (this.pageModel.viewType == ViewType.EMPTY) {
  34 + EmptyComponent()
  35 + } else {
  36 + this.ListLayout()
  37 + }
  38 + }
  39 + .width(CommonConstants.FULL_PARENT)
  40 + .height(CommonConstants.FULL_PARENT)
  41 + .onTouch((event: TouchEvent | undefined) => {
  42 + if (event) {
  43 + if (this.pageModel.viewType === ViewType.LOADED) {
  44 + listTouchEvent(this.pageModel, event);
  45 + }
  46 + }
  47 + })
  48 +
  49 + }
  50 +
  51 + @Builder ListLayout() {
  52 + List() {
  53 + // 下拉刷新
  54 + ListItem() {
  55 + RefreshLayout({
  56 + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
  57 + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
  58 + })
  59 + }
  60 +
  61 + LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
  62 + ListItem() {
  63 + Column() {
  64 + CompParser({ compDTO: compDTO, compIndex: compIndex });
  65 + }
  66 + }
  67 + })
  68 +
  69 + // 加载更多
  70 + ListItem() {
  71 + if (this.pageModel.hasMore) {
  72 + LoadMoreLayout({
  73 + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
  74 + this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
  75 + })
  76 + } else {
  77 + NoMoreLayout()
  78 + }
  79 + }
  80 + }
  81 + .cachedCount(5)
  82 + .height(CommonConstants.FULL_PARENT)
  83 + .onScrollIndex((start: number, end: number) => {
  84 + // Listen to the first index of the current list.
  85 + this.pageModel.startIndex = start;
  86 + // 包含了 头尾item,判断时需要考虑+2
  87 + this.pageModel.endIndex = end;
  88 + })
  89 + }
  90 +
  91 + @Builder LoadingLayout() {
  92 + CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,
  93 + $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight) })
  94 + }
  95 +
  96 + async aboutToAppear() {
  97 + // 选中tab,才请求数据。拦截大量接口请求
  98 + if (this.navIndex === this.currentTopNavSelectedIndex) {
  99 + this.getData();
  100 + }
  101 + }
  102 +
  103 + onChange() {
  104 + if (this.navIndex === this.currentTopNavSelectedIndex) {
  105 + this.getData();
  106 + }
  107 + }
  108 +
  109 + async getData() {
  110 + Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`);
  111 + this.pageModel.pageId = this.pageId;
  112 + this.pageModel.groupId = this.pageId;
  113 + this.pageModel.channelId = this.channelId;
  114 + this.pageModel.currentPage = 1;
  115 + let pageDto = await PageViewModel.getPageData(this.pageModel.pageId, this.pageModel.pageId, this.pageModel.channelId
  116 + , this.pageModel.currentPage, this.pageModel.pageSize, getContext(this))
  117 + if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
  118 + this.pageModel.viewType = ViewType.LOADED;
  119 + this.pageModel.compList.push(...pageDto.compList)
  120 + if (pageDto.compList.length === this.pageModel.pageSize) {
  121 + this.pageModel.currentPage++;
  122 + this.pageModel.hasMore = true;
  123 + } else {
  124 + this.pageModel.hasMore = false;
  125 + }
  126 + } else {
  127 + Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
  128 + this.pageModel.viewType = ViewType.EMPTY;
  129 + }
  130 + }
  131 +}
  132 +
  1 +import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
  2 +import { RefreshLayoutBean } from './RefreshLayoutBean';
  3 +
  4 +/**
  5 + * The refresh layout component.
  6 + */
  7 +@Component
  8 +export default struct RefreshLayout {
  9 + @ObjectLink refreshBean: RefreshLayoutBean;
  10 +
  11 + build() {
  12 + Column() {
  13 + if (this.refreshBean.isVisible) {
  14 + CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean
  15 + (this.refreshBean.isVisible, this.refreshBean.imageSrc, this.refreshBean.textValue,
  16 + this.refreshBean.heightValue) })
  17 + }
  18 + }
  19 + }
  20 +}
  1 +/**
  2 + * Custom refresh load layout data.
  3 + */
  4 +@Observed
  5 +export class RefreshLayoutBean {
  6 + /**
  7 + * Custom refresh load layout isVisible.
  8 + */
  9 + isVisible: boolean;
  10 +
  11 + /**
  12 + * Custom refresh load layout imageSrc.
  13 + */
  14 + imageSrc: Resource;
  15 +
  16 + /**
  17 + * Custom refresh load layout textValue.
  18 + */
  19 + textValue: Resource;
  20 +
  21 + /**
  22 + * Custom refresh load layout heightValue.
  23 + */
  24 + heightValue: number;
  25 +
  26 + constructor(isVisible: boolean, imageSrc: Resource, textValue: Resource, heightValue: number) {
  27 + this.isVisible = isVisible;
  28 + this.imageSrc = imageSrc;
  29 + this.textValue = textValue;
  30 + this.heightValue = heightValue;
  31 + }
  32 +}
1 import { LazyDataSource, Logger } from 'wdKit'; 1 import { LazyDataSource, Logger } from 'wdKit';
2 -import { CompDTO } from '../repository/bean/CompDTO';  
3 -import { TopNavDTO } from '../repository/bean/TopNavDTO'; 2 +import { CompDTO } from '../../repository/bean/CompDTO';
  3 +import { TopNavDTO } from '../../repository/bean/TopNavDTO';
4 import { PageComponent } from './PageComponent'; 4 import { PageComponent } from './PageComponent';
5 5
6 const TAG = 'TopNavigationComponent'; 6 const TAG = 'TopNavigationComponent';
@@ -21,7 +21,12 @@ export struct TopNavigationComponent { @@ -21,7 +21,12 @@ export struct TopNavigationComponent {
21 Tabs() { 21 Tabs() {
22 ForEach(this.topNavList, (navItem: TopNavDTO, index: number) => { 22 ForEach(this.topNavList, (navItem: TopNavDTO, index: number) => {
23 TabContent() { 23 TabContent() {
24 - PageComponent({ currentTopNavSelectedIndex: index, pageId: navItem.pageId, channelId: navItem.channelId }) 24 + PageComponent({
  25 + currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
  26 + navIndex: index,
  27 + pageId: navItem.pageId,
  28 + channelId: navItem.channelId
  29 + })
25 } 30 }
26 .tabBar(this.tabBarBuilder(navItem, index)) 31 .tabBar(this.tabBarBuilder(navItem, index))
27 }, (navItem: TopNavDTO) => JSON.stringify(navItem)); 32 }, (navItem: TopNavDTO) => JSON.stringify(navItem));
  1 +/**
  2 + * BannerComponent
  3 + * 轮播图卡/单图
  4 + * 邢照杰
  5 + */
  6 +
  7 +import { CommonConstants } from 'wdConstant';
  8 +import colorSpaceManager from '@ohos.graphics.colorSpaceManager';
  9 +import { CompDTO } from '../../repository/bean/CompDTO';
  10 +import { CompUtils } from '../../utils/CompUtils';
  11 +import { ContentDTO } from '../../repository/bean/ContentDTO';
  12 +
  13 +
  14 +const TAG = 'BannerComponent';
  15 +let timerIds: number[] = [];
  16 +
  17 +
  18 +/**
  19 + * 轮播卡(暂时仅展示主标题,不展示子标题)
  20 + * comp类型
  21 + * 重磅推荐/精选/电视剧/电影/综艺/短剧/更多>/
  22 + */
  23 +@Entry
  24 +@Component
  25 +export struct BannerComponent {
  26 + @State compDTO: CompDTO = {} as CompDTO
  27 + @State index: number = 0;
  28 + private bannerContent:ContentDTO;
  29 + private swiperController: SwiperController = new SwiperController();
  30 +
  31 + aboutToAppear() {
  32 +
  33 + // Data Initialization.
  34 + this.bannerContent = this.compDTO.operDataList[0];
  35 + // Turn on scheduled task.
  36 + if (this.compDTO.operDataList.length > 1) {
  37 + startPlay(this.swiperController);
  38 + }
  39 + }
  40 +
  41 + aboutToDisappear() {
  42 + stopPlay();
  43 + }
  44 +
  45 + build() {
  46 + // 整体父视图
  47 + Column() {
  48 + // 判断数组元素个数
  49 + if (this.compDTO.operDataList.length > 1) {
  50 + // 滚动banner
  51 + Swiper(this.swiperController) {
  52 + ForEach(this.compDTO.operDataList, item => {
  53 + Stack() {
  54 + // 背景图
  55 + Image(item.coverUrl)
  56 + .objectFit(ImageFit.Fill)
  57 + .borderRadius(5)
  58 +
  59 + // 底部标题和时间
  60 + Column() {
  61 + Text(item.description)
  62 + .fontSize(18)
  63 + .margin({ bottom: 4 })
  64 + .fontColor(Color.White)
  65 + .fontWeight(600)
  66 + .maxLines(1)
  67 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  68 + .padding({ left: 10, right: 5 })
  69 + .width('100%')
  70 + .textAlign(TextAlign.Start)
  71 + if (item.lengthTime) {
  72 + Row() {
  73 + Image($r('app.media.videoTypeIcon'))
  74 + .height(20)
  75 + .width(20)
  76 + // .margin({right:3})
  77 + Text(item.lengthTime)
  78 + .padding({ left: 5, right: 5 })
  79 + .fontColor(Color.White)
  80 + }
  81 + .backgroundColor('#333333')
  82 + .height(20)
  83 + .margin({ right: 5, bottom: 3 })
  84 + .alignSelf(ItemAlign.End)
  85 + .borderRadius(2)
  86 + }
  87 + }
  88 + .height('50')
  89 + .width('100%')
  90 + }
  91 + .alignContent(Alignment.BottomStart)
  92 + }, item => JSON.stringify(item))
  93 + }
  94 + .width('100%')
  95 + .height('100%')
  96 + .index(this.index)
  97 + .indicatorStyle({
  98 + selectedColor: Color.White,
  99 + color: Color.Gray,
  100 + size: 18,
  101 + left: 15
  102 + })
  103 + .indicator(true)
  104 + .duration(500)
  105 + } else {
  106 + // 不滚动banner
  107 + Stack() {
  108 + // 背景图
  109 + Image(this.bannerContent.coverUrl.toString())
  110 + .objectFit(ImageFit.Fill)
  111 + .borderRadius(5)
  112 +
  113 + // 底部标题和时间
  114 + Row() {
  115 + // 标题
  116 + Text(this.bannerContent.description.toString())
  117 + .fontSize(18)
  118 + .fontColor(Color.White)
  119 + .fontWeight(600)
  120 + .maxLines(2)
  121 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  122 + .padding({ left: 10, right: 0 ,bottom: 5 })
  123 + .width('80%')
  124 + // 时间
  125 + if (this.bannerContent.lengthTime) {
  126 + Row() {
  127 + Image($r('app.media.videoTypeIcon'))
  128 + .height(20)
  129 + .width(20)
  130 + // .margin({right:3})
  131 + Text(this.bannerContent.lengthTime.toString())
  132 + .padding({ left: 5, right: 5 })
  133 + .fontColor(Color.White)
  134 + }
  135 + .backgroundColor('#333333')
  136 + .height(20)
  137 + .borderRadius(2)
  138 + .margin({ bottom: 6 })
  139 + }
  140 + }
  141 + .width('100%')
  142 + .height('100%')
  143 + .alignItems(VerticalAlign.Bottom)
  144 + }
  145 + .alignContent(Alignment.BottomStart)
  146 + .width('100%')
  147 + .height('100%')
  148 + }
  149 + }
  150 + .width('100%')
  151 + .aspectRatio(1.7)
  152 + .padding({left:10,right:15,top:10,bottom:10})
  153 + }
  154 +}
  155 +
  156 +/**
  157 + * start scheduled task.
  158 + *
  159 + * @param swiperController Controller.
  160 + */
  161 +export function startPlay(swiperController: SwiperController) {
  162 + let timerId = setInterval(() => {
  163 + swiperController.showNext();
  164 + }, 3000);
  165 + timerIds.push(timerId);
  166 +}
  167 +
  168 +/**
  169 + * stop scheduled task.
  170 + */
  171 +export function stopPlay() {
  172 + timerIds.forEach((item) => {
  173 + clearTimeout(item);
  174 + })
  175 +}
@@ -46,7 +46,7 @@ export struct EmptyComponent { @@ -46,7 +46,7 @@ export struct EmptyComponent {
46 46
47 Text(this.buildNoDataTip()) 47 Text(this.buildNoDataTip())
48 .fontSize($r('app.float.normal_text_size')) 48 .fontSize($r('app.float.normal_text_size'))
49 - .fontColor('#B2B2B2') 49 + .fontColor('#000000')
50 .fontWeight(FontWeight.Normal) 50 .fontWeight(FontWeight.Normal)
51 .opacity(this.TEXT_OPACITY) 51 .opacity(this.TEXT_OPACITY)
52 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 52 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
  1 +import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from '../../repository/bean/CompDTO'
  3 +
  4 +@Component
  5 +export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
  6 + @State compDTO: CompDTO = {} as CompDTO
  7 + private arr: number[] = [0, 1, 2]
  8 + build() {
  9 + Column() {
  10 + Row() {
  11 + Row() {
  12 + Image($r("app.media.redLine"))
  13 + .width(3)
  14 + .height(16)
  15 + .margin({ right: 4 })
  16 + Text("大标题")
  17 + .fontSize($r("app.float.font_size_17"))
  18 + .fontColor($r("app.color.color_222222"))
  19 + .fontWeight(600)
  20 + }
  21 +
  22 + Row() {
  23 + Text("更多")
  24 + .fontSize($r("app.float.font_size_14"))
  25 + .fontColor($r("app.color.color_999999"))
  26 + .margin({ right: 1 })
  27 + Image($r("app.media.more"))
  28 + .width(14)
  29 + .height(14)
  30 + }
  31 + }.justifyContent(FlexAlign.SpaceBetween)
  32 + .padding({left:16,right:16})
  33 + .margin({top:8 ,bottom:8})
  34 + .width('100%')
  35 + // .backgroundColor($r("app.color.white"))
  36 + List({ space: 12 }) {
  37 +
  38 + ForEach(this.arr, (item: number) => {
  39 + ListItem() {
  40 + Column() {
  41 + Image($r("app.media.setting"))
  42 + .aspectRatio(1.5)
  43 + .width(150)
  44 + .borderRadius(4)
  45 + .objectFit(ImageFit.Cover)
  46 +
  47 + Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
  48 + .fontSize($r("app.float.font_size_14"))
  49 + .fontColor($r("app.color.color_212228"))
  50 + .fontWeight(400)
  51 + .maxLines(2)
  52 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  53 + .textAlign(TextAlign.Start)
  54 + .margin({ top: 8 })
  55 + .width(150)
  56 + }
  57 + }
  58 + .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})
  59 + // .offset({x:16})
  60 + }, item => item)
  61 +
  62 + }.listDirection(Axis.Horizontal)
  63 + .width('100%')
  64 + // .backgroundColor($r("app.color.color_FE4B05"))
  65 + // .padding({left:16,right:16})
  66 + // .margin({left:16,right:16})
  67 +
  68 + }
  69 + .width("100%")
  70 + .padding({
  71 + top: 14,
  72 + left: 0,
  73 + right: 0,
  74 + bottom: 14
  75 + })
  76 + .backgroundColor($r("app.color.white"))
  77 + // .backgroundColor($r("app.color.color_FE4B05"))
  78 + .margin({ bottom: 8 })
  79 + }
  80 +}
  81 +
  1 +import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from '../../repository/bean/CompDTO'
  3 +
  4 +@Component
  5 +export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
  6 + @State compDTO: CompDTO = {} as CompDTO
  7 + build() {
  8 + Column() {
  9 + Row() {
  10 + Row() {
  11 + Image($r("app.media.redLine"))
  12 + .width(3)
  13 + .height(16)
  14 + .margin({ right: 4 })
  15 + Text("大标题")
  16 + .fontSize($r("app.float.font_size_17"))
  17 + .fontColor($r("app.color.color_222222"))
  18 + .fontWeight(600)
  19 + }
  20 +
  21 + Row() {
  22 + Text("更多")
  23 + .fontSize($r("app.float.font_size_14"))
  24 + .fontColor($r("app.color.color_999999"))
  25 + .margin({ right: 1 })
  26 + Image($r("app.media.more"))
  27 + .width(14)
  28 + .height(14)
  29 + }
  30 + }.justifyContent(FlexAlign.SpaceBetween)
  31 + .margin({ top: 8 ,bottom: 8})
  32 + .width('100%')
  33 +
  34 +
  35 + Image($r("app.media.setting"))
  36 + .aspectRatio(1.5)
  37 + .width('100%')
  38 + .borderRadius(4)
  39 + .objectFit(ImageFit.Cover)
  40 +
  41 + Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
  42 + .fontSize($r("app.float.font_size_14"))
  43 + .fontColor($r("app.color.color_212228"))
  44 + .fontWeight(400)
  45 + .maxLines(1)
  46 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  47 + .textAlign(TextAlign.Start)
  48 + .margin({ top: 8 })
  49 + .width('100%')
  50 +
  51 + }.width("100%")
  52 + .padding({
  53 + top: 14,
  54 + left: 16,
  55 + right: 16,
  56 + bottom: 14
  57 + })
  58 + .backgroundColor($r("app.color.white"))
  59 + .margin({ bottom: 8 })
  60 + }
  61 +}
  1 +import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from '../../repository/bean/CompDTO'
  3 +
  4 +@Component
  5 +export struct HorizontalStrokeCardThreeTwoRadioForTwoComponent {
  6 + @State compDTO: CompDTO = {} as CompDTO
  7 + private arr: number[] = [0, 1, 2]
  8 + build() {
  9 + Column() {
  10 + Row() {
  11 + Row() {
  12 + Image($r("app.media.redLine"))
  13 + .width(3)
  14 + .height(16)
  15 + .margin({ right: 4 })
  16 + Text("大标题")
  17 + .fontSize($r("app.float.font_size_17"))
  18 + .fontColor($r("app.color.color_222222"))
  19 + .fontWeight(600)
  20 + }
  21 +
  22 + Row() {
  23 + Text("更多")
  24 + .fontSize($r("app.float.font_size_14"))
  25 + .fontColor($r("app.color.color_999999"))
  26 + .margin({ right: 1 })
  27 + Image($r("app.media.more"))
  28 + .width(14)
  29 + .height(14)
  30 + }
  31 + }.justifyContent(FlexAlign.SpaceBetween)
  32 + .padding({left:16,right:16})
  33 + .margin({top:8 ,bottom:8})
  34 + .width('100%')
  35 + // .backgroundColor($r("app.color.white"))
  36 + List({ space: 12 }) {
  37 +
  38 + ForEach(this.arr, (item: number) => {
  39 + ListItem() {
  40 + Column() {
  41 + Image($r("app.media.setting"))
  42 + .aspectRatio(1.5)
  43 + .width(210)
  44 + .borderRadius(4)
  45 + .objectFit(ImageFit.Cover)
  46 +
  47 + Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
  48 + .fontSize($r("app.float.font_size_14"))
  49 + .fontColor($r("app.color.color_212228"))
  50 + .fontWeight(400)
  51 + .maxLines(2)
  52 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  53 + .textAlign(TextAlign.Start)
  54 + .margin({ top: 8 })
  55 + .width(210)
  56 + }
  57 + }
  58 + .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})
  59 + // .offset({x:16})
  60 + }, item => item)
  61 +
  62 + }.listDirection(Axis.Horizontal)
  63 + .width('100%')
  64 + // .backgroundColor($r("app.color.color_FE4B05"))
  65 + // .padding({left:16,right:16})
  66 + // .margin({left:16,right:16})
  67 +
  68 + }
  69 + .width("100%")
  70 + .padding({
  71 + top: 14,
  72 + left: 0,
  73 + right: 0,
  74 + bottom: 14
  75 + })
  76 + .backgroundColor($r("app.color.white"))
  77 + // .backgroundColor($r("app.color.color_FE4B05"))
  78 + .margin({ bottom: 8 })
  79 + }
  80 +}
  81 +
1 import { CommonConstants } from 'wdConstant'; 1 import { CommonConstants } from 'wdConstant';
2 -import { CompDTO } from '../repository/bean/CompDTO';  
3 -import { CompUtils } from '../utils/CompUtils'; 2 +import { CompDTO } from '../../repository/bean/CompDTO';
  3 +import { CompUtils } from '../../utils/CompUtils';
4 4
5 const TAG = 'LabelComponent'; 5 const TAG = 'LabelComponent';
6 6
1 -import { CommonConstants } from 'wdConstant/src/main/ets/constants/CommonConstants' 1 +// import { CommonConstants } from 'wdConstant/src/main/ets/constants/CommonConstants'
2 2
3 @Entry 3 @Entry
4 @Component 4 @Component
@@ -57,7 +57,8 @@ export struct SmallVideoCardComponent { @@ -57,7 +57,8 @@ export struct SmallVideoCardComponent {
57 .backgroundColor($r('app.color.color_4d000000')) 57 .backgroundColor($r('app.color.color_4d000000'))
58 } 58 }
59 } 59 }
60 - .width(CommonConstants.FULL_WIDTH) 60 + // .width(CommonConstants.FULL_WIDTH)
  61 + .width('100%')
61 .height(184) 62 .height(184)
62 .padding({ 63 .padding({
63 top: 14, 64 top: 14,
1 //缩略标题 1 //缩略标题
2 import { CommonConstants } from 'wdConstant' 2 import { CommonConstants } from 'wdConstant'
3 -import { CompDTO } from '../repository/bean/CompDTO' 3 +import { CompDTO } from '../../repository/bean/CompDTO'
4 4
5 @Component 5 @Component
6 export struct TitleAbbrComponent { 6 export struct TitleAbbrComponent {
1 //全标题 "compStyle":"3", 1 //全标题 "compStyle":"3",
2 import { CommonConstants } from 'wdConstant' 2 import { CommonConstants } from 'wdConstant'
3 -import { CompDTO } from '../repository/bean/CompDTO' 3 +import { CompDTO } from '../../repository/bean/CompDTO'
4 4
5 @Component 5 @Component
6 export struct TitleAllComponent { 6 export struct TitleAllComponent {
  1 +export class ContentConstants {
  2 + /* content#objectType,跳转类型:0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 */
  3 + /**
  4 + * 0:不跳转
  5 + */
  6 + static readonly TYPE_NONE: string = "0";
  7 + /**
  8 + * 1:点播
  9 + */
  10 + static readonly TYPE_VOD: string = "1";
  11 + /**
  12 + * 8:图文详情,这里是h5页面
  13 + */
  14 + static readonly TYPE_TELETEXT: string = "8";
  15 +}
@@ -18,6 +18,10 @@ export class HttpUrlUtils { @@ -18,6 +18,10 @@ export class HttpUrlUtils {
18 * 展现comp接口 18 * 展现comp接口
19 */ 19 */
20 static readonly COMP_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo"; 20 static readonly COMP_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
  21 + /**
  22 + * 详情页面详情接口
  23 + */
  24 + static readonly DETAIL_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail";
21 25
22 static getCommonHeaders(): HashMap<string, string> { 26 static getCommonHeaders(): HashMap<string, string> {
23 let headers: HashMap<string, string> = new HashMap<string, string>() 27 let headers: HashMap<string, string> = new HashMap<string, string>()
@@ -46,7 +50,12 @@ export class HttpUrlUtils { @@ -46,7 +50,12 @@ export class HttpUrlUtils {
46 // TODO 判断是否登录 50 // TODO 判断是否登录
47 headers.set('userId', this.getUserId()) 51 headers.set('userId', this.getUserId())
48 headers.set('userType', this.getUserType()) 52 headers.set('userType', this.getUserType())
49 - Logger.debug("TAG", 'getCommonHeaders headers: ' + headers); 53 +
  54 + // Logger.debug("TAG", '******************* commonHeaders headers start ******************************** ');
  55 + // headers.forEach((v,k)=>{
  56 + // Logger.debug("TAG", 'getCommonHeaders header: ' + k + ': ' + v);
  57 + // })
  58 + // Logger.debug("TAG", '******************* commonHeaders headers end ******************************** ');
50 return headers; 59 return headers;
51 } 60 }
52 61
@@ -55,21 +64,32 @@ export class HttpUrlUtils { @@ -55,21 +64,32 @@ export class HttpUrlUtils {
55 return this.HOST + this.BOTTOM_NAV_PATH; 64 return this.HOST + this.BOTTOM_NAV_PATH;
56 } 65 }
57 66
58 - static getCompInfoUrl(pageId: string, groupId: string, channelId: string) { 67 + static getCompInfoUrl(pageId: string, groupId: string, channelId: string, currentPage: number
  68 + , pageSize: number) {
59 let url = this.HOST + this.COMP_PATH; 69 let url = this.HOST + this.COMP_PATH;
60 - // TODO 暂定只请求第一页,后续对接分页加载,参数再调整  
61 - url = url + "?channelStrategy=2&pageSize=20&pageNum=1&loadStrategy=first_load" 70 + // TODO 暂定只请求第一页,后续对接分页加载,参数再调整 first_load?
  71 + url = url + "?channelStrategy=2&loadStrategy=first_load"
62 + "&districtCode=" + this.getDistrictCode() 72 + "&districtCode=" + this.getDistrictCode()
63 + "&provinceCode=" + this.getProvinceCode() 73 + "&provinceCode=" + this.getProvinceCode()
64 + "&cityCode=" + this.getCityCode() 74 + "&cityCode=" + this.getCityCode()
65 - // + "&refreshTime=" + DateTimeUtils.getCurrentTimeMillis()  
66 - + "&refreshTime=" + "1703472405653" 75 + + "&refreshTime=" + DateTimeUtils.getCurrentTimeMillis()
67 + "&pageId=" + pageId 76 + "&pageId=" + pageId
68 + "&groupId=" + groupId 77 + "&groupId=" + groupId
69 - + "&channelId=" + channelId; 78 + + "&channelId=" + channelId
  79 + + "&pageSize=" + pageSize
  80 + + "&pageNum=" + currentPage;
  81 + // Logger.debug("TAG", 'getCompInfoUrl url: '+url);
70 return url; 82 return url;
71 } 83 }
72 84
  85 + static getDetailInfoUrl(relId: string, contentId: string, relType: string) {
  86 + let url = this.HOST + this.DETAIL_PATH;
  87 + url = url + "?relId=" + relId
  88 + + "&contentId=" + contentId
  89 + + "&relType=" + relType;
  90 + // Logger.debug("TAG", 'getCompInfoUrl url: '+url);
  91 + return url;
  92 + }
73 93
74 private static getCity() { 94 private static getCity() {
75 // TODO 对接定位 95 // TODO 对接定位
@@ -87,6 +107,7 @@ export class HttpUrlUtils { @@ -87,6 +107,7 @@ export class HttpUrlUtils {
87 107
88 private static getTimestamp() { 108 private static getTimestamp() {
89 // return DateTimeUtils.getCurrentTime() + ''; 109 // return DateTimeUtils.getCurrentTime() + '';
  110 + // TODO 暂时写死,有些page 真实时间戳 返回数据为空
90 return '155203523'; 111 return '155203523';
91 } 112 }
92 113
@@ -11,9 +11,16 @@ export class PageRepository { @@ -11,9 +11,16 @@ export class PageRepository {
11 return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url, headers) 11 return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url, headers)
12 }; 12 };
13 13
14 - static fetchPageData(pageId: string, groupId: string, channelId: string) {  
15 - let url = HttpUrlUtils.getCompInfoUrl(pageId, groupId, channelId) 14 + static fetchPageData(pageId: string, groupId: string, channelId: string, currentPage: number
  15 + , pageSize: number) {
  16 + let url = HttpUrlUtils.getCompInfoUrl(pageId, groupId, channelId, currentPage, pageSize)
16 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 17 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
17 return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) 18 return WDHttp.get<ResponseDTO<PageDTO>>(url, headers)
18 }; 19 };
  20 +
  21 + static fetchDetailData(relId: string, contentId: string, relType: string) {
  22 + let url = HttpUrlUtils.getDetailInfoUrl(relId, contentId, relType)
  23 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  24 + return WDHttp.get<ResponseDTO<string>>(url, headers)
  25 + };
19 } 26 }
  1 +export interface AuthorListDTO {
  2 + authorName: string;
  3 +}
1 -import { FullColumnImgUrlsDTO } from './FullColumnImgUrlsDTO';  
2 export interface ContentDTO { 1 export interface ContentDTO {
3 cityCode: string; 2 cityCode: string;
4 coverSize: string; 3 coverSize: string;
@@ -11,7 +10,7 @@ export interface ContentDTO { @@ -11,7 +10,7 @@ export interface ContentDTO {
11 heatValue: string; 10 heatValue: string;
12 innerUrl: string; 11 innerUrl: string;
13 landscape: number; 12 landscape: number;
14 - // lengthTime?: any; 13 + lengthTime?: any;
15 linkUrl: string; 14 linkUrl: string;
16 openLikes: number; 15 openLikes: number;
17 openUrl: string; 16 openUrl: string;
@@ -35,6 +34,11 @@ export interface ContentDTO { @@ -35,6 +34,11 @@ export interface ContentDTO {
35 vImageUrl: string; 34 vImageUrl: string;
36 screenType: string; 35 screenType: string;
37 source:string; 36 source:string;
  37 + objectId:string;
  38 + objectType:string;
  39 + channelId:string;
  40 + relId:string;
  41 + relType:string;
38 newsTitle:string; 42 newsTitle:string;
39 publishTime:string; 43 publishTime:string;
40 fullColumnImgUrls:FullColumnImgUrlsDTO[]; 44 fullColumnImgUrls:FullColumnImgUrlsDTO[];
  1 +import { AuthorListDTO } from './AuthorListDTO';
  2 +import { FullColumnImgUrlDTO } from './FullColumnImgUrlDTO';
  3 +import { ReLInfoDTO } from './ReLInfoDTO';
  4 +import { ShareInfoDTO } from './ShareInfoDTO';
  5 +import { VideoInfoDTO } from './VideoInfoDTO';
  6 +
  7 +/**
  8 + * 接口定义:
  9 + * http://192.168.1.3:3300/project/3802/interface/api/200915
  10 + */
  11 +export interface ContentDetailDTO {
  12 + newsId: string;
  13 + newsTitle: string;
  14 + newsShortTitle: string;
  15 + newsDownTitle: string;
  16 + newsBodyTitle: string;
  17 + publishTime: string;
  18 + appstyle: number;
  19 + newsType: number;
  20 + newsSummary: string;
  21 + newsSource: string;
  22 + newsSourceName: string;
  23 + newsContent: string;
  24 + newsContentBak: string;
  25 + newsLinkUrl: string;
  26 + bestNoticer: number;
  27 + newLinkObject?: any;
  28 + newIntroduction: string;
  29 + authorList: AuthorListDTO[];
  30 + editorName: string;
  31 + openAudio: number;
  32 + audioList: any[];
  33 + hasPopUp?: any;
  34 + popUps?: any[];
  35 + firstFrameImageUri: string;
  36 + reLInfo?: ReLInfoDTO;
  37 + fullColumnImgUrls: FullColumnImgUrlDTO[];
  38 + shareInfo: ShareInfoDTO;
  39 + photoList: any[];
  40 + videoInfo: VideoInfoDTO[];
  41 + liveInfo?: any;
  42 + voteInfo?: any;
  43 + rmhInfo?: any;
  44 + userInfo?: any;
  45 + openLikes: number;
  46 + openComment: number;
  47 + likesStyle: number;
  48 + preCommentFlag: number;
  49 + commentDisplay: number;
  50 + keyArticle: number;
  51 + rmhPlatform: number;
  52 + readFlag?: number;
  53 + topicInfo?: any;
  54 + traceId: string;
  55 + itemId: string;
  56 + sceneId: string;
  57 + subSceneId: string;
  58 + activityInfos: any[];
  59 + recommendShow: number;
  60 + visitorComment: number;
  61 + itemTypeCode: string;
  62 + menuShow: number;
  63 + newsTags: string;
  64 + specialColumnId?: any;
  65 + specialColumnName: string;
  66 + timeline?: any;
  67 + traceInfo: string;
  68 + viewCount: number;
  69 +}
  1 +export interface FullColumnImgUrlDTO {
  2 + format?: any;
  3 + height: number;
  4 + landscape: number;
  5 + size: number;
  6 + url: string;
  7 + weight: number;
  8 +}
  1 +export interface ReLInfoDTO {
  2 + channelId: number;
  3 + relId: string;
  4 + relObjectId: number;
  5 + relType: string;
  6 +}
  1 +export interface ShareInfoDTO {
  2 + shareCoverUrl: string;
  3 + shareOpen: number;
  4 + sharePosterCoverUrl: string;
  5 + sharePosterOpen: number;
  6 + shareSummary: string;
  7 + shareTitle: string;
  8 + shareUrl: string;
  9 +}
  1 +export interface VideoInfoDTO {
  2 + clarity: number;
  3 + resolutionHeight: number;
  4 + resolutionWidth: number;
  5 + videoDuration: number;
  6 + videoLandScape: number;
  7 + videoType: number;
  8 + videoUrl: string;
  9 +}
  1 +import { Logger } from 'wdKit';
  2 +import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
  3 +import { ContentConstants } from '../constants/ContentConstants';
  4 +import { ContentDTO } from '../repository/bean/ContentDTO';
  5 +
  6 +/**
  7 + * 页面跳转业务封装
  8 + */
  9 +export class ProcessUtils {
  10 + static readonly TAG: string = "ProcessUtils";
  11 + /**
  12 + * 页面跳转
  13 + */
  14 + static processPage(content: ContentDTO) {
  15 + if (content == null) {
  16 + Logger.error(this.TAG, "processPage, content is null");
  17 + return;
  18 + }
  19 + if (StringUtils.isEmpty(content.objectType)) {
  20 + Logger.error(this.TAG, "processPage, objectType is empty");
  21 + return;
  22 + }
  23 + let type = content.objectType;
  24 + switch (type) {
  25 + case ContentConstants.TYPE_NONE:
  26 + Logger.debug(this.TAG, "processPage, do nothing");
  27 + break;
  28 + case ContentConstants.TYPE_VOD:
  29 + Logger.debug(this.TAG, "processPage, nonsupport!!!");
  30 + // TODO 待对接更多页面
  31 + break;
  32 + case ContentConstants.TYPE_TELETEXT:
  33 + // 图文详情,跳转h5
  34 + this.gotoWeb(content);
  35 + break;
  36 + default:
  37 + break;
  38 + }
  39 + }
  40 +
  41 + private static gotoWeb(content: ContentDTO) {
  42 + // // topicId
  43 + // content.channelId;
  44 + // content.linkUrl;
  45 + // content.objectId;
  46 + // // CompId
  47 + // content.relId;
  48 + // content.relType;
  49 + // // ScrollToBottom
  50 + // // FromPage
  51 + // TODO 对接路由
  52 + Logger.debug(this.TAG, `gotoWeb, ${content.objectId}`);
  53 + }
  54 +}
  1 +import promptAction from '@ohos.promptAction';
  2 +import PageModel from '../viewmodel/PageModel';
  3 +import { RefreshConstants as Const, RefreshState } from './RefreshConstants';
  4 +import PageViewModel from '../viewmodel/PageViewModel';
  5 +import { PageDTO } from '../repository/bean/PageDTO';
  6 +import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore';
  7 +
  8 +export function listTouchEvent(pageModel: PageModel, event: TouchEvent) {
  9 + switch (event.type) {
  10 + case TouchType.Down:
  11 + pageModel.downY = event.touches[0].y;
  12 + pageModel.lastMoveY = event.touches[0].y;
  13 + break;
  14 + case TouchType.Move:
  15 + if ((pageModel.isRefreshing === true) || (pageModel.isLoading === true)) {
  16 + return;
  17 + }
  18 + let isDownPull = event.touches[0].y - pageModel.lastMoveY > 0;
  19 + if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) && (pageModel.isCanLoadMore === false)) {
  20 + // Finger movement, processing pull-down refresh.
  21 + touchMovePullRefresh(pageModel, event);
  22 + } else {
  23 + // Finger movement, processing load more.
  24 + touchMoveLoadMore(pageModel, event);
  25 + }
  26 + pageModel.lastMoveY = event.touches[0].y;
  27 + break;
  28 + case TouchType.Cancel:
  29 + break;
  30 + case TouchType.Up:
  31 + if ((pageModel.isRefreshing === true) || (pageModel.isLoading === true)) {
  32 + return;
  33 + }
  34 + if ((pageModel.isPullRefreshOperation === true)) {
  35 + // Lift your finger and pull down to refresh.
  36 + touchUpPullRefresh(pageModel);
  37 + } else {
  38 + // Fingers up, handle loading more.
  39 + touchUpLoadMore(pageModel);
  40 + }
  41 + break;
  42 + default:
  43 + break;
  44 + }
  45 +}
  46 +
  47 +export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) {
  48 + if (pageModel.startIndex === 0) {
  49 + pageModel.isPullRefreshOperation = true;
  50 + let height = vp2px(pageModel.pullDownRefreshHeight);
  51 + pageModel.offsetY = event.touches[0].y - pageModel.downY;
  52 + // The sliding offset is greater than the pull-down refresh layout height, and the refresh condition is met.
  53 + if (pageModel.offsetY >= height) {
  54 + pullRefreshState(pageModel, RefreshState.Release);
  55 + pageModel.offsetY = height + pageModel.offsetY * Const.Y_OFF_SET_COEFFICIENT;
  56 + } else {
  57 + pullRefreshState(pageModel, RefreshState.DropDown);
  58 + }
  59 + if (pageModel.offsetY < 0) {
  60 + pageModel.offsetY = 0;
  61 + pageModel.isPullRefreshOperation = false;
  62 + }
  63 + }
  64 +}
  65 +
  66 +export function touchUpPullRefresh(pageModel: PageModel) {
  67 + if (pageModel.isCanRefresh === true) {
  68 + pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
  69 + pullRefreshState(pageModel, RefreshState.Refreshing);
  70 + pageModel.currentPage = 1;
  71 + setTimeout(() => {
  72 + let self: PageModel = pageModel;
  73 +
  74 + PageViewModel.getPageData(self.pageId, self.groupId, self.channelId, self.currentPage, self.pageSize)
  75 + .then((data: PageDTO) => {
  76 + if (data == null || data.compList == null || data.compList.length == 0) {
  77 + self.hasMore = false;
  78 + } else {
  79 + if (data.compList.length == self.pageSize) {
  80 + self.currentPage++;
  81 + self.hasMore = true;
  82 + } else {
  83 + self.hasMore = false;
  84 + }
  85 + // 刷新,替换所有数据
  86 + self.compList.replaceAll(...data.compList)
  87 + }
  88 + closeRefresh(self, true);
  89 + }).catch((err: string | Resource) => {
  90 + promptAction.showToast({ message: err });
  91 + closeRefresh(self, false);
  92 + });
  93 + }, Const.DELAY_TIME);
  94 + } else {
  95 + closeRefresh(pageModel, false);
  96 + }
  97 +}
  98 +
  99 +export function pullRefreshState(pageModel: PageModel, state: number) {
  100 + switch (state) {
  101 + case RefreshState.DropDown:
  102 + pageModel.pullDownRefreshText = $r('app.string.pull_down_refresh_text');
  103 + pageModel.pullDownRefreshImage = $r('app.media.ic_pull_down_refresh');
  104 + pageModel.isCanRefresh = false;
  105 + pageModel.isRefreshing = false;
  106 + pageModel.isVisiblePullDown = true;
  107 + break;
  108 + case RefreshState.Release:
  109 + pageModel.pullDownRefreshText = $r('app.string.release_refresh_text');
  110 + pageModel.pullDownRefreshImage = $r('app.media.ic_pull_up_refresh');
  111 + pageModel.isCanRefresh = true;
  112 + pageModel.isRefreshing = false;
  113 + break;
  114 + case RefreshState.Refreshing:
  115 + pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
  116 + pageModel.pullDownRefreshText = $r('app.string.refreshing_text');
  117 + pageModel.pullDownRefreshImage = $r('app.media.ic_pull_up_load');
  118 + pageModel.isCanRefresh = true;
  119 + pageModel.isRefreshing = true;
  120 + break;
  121 + case RefreshState.Success:
  122 + pageModel.pullDownRefreshText = $r('app.string.refresh_success_text');
  123 + pageModel.pullDownRefreshImage = $r('app.media.ic_succeed_refresh');
  124 + pageModel.isCanRefresh = true;
  125 + pageModel.isRefreshing = true;
  126 + break;
  127 + case RefreshState.Fail:
  128 + pageModel.pullDownRefreshText = $r('app.string.refresh_fail_text');
  129 + pageModel.pullDownRefreshImage = $r('app.media.ic_fail_refresh');
  130 + pageModel.isCanRefresh = true;
  131 + pageModel.isRefreshing = true;
  132 + break;
  133 + default:
  134 + break;
  135 + }
  136 +}
  137 +
  138 +export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) {
  139 + let self = pageModel;
  140 + setTimeout(() => {
  141 + let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH;
  142 + if (self.isCanRefresh === true) {
  143 + pullRefreshState(pageModel, isRefreshSuccess ? RefreshState.Success : RefreshState.Fail);
  144 + delay = Const.RefreshConstant_DELAY_SHRINK_ANIMATION_TIME;
  145 + }
  146 + animateTo({
  147 + duration: Const.RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME,
  148 + delay: delay,
  149 + onFinish: () => {
  150 + pullRefreshState(pageModel, RefreshState.DropDown);
  151 + self.isVisiblePullDown = false;
  152 + self.isPullRefreshOperation = false;
  153 + }
  154 + }, () => {
  155 + self.offsetY = 0;
  156 + })
  157 + }, self.isCanRefresh ? Const.DELAY_ANIMATION_DURATION : 0);
  158 +}
  1 +import promptAction from '@ohos.promptAction';
  2 +import PageModel from '../viewmodel/PageModel';
  3 +import { RefreshConstants as Const } from './RefreshConstants';
  4 +import PageViewModel from '../viewmodel/PageViewModel';
  5 +import { PageDTO } from '../repository/bean/PageDTO';
  6 +
  7 +export function touchMoveLoadMore(model: PageModel, event: TouchEvent) {
  8 + // list size +1
  9 + if (model.endIndex === model.compList.size() || model.endIndex === model.compList.size() + 1) {
  10 + model.offsetY = event.touches[0].y - model.downY;
  11 + if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) {
  12 + model.isCanLoadMore = true;
  13 + model.isVisiblePullUpLoad = true;
  14 + model.offsetY = -vp2px(model.pullUpLoadHeight) + model.offsetY * Const.Y_OFF_SET_COEFFICIENT;
  15 + }
  16 + }
  17 +}
  18 +
  19 +export function touchUpLoadMore(model: PageModel) {
  20 + let self: PageModel = model;
  21 + animateTo({
  22 + duration: Const.ANIMATION_DURATION,
  23 + }, () => {
  24 + self.offsetY = 0;
  25 + })
  26 + if ((self.isCanLoadMore === true) && (self.hasMore === true)) {
  27 + self.isLoading = true;
  28 + setTimeout(() => {
  29 + closeLoadMore(model);
  30 + PageViewModel.getPageData(self.pageId, self.groupId, self.channelId, self.currentPage, self.pageSize)
  31 + .then((data: PageDTO) => {
  32 + if (data == null || data.compList == null || data.compList.length == 0) {
  33 + self.hasMore = false;
  34 + } else {
  35 + if (data.compList.length == self.pageSize) {
  36 + self.currentPage++;
  37 + self.hasMore = true;
  38 + } else {
  39 + self.hasMore = false;
  40 + }
  41 + self.compList.push(...data.compList)
  42 + }
  43 + }).catch((err: string | Resource) => {
  44 + promptAction.showToast({ message: err });
  45 + })
  46 + }, Const.DELAY_TIME);
  47 + } else {
  48 + closeLoadMore(self);
  49 + }
  50 +}
  51 +
  52 +export function closeLoadMore(model: PageModel) {
  53 + model.isCanLoadMore = false;
  54 + model.isLoading = false;
  55 + model.isVisiblePullUpLoad = false;
  56 +}
  1 +/**
  2 + * The constant of refresh.
  3 + */
  4 +export class RefreshConstants {
  5 + /**
  6 + * The off set coefficient.
  7 + */
  8 + static readonly Y_OFF_SET_COEFFICIENT: number = 0.1;
  9 + /**
  10 + * The animation delay time.
  11 + */
  12 + static readonly DELAY_ANIMATION_DURATION: number = 300;
  13 + /**
  14 + * The delay time.
  15 + */
  16 + static readonly DELAY_TIME: number = 1000;
  17 +
  18 + /**
  19 + * The animation duration.
  20 + */
  21 + static readonly ANIMATION_DURATION: number = 2000;
  22 + /**
  23 + * The RefreshConstant constants.
  24 + */
  25 + static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50;
  26 + static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150;
  27 + static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 500;
  28 +
  29 + /**
  30 + * The page size.
  31 + */
  32 + static readonly PAGE_SIZE: number = 20;
  33 +
  34 + /**
  35 + * The refresh and load height.
  36 + */
  37 + static readonly CUSTOM_LAYOUT_HEIGHT: number = 70;
  38 + /**
  39 + * Full the width.
  40 + */
  41 + static readonly FULL_WIDTH: string = '100%';
  42 + /**
  43 + * The NoMoreLayout constants.
  44 + */
  45 + static readonly NoMoreLayoutConstant_NORMAL_PADDING: number = 8;
  46 + static readonly NoMoreLayoutConstant_TITLE_FONT: string = '16fp';
  47 +
  48 + /**
  49 + * The RefreshLayout constants.
  50 + */
  51 + static readonly RefreshLayout_MARGIN_LEFT: string = '40%';
  52 + static readonly RefreshLayout_TEXT_MARGIN_BOTTOM: number = 1;
  53 + static readonly RefreshLayout_TEXT_MARGIN_LEFT: number = 7;
  54 + static readonly RefreshLayout_TEXT_FONT_SIZE: number = 17;
  55 + static readonly RefreshLayout_IMAGE_WIDTH: number = 18;
  56 + static readonly RefreshLayout_IMAGE_HEIGHT: number = 18;
  57 +}
  58 +/**
  59 + * The refresh state enum.
  60 + */
  61 +export const enum RefreshState {
  62 + DropDown = 0,
  63 + Release = 1,
  64 + Refreshing = 2,
  65 + Success = 3,
  66 + Fail = 4
  67 +}
  1 +import { Logger, StringUtils } from 'wdKit';
  2 +import { ResponseDTO, } from 'wdNetwork';
  3 +import { ContentDetailDTO } from '../repository/bean/ContentDetailDTO';
  4 +import { PageRepository } from '../repository/PageRepository';
  5 +import { BaseViewModel } from './BaseViewModel';
  6 +
  7 +const TAG = 'DetailViewModel';
  8 +
  9 +/**
  10 + * 处理返回后的数据
  11 + */
  12 +export class DetailViewModel extends BaseViewModel {
  13 + getLogTag() {
  14 + return TAG;
  15 + }
  16 +
  17 + /**
  18 + * 获取详情数据.
  19 + * 例:https://pd-apis-uat.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500000008738&contentId=30001373964&relType=1
  20 + * @return {string} resDTO.data
  21 + */
  22 + async getDetailPageData(relId: string, contentId: string, relType: string): Promise<string> {
  23 + Logger.debug(TAG, 'getDetailPageData contentId: ' + contentId);
  24 + return new Promise<string>((success, error) => {
  25 + PageRepository.fetchDetailData(relId, contentId, relType)
  26 + .then((resDTO: ResponseDTO<string>) => {
  27 + if (this.isRespondsInvalid(resDTO, 'getDetailPageData')) {
  28 + error("detail data invalid");
  29 + return
  30 + }
  31 + Logger.info(TAG, "getDetailPageData then,resDTO.timeStamp:" + resDTO.timestamp);
  32 + success(JSON.stringify(resDTO.data));
  33 + })
  34 + .catch((err: Error) => {
  35 + Logger.error(TAG, `getDetailPageData catch, error.name : ${err.name}, error.message:${err.message}`);
  36 + error(err);
  37 + })
  38 + })
  39 + }
  40 +
  41 + private dataTranslate(json: string): ContentDetailDTO {
  42 + if (StringUtils.isEmpty(json)) {
  43 + return null;
  44 + }
  45 + try {
  46 + let data: ContentDetailDTO = JSON.parse(json)
  47 + return data;
  48 + } catch (err) {
  49 + // json解析异常
  50 + Logger.error(TAG, `dataTranslate catch parse failed.: ${err}`);
  51 + }
  52 + return null;
  53 + }
  54 +}
  55 +
  56 +let detailViewModel = new DetailViewModel();
  57 +
  58 +export default detailViewModel as DetailViewModel;
  1 +import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
  2 +import { LazyDataSource } from 'wdKit';
  3 +import { CompDTO } from '../repository/bean/CompDTO';
  4 +import { RefreshConstants as Const } from '../utils/RefreshConstants';
  5 +
  6 +export default class PageModel {
  7 + // 页面数据
  8 + pageId: string = "";
  9 + groupId: string = "";
  10 + channelId: string = "";
  11 + compList: LazyDataSource<CompDTO> = new LazyDataSource();
  12 + // 页面状态,刷新、加载更多等
  13 + currentPage: number = 1;
  14 + pageSize: number = Const.PAGE_SIZE;
  15 + pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text');
  16 + pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh');
  17 + pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT;
  18 + isVisiblePullDown: boolean = false;
  19 + pullUpLoadText: Resource = $r('app.string.pull_up_load_text');
  20 + pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load');
  21 + pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT;
  22 + isVisiblePullUpLoad: boolean = false;
  23 + offsetY: number = 0;
  24 + viewType: number = ViewType.LOADING;
  25 + hasMore: boolean = true;
  26 + startIndex = 0;
  27 + endIndex = 0;
  28 + downY = 0;
  29 + lastMoveY = 0;
  30 + isRefreshing: boolean = false;
  31 + isCanRefresh = false;
  32 + isPullRefreshOperation = false;
  33 + isLoading: boolean = false;
  34 + isCanLoadMore: boolean = false;
  35 +}
1 -import { AppContext, Logger, ResourcesUtils } from 'wdKit'; 1 +import { Logger, ResourcesUtils } from 'wdKit';
2 import { ResponseDTO, } from 'wdNetwork'; 2 import { ResponseDTO, } from 'wdNetwork';
3 import { PageRepository } from '../repository/PageRepository'; 3 import { PageRepository } from '../repository/PageRepository';
4 -import http from '@ohos.net.http';  
5 import { NavigationBodyDTO } from '../repository/bean/NavigationBodyDTO'; 4 import { NavigationBodyDTO } from '../repository/bean/NavigationBodyDTO';
6 -import { BottomNavDTO } from '../repository/bean/BottomNavDTO';  
7 import { PageDTO } from '../repository/bean/PageDTO'; 5 import { PageDTO } from '../repository/bean/PageDTO';
8 import { BaseViewModel } from './BaseViewModel'; 6 import { BaseViewModel } from './BaseViewModel';
9 -import Router from '@system.router';  
10 -import router from '@ohos.router';  
11 7
12 const TAG = 'PageViewModel'; 8 const TAG = 'PageViewModel';
13 /** 9 /**
@@ -29,17 +25,17 @@ export class PageViewModel extends BaseViewModel { @@ -29,17 +25,17 @@ export class PageViewModel extends BaseViewModel {
29 * 25 *
30 * @return BottomNavBean[] Nav Data List 26 * @return BottomNavBean[] Nav Data List
31 */ 27 */
32 - async getBottomNavData(): Promise<NavigationBodyDTO> { 28 + async getBottomNavData(context?: Context): Promise<NavigationBodyDTO> {
33 Logger.info(TAG, `getBottomNavData start`); 29 Logger.info(TAG, `getBottomNavData start`);
34 if (mock_switch) { 30 if (mock_switch) {
35 - return this.getBottomNavDataMock(); 31 + return this.getBottomNavDataMock(context);
36 } 32 }
37 return this.getNavData(); 33 return this.getNavData();
38 } 34 }
39 35
40 - async getBottomNavDataMock(): Promise<NavigationBodyDTO> { 36 + async getBottomNavDataMock(context?: Context): Promise<NavigationBodyDTO> {
41 Logger.info(TAG, `getBottomNavDataMock start`); 37 Logger.info(TAG, `getBottomNavDataMock start`);
42 - let compRes: ResponseDTO<NavigationBodyDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<NavigationBodyDTO>>('bottom_nav.json'); 38 + let compRes: ResponseDTO<NavigationBodyDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<NavigationBodyDTO>>('bottom_nav.json', context);
43 if (!compRes || !compRes.data) { 39 if (!compRes || !compRes.data) {
44 Logger.info(TAG, `getBottomNavDataMock compRes bottomNavList is empty`); 40 Logger.info(TAG, `getBottomNavDataMock compRes bottomNavList is empty`);
45 return null 41 return null
@@ -71,8 +67,12 @@ export class PageViewModel extends BaseViewModel { @@ -71,8 +67,12 @@ export class PageViewModel extends BaseViewModel {
71 * 67 *
72 * @return {GroupDTO} compRes.data 68 * @return {GroupDTO} compRes.data
73 */ 69 */
74 - private async getPageData1(): Promise<PageDTO> {  
75 - let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>('comp_list0.json'); 70 + private async getPageData1(currentPage: number, context?: Context): Promise<PageDTO> {
  71 + if (currentPage > 1) {
  72 + // 加载更多,返回无数据
  73 + return {} as PageDTO
  74 + }
  75 + let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>('comp_list0.json', context);
76 if (!compRes || !compRes.data) { 76 if (!compRes || !compRes.data) {
77 Logger.info(TAG, `getCompList compRes is empty`); 77 Logger.info(TAG, `getCompList compRes is empty`);
78 return {} as PageDTO 78 return {} as PageDTO
@@ -87,7 +87,7 @@ export class PageViewModel extends BaseViewModel { @@ -87,7 +87,7 @@ export class PageViewModel extends BaseViewModel {
87 * @return {GroupDTO} compRes.data 87 * @return {GroupDTO} compRes.data
88 * @deprecated 88 * @deprecated
89 */ 89 */
90 - private async getPageData2(): Promise<PageDTO> { 90 + private async getPageData2(context?: Context): Promise<PageDTO> {
91 let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>('comp_list2.json'); 91 let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>('comp_list2.json');
92 if (!compRes || !compRes.data) { 92 if (!compRes || !compRes.data) {
93 Logger.info(TAG, `getCompList compRes is empty`); 93 Logger.info(TAG, `getCompList compRes is empty`);
@@ -98,23 +98,26 @@ export class PageViewModel extends BaseViewModel { @@ -98,23 +98,26 @@ export class PageViewModel extends BaseViewModel {
98 return compRes.data 98 return compRes.data
99 } 99 }
100 100
101 - async getPageData(pageId: string, groupId: string, channelId: string): Promise<PageDTO> {  
102 - Logger.error(TAG, 'getPageData pageId: ' + pageId); 101 + async getPageData(pageId: string, groupId: string, channelId: string, currentPage: number
  102 + , pageSize: number, context?: Context): Promise<PageDTO> {
  103 + Logger.debug(TAG, 'getPageData pageId: ' + pageId);
103 if (mock_switch) { 104 if (mock_switch) {
104 - return this.getPageData1(); 105 + return this.getPageData1(currentPage, context);
105 } 106 }
106 return new Promise<PageDTO>((success, error) => { 107 return new Promise<PageDTO>((success, error) => {
107 - PageRepository.fetchPageData(pageId, groupId, channelId).then((resDTO: ResponseDTO<PageDTO>) => {  
108 - if (this.isRespondsInvalid(resDTO, 'getPageData')) {  
109 - error("page data invalid");  
110 - return  
111 - }  
112 - Logger.info(TAG, "getPageData then,resDTO.timeStamp:" + resDTO.timestamp);  
113 - success(resDTO.data);  
114 - }).catch((err: Error) => {  
115 - Logger.error(TAG, `getPageData catch, error.name : ${err.name}, error.message:${err.message}`);  
116 - error(err);  
117 - }) 108 + PageRepository.fetchPageData(pageId, groupId, channelId, currentPage, pageSize)
  109 + .then((resDTO: ResponseDTO<PageDTO>) => {
  110 + if (this.isRespondsInvalid(resDTO, 'getPageData')) {
  111 + error("page data invalid");
  112 + return
  113 + }
  114 + Logger.info(TAG, "getPageData then,resDTO.timeStamp:" + resDTO.timestamp);
  115 + success(resDTO.data);
  116 + })
  117 + .catch((err: Error) => {
  118 + Logger.error(TAG, `getPageData catch, error.name : ${err.name}, error.message:${err.message}`);
  119 + error(err);
  120 + })
118 }) 121 })
119 } 122 }
120 } 123 }
@@ -33,6 +33,10 @@ @@ -33,6 +33,10 @@
33 "value": "#B0B0B0" 33 "value": "#B0B0B0"
34 }, 34 },
35 { 35 {
  36 + "name": "color_212228",
  37 + "value": "#212228"
  38 + },
  39 + {
36 "name": "color_fff", 40 "name": "color_fff",
37 "value": "#ffffff" 41 "value": "#ffffff"
38 }, 42 },
@@ -7,6 +7,30 @@ @@ -7,6 +7,30 @@
7 { 7 {
8 "name": "footer_text", 8 "name": "footer_text",
9 "value": "已经到底了" 9 "value": "已经到底了"
  10 + },
  11 + {
  12 + "name": "pull_up_load_text",
  13 + "value": "加载中..."
  14 + },
  15 + {
  16 + "name": "pull_down_refresh_text",
  17 + "value": "下拉刷新"
  18 + },
  19 + {
  20 + "name": "release_refresh_text",
  21 + "value": "松开刷新"
  22 + },
  23 + {
  24 + "name": "refreshing_text",
  25 + "value": "正在刷新"
  26 + },
  27 + {
  28 + "name": "refresh_success_text",
  29 + "value": "刷新成功"
  30 + },
  31 + {
  32 + "name": "refresh_fail_text",
  33 + "value": "刷新失败"
10 } 34 }
11 ] 35 ]
12 } 36 }
  1 +{
  2 + "src": [
  3 + "components/DemoPreviewerComponent",
  4 + "components/view/SmallVideoCardComponent"
  5 + ]
  6 +}
@@ -36,6 +36,10 @@ export class LazyDataSource<T> extends BasicDataSource<T> { @@ -36,6 +36,10 @@ export class LazyDataSource<T> extends BasicDataSource<T> {
36 return this.dataArray; 36 return this.dataArray;
37 } 37 }
38 38
  39 + public size(): number {
  40 + return this.dataArray.length
  41 + }
  42 +
39 // 增加/插入1个Item/数据,若index为undefined,则在数据尾部增加1个元素;否则,在指定索引(可为负/或大于数组长度)位置插入1个元素 43 // 增加/插入1个Item/数据,若index为undefined,则在数据尾部增加1个元素;否则,在指定索引(可为负/或大于数组长度)位置插入1个元素
40 public addItem(data: T, index?: number): void { 44 public addItem(data: T, index?: number): void {
41 if (index == undefined) { 45 if (index == undefined) {
@@ -20,7 +20,7 @@ export class ResourcesUtils { @@ -20,7 +20,7 @@ export class ResourcesUtils {
20 } 20 }
21 return new Promise((success, error) => { 21 return new Promise((success, error) => {
22 Logger.info(TAG, "ResourcesUtils getResourcesText filename:" + filename); 22 Logger.info(TAG, "ResourcesUtils getResourcesText filename:" + filename);
23 - context.resourceManager.getRawFileContent(filename).then((content: Uint8Array) => { 23 + context?.resourceManager.getRawFileContent(filename).then((content: Uint8Array) => {
24 if (!content) { 24 if (!content) {
25 Logger.warn(TAG, 'getResourcesText then content is empty'); 25 Logger.warn(TAG, 'getResourcesText then content is empty');
26 error("file is empty"); 26 error("file is empty");
@@ -6,9 +6,9 @@ @@ -6,9 +6,9 @@
6 "type": "HarmonyOS", 6 "type": "HarmonyOS",
7 "material": { 7 "material": {
8 "certpath": "C:\\Users\\PC\\.ohos\\config\\auto_debug_sight_harmony_com.wondertek.sight_70086000309521319.cer", 8 "certpath": "C:\\Users\\PC\\.ohos\\config\\auto_debug_sight_harmony_com.wondertek.sight_70086000309521319.cer",
9 - "storePassword": "0000001AB8EC943F2BE2E18A8AEFE1FCA450B66E91DFD2548DD09FD6AB15755699E084327B0CC2ED695B", 9 + "storePassword": "0000001B264B065AE68D1C7F3C0863A33C083D91E12CC54AA36D44179AA8DBA37EA3C50E7F3692F5EB6F3E",
10 "keyAlias": "debugKey", 10 "keyAlias": "debugKey",
11 - "keyPassword": "0000001AAB9FF41A89BB2C32EA7122E2EE2E6C97447932FDC7E91010CC02128130B6040A09EBC04CD07E", 11 + "keyPassword": "0000001BFB62A8007F44B0EAAF9CF878A92620ED75A21E53B3740EA60DEBF6543F6E16AA7200542280D746",
12 "profile": "C:\\Users\\PC\\.ohos\\config\\auto_debug_sight_harmony_com.wondertek.sight_70086000309521319.p7b", 12 "profile": "C:\\Users\\PC\\.ohos\\config\\auto_debug_sight_harmony_com.wondertek.sight_70086000309521319.p7b",
13 "signAlg": "SHA256withECDSA", 13 "signAlg": "SHA256withECDSA",
14 "storeFile": "C:\\Users\\PC\\.ohos\\config\\auto_debug_sight_harmony_com.wondertek.sight_70086000309521319.p12" 14 "storeFile": "C:\\Users\\PC\\.ohos\\config\\auto_debug_sight_harmony_com.wondertek.sight_70086000309521319.p12"
@@ -133,18 +133,78 @@ @@ -133,18 +133,78 @@
133 ] 133 ]
134 } 134 }
135 ] 135 ]
  136 + },
  137 + // {
  138 + // "name": "wdLayout",
  139 + // "srcPath": "./wdLayout",
  140 + // "targets": [
  141 + // {
  142 + // "name": "default",
  143 + // "applyToProducts": [
  144 + // "default"
  145 + // ]
  146 + // }
  147 + // ]
  148 + // },
  149 + {
  150 + "name": "wdPlayer",
  151 + "srcPath": "./wdPlayer",
  152 + "targets": [
  153 + {
  154 + "name": "default",
  155 + "applyToProducts": [
  156 + "default"
  157 + ]
  158 + }
  159 + ]
  160 + },
  161 + {
  162 + "name": "wdDetailPlayApi",
  163 + "srcPath": "./wdDetailPlayApi",
  164 + "targets": [
  165 + {
  166 + "name": "default",
  167 + "applyToProducts": [
  168 + "default"
  169 + ]
  170 + }
  171 + ]
  172 + },
  173 + {
  174 + "name": "wdDetailPlayShortVideo",
  175 + "srcPath": "./wdDetailPlayShortVideo",
  176 + "targets": [
  177 + {
  178 + "name": "default",
  179 + "applyToProducts": [
  180 + "default"
  181 + ]
  182 + }
  183 + ]
  184 + },
  185 + {
  186 + "name": "wdDetailPlayVod",
  187 + "srcPath": "./wdDetailPlayVod",
  188 + "targets": [
  189 + {
  190 + "name": "default",
  191 + "applyToProducts": [
  192 + "default"
  193 + ]
  194 + }
  195 + ]
  196 + },
  197 + {
  198 + "name": "wdDetailPlayLive",
  199 + "srcPath": "./wdDetailPlayLive",
  200 + "targets": [
  201 + {
  202 + "name": "default",
  203 + "applyToProducts": [
  204 + "default"
  205 + ]
  206 + }
  207 + ]
136 } 208 }
137 -// {  
138 -// "name": "wdLayout",  
139 -// "srcPath": "./wdLayout",  
140 -// "targets": [  
141 -// {  
142 -// "name": "default",  
143 -// "applyToProducts": [  
144 -// "default"  
145 -// ]  
146 -// }  
147 -// ]  
148 -// }  
149 ] 209 ]
150 } 210 }
@@ -4,11 +4,15 @@ import UIAbility from '@ohos.app.ability.UIAbility'; @@ -4,11 +4,15 @@ import UIAbility from '@ohos.app.ability.UIAbility';
4 import Want from '@ohos.app.ability.Want'; 4 import Want from '@ohos.app.ability.Want';
5 import window from '@ohos.window'; 5 import window from '@ohos.window';
6 import { registerRouter } from 'wdRouter'; 6 import { registerRouter } from 'wdRouter';
  7 +import { SPHelper, WindowModel } from 'wdKit';
  8 +import { WDHttp } from 'wdNetwork'
7 9
8 export default class EntryAbility extends UIAbility { 10 export default class EntryAbility extends UIAbility {
9 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { 11 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
  12 + SPHelper.init(this.context);
10 hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); 13 hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
11 registerRouter(); 14 registerRouter();
  15 + WDHttp.initHttpHeader()
12 } 16 }
13 17
14 onDestroy(): void { 18 onDestroy(): void {
@@ -18,8 +22,17 @@ export default class EntryAbility extends UIAbility { @@ -18,8 +22,17 @@ export default class EntryAbility extends UIAbility {
18 onWindowStageCreate(windowStage: window.WindowStage): void { 22 onWindowStageCreate(windowStage: window.WindowStage): void {
19 // Main window is created, set main page for this ability 23 // Main window is created, set main page for this ability
20 hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); 24 hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
21 -  
22 - windowStage.loadContent('pages/Index', (err, data) => { 25 + WindowModel.shared.setWindowStage(windowStage);
  26 + // let a = new WindowModel();
  27 + // 设置窗口的显示方向属性
  28 + WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
  29 + .then(() => {
  30 + hilog.info(0x0000, 'testTag', 'setPreferredOrientation Succeeded');
  31 + })
  32 + .catch((err: Error) => {
  33 + hilog.error(0x0000, 'testTag', `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);
  34 + })
  35 + windowStage.loadContent('pages/MainPage', (err, data) => {
23 if (err.code) { 36 if (err.code) {
24 hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); 37 hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
25 return; 38 return;
  1 +import { ENewspaperPageComponent } from 'wdComponent';
  2 +import { Logger } from 'wdKit'
  3 +
  4 +const TAG = 'ENewspaper';
  5 +
  6 +@Entry
  7 +@Component
  8 +struct ENewspaper {
  9 +
  10 + build() {
  11 + Column() {
  12 + ENewspaperPageComponent()
  13 + }
  14 + }
  15 +
  16 + pageTransition(){
  17 + // 定义页面进入时的效果,从底侧滑入
  18 + PageTransitionEnter({ type: RouteType.None, duration: 300 })
  19 + .slide(SlideEffect.Bottom)
  20 + // 定义页面退出时的效果,向底侧滑出
  21 + PageTransitionExit({ type: RouteType.None, duration: 300 })
  22 + .slide(SlideEffect.Bottom)
  23 + }
  24 +
  25 + aboutToAppear() {
  26 + Logger.info(TAG, 'aboutToAppear');
  27 + }
  28 +
  29 + aboutToDisappear() {
  30 + Logger.info(TAG, 'aboutToDisappear');
  31 + }
  32 +
  33 + onPageShow() {
  34 + Logger.info(TAG, 'onPageShow');
  35 + }
  36 +
  37 + onPageHide() {
  38 + Logger.info(TAG, 'onPageHide');
  39 + }
  40 +
  41 + onBackPress() {
  42 + Logger.info(TAG, 'onBackPress');
  43 + }
  44 +}
1 -import { BottomNavBean } from 'wdBean';  
2 -import { BottomNavigationComponent, PageViewModel } from 'wdComponent'; 1 +import { BottomNavigationComponent} from 'wdComponent';
3 import { BreakpointConstants } from 'wdConstant'; 2 import { BreakpointConstants } from 'wdConstant';
  3 +
4 import { BreakpointSystem, Logger } from 'wdKit'; 4 import { BreakpointSystem, Logger } from 'wdKit';
5 5
6 -const TAG = 'Index'; 6 +const TAG = 'MainPage';
7 7
8 @Entry 8 @Entry
9 @Component 9 @Component
10 -struct Index { 10 +struct MainPage {
11 private breakpointSystem: BreakpointSystem = new BreakpointSystem() 11 private breakpointSystem: BreakpointSystem = new BreakpointSystem()
12 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS; 12 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS;
13 - @State bottomNavList: BottomNavBean[] = []  
14 13
15 watchCurrentBreakpoint() { 14 watchCurrentBreakpoint() {
16 Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); 15 Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`);
17 } 16 }
18 17
19 - build() {  
20 - Column() {  
21 - BottomNavigationComponent({ bottomNavList: this.bottomNavList })  
22 - }  
23 - }  
24 -  
25 aboutToAppear() { 18 aboutToAppear() {
26 this.breakpointSystem.register() 19 this.breakpointSystem.register()
27 - let bottomNav = PageViewModel.getBottomNavData(getContext(this))  
28 - if (bottomNav) {  
29 - Logger.info(TAG, `aboutToAppear, bottomNav.length: ${bottomNav.length}`);  
30 - this.bottomNavList = bottomNav  
31 - } 20 + Logger.info(TAG, `aboutToAppear `);
32 } 21 }
33 22
34 aboutToDisappear() { 23 aboutToDisappear() {
@@ -47,4 +36,10 @@ struct Index { @@ -47,4 +36,10 @@ struct Index {
47 onBackPress() { 36 onBackPress() {
48 Logger.info(TAG, 'onBackPress'); 37 Logger.info(TAG, 'onBackPress');
49 } 38 }
  39 +
  40 + build() {
  41 + Column() {
  42 + BottomNavigationComponent()
  43 + }
  44 + }
50 } 45 }
1 { 1 {
2 "src": [ 2 "src": [
3 - "pages/Index",  
4 - "pages/web/DefaultWebPage" 3 + "pages/MainPage",
  4 + "pages/web/DefaultWebPage",
  5 + "pages/ENewspaper"
5 ] 6 ]
6 -} 7 +}
@@ -4,39 +4,40 @@ @@ -4,39 +4,40 @@
4 "backgroundColor": "#FFFFFF", 4 "backgroundColor": "#FFFFFF",
5 "bottomNavList": [ 5 "bottomNavList": [
6 { 6 {
7 - "backgroundUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/2e1d5f235d1a44cfb9fc120e8596c56b.png",  
8 - "channelChooseActionUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231227/vod/display/7c92f5b2a08b4a65aa9da13e66d5ad4a.pag",  
9 - "channelChooseCColor": "#666666",  
10 - "channelChooseColor": "#222222",  
11 - "channelMoreColor": "#666666", 7 + "backgroundUrl": "",
  8 + "channelChooseActionUrl": "",
  9 + "channelChooseCColor": "",
  10 + "channelChooseColor": "",
  11 + "channelMoreColor": "",
12 "extraData": "{\"haveSearch\":\"1\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}", 12 "extraData": "{\"haveSearch\":\"1\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}",
13 - "homePageColor": "#FFFFF",  
14 - "icon": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/0dc20f38da09405ea0ab675d700bc2ce.png",  
15 - "iconC": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/e162a5d3401045f298c237f1c795c015.gif", 13 + "homePageColor": "",
  14 + "icon": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/a59ee3978357490bb58cbc378d70b557.png",
  15 + "iconC": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/213ab95c788d41f2838771e1eaaba62d.png",
16 "id": 201, 16 "id": 201,
17 "immersiveIconCUrl": "", 17 "immersiveIconCUrl": "",
18 "immersiveIconUrl": "", 18 "immersiveIconUrl": "",
19 - "immersiveNameCColor": "#FFFFFF",  
20 - "immersiveNameColor": "#FFFFFF",  
21 - "logoUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231229/image/display/51d568f9af05421f9754a2c08906dc42.png",  
22 - "morningAndEveningUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/0f37cc0c86194c969d2143f85c056c9c.png", 19 + "immersiveNameCColor": "",
  20 + "immersiveNameColor": "",
  21 + "logoUrl": "",
  22 + "morningAndEveningUrl": "",
23 "name": "新闻", 23 "name": "新闻",
24 - "nameCColor": "#ED2800", 24 + "nameCColor": "#CB0000",
25 "nameColor": "#999999", 25 "nameColor": "#999999",
26 "nightIconCUrl": "", 26 "nightIconCUrl": "",
27 "nightIconUrl": "", 27 "nightIconUrl": "",
28 "nightNameCColor": "", 28 "nightNameCColor": "",
29 "nightNameColor": "", 29 "nightNameColor": "",
30 - "noticeColor": "#FFFFFF", 30 + "noticeColor": "",
31 "pageId": null, 31 "pageId": null,
32 "pageType": null, 32 "pageType": null,
33 - "searchBothColor": "#666666",  
34 - "searchUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/2f2a9b3af5334eac8d7c3b6007240b83.png", 33 + "searchBothColor": "",
  34 + "searchUrl": "",
35 "sortValue": 1, 35 "sortValue": 1,
36 - "statusBarColor": 1, 36 + "statusBarColor": null,
37 "topNavChannelList": [ 37 "topNavChannelList": [
38 { 38 {
39 - "channelId": 2002, 39 + "channelId": 2001,
  40 + "channelStrategy": 1,
40 "channelStyle": 2, 41 "channelStyle": 2,
41 "channelType": 1, 42 "channelType": 1,
42 "defaultPermitted": 1, 43 "defaultPermitted": 1,
@@ -53,21 +54,22 @@ @@ -53,21 +54,22 @@
53 "moreChannel": "0", 54 "moreChannel": "0",
54 "movePermitted": 0, 55 "movePermitted": 0,
55 "myChannel": "0", 56 "myChannel": "0",
56 - "name": "热点", 57 + "name": "推荐",
57 "num": 1, 58 "num": 1,
58 - "pageId": 20012, 59 + "pageId": 20011,
59 "pageType": "", 60 "pageType": "",
60 "underlineCColor": "" 61 "underlineCColor": ""
61 }, 62 },
62 { 63 {
63 - "channelId": 2001, 64 + "channelId": 2002,
  65 + "channelStrategy": 2,
64 "channelStyle": 2, 66 "channelStyle": 2,
65 "channelType": 1, 67 "channelType": 1,
66 "defaultPermitted": 1, 68 "defaultPermitted": 1,
67 "delPermitted": 0, 69 "delPermitted": 0,
68 "fontCColor": "#FFFFFF", 70 "fontCColor": "#FFFFFF",
69 "fontColor": "#F9AB99", 71 "fontColor": "#F9AB99",
70 - "headlinesOn": 0, 72 + "headlinesOn": 1,
71 "homeChannel": "0", 73 "homeChannel": "0",
72 "iconCUrl": "", 74 "iconCUrl": "",
73 "iconCUrlSize": "", 75 "iconCUrlSize": "",
@@ -77,15 +79,16 @@ @@ -77,15 +79,16 @@
77 "moreChannel": "0", 79 "moreChannel": "0",
78 "movePermitted": 0, 80 "movePermitted": 0,
79 "myChannel": "0", 81 "myChannel": "0",
80 - "name": "推荐", 82 + "name": "热点",
81 "num": 2, 83 "num": 2,
82 - "pageId": 20011, 84 + "pageId": 20012,
83 "pageType": "", 85 "pageType": "",
84 "underlineCColor": "" 86 "underlineCColor": ""
85 }, 87 },
86 { 88 {
87 - "channelId": 2009,  
88 - "channelStyle": 2, 89 + "channelId": 2066,
  90 + "channelStrategy": 2,
  91 + "channelStyle": 3,
89 "channelType": 1, 92 "channelType": 1,
90 "defaultPermitted": 0, 93 "defaultPermitted": 0,
91 "delPermitted": 1, 94 "delPermitted": 1,
@@ -101,14 +104,15 @@ @@ -101,14 +104,15 @@
101 "moreChannel": "0", 104 "moreChannel": "0",
102 "movePermitted": 1, 105 "movePermitted": 1,
103 "myChannel": "0", 106 "myChannel": "0",
104 - "name": "社会", 107 + "name": "播报",
105 "num": 3, 108 "num": 3,
106 - "pageId": 20019, 109 + "pageId": 21003,
107 "pageType": "", 110 "pageType": "",
108 "underlineCColor": "" 111 "underlineCColor": ""
109 }, 112 },
110 { 113 {
111 - "channelId": 2066, 114 + "channelId": 2006,
  115 + "channelStrategy": 2,
112 "channelStyle": 3, 116 "channelStyle": 3,
113 "channelType": 1, 117 "channelType": 1,
114 "defaultPermitted": 0, 118 "defaultPermitted": 0,
@@ -125,14 +129,15 @@ @@ -125,14 +129,15 @@
125 "moreChannel": "0", 129 "moreChannel": "0",
126 "movePermitted": 1, 130 "movePermitted": 1,
127 "myChannel": "0", 131 "myChannel": "0",
128 - "name": "播报", 132 + "name": "版面",
129 "num": 4, 133 "num": 4,
130 - "pageId": 21003, 134 + "pageId": 20016,
131 "pageType": "", 135 "pageType": "",
132 "underlineCColor": "" 136 "underlineCColor": ""
133 }, 137 },
134 { 138 {
135 - "channelId": 2012, 139 + "channelId": 2065,
  140 + "channelStrategy": 2,
136 "channelStyle": 2, 141 "channelStyle": 2,
137 "channelType": 1, 142 "channelType": 1,
138 "defaultPermitted": 0, 143 "defaultPermitted": 0,
@@ -147,16 +152,17 @@ @@ -147,16 +152,17 @@
147 "iconUrlSize": "", 152 "iconUrlSize": "",
148 "localChannel": "0", 153 "localChannel": "0",
149 "moreChannel": "0", 154 "moreChannel": "0",
150 - "movePermitted": 0, 155 + "movePermitted": 1,
151 "myChannel": "0", 156 "myChannel": "0",
152 - "name": "文化", 157 + "name": "三农",
153 "num": 5, 158 "num": 5,
154 - "pageId": 20022, 159 + "pageId": 21002,
155 "pageType": "", 160 "pageType": "",
156 "underlineCColor": "" 161 "underlineCColor": ""
157 }, 162 },
158 { 163 {
159 - "channelId": 2007, 164 + "channelId": 2063,
  165 + "channelStrategy": 2,
160 "channelStyle": 2, 166 "channelStyle": 2,
161 "channelType": 1, 167 "channelType": 1,
162 "defaultPermitted": 0, 168 "defaultPermitted": 0,
@@ -173,38 +179,15 @@ @@ -173,38 +179,15 @@
173 "moreChannel": "0", 179 "moreChannel": "0",
174 "movePermitted": 1, 180 "movePermitted": 1,
175 "myChannel": "0", 181 "myChannel": "0",
176 - "name": "镜头", 182 + "name": "两会",
177 "num": 6, 183 "num": 6,
178 - "pageId": 20017,  
179 - "pageType": "",  
180 - "underlineCColor": ""  
181 - },  
182 - {  
183 - "channelId": 2006,  
184 - "channelStyle": 3,  
185 - "channelType": 1,  
186 - "defaultPermitted": 0,  
187 - "delPermitted": 1,  
188 - "fontCColor": "#FFFFFF",  
189 - "fontColor": "#F9AB99",  
190 - "headlinesOn": 0,  
191 - "homeChannel": "0",  
192 - "iconCUrl": "",  
193 - "iconCUrlSize": "",  
194 - "iconUrl": "",  
195 - "iconUrlSize": "",  
196 - "localChannel": "0",  
197 - "moreChannel": "0",  
198 - "movePermitted": 1,  
199 - "myChannel": "0",  
200 - "name": "版面",  
201 - "num": 7,  
202 - "pageId": 20016, 184 + "pageId": 21000,
203 "pageType": "", 185 "pageType": "",
204 "underlineCColor": "" 186 "underlineCColor": ""
205 }, 187 },
206 { 188 {
207 "channelId": 2015, 189 "channelId": 2015,
  190 + "channelStrategy": 1,
208 "channelStyle": 2, 191 "channelStyle": 2,
209 "channelType": 1, 192 "channelType": 1,
210 "defaultPermitted": 0, 193 "defaultPermitted": 0,
@@ -214,9 +197,9 @@ @@ -214,9 +197,9 @@
214 "headlinesOn": 0, 197 "headlinesOn": 0,
215 "homeChannel": "0", 198 "homeChannel": "0",
216 "iconCUrl": "", 199 "iconCUrl": "",
217 - "iconCUrlSize": "210*60", 200 + "iconCUrlSize": "",
218 "iconUrl": "", 201 "iconUrl": "",
219 - "iconUrlSize": "210*60", 202 + "iconUrlSize": "",
220 "localChannel": "0", 203 "localChannel": "0",
221 "moreChannel": "0", 204 "moreChannel": "0",
222 "movePermitted": 1, 205 "movePermitted": 1,
@@ -228,11 +211,12 @@ @@ -228,11 +211,12 @@
228 "underlineCColor": "" 211 "underlineCColor": ""
229 }, 212 },
230 { 213 {
231 - "channelId": 2063, 214 + "channelId": 2003,
  215 + "channelStrategy": 2,
232 "channelStyle": 2, 216 "channelStyle": 2,
233 "channelType": 1, 217 "channelType": 1,
234 "defaultPermitted": 0, 218 "defaultPermitted": 0,
235 - "delPermitted": 0, 219 + "delPermitted": 1,
236 "fontCColor": "#FFFFFF", 220 "fontCColor": "#FFFFFF",
237 "fontColor": "#F9AB99", 221 "fontColor": "#F9AB99",
238 "headlinesOn": 0, 222 "headlinesOn": 0,
@@ -245,14 +229,15 @@ @@ -245,14 +229,15 @@
245 "moreChannel": "0", 229 "moreChannel": "0",
246 "movePermitted": 1, 230 "movePermitted": 1,
247 "myChannel": "0", 231 "myChannel": "0",
248 - "name": "两会", 232 + "name": "锐评",
249 "num": 9, 233 "num": 9,
250 - "pageId": 21000, 234 + "pageId": 20013,
251 "pageType": "", 235 "pageType": "",
252 "underlineCColor": "" 236 "underlineCColor": ""
253 }, 237 },
254 { 238 {
255 - "channelId": 2064, 239 + "channelId": 2011,
  240 + "channelStrategy": 1,
256 "channelStyle": 2, 241 "channelStyle": 2,
257 "channelType": 1, 242 "channelType": 1,
258 "defaultPermitted": 0, 243 "defaultPermitted": 0,
@@ -269,14 +254,15 @@ @@ -269,14 +254,15 @@
269 "moreChannel": "0", 254 "moreChannel": "0",
270 "movePermitted": 1, 255 "movePermitted": 1,
271 "myChannel": "0", 256 "myChannel": "0",
272 - "name": "二十大", 257 + "name": "体育",
273 "num": 10, 258 "num": 10,
274 - "pageId": 21001, 259 + "pageId": 20021,
275 "pageType": "", 260 "pageType": "",
276 "underlineCColor": "" 261 "underlineCColor": ""
277 }, 262 },
278 { 263 {
279 - "channelId": 2003, 264 + "channelId": 2005,
  265 + "channelStrategy": 2,
280 "channelStyle": 2, 266 "channelStyle": 2,
281 "channelType": 1, 267 "channelType": 1,
282 "defaultPermitted": 0, 268 "defaultPermitted": 0,
@@ -293,14 +279,15 @@ @@ -293,14 +279,15 @@
293 "moreChannel": "0", 279 "moreChannel": "0",
294 "movePermitted": 1, 280 "movePermitted": 1,
295 "myChannel": "0", 281 "myChannel": "0",
296 - "name": "锐评",  
297 - "num": 11,  
298 - "pageId": 20013, 282 + "name": "文件",
  283 + "num": 12,
  284 + "pageId": 20015,
299 "pageType": "", 285 "pageType": "",
300 "underlineCColor": "" 286 "underlineCColor": ""
301 }, 287 },
302 { 288 {
303 - "channelId": 2011, 289 + "channelId": 2016,
  290 + "channelStrategy": 2,
304 "channelStyle": 2, 291 "channelStyle": 2,
305 "channelType": 1, 292 "channelType": 1,
306 "defaultPermitted": 0, 293 "defaultPermitted": 0,
@@ -317,14 +304,15 @@ @@ -317,14 +304,15 @@
317 "moreChannel": "0", 304 "moreChannel": "0",
318 "movePermitted": 1, 305 "movePermitted": 1,
319 "myChannel": "0", 306 "myChannel": "0",
320 - "name": "体育",  
321 - "num": 12,  
322 - "pageId": 20021, 307 + "name": "乡村振兴",
  308 + "num": 13,
  309 + "pageId": 20026,
323 "pageType": "", 310 "pageType": "",
324 "underlineCColor": "" 311 "underlineCColor": ""
325 }, 312 },
326 { 313 {
327 - "channelId": 2005, 314 + "channelId": 2007,
  315 + "channelStrategy": 2,
328 "channelStyle": 2, 316 "channelStyle": 2,
329 "channelType": 1, 317 "channelType": 1,
330 "defaultPermitted": 0, 318 "defaultPermitted": 0,
@@ -341,14 +329,15 @@ @@ -341,14 +329,15 @@
341 "moreChannel": "0", 329 "moreChannel": "0",
342 "movePermitted": 1, 330 "movePermitted": 1,
343 "myChannel": "0", 331 "myChannel": "0",
344 - "name": "文件", 332 + "name": "镜头",
345 "num": 14, 333 "num": 14,
346 - "pageId": 20015, 334 + "pageId": 20017,
347 "pageType": "", 335 "pageType": "",
348 "underlineCColor": "" 336 "underlineCColor": ""
349 }, 337 },
350 { 338 {
351 - "channelId": 2065, 339 + "channelId": 2009,
  340 + "channelStrategy": 2,
352 "channelStyle": 2, 341 "channelStyle": 2,
353 "channelType": 1, 342 "channelType": 1,
354 "defaultPermitted": 0, 343 "defaultPermitted": 0,
@@ -365,14 +354,15 @@ @@ -365,14 +354,15 @@
365 "moreChannel": "0", 354 "moreChannel": "0",
366 "movePermitted": 1, 355 "movePermitted": 1,
367 "myChannel": "0", 356 "myChannel": "0",
368 - "name": "三农",  
369 - "num": 15,  
370 - "pageId": 21002, 357 + "name": "社会",
  358 + "num": 16,
  359 + "pageId": 20019,
371 "pageType": "", 360 "pageType": "",
372 "underlineCColor": "" 361 "underlineCColor": ""
373 }, 362 },
374 { 363 {
375 - "channelId": 2016, 364 + "channelId": 2010,
  365 + "channelStrategy": 1,
376 "channelStyle": 2, 366 "channelStyle": 2,
377 "channelType": 1, 367 "channelType": 1,
378 "defaultPermitted": 0, 368 "defaultPermitted": 0,
@@ -389,14 +379,15 @@ @@ -389,14 +379,15 @@
389 "moreChannel": "0", 379 "moreChannel": "0",
390 "movePermitted": 1, 380 "movePermitted": 1,
391 "myChannel": "0", 381 "myChannel": "0",
392 - "name": "乡村振兴",  
393 - "num": 16,  
394 - "pageId": 20026, 382 + "name": "财经",
  383 + "num": 17,
  384 + "pageId": 20020,
395 "pageType": "", 385 "pageType": "",
396 "underlineCColor": "" 386 "underlineCColor": ""
397 }, 387 },
398 { 388 {
399 - "channelId": 2010, 389 + "channelId": 2012,
  390 + "channelStrategy": 2,
400 "channelStyle": 2, 391 "channelStyle": 2,
401 "channelType": 1, 392 "channelType": 1,
402 "defaultPermitted": 0, 393 "defaultPermitted": 0,
@@ -411,16 +402,17 @@ @@ -411,16 +402,17 @@
411 "iconUrlSize": "", 402 "iconUrlSize": "",
412 "localChannel": "0", 403 "localChannel": "0",
413 "moreChannel": "0", 404 "moreChannel": "0",
414 - "movePermitted": 1, 405 + "movePermitted": 0,
415 "myChannel": "0", 406 "myChannel": "0",
416 - "name": "财经", 407 + "name": "文化",
417 "num": 18, 408 "num": 18,
418 - "pageId": 20020, 409 + "pageId": 20022,
419 "pageType": "", 410 "pageType": "",
420 "underlineCColor": "" 411 "underlineCColor": ""
421 }, 412 },
422 { 413 {
423 "channelId": 2013, 414 "channelId": 2013,
  415 + "channelStrategy": 2,
424 "channelStyle": 2, 416 "channelStyle": 2,
425 "channelType": 1, 417 "channelType": 1,
426 "defaultPermitted": 0, 418 "defaultPermitted": 0,
@@ -445,6 +437,7 @@ @@ -445,6 +437,7 @@
445 }, 437 },
446 { 438 {
447 "channelId": 2017, 439 "channelId": 2017,
  440 + "channelStrategy": 2,
448 "channelStyle": 2, 441 "channelStyle": 2,
449 "channelType": 1, 442 "channelType": 1,
450 "defaultPermitted": 0, 443 "defaultPermitted": 0,
@@ -469,6 +462,7 @@ @@ -469,6 +462,7 @@
469 }, 462 },
470 { 463 {
471 "channelId": 2014, 464 "channelId": 2014,
  465 + "channelStrategy": 1,
472 "channelStyle": 2, 466 "channelStyle": 2,
473 "channelType": 1, 467 "channelType": 1,
474 "defaultPermitted": 0, 468 "defaultPermitted": 0,
@@ -493,6 +487,7 @@ @@ -493,6 +487,7 @@
493 }, 487 },
494 { 488 {
495 "channelId": 2018, 489 "channelId": 2018,
  490 + "channelStrategy": 1,
496 "channelStyle": 2, 491 "channelStyle": 2,
497 "channelType": 1, 492 "channelType": 1,
498 "defaultPermitted": 0, 493 "defaultPermitted": 0,
@@ -517,6 +512,7 @@ @@ -517,6 +512,7 @@
517 }, 512 },
518 { 513 {
519 "channelId": 2019, 514 "channelId": 2019,
  515 + "channelStrategy": 1,
520 "channelStyle": 2, 516 "channelStyle": 2,
521 "channelType": 1, 517 "channelType": 1,
522 "defaultPermitted": 0, 518 "defaultPermitted": 0,
@@ -541,6 +537,7 @@ @@ -541,6 +537,7 @@
541 }, 537 },
542 { 538 {
543 "channelId": 2027, 539 "channelId": 2027,
  540 + "channelStrategy": 2,
544 "channelStyle": 2, 541 "channelStyle": 2,
545 "channelType": 2, 542 "channelType": 2,
546 "defaultPermitted": 0, 543 "defaultPermitted": 0,
@@ -565,6 +562,7 @@ @@ -565,6 +562,7 @@
565 }, 562 },
566 { 563 {
567 "channelId": 2029, 564 "channelId": 2029,
  565 + "channelStrategy": 2,
568 "channelStyle": 2, 566 "channelStyle": 2,
569 "channelType": 2, 567 "channelType": 2,
570 "defaultPermitted": 0, 568 "defaultPermitted": 0,
@@ -589,6 +587,7 @@ @@ -589,6 +587,7 @@
589 }, 587 },
590 { 588 {
591 "channelId": 2030, 589 "channelId": 2030,
  590 + "channelStrategy": 2,
592 "channelStyle": 2, 591 "channelStyle": 2,
593 "channelType": 2, 592 "channelType": 2,
594 "defaultPermitted": 0, 593 "defaultPermitted": 0,
@@ -613,6 +612,7 @@ @@ -613,6 +612,7 @@
613 }, 612 },
614 { 613 {
615 "channelId": 2031, 614 "channelId": 2031,
  615 + "channelStrategy": 1,
616 "channelStyle": 2, 616 "channelStyle": 2,
617 "channelType": 2, 617 "channelType": 2,
618 "defaultPermitted": 0, 618 "defaultPermitted": 0,
@@ -637,6 +637,7 @@ @@ -637,6 +637,7 @@
637 }, 637 },
638 { 638 {
639 "channelId": 2032, 639 "channelId": 2032,
  640 + "channelStrategy": 2,
640 "channelStyle": 2, 641 "channelStyle": 2,
641 "channelType": 2, 642 "channelType": 2,
642 "defaultPermitted": 0, 643 "defaultPermitted": 0,
@@ -661,6 +662,7 @@ @@ -661,6 +662,7 @@
661 }, 662 },
662 { 663 {
663 "channelId": 2033, 664 "channelId": 2033,
  665 + "channelStrategy": 1,
664 "channelStyle": 2, 666 "channelStyle": 2,
665 "channelType": 2, 667 "channelType": 2,
666 "defaultPermitted": 0, 668 "defaultPermitted": 0,
@@ -685,6 +687,7 @@ @@ -685,6 +687,7 @@
685 }, 687 },
686 { 688 {
687 "channelId": 2034, 689 "channelId": 2034,
  690 + "channelStrategy": 1,
688 "channelStyle": 2, 691 "channelStyle": 2,
689 "channelType": 2, 692 "channelType": 2,
690 "defaultPermitted": 0, 693 "defaultPermitted": 0,
@@ -709,6 +712,7 @@ @@ -709,6 +712,7 @@
709 }, 712 },
710 { 713 {
711 "channelId": 2035, 714 "channelId": 2035,
  715 + "channelStrategy": 1,
712 "channelStyle": 2, 716 "channelStyle": 2,
713 "channelType": 2, 717 "channelType": 2,
714 "defaultPermitted": 0, 718 "defaultPermitted": 0,
@@ -733,6 +737,7 @@ @@ -733,6 +737,7 @@
733 }, 737 },
734 { 738 {
735 "channelId": 2028, 739 "channelId": 2028,
  740 + "channelStrategy": 1,
736 "channelStyle": 2, 741 "channelStyle": 2,
737 "channelType": 2, 742 "channelType": 2,
738 "defaultPermitted": 0, 743 "defaultPermitted": 0,
@@ -757,6 +762,7 @@ @@ -757,6 +762,7 @@
757 }, 762 },
758 { 763 {
759 "channelId": 2036, 764 "channelId": 2036,
  765 + "channelStrategy": 1,
760 "channelStyle": 2, 766 "channelStyle": 2,
761 "channelType": 2, 767 "channelType": 2,
762 "defaultPermitted": 0, 768 "defaultPermitted": 0,
@@ -781,6 +787,7 @@ @@ -781,6 +787,7 @@
781 }, 787 },
782 { 788 {
783 "channelId": 2037, 789 "channelId": 2037,
  790 + "channelStrategy": 1,
784 "channelStyle": 2, 791 "channelStyle": 2,
785 "channelType": 2, 792 "channelType": 2,
786 "defaultPermitted": 0, 793 "defaultPermitted": 0,
@@ -805,6 +812,7 @@ @@ -805,6 +812,7 @@
805 }, 812 },
806 { 813 {
807 "channelId": 2038, 814 "channelId": 2038,
  815 + "channelStrategy": 2,
808 "channelStyle": 2, 816 "channelStyle": 2,
809 "channelType": 2, 817 "channelType": 2,
810 "defaultPermitted": 0, 818 "defaultPermitted": 0,
@@ -829,6 +837,7 @@ @@ -829,6 +837,7 @@
829 }, 837 },
830 { 838 {
831 "channelId": 2039, 839 "channelId": 2039,
  840 + "channelStrategy": 1,
832 "channelStyle": 2, 841 "channelStyle": 2,
833 "channelType": 2, 842 "channelType": 2,
834 "defaultPermitted": 0, 843 "defaultPermitted": 0,
@@ -853,6 +862,7 @@ @@ -853,6 +862,7 @@
853 }, 862 },
854 { 863 {
855 "channelId": 2040, 864 "channelId": 2040,
  865 + "channelStrategy": 1,
856 "channelStyle": 2, 866 "channelStyle": 2,
857 "channelType": 2, 867 "channelType": 2,
858 "defaultPermitted": 0, 868 "defaultPermitted": 0,
@@ -877,6 +887,7 @@ @@ -877,6 +887,7 @@
877 }, 887 },
878 { 888 {
879 "channelId": 2041, 889 "channelId": 2041,
  890 + "channelStrategy": 1,
880 "channelStyle": 2, 891 "channelStyle": 2,
881 "channelType": 2, 892 "channelType": 2,
882 "defaultPermitted": 0, 893 "defaultPermitted": 0,
@@ -901,6 +912,7 @@ @@ -901,6 +912,7 @@
901 }, 912 },
902 { 913 {
903 "channelId": 2042, 914 "channelId": 2042,
  915 + "channelStrategy": 1,
904 "channelStyle": 2, 916 "channelStyle": 2,
905 "channelType": 2, 917 "channelType": 2,
906 "defaultPermitted": 0, 918 "defaultPermitted": 0,
@@ -925,6 +937,7 @@ @@ -925,6 +937,7 @@
925 }, 937 },
926 { 938 {
927 "channelId": 2043, 939 "channelId": 2043,
  940 + "channelStrategy": 1,
928 "channelStyle": 2, 941 "channelStyle": 2,
929 "channelType": 2, 942 "channelType": 2,
930 "defaultPermitted": 0, 943 "defaultPermitted": 0,
@@ -949,6 +962,7 @@ @@ -949,6 +962,7 @@
949 }, 962 },
950 { 963 {
951 "channelId": 2044, 964 "channelId": 2044,
  965 + "channelStrategy": 1,
952 "channelStyle": 2, 966 "channelStyle": 2,
953 "channelType": 2, 967 "channelType": 2,
954 "defaultPermitted": 0, 968 "defaultPermitted": 0,
@@ -973,6 +987,7 @@ @@ -973,6 +987,7 @@
973 }, 987 },
974 { 988 {
975 "channelId": 2045, 989 "channelId": 2045,
  990 + "channelStrategy": 1,
976 "channelStyle": 2, 991 "channelStyle": 2,
977 "channelType": 2, 992 "channelType": 2,
978 "defaultPermitted": 0, 993 "defaultPermitted": 0,
@@ -997,6 +1012,7 @@ @@ -997,6 +1012,7 @@
997 }, 1012 },
998 { 1013 {
999 "channelId": 2046, 1014 "channelId": 2046,
  1015 + "channelStrategy": 1,
1000 "channelStyle": 2, 1016 "channelStyle": 2,
1001 "channelType": 2, 1017 "channelType": 2,
1002 "defaultPermitted": 0, 1018 "defaultPermitted": 0,
@@ -1021,6 +1037,7 @@ @@ -1021,6 +1037,7 @@
1021 }, 1037 },
1022 { 1038 {
1023 "channelId": 2047, 1039 "channelId": 2047,
  1040 + "channelStrategy": 1,
1024 "channelStyle": 2, 1041 "channelStyle": 2,
1025 "channelType": 2, 1042 "channelType": 2,
1026 "defaultPermitted": 0, 1043 "defaultPermitted": 0,
@@ -1045,6 +1062,7 @@ @@ -1045,6 +1062,7 @@
1045 }, 1062 },
1046 { 1063 {
1047 "channelId": 2048, 1064 "channelId": 2048,
  1065 + "channelStrategy": 1,
1048 "channelStyle": 2, 1066 "channelStyle": 2,
1049 "channelType": 2, 1067 "channelType": 2,
1050 "defaultPermitted": 0, 1068 "defaultPermitted": 0,
@@ -1069,6 +1087,7 @@ @@ -1069,6 +1087,7 @@
1069 }, 1087 },
1070 { 1088 {
1071 "channelId": 2049, 1089 "channelId": 2049,
  1090 + "channelStrategy": 1,
1072 "channelStyle": 2, 1091 "channelStyle": 2,
1073 "channelType": 2, 1092 "channelType": 2,
1074 "defaultPermitted": 0, 1093 "defaultPermitted": 0,
@@ -1093,6 +1112,7 @@ @@ -1093,6 +1112,7 @@
1093 }, 1112 },
1094 { 1113 {
1095 "channelId": 2050, 1114 "channelId": 2050,
  1115 + "channelStrategy": 1,
1096 "channelStyle": 2, 1116 "channelStyle": 2,
1097 "channelType": 2, 1117 "channelType": 2,
1098 "defaultPermitted": 0, 1118 "defaultPermitted": 0,
@@ -1117,6 +1137,7 @@ @@ -1117,6 +1137,7 @@
1117 }, 1137 },
1118 { 1138 {
1119 "channelId": 2051, 1139 "channelId": 2051,
  1140 + "channelStrategy": 1,
1120 "channelStyle": 2, 1141 "channelStyle": 2,
1121 "channelType": 2, 1142 "channelType": 2,
1122 "defaultPermitted": 0, 1143 "defaultPermitted": 0,
@@ -1141,6 +1162,7 @@ @@ -1141,6 +1162,7 @@
1141 }, 1162 },
1142 { 1163 {
1143 "channelId": 2052, 1164 "channelId": 2052,
  1165 + "channelStrategy": 1,
1144 "channelStyle": 2, 1166 "channelStyle": 2,
1145 "channelType": 2, 1167 "channelType": 2,
1146 "defaultPermitted": 0, 1168 "defaultPermitted": 0,
@@ -1165,6 +1187,7 @@ @@ -1165,6 +1187,7 @@
1165 }, 1187 },
1166 { 1188 {
1167 "channelId": 2053, 1189 "channelId": 2053,
  1190 + "channelStrategy": 1,
1168 "channelStyle": 2, 1191 "channelStyle": 2,
1169 "channelType": 2, 1192 "channelType": 2,
1170 "defaultPermitted": 0, 1193 "defaultPermitted": 0,
@@ -1189,6 +1212,7 @@ @@ -1189,6 +1212,7 @@
1189 }, 1212 },
1190 { 1213 {
1191 "channelId": 2054, 1214 "channelId": 2054,
  1215 + "channelStrategy": 1,
1192 "channelStyle": 2, 1216 "channelStyle": 2,
1193 "channelType": 2, 1217 "channelType": 2,
1194 "defaultPermitted": 0, 1218 "defaultPermitted": 0,
@@ -1213,6 +1237,7 @@ @@ -1213,6 +1237,7 @@
1213 }, 1237 },
1214 { 1238 {
1215 "channelId": 2055, 1239 "channelId": 2055,
  1240 + "channelStrategy": 2,
1216 "channelStyle": 2, 1241 "channelStyle": 2,
1217 "channelType": 2, 1242 "channelType": 2,
1218 "defaultPermitted": 0, 1243 "defaultPermitted": 0,
@@ -1237,6 +1262,7 @@ @@ -1237,6 +1262,7 @@
1237 }, 1262 },
1238 { 1263 {
1239 "channelId": 2056, 1264 "channelId": 2056,
  1265 + "channelStrategy": 2,
1240 "channelStyle": 2, 1266 "channelStyle": 2,
1241 "channelType": 2, 1267 "channelType": 2,
1242 "defaultPermitted": 0, 1268 "defaultPermitted": 0,
@@ -1261,6 +1287,7 @@ @@ -1261,6 +1287,7 @@
1261 }, 1287 },
1262 { 1288 {
1263 "channelId": 2057, 1289 "channelId": 2057,
  1290 + "channelStrategy": 2,
1264 "channelStyle": 2, 1291 "channelStyle": 2,
1265 "channelType": 2, 1292 "channelType": 2,
1266 "defaultPermitted": 0, 1293 "defaultPermitted": 0,
@@ -1285,6 +1312,7 @@ @@ -1285,6 +1312,7 @@
1285 }, 1312 },
1286 { 1313 {
1287 "channelId": 2020, 1314 "channelId": 2020,
  1315 + "channelStrategy": 2,
1288 "channelStyle": 2, 1316 "channelStyle": 2,
1289 "channelType": 1, 1317 "channelType": 1,
1290 "defaultPermitted": 0, 1318 "defaultPermitted": 0,
@@ -1309,6 +1337,7 @@ @@ -1309,6 +1337,7 @@
1309 }, 1337 },
1310 { 1338 {
1311 "channelId": 2021, 1339 "channelId": 2021,
  1340 + "channelStrategy": 1,
1312 "channelStyle": 2, 1341 "channelStyle": 2,
1313 "channelType": 1, 1342 "channelType": 1,
1314 "defaultPermitted": 0, 1343 "defaultPermitted": 0,
@@ -1332,7 +1361,8 @@ @@ -1332,7 +1361,8 @@
1332 "underlineCColor": "" 1361 "underlineCColor": ""
1333 }, 1362 },
1334 { 1363 {
1335 - "channelId": 2022, 1364 + "channelId": 2069,
  1365 + "channelStrategy": 2,
1336 "channelStyle": 2, 1366 "channelStyle": 2,
1337 "channelType": 1, 1367 "channelType": 1,
1338 "defaultPermitted": 0, 1368 "defaultPermitted": 0,
@@ -1349,18 +1379,19 @@ @@ -1349,18 +1379,19 @@
1349 "moreChannel": "0", 1379 "moreChannel": "0",
1350 "movePermitted": 1, 1380 "movePermitted": 1,
1351 "myChannel": "0", 1381 "myChannel": "0",
1352 - "name": "生活",  
1353 - "num": 59,  
1354 - "pageId": 20032, 1382 + "name": "冬奥",
  1383 + "num": 66,
  1384 + "pageId": 21006,
1355 "pageType": "", 1385 "pageType": "",
1356 "underlineCColor": "" 1386 "underlineCColor": ""
1357 }, 1387 },
1358 { 1388 {
1359 - "channelId": 2092, 1389 + "channelId": 2070,
  1390 + "channelStrategy": 2,
1360 "channelStyle": 2, 1391 "channelStyle": 2,
1361 "channelType": 1, 1392 "channelType": 1,
1362 "defaultPermitted": 0, 1393 "defaultPermitted": 0,
1363 - "delPermitted": 0, 1394 + "delPermitted": 1,
1364 "fontCColor": "#FFFFFF", 1395 "fontCColor": "#FFFFFF",
1365 "fontColor": "#F9AB99", 1396 "fontColor": "#F9AB99",
1366 "headlinesOn": 0, 1397 "headlinesOn": 0,
@@ -1373,18 +1404,19 @@ @@ -1373,18 +1404,19 @@
1373 "moreChannel": "0", 1404 "moreChannel": "0",
1374 "movePermitted": 1, 1405 "movePermitted": 1,
1375 "myChannel": "0", 1406 "myChannel": "0",
1376 - "name": "设计",  
1377 - "num": 68,  
1378 - "pageId": 21063, 1407 + "name": "旅游",
  1408 + "num": 67,
  1409 + "pageId": 21007,
1379 "pageType": "", 1410 "pageType": "",
1380 "underlineCColor": "" 1411 "underlineCColor": ""
1381 }, 1412 },
1382 { 1413 {
1383 - "channelId": 2098, 1414 + "channelId": 2077,
  1415 + "channelStrategy": 2,
1384 "channelStyle": 2, 1416 "channelStyle": 2,
1385 "channelType": 1, 1417 "channelType": 1,
1386 "defaultPermitted": 0, 1418 "defaultPermitted": 0,
1387 - "delPermitted": 0, 1419 + "delPermitted": 1,
1388 "fontCColor": "#FFFFFF", 1420 "fontCColor": "#FFFFFF",
1389 "fontColor": "#F9AB99", 1421 "fontColor": "#F9AB99",
1390 "headlinesOn": 0, 1422 "headlinesOn": 0,
@@ -1395,35 +1427,11 @@ @@ -1395,35 +1427,11 @@
1395 "iconUrlSize": "", 1427 "iconUrlSize": "",
1396 "localChannel": "0", 1428 "localChannel": "0",
1397 "moreChannel": "0", 1429 "moreChannel": "0",
1398 - "movePermitted": 0,  
1399 - "myChannel": "0",  
1400 - "name": "设计组件",  
1401 - "num": 72,  
1402 - "pageId": 21299,  
1403 - "pageType": "",  
1404 - "underlineCColor": ""  
1405 - },  
1406 - {  
1407 - "channelId": 2099,  
1408 - "channelStyle": 2,  
1409 - "channelType": 1,  
1410 - "defaultPermitted": 0,  
1411 - "delPermitted": 0,  
1412 - "fontCColor": "",  
1413 - "fontColor": "",  
1414 - "headlinesOn": 0,  
1415 - "homeChannel": "0",  
1416 - "iconCUrl": "",  
1417 - "iconCUrlSize": "",  
1418 - "iconUrl": "",  
1419 - "iconUrlSize": "",  
1420 - "localChannel": "0",  
1421 - "moreChannel": "0",  
1422 "movePermitted": 1, 1430 "movePermitted": 1,
1423 "myChannel": "0", 1431 "myChannel": "0",
1424 - "name": "设计号",  
1425 - "num": 73,  
1426 - "pageId": 21736, 1432 + "name": "设计",
  1433 + "num": 69,
  1434 + "pageId": 21528,
1427 "pageType": "", 1435 "pageType": "",
1428 "underlineCColor": "" 1436 "underlineCColor": ""
1429 } 1437 }
@@ -1432,39 +1440,40 @@ @@ -1432,39 +1440,40 @@
1432 "type": "1" 1440 "type": "1"
1433 }, 1441 },
1434 { 1442 {
1435 - "backgroundUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/2e1d5f235d1a44cfb9fc120e8596c56b.png",  
1436 - "channelChooseActionUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231227/vod/display/3835f09a973443cb824af179e30e87ed.pag",  
1437 - "channelChooseCColor": "#666666",  
1438 - "channelChooseColor": "#222222", 1443 + "backgroundUrl": "",
  1444 + "channelChooseActionUrl": "",
  1445 + "channelChooseCColor": "",
  1446 + "channelChooseColor": "",
1439 "channelMoreColor": "", 1447 "channelMoreColor": "",
1440 "extraData": "{\"haveSearch\":\"0\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}", 1448 "extraData": "{\"haveSearch\":\"0\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}",
1441 - "homePageColor": "#FFFFFF",  
1442 - "icon": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/460f61a48c6a4993af442d54aedb682b.png",  
1443 - "iconC": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/9aa759f72ccb4848b3ded2dee9502c25.gif", 1449 + "homePageColor": "",
  1450 + "icon": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/e54cb55897604f099940d0a8526680c0.png",
  1451 + "iconC": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/29e827defea748e295fa4397022b6cc9.png",
1444 "id": 202, 1452 "id": 202,
1445 "immersiveIconCUrl": "", 1453 "immersiveIconCUrl": "",
1446 "immersiveIconUrl": "", 1454 "immersiveIconUrl": "",
1447 - "immersiveNameCColor": "#FFFFFF",  
1448 - "immersiveNameColor": "#FFFFFF", 1455 + "immersiveNameCColor": "",
  1456 + "immersiveNameColor": "",
1449 "logoUrl": "", 1457 "logoUrl": "",
1450 "morningAndEveningUrl": "", 1458 "morningAndEveningUrl": "",
1451 "name": "人民号", 1459 "name": "人民号",
1452 - "nameCColor": "#ED2800", 1460 + "nameCColor": "#CB0000",
1453 "nameColor": "#999999", 1461 "nameColor": "#999999",
1454 "nightIconCUrl": "", 1462 "nightIconCUrl": "",
1455 "nightIconUrl": "", 1463 "nightIconUrl": "",
1456 "nightNameCColor": "", 1464 "nightNameCColor": "",
1457 "nightNameColor": "", 1465 "nightNameColor": "",
1458 - "noticeColor": "#FFFFFF", 1466 + "noticeColor": "",
1459 "pageId": null, 1467 "pageId": null,
1460 "pageType": null, 1468 "pageType": null,
1461 - "searchBothColor": "#222222", 1469 + "searchBothColor": "",
1462 "searchUrl": "", 1470 "searchUrl": "",
1463 "sortValue": 2, 1471 "sortValue": 2,
1464 - "statusBarColor": 1, 1472 + "statusBarColor": null,
1465 "topNavChannelList": [ 1473 "topNavChannelList": [
1466 { 1474 {
1467 "channelId": 2058, 1475 "channelId": 2058,
  1476 + "channelStrategy": 1,
1468 "channelStyle": 3, 1477 "channelStyle": 3,
1469 "channelType": 1, 1478 "channelType": 1,
1470 "defaultPermitted": 0, 1479 "defaultPermitted": 0,
@@ -1489,6 +1498,7 @@ @@ -1489,6 +1498,7 @@
1489 }, 1498 },
1490 { 1499 {
1491 "channelId": 2059, 1500 "channelId": 2059,
  1501 + "channelStrategy": 2,
1492 "channelStyle": 3, 1502 "channelStyle": 3,
1493 "channelType": 3, 1503 "channelType": 3,
1494 "defaultPermitted": 0, 1504 "defaultPermitted": 0,
@@ -1513,6 +1523,7 @@ @@ -1513,6 +1523,7 @@
1513 }, 1523 },
1514 { 1524 {
1515 "channelId": 2073, 1525 "channelId": 2073,
  1526 + "channelStrategy": 2,
1516 "channelStyle": 3, 1527 "channelStyle": 3,
1517 "channelType": 1, 1528 "channelType": 1,
1518 "defaultPermitted": 0, 1529 "defaultPermitted": 0,
@@ -1540,39 +1551,40 @@ @@ -1540,39 +1551,40 @@
1540 "type": "1" 1551 "type": "1"
1541 }, 1552 },
1542 { 1553 {
1543 - "backgroundUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/2e1d5f235d1a44cfb9fc120e8596c56b.png",  
1544 - "channelChooseActionUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231221/vod/display/65c6eb2ca91849c582d057adc9e76d46.pag",  
1545 - "channelChooseCColor": "#666666",  
1546 - "channelChooseColor": "#222222", 1554 + "backgroundUrl": "",
  1555 + "channelChooseActionUrl": "",
  1556 + "channelChooseCColor": "",
  1557 + "channelChooseColor": "",
1547 "channelMoreColor": "", 1558 "channelMoreColor": "",
1548 "extraData": "{\"haveSearch\":\"1\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}", 1559 "extraData": "{\"haveSearch\":\"1\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}",
1549 - "homePageColor": "#FFFFFF",  
1550 - "icon": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231221/image/display/bf77561966654001a538857ebef8a15c.png",  
1551 - "iconC": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231224/image/display/1a42d5b8183a4eb1a044ddd64223c687.png", 1560 + "homePageColor": "",
  1561 + "icon": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/551a687fccdc44ce916a391cc10eabdd.png",
  1562 + "iconC": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/8ebb3bfe44534b059d5af53aafba8919.png",
1552 "id": 203, 1563 "id": 203,
1553 "immersiveIconCUrl": "", 1564 "immersiveIconCUrl": "",
1554 "immersiveIconUrl": "", 1565 "immersiveIconUrl": "",
1555 - "immersiveNameCColor": "#FFFFFF",  
1556 - "immersiveNameColor": "#FFFFFF", 1566 + "immersiveNameCColor": "",
  1567 + "immersiveNameColor": "",
1557 "logoUrl": "", 1568 "logoUrl": "",
1558 "morningAndEveningUrl": "", 1569 "morningAndEveningUrl": "",
1559 "name": "视频", 1570 "name": "视频",
1560 - "nameCColor": "#ED2800", 1571 + "nameCColor": "#CB0000",
1561 "nameColor": "#999999", 1572 "nameColor": "#999999",
1562 "nightIconCUrl": "", 1573 "nightIconCUrl": "",
1563 "nightIconUrl": "", 1574 "nightIconUrl": "",
1564 "nightNameCColor": "", 1575 "nightNameCColor": "",
1565 "nightNameColor": "", 1576 "nightNameColor": "",
1566 - "noticeColor": "#FFFFFF", 1577 + "noticeColor": "",
1567 "pageId": null, 1578 "pageId": null,
1568 "pageType": null, 1579 "pageType": null,
1569 - "searchBothColor": "#222222", 1580 + "searchBothColor": "",
1570 "searchUrl": "", 1581 "searchUrl": "",
1571 "sortValue": 3, 1582 "sortValue": 3,
1572 - "statusBarColor": 1, 1583 + "statusBarColor": null,
1573 "topNavChannelList": [ 1584 "topNavChannelList": [
1574 { 1585 {
1575 "channelId": 2060, 1586 "channelId": 2060,
  1587 + "channelStrategy": 1,
1576 "channelStyle": 1, 1588 "channelStyle": 1,
1577 "channelType": 1, 1589 "channelType": 1,
1578 "defaultPermitted": 0, 1590 "defaultPermitted": 0,
@@ -1597,6 +1609,7 @@ @@ -1597,6 +1609,7 @@
1597 }, 1609 },
1598 { 1610 {
1599 "channelId": 2061, 1611 "channelId": 2061,
  1612 + "channelStrategy": 2,
1600 "channelStyle": 3, 1613 "channelStyle": 3,
1601 "channelType": 1, 1614 "channelType": 1,
1602 "defaultPermitted": 0, 1615 "defaultPermitted": 0,
@@ -1624,39 +1637,40 @@ @@ -1624,39 +1637,40 @@
1624 "type": "1" 1637 "type": "1"
1625 }, 1638 },
1626 { 1639 {
1627 - "backgroundUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/2e1d5f235d1a44cfb9fc120e8596c56b.png",  
1628 - "channelChooseActionUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231221/vod/display/65c6eb2ca91849c582d057adc9e76d46.pag",  
1629 - "channelChooseCColor": "#666666",  
1630 - "channelChooseColor": "#222222", 1640 + "backgroundUrl": "",
  1641 + "channelChooseActionUrl": "",
  1642 + "channelChooseCColor": "",
  1643 + "channelChooseColor": "",
1631 "channelMoreColor": "", 1644 "channelMoreColor": "",
1632 "extraData": "{\"haveSearch\":\"1\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}", 1645 "extraData": "{\"haveSearch\":\"1\",\"haveTopNav\":\"1\",\"leftIconurl\":\"\",\"rightIconUrl\":\"\"}",
1633 - "homePageColor": "#FFFFFF",  
1634 - "icon": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/5a6cf95f7b9e489390ec73faf458b58a.png",  
1635 - "iconC": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/1b075ed30a6b43d2ae319e5d892c66e4.gif", 1646 + "homePageColor": "",
  1647 + "icon": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/a35a51ac415343bb8122b48f84b5ca70.png",
  1648 + "iconC": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/972642ec160b4fc2a5dad2de3488d903.png",
1636 "id": 204, 1649 "id": 204,
1637 "immersiveIconCUrl": "", 1650 "immersiveIconCUrl": "",
1638 "immersiveIconUrl": "", 1651 "immersiveIconUrl": "",
1639 - "immersiveNameCColor": "#FFFFFF",  
1640 - "immersiveNameColor": "#FFFFFF", 1652 + "immersiveNameCColor": "",
  1653 + "immersiveNameColor": "",
1641 "logoUrl": "", 1654 "logoUrl": "",
1642 "morningAndEveningUrl": "", 1655 "morningAndEveningUrl": "",
1643 "name": "服务", 1656 "name": "服务",
1644 - "nameCColor": "#ED2800", 1657 + "nameCColor": "#CB0000",
1645 "nameColor": "#999999", 1658 "nameColor": "#999999",
1646 "nightIconCUrl": "", 1659 "nightIconCUrl": "",
1647 "nightIconUrl": "", 1660 "nightIconUrl": "",
1648 "nightNameCColor": "", 1661 "nightNameCColor": "",
1649 "nightNameColor": "", 1662 "nightNameColor": "",
1650 - "noticeColor": "#FFFFFF", 1663 + "noticeColor": "",
1651 "pageId": null, 1664 "pageId": null,
1652 "pageType": null, 1665 "pageType": null,
1653 - "searchBothColor": "#222222", 1666 + "searchBothColor": "",
1654 "searchUrl": "", 1667 "searchUrl": "",
1655 "sortValue": 4, 1668 "sortValue": 4,
1656 - "statusBarColor": 1, 1669 + "statusBarColor": null,
1657 "topNavChannelList": [ 1670 "topNavChannelList": [
1658 { 1671 {
1659 "channelId": 2062, 1672 "channelId": 2062,
  1673 + "channelStrategy": 2,
1660 "channelStyle": 3, 1674 "channelStyle": 3,
1661 "channelType": 1, 1675 "channelType": 1,
1662 "defaultPermitted": 0, 1676 "defaultPermitted": 0,
@@ -1684,36 +1698,36 @@ @@ -1684,36 +1698,36 @@
1684 "type": "1" 1698 "type": "1"
1685 }, 1699 },
1686 { 1700 {
1687 - "backgroundUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231214/image/display/3e1f4fe85b0445b6a0be24f3759d0ff6.png", 1701 + "backgroundUrl": "",
1688 "channelChooseActionUrl": "", 1702 "channelChooseActionUrl": "",
1689 - "channelChooseCColor": "#FFFFFF",  
1690 - "channelChooseColor": "#FFFFFF", 1703 + "channelChooseCColor": "",
  1704 + "channelChooseColor": "",
1691 "channelMoreColor": "", 1705 "channelMoreColor": "",
1692 "extraData": "{\"haveSearch\":\"0\",\"haveTopNav\":\"0\"}", 1706 "extraData": "{\"haveSearch\":\"0\",\"haveTopNav\":\"0\"}",
1693 - "homePageColor": "#222222",  
1694 - "icon": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/f55f0ac25b764809bc8285c284adb147.png",  
1695 - "iconC": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231220/image/display/3b5cff54d2a546f5b523a8aa8c33352e.gif", 1707 + "homePageColor": "",
  1708 + "icon": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/3fa1832f3fbf49e6ad6765e64d27e60e.png",
  1709 + "iconC": "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231015/image/display/39a357a0f0954b86b993a18988d29f96.png",
1696 "id": 205, 1710 "id": 205,
1697 - "immersiveIconCUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/inen-20230403/image/display/9f22b579db15497797e8204b1ec12d14.png",  
1698 - "immersiveIconUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/inen-20230403/image/display/5be23055a4dc4d869be2139e9deb7a55.png", 1711 + "immersiveIconCUrl": "https://cdnjdphoto.aikan.pdnews.cn/inen-20230403/image/display/9f22b579db15497797e8204b1ec12d14.png",
  1712 + "immersiveIconUrl": "https://cdnjdphoto.aikan.pdnews.cn/inen-20230403/image/display/5be23055a4dc4d869be2139e9deb7a55.png",
1699 "immersiveNameCColor": "#FFFFFF", 1713 "immersiveNameCColor": "#FFFFFF",
1700 - "immersiveNameColor": "#FFFFFF", 1714 + "immersiveNameColor": "#6A6B75",
1701 "logoUrl": "", 1715 "logoUrl": "",
1702 "morningAndEveningUrl": "", 1716 "morningAndEveningUrl": "",
1703 "name": "我的", 1717 "name": "我的",
1704 - "nameCColor": "#ED2800", 1718 + "nameCColor": "#CB0000",
1705 "nameColor": "#999999", 1719 "nameColor": "#999999",
1706 - "nightIconCUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/inen-20230403/image/display/9d584ddcfdf74e3ea8e445d102127b97.png",  
1707 - "nightIconUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/inen-20230403/image/display/1f79063b6ecb493c95703e45529d3a5f.png", 1720 + "nightIconCUrl": "https://cdnjdphoto.aikan.pdnews.cn/inen-20230403/image/display/9d584ddcfdf74e3ea8e445d102127b97.png",
  1721 + "nightIconUrl": "https://cdnjdphoto.aikan.pdnews.cn/inen-20230403/image/display/1f79063b6ecb493c95703e45529d3a5f.png",
1708 "nightNameCColor": "#DA1C1C", 1722 "nightNameCColor": "#DA1C1C",
1709 "nightNameColor": "#6A6B75", 1723 "nightNameColor": "#6A6B75",
1710 - "noticeColor": "#ED2800", 1724 + "noticeColor": "",
1711 "pageId": null, 1725 "pageId": null,
1712 "pageType": null, 1726 "pageType": null,
1713 - "searchBothColor": "#FFFFFF", 1727 + "searchBothColor": "",
1714 "searchUrl": "", 1728 "searchUrl": "",
1715 "sortValue": 5, 1729 "sortValue": 5,
1716 - "statusBarColor": 1, 1730 + "statusBarColor": null,
1717 "topNavChannelList": [], 1731 "topNavChannelList": [],
1718 "topStyle": "", 1732 "topStyle": "",
1719 "type": "2" 1733 "type": "2"
@@ -1728,9 +1742,9 @@ @@ -1728,9 +1742,9 @@
1728 }, 1742 },
1729 "message": "Success", 1743 "message": "Success",
1730 "meta": { 1744 "meta": {
1731 - "md5": "e2942dbcd76710d1bac0d98f9a0a9d0a" 1745 + "md5": "bab17ef603000513258f3ff7c4add868"
1732 }, 1746 },
1733 "requestId": "", 1747 "requestId": "",
1734 "success": true, 1748 "success": true,
1735 - "timestamp": 1704765430031 1749 + "timestamp": 1706625315509
1736 } 1750 }
@@ -155,6 +155,130 @@ @@ -155,6 +155,130 @@
155 "subType": "" 155 "subType": ""
156 }, 156 },
157 { 157 {
  158 + "audioDataList": [],
  159 + "backgroundImgUrl": "",
  160 + "bottomNavId": null,
  161 + "cardItemId": "",
  162 + "cardUpdateStrategy": null,
  163 + "compStyle": "Single_Imagecard_03",
  164 + "compType": "appStyle",
  165 + "dataSourceType": "",
  166 + "extraData": "",
  167 + "fullColumnImgUrls": [],
  168 + "hasMore": 1,
  169 + "id": null,
  170 + "imageScale": null,
  171 + "imgSize": "",
  172 + "itemId": "",
  173 + "itemType": "",
  174 + "itemTypeCode": "",
  175 + "linkUrl": "",
  176 + "name": "",
  177 + "objectId": "",
  178 + "objectLevel": "",
  179 + "objectSummary": "",
  180 + "objectTitle": "",
  181 + "objectType": "",
  182 + "openComment": null,
  183 + "openLikes": null,
  184 + "operDataList": [
  185 + {
  186 + "activityExt": null,
  187 + "appStyle": "13",
  188 + "askInfo": null,
  189 + "axisColor": "",
  190 + "bestNoticer": null,
  191 + "bottomNavId": null,
  192 + "cardItemId": "",
  193 + "channelId": 2001,
  194 + "commentInfo": null,
  195 + "corner": "",
  196 + "coverSize": "660*440",
  197 + "coverType": 1,
  198 + "coverUrl": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231215/image/display/846c62e2411e4eb39d2ac37bf72910df.png?x-oss-process=image/resize,w_240/quality,q_90/format,jpg",
  199 + "extra": "",
  200 + "fullColumnImgUrls": [
  201 + {
  202 + "format": null,
  203 + "height": 440,
  204 + "landscape": 1,
  205 + "size": 445035,
  206 + "url": "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231215/image/display/846c62e2411e4eb39d2ac37bf72910df.png?x-oss-process=image/resize,w_240/quality,q_90/format,jpg",
  207 + "weight": 660
  208 + }
  209 + ],
  210 + "hasMore": null,
  211 + "itemId": "",
  212 + "itemType": "",
  213 + "itemTypeCode": "",
  214 + "keyArticle": null,
  215 + "landscape": null,
  216 + "likeStyle": null,
  217 + "linkUrl": "",
  218 + "liveInfo": null,
  219 + "menuShow": 1,
  220 + "newTags": "",
  221 + "newsAuthor": "",
  222 + "newsSubTitle": "",
  223 + "newsSummary": "",
  224 + "newsTitle": "特稿:《巴黎协定》首次全球“大考” 中国“答卷”尽显大国担当",
  225 + "newsTitleColor": "",
  226 + "objectId": "30001374647",
  227 + "objectLevel": "",
  228 + "objectType": "8",
  229 + "openComment": null,
  230 + "openLikes": null,
  231 + "pageId": "",
  232 + "photoNum": null,
  233 + "position": null,
  234 + "publishTime": "1702627948000",
  235 + "pushTime": null,
  236 + "pushUnqueId": null,
  237 + "readFlag": 0,
  238 + "recommend": null,
  239 + "relId": 500000008765,
  240 + "relObjectId": "2001",
  241 + "relType": 1,
  242 + "rmhInfo": null,
  243 + "rmhPlatform": 0,
  244 + "sceneId": "",
  245 + "shareInfo": null,
  246 + "slideShows": [],
  247 + "sortValue": null,
  248 + "source": "",
  249 + "subSceneId": "",
  250 + "tagIds": [],
  251 + "tagWord": null,
  252 + "titleShow": null,
  253 + "titleShowPolicy": null,
  254 + "topicTemplate": null,
  255 + "traceId": "",
  256 + "traceInfo": "",
  257 + "userInfo": null,
  258 + "videoInfo": null,
  259 + "visitorComment": 1,
  260 + "voiceInfo": null
  261 + }
  262 + ],
  263 + "pageId": "",
  264 + "position": null,
  265 + "posterSize": "",
  266 + "posterUrl": "",
  267 + "recommend": 0,
  268 + "relId": null,
  269 + "sceneId": "",
  270 + "sortValue": null,
  271 + "subSceneId": "",
  272 + "summaryName": "",
  273 + "tabOperDataList": [],
  274 + "titleShowPolicy": null,
  275 + "topicTemplate": null,
  276 + "traceId": "",
  277 + "traceInfo": "",
  278 + "viewTime": "",
  279 + "viewTimeBlurred": null
  280 + },
  281 + {
158 "backgroundColor": "", 282 "backgroundColor": "",
159 "backgroundImgUrl": "", 283 "backgroundImgUrl": "",
160 "cityCode": "", 284 "cityCode": "",
  1 +{
  2 + "code":"0",
  3 + "data":[
  4 + {
  5 + "activityInfos":[
  6 +
  7 + ],
  8 + "appstyle":13,
  9 + "audioList":[
  10 +
  11 + ],
  12 + "authorList":[
  13 + {
  14 + "authorName":""
  15 + }
  16 + ],
  17 + "bestNoticer":1,
  18 + "commentDisplay":1,
  19 + "editorName":"韩文鋆",
  20 + "firstFrameImageUri":"https://cdnjdout.aikan.pdnews.cn/zhbj-20240127/vod/content/output/f45ef51bb33f4ffd9458f8b386aa3227_opt.png",
  21 + "fullColumnImgUrls":[
  22 + {
  23 + "format":null,
  24 + "height":837,
  25 + "landscape":1,
  26 + "size":1222753,
  27 + "url":"https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240127/image/display/efd5771a861f45dd8170da1c3c8c4d04.png",
  28 + "weight":1256
  29 + }
  30 + ],
  31 + "hasPopUp":null,
  32 + "itemId":"",
  33 + "itemTypeCode":"",
  34 + "keyArticle":0,
  35 + "likesStyle":1,
  36 + "liveInfo":null,
  37 + "menuShow":1,
  38 + "newIntroduction":"",
  39 + "newLinkObject":null,
  40 + "newsBodyTitle":"",
  41 + "newsContent":"",
  42 + "newsContentBak":"",
  43 + "newsDownTitle":"",
  44 + "newsId":30013266075,
  45 + "newsLinkUrl":"",
  46 + "newsShortTitle":"",
  47 + "newsSource":"41",
  48 + "newsSourceName":"中国铁路微信公号",
  49 + "newsSummary":"",
  50 + "newsTags":"",
  51 + "newsTitle":"旅途平安!这首歌送给即将启程回家的你",
  52 + "newsType":1,
  53 + "openAudio":1,
  54 + "openComment":1,
  55 + "openLikes":1,
  56 + "photoList":[
  57 +
  58 + ],
  59 + "popUps":[
  60 +
  61 + ],
  62 + "preCommentFlag":1,
  63 + "publishTime":"2024-01-27 14:18:52",
  64 + "reLInfo":{
  65 + "channelId":2002,
  66 + "relId":"500000301942",
  67 + "relObjectId":2002,
  68 + "relType":"1"
  69 + },
  70 + "readFlag":0,
  71 + "recommendShow":1,
  72 + "rmhInfo":null,
  73 + "rmhPlatform":0,
  74 + "sceneId":"",
  75 + "shareInfo":{
  76 + "shareCoverUrl":"https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240127/image/content/6706775f96a346a8a1e7393c325e043d.png?x-oss-process=image/resize,w_200",
  77 + "shareOpen":1,
  78 + "sharePosterCoverUrl":"https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240127/image/display/efd5771a861f45dd8170da1c3c8c4d04.png",
  79 + "sharePosterOpen":1,
  80 + "shareSummary":"人民日报,有品质的新闻",
  81 + "shareTitle":"旅途平安!这首歌送给即将启程回家的你",
  82 + "shareUrl":"https://people.pdnews.cn/vod/rel/500000301942/30013266075"
  83 + },
  84 + "specialColumnId":null,
  85 + "specialColumnName":"",
  86 + "subSceneId":"",
  87 + "timeline":null,
  88 + "topicInfo":null,
  89 + "traceId":"",
  90 + "traceInfo":"",
  91 + "userInfo":null,
  92 + "videoInfo":[
  93 + {
  94 + "clarity":5,
  95 + "resolutionHeight":1080,
  96 + "resolutionWidth":1920,
  97 + "videoDuration":143,
  98 + "videoLandScape":1,
  99 + "videoType":1,
  100 + "videoUrl":"https://cdnjdout.aikan.pdnews.cn/zhbj-20240127/vod/content/output/f45ef51bb33f4ffd9458f8b386aa3227_opt.mp4"
  101 + }
  102 + ],
  103 + "viewCount":0,
  104 + "voteInfo":null
  105 + }
  106 + ],
  107 + "message":"Success",
  108 + "meta":null,
  109 + "requestId":"",
  110 + "success":true,
  111 + "timestamp":1706514747211
  112 +}
This diff could not be displayed because it is too large.
  1 +{
  2 + "code": "0",
  3 + "data": [{
  4 + "date": "49997-06-15",
  5 + "list": [{
  6 + "exist": 1,
  7 + "pageName": "",
  8 + "pageNum": "05",
  9 + "periodNum": "49997-06-15"
  10 + }]
  11 + }],
  12 + "message": "Success",
  13 + "meta": null,
  14 + "requestId": "",
  15 + "success": true,
  16 + "timestamp": 1706170629625
  17 +}
1 -// enum  
2 -export { BottomNavi } from './src/main/ets/enum/BottomNavi';  
3 -  
4 -export { CompStyle } from './src/main/ets/enum/CompStyle';  
5 -  
6 -export { CompType } from './src/main/ets/enum/CompType';  
7 -  
8 -export { NetDataStatusType } from './src/main/ets/enum/NetDataStatusType';  
9 -  
10 -export { ViewType } from './src/main/ets/enum/ViewType';  
11 -  
12 -export { DelayTimeEnum } from './src/main/ets/enum/DelayTimeEnum';  
13 -  
14 -export { ScreenType } from './src/main/ets/enum/ScreenType';  
15 -  
16 // navigation 1 // navigation
17 -export { NavigationBody } from './src/main/ets/bean/navigation/NavigationBody'; 2 +export { NavigationBodyDTO } from './src/main/ets/bean/navigation/NavigationBodyDTO';
18 3
19 -export { BottomNavBean } from './src/main/ets/bean/navigation/BottomNavBean'; 4 +export { BottomNavDTO } from './src/main/ets/bean/navigation/BottomNavDTO';
20 5
21 -export { TopNavBean } from './src/main/ets/bean/navigation/TopNavBean'; 6 +export { TopNavDTO } from './src/main/ets/bean/navigation/TopNavDTO';
22 7
23 // entity 8 // entity
24 export { ItemDTO } from './src/main/ets/bean/ItemDTO'; 9 export { ItemDTO } from './src/main/ets/bean/ItemDTO';
@@ -30,12 +15,28 @@ export { Action } from './src/main/ets/bean/programme/Action' @@ -30,12 +15,28 @@ export { Action } from './src/main/ets/bean/programme/Action'
30 15
31 export { Params } from './src/main/ets/bean/programme/Params' 16 export { Params } from './src/main/ets/bean/programme/Params'
32 17
  18 +export { Pic } from './src/main/ets/bean/programme/Pic'
  19 +
33 export { LabelBean } from './src/main/ets/bean/component/extra/LabelBean'; 20 export { LabelBean } from './src/main/ets/bean/component/extra/LabelBean';
34 21
35 export { LabelDTO } from './src/main/ets/bean/component/extra/LabelDTO'; 22 export { LabelDTO } from './src/main/ets/bean/component/extra/LabelDTO';
36 23
  24 +export { PageDTO } from './src/main/ets/bean/component/PageDTO';
  25 +
37 export { GroupDTO } from './src/main/ets/bean/component/GroupDTO'; 26 export { GroupDTO } from './src/main/ets/bean/component/GroupDTO';
38 27
39 export { CompDTO } from './src/main/ets/bean/component/CompDTO'; 28 export { CompDTO } from './src/main/ets/bean/component/CompDTO';
40 29
41 export { ContentDTO } from './src/main/ets/bean/component/ContentDTO'; 30 export { ContentDTO } from './src/main/ets/bean/component/ContentDTO';
  31 +
  32 +export { NewspaperListBean } from './src/main/ets/bean/newspaper/NewspaperListBean';
  33 +
  34 +export { NewspaperListItemBean } from './src/main/ets/bean/newspaper/NewspaperListItemBean';
  35 +
  36 +export { NewspaperPositionItemBean } from './src/main/ets/bean/newspaper/NewspaperPositionItemBean';
  37 +
  38 +export { NewspaperShareBean } from './src/main/ets/bean/newspaper/NewspaperShareBean';
  39 +
  40 +export { NewspaperTimeInfoBean } from './src/main/ets/bean/newspaper/NewspaperTimeInfoBean';
  41 +
  42 +export { NewspaperTimeItemBean } from './src/main/ets/bean/newspaper/NewspaperTimeItemBean';
@@ -6,14 +6,9 @@ import { Pic } from './programme/Pic'; @@ -6,14 +6,9 @@ import { Pic } from './programme/Pic';
6 * 绑定到组件comp/view的数据Bean 6 * 绑定到组件comp/view的数据Bean
7 */ 7 */
8 @Observed 8 @Observed
9 -// export abstract class ItemBean<DTO> implements Mapper<DTO> {  
10 -export abstract class ItemBean extends ItemDTO {  
11 - landscapeCover?: string; // 横向低分辨封面图片  
12 - portraitCover?: string; // 竖向低分辨封面图片  
13 - highLandscapeCover?: string; // 横向高分辨封面图片  
14 - highPortraitCover?: string; // 竖向高分辨封面图片  
15 - lowResolutionV34?: string; // 低清竖图(3:4比例), 取图逻辑 3:4低清竖图-->3:4高清竖图-->低分辨率竖图-->高分辨率竖图  
16 - highResolutionV34?: string; // 高清竖图(3:4比例), 取图逻辑 3:4高清竖图-->3:4低清竖图-->高分辨率竖图-->低分辨率竖图 9 +export abstract class ItemBean {
  10 + action?: Action; // 事件行为
  11 + pics?: Pic
17 /** 12 /**
18 * 是否被曝光 13 * 是否被曝光
19 */ 14 */
@@ -23,18 +18,20 @@ export abstract class ItemBean extends ItemDTO { @@ -23,18 +18,20 @@ export abstract class ItemBean extends ItemDTO {
23 */ 18 */
24 position: string; 19 position: string;
25 20
26 - constructor(dto: ItemDTO) {  
27 - super(dto.action, dto.actionId, dto.pics, dto.h5pics)  
28 -  
29 - this.landscapeCover = !dto.pics ? "" : !dto.pics.lowResolutionH ? dto.pics.highResolutionH : dto.pics.lowResolutionH;  
30 - this.portraitCover = !dto.pics ? "" : !dto.pics.lowResolutionV ? dto.pics.highResolutionV : dto.pics.lowResolutionV;  
31 - this.highLandscapeCover = !dto.pics ? "" : !dto.pics.highResolutionH ? dto.pics.lowResolutionH : dto.pics.highResolutionH;  
32 - this.highPortraitCover = !dto.pics ? "" : !dto.pics.highResolutionV ? dto.pics.lowResolutionV : dto.pics.highResolutionV;  
33 -  
34 - this.lowResolutionV34 = !dto.pics ? "" : (!dto.pics.lowResolutionV34 ? dto.pics.lowResolutionV34 : (!dto.pics.highResolutionV34 ? dto.pics.highResolutionV34 : this.portraitCover));  
35 - this.highResolutionV34 = !dto.pics ? "" : (!dto.pics.highResolutionV34 ? dto.pics.highResolutionV34 : (!dto.pics.lowResolutionV34 ? dto.pics.lowResolutionV34 : this.highPortraitCover));  
36 - 21 + constructor(dto?: ItemDTO) {
  22 + if (dto) {
  23 + this.action = dto.action
  24 + this.pics = dto.pics
  25 + }
37 this.exposed = false 26 this.exposed = false
38 this.position = "0" 27 this.position = "0"
39 } 28 }
  29 +
  30 + public setAction(action: Action): void {
  31 + this.action = action
  32 + }
  33 +
  34 + public getAction(): Action {
  35 + return this.action ?? {} as Action
  36 + }
40 } 37 }
@@ -5,16 +5,7 @@ import { Pic } from './programme/Pic'; @@ -5,16 +5,7 @@ import { Pic } from './programme/Pic';
5 * 组件comp/view对应的服务端数据 5 * 组件comp/view对应的服务端数据
6 * DTO 数据传输实体类接口,所有数据传输层数据结构体需实现该接口 6 * DTO 数据传输实体类接口,所有数据传输层数据结构体需实现该接口
7 */ 7 */
8 -export abstract class ItemDTO { 8 +export interface ItemDTO {
9 action?: Action; // 事件对象 9 action?: Action; // 事件对象
10 - actionId?: string; // 点击事件id  
11 pics?: Pic // 图片 10 pics?: Pic // 图片
12 - h5pics?: Pic; // h5图片  
13 -  
14 - constructor(action?: Action, actionId?: string, pics?: Pic, h5pics?: Pic) {  
15 - this.action = action;  
16 - this.actionId = actionId;  
17 - this.pics = pics;  
18 - this.h5pics = h5pics;  
19 - }  
20 } 11 }
@@ -10,7 +10,7 @@ export interface ContentDTO { @@ -10,7 +10,7 @@ export interface ContentDTO {
10 heatValue: string; 10 heatValue: string;
11 innerUrl: string; 11 innerUrl: string;
12 landscape: number; 12 landscape: number;
13 - // lengthTime?: any; 13 + lengthTime?: object;
14 linkUrl: string; 14 linkUrl: string;
15 openLikes: number; 15 openLikes: number;
16 openUrl: string; 16 openUrl: string;
@@ -33,4 +33,16 @@ export interface ContentDTO { @@ -33,4 +33,16 @@ export interface ContentDTO {
33 title: string; 33 title: string;
34 vImageUrl: string; 34 vImageUrl: string;
35 screenType: string; 35 screenType: string;
  36 +
  37 + source: string;
  38 + objectId: string;
  39 + objectType: string;
  40 + channelId: string;
  41 + relId: string;
  42 + relType: string;
  43 +
  44 + //单图卡/2行标题/3行标题
  45 + newsTitle:string;
  46 + publishTime:string;
  47 + visitorComment:number;
36 } 48 }
1 -import { GroupDTO } from './GroupDTO'; 1 +import { CompDTO } from './CompDTO';
2 2
3 /** 3 /**
4 * Page数据DTO 4 * Page数据DTO
5 */ 5 */
6 export interface PageDTO { 6 export interface PageDTO {
7 - id: number; // 页面id  
8 - name: string; // 页面名称  
9 - description: string; // 描述  
10 - groups: GroupDTO[]; // page下的group列表 7 + pageId: string; // 页面id
  8 + id: number; // 楼层id
  9 + name: string; // 名称
  10 + branchMark: boolean;
  11 + compList: CompDTO[]; // Components集合的布局信息
11 } 12 }
1 -import { TopNavBean } from './TopNavBean'; 1 +import { TopNavDTO } from './TopNavDTO';
2 2
3 /** 3 /**
4 * 底导(包含顶导列表)数据 4 * 底导(包含顶导列表)数据
5 */ 5 */
6 -export interface BottomNavBean { 6 +export interface BottomNavDTO {
7 backgroundUrl: string; 7 backgroundUrl: string;
8 channelChooseActionUrl: string; 8 channelChooseActionUrl: string;
9 channelChooseCColor: string; 9 channelChooseCColor: string;
@@ -34,7 +34,7 @@ export interface BottomNavBean { @@ -34,7 +34,7 @@ export interface BottomNavBean {
34 searchUrl: string; 34 searchUrl: string;
35 sortValue: number; 35 sortValue: number;
36 statusBarColor: number; 36 statusBarColor: number;
37 - topNavChannelList: TopNavBean[]; 37 + topNavChannelList: TopNavDTO[];
38 topStyle: string; 38 topStyle: string;
39 type: string; 39 type: string;
40 } 40 }
1 -import { BottomNavBean } from './BottomNavBean'; 1 +import { BottomNavDTO } from './BottomNavDTO';
2 2
3 /** 3 /**
4 * 导航Body数据 4 * 导航Body数据
5 */ 5 */
6 -export interface NavigationBody { 6 +export interface NavigationBodyDTO {
7 backgroundColor: string; 7 backgroundColor: string;
8 - bottomNavList: BottomNavBean[]; 8 + bottomNavList: BottomNavDTO[];
9 // greyBottomNav: GreyBottomNav; 9 // greyBottomNav: GreyBottomNav;
10 immersiveBackgroundColor: string; 10 immersiveBackgroundColor: string;
11 nightBackgroundColor: string; 11 nightBackgroundColor: string;
1 /** 1 /**
2 * 顶导 2 * 顶导
3 */ 3 */
4 -export interface TopNavBean { 4 +export interface TopNavDTO {
5 channelId: number; 5 channelId: number;
6 channelStyle: number; 6 channelStyle: number;
7 channelType: number; 7 channelType: number;
  1 +import { NewspaperListItemBean } from './NewspaperListItemBean';
  2 +
  3 +export interface NewspaperListBean {
  4 + list:NewspaperListItemBean[];
  5 +}
  1 +import { NewspaperPositionItemBean } from './NewspaperPositionItemBean';
  2 +import { NewspaperShareBean } from './NewspaperShareBean';
  3 +
  4 +export interface NewspaperListItemBean {
  5 + items:NewspaperPositionItemBean[];
  6 + pageName:string;
  7 + pageNum:string;
  8 + pagePic:string;
  9 + periodNum:string;
  10 + sharePagePic:NewspaperShareBean;
  11 +}
  1 +export interface NewspaperPositionItemBean {
  2 + image:string[];
  3 + downTitle:string;
  4 + imageHeight:number;
  5 + imageWidth:number;
  6 + newsId:number;
  7 + newsTxt:string;
  8 + newsType:number;
  9 + points:string;
  10 + relId:number;
  11 + relObjectId: string;
  12 + relType: string;
  13 + shortTitle: string;
  14 + title: string;
  15 +}
  1 +export interface NewspaperShareBean {
  2 + shareUrl:string;
  3 + sharePosterOpen:number;
  4 +}
  1 +import { NewspaperTimeItemBean } from './NewspaperTimeItemBean';
  2 +
  3 +export interface NewspaperTimeInfoBean {
  4 + date:string;
  5 + list:NewspaperTimeItemBean[];
  6 +}
  1 +export interface NewspaperTimeItemBean {
  2 + pageName:string;
  3 + pageNum:string;
  4 + periodNum:string;
  5 + exit:number;
  6 +}
@@ -3,6 +3,5 @@ import { Params } from './Params'; @@ -3,6 +3,5 @@ import { Params } from './Params';
3 // 事件对象 3 // 事件对象
4 export interface Action { 4 export interface Action {
5 type: string; 5 type: string;
6 - name?: string; // 行为的名称,目前值与type相同,暂不启用  
7 params?: Params; // 参数集合 6 params?: Params; // 参数集合
8 } 7 }
@@ -6,5 +6,15 @@ export interface Params { @@ -6,5 +6,15 @@ export interface Params {
6 path?: string; 6 path?: string;
7 url?: string; 7 url?: string;
8 extra?: ExtraDTO; // 跳转时额外需要带的参数:map<String,String> 即仅有一层的json 8 extra?: ExtraDTO; // 跳转时额外需要带的参数:map<String,String> 即仅有一层的json
  9 +
  10 + // 详情页类型
  11 + // 1.点播详情页
  12 + // 2.直播详情页
  13 + // 3.图文详情页
  14 + // 4.全民播详情页
  15 + // 5.欢喜详情页
  16 + // 6.挂件详情页
  17 + // 7.沉浸式竖屏详情页
  18 + // 8.专辑竖屏详情页
9 detailPageType?:number; // 详情页类型 19 detailPageType?:number; // 详情页类型
10 } 20 }
1 -/**  
2 - * 延时枚举常量值  
3 - */  
4 -export const enum DelayTimeEnum {  
5 - DURATION_50 = 50, // 50毫秒  
6 - DURATION_100 = 100, // 50毫秒  
7 - DURATION_1000 = 1000, // 1秒/1000ms  
8 - DURATION_2000 = 2000, // 2秒/2000ms  
9 - LAUNCHER_DELAY_TIME = 1500, // 1.5秒  
10 - INTERVAL_4000 = 4000, //4秒  
11 -}  
@@ -2,26 +2,36 @@ export { PageViewModel } from "./src/main/ets/viewmodel/PageViewModel" @@ -2,26 +2,36 @@ export { PageViewModel } from "./src/main/ets/viewmodel/PageViewModel"
2 2
3 export { CompUtils } from "./src/main/ets/utils/CompUtils" 3 export { CompUtils } from "./src/main/ets/utils/CompUtils"
4 4
5 -export { EmptyComponent } from "./src/main/ets/components/EmptyComponent" 5 +export { EmptyComponent } from "./src/main/ets/components/view/EmptyComponent"
6 6
7 -export { ErrorComponent } from "./src/main/ets/components/ErrorComponent" 7 +export { ErrorComponent } from "./src/main/ets/components/view/ErrorComponent"
8 8
9 -export { LoadingComponent } from "./src/main/ets/components/LoadingComponent" 9 +export { LoadingComponent } from "./src/main/ets/components/view/LoadingComponent"
10 10
11 -export { PageComponent } from "./src/main/ets/components/PageComponent" 11 +export { PageComponent } from "./src/main/ets/components/page/PageComponent"
12 12
13 -export { BottomNavigationComponent } from "./src/main/ets/components/BottomNavigationComponent" 13 +export { BottomNavigationComponent } from "./src/main/ets/components/page/BottomNavigationComponent"
14 14
15 -export { TopNavigationComponent } from "./src/main/ets/components/TopNavigationComponent" 15 +export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent"
16 16
17 -export { LabelComponent } from "./src/main/ets/components/LabelComponent" 17 +export { LabelComponent } from "./src/main/ets/components/view/LabelComponent"
18 18
19 -export { BannerComponent } from "./src/main/ets/components/BannerComponent" 19 +export { BannerComponent } from "./src/main/ets/components/view/BannerComponent"
20 20
21 -export { SingleRow03Component } from "./src/main/ets/components/SingleRow03Component" 21 +export { SingleRow03Component } from "./src/main/ets/components/page/SingleRow03Component"
22 22
23 -export { SingleColumnComponent } from "./src/main/ets/components/SingleColumnComponent" 23 +export { SingleColumnComponent } from "./src/main/ets/components/page/SingleColumnComponent"
24 24
25 -export { GridLayout01Component } from "./src/main/ets/components/GridLayout01Component" 25 +export { GridLayout01Component } from "./src/main/ets/components/page/GridLayout01Component"
26 26
27 -export { WaterFlowComponent } from "./src/main/ets/components/WaterFlowComponent" 27 +export { WaterFlowComponent } from "./src/main/ets/components/page/WaterFlowComponent"
  28 +
  29 +export { NewspaperViewModel } from "./src/main/ets/viewmodel/NewspaperViewModel"
  30 +
  31 +export { ENewspaperPageComponent } from "./src/main/ets/components/ENewspaperPageComponent"
  32 +
  33 +export { ENewspaperItemComponent } from "./src/main/ets/components/ENewspaperItemComponent"
  34 +
  35 +export { ENewspaperListDialog } from "./src/main/ets/dialog/ENewspaperListDialog"
  36 +
  37 +export { SingleImageCardComponent } from "./src/main/ets/components/view/SingleImageCardComponent"
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 "wdConstant": "file:../wdConstant", 10 "wdConstant": "file:../wdConstant",
11 "wdKit": "file:../wdKit", 11 "wdKit": "file:../wdKit",
12 "wdBean": "file:../wdBean", 12 "wdBean": "file:../wdBean",
13 - "wdNetwork": "file:../wdNetwork",  
14 - "wdRouter": "file:../wdRouter" 13 + "wdRouter": "file:../wdRouter",
  14 + "wdNetwork": "file:../wdNetwork"
15 } 15 }
16 } 16 }
1 -import { CompDTO, ContentDTO, DelayTimeEnum } from 'wdBean';  
2 -import { BreakpointConstants, CommonConstants } from 'wdConstant';  
3 -import { BreakPointType, Logger } from 'wdKit';  
4 -import { CompUtils } from '../utils/CompUtils';  
5 -import { CarouselLayout01CardView } from './CardView';  
6 -import { EmptyComponent } from './EmptyComponent';  
7 -  
8 -const TAG = 'BannerComponent';  
9 -  
10 -/**  
11 - * 轮播组件,即Banner/轮播大图/焦点图/自动滑动  
12 - * 样式:  
13 - * 'Carousel_Layout-01', // 通用轮播卡:视频、直播、活动、专题、榜单、外链  
14 - */  
15 -@Component  
16 -export struct BannerComponent {  
17 - @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS;  
18 - @State compDTO: CompDTO = {} as CompDTO  
19 -  
20 - watchCurrentBreakpoint() {  
21 - Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`);  
22 - }  
23 -  
24 - aboutToAppear() {  
25 - Logger.info(TAG, `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`);  
26 - }  
27 -  
28 - aboutToDisappear() {  
29 - Logger.info(TAG, 'aboutToDisappear');  
30 - }  
31 -  
32 - onPageShow() {  
33 - Logger.info(TAG, 'onPageShow');  
34 - }  
35 -  
36 - onPageHide() {  
37 - Logger.info(TAG, 'onPageHide');  
38 - }  
39 -  
40 - onBackPress() {  
41 - Logger.info(TAG, 'onBackPress');  
42 - }  
43 -  
44 - build() {  
45 - if (this.compDTO && this.compDTO?.operDataList?.length > 0) {  
46 - Swiper() {  
47 - ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => {  
48 - this.buildItemBanner01(item, index)  
49 - })  
50 - }  
51 - .margin({ left: $r('app.float.main_margin'), right: $r('app.float.main_margin') })  
52 - .padding({ bottom: 14 })  
53 - .displayCount(this.buildDisplayCount()) // 仅展示1个图片  
54 - .cachedCount(2)  
55 - .index(1) // The default index of Swiper.  
56 - .autoPlay(true)  
57 - .interval(DelayTimeEnum.INTERVAL_4000)  
58 - .indicator(Indicator.dot()  
59 - .right(5)  
60 - .itemWidth(4)  
61 - .itemHeight(4)  
62 - .selectedItemWidth(10)  
63 - .selectedItemHeight(6))  
64 - .loop(true)  
65 - .duration(DelayTimeEnum.DURATION_1000)  
66 - .vertical(false)  
67 - .curve(Curve.Linear)  
68 - .onChange((index: number) => {  
69 - Logger.info(TAG, `Swiper onChange index : ${index}`);  
70 - })  
71 - } else {  
72 - EmptyComponent({ emptyHeight: 200 })  
73 - }  
74 - }  
75 -  
76 - public buildDisplayCount(): number {  
77 - return new BreakPointType({ xs: 1, sm: 1, md: 2, lg: 3 }).getValue(this.currentBreakpoint)  
78 - }  
79 -  
80 - /**  
81 - * 组件项  
82 - *  
83 - * @param programmeBean item 组件项  
84 - */  
85 - @Builder  
86 - buildItemBanner01(item: ContentDTO, index: number) {  
87 - CarouselLayout01CardView({  
88 - item: item,  
89 - index: index  
90 - })  
91 - }  
92 -}  
  1 +import { CommonConstants, CompStyle } from 'wdConstant';
  2 +import { BannerComponent } from './view/BannerComponent';
  3 +import { LabelComponent } from './view/LabelComponent';
  4 +import { TitleAbbrComponent } from './view/TitleAbbrComponent';
  5 +import { TitleAllComponent } from './view/TitleAllComponent';
  6 +import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
  7 +import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/HorizontalStrokeCardThreeTwoRadioForTwoComponent';
  8 +import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
  9 +import { CompDTO } from 'wdBean';
  10 +import { SingleImageCardComponent } from './view/SingleImageCardComponent';
  11 +
  12 +/**
  13 + * comp适配器.
  14 + */
  15 +@Component
  16 +export struct CompParser {
  17 + compDTO: CompDTO = {} as CompDTO;
  18 + compIndex: number = 0;
  19 +
  20 + build() {
  21 + this.componentBuilder(this.compDTO, this.compIndex);
  22 + }
  23 +
  24 + @Builder
  25 + componentBuilder(compDTO: CompDTO, compIndex: number) {
  26 + if (compDTO.compStyle === CompStyle.Label_03) {
  27 + LabelComponent({ compDTO: compDTO })
  28 + } else if (compDTO.compStyle === CompStyle.Title_Abbr_01) {
  29 + TitleAbbrComponent({ compDTO: compDTO })
  30 + } else if (compDTO.compStyle === CompStyle.Title_All_01) {
  31 + TitleAllComponent({ compDTO: compDTO })
  32 + } else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) {
  33 + BannerComponent({ compDTO: compDTO })
  34 + } else if (compDTO.compStyle === CompStyle.Single_Imagecard_02 || compDTO.compStyle === CompStyle.Single_Imagecard_03) {
  35 + SingleImageCardComponent({ compDTO: compDTO })
  36 + } else {
  37 + // todo:组件未实现 / Component Not Implemented
  38 + Text(compDTO.compStyle)
  39 + .width(CommonConstants.FULL_PARENT)
  40 + .padding(10)
  41 + // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle
  42 + }
  43 + }
  44 +}
  1 +import { CompDTO, ContentDTO } from 'wdBean';
  2 +
  3 +const FULL_PARENT: string = '100%';
  4 +const COLUMNS_TEMPLATE_ONE: string = '1fr';
  5 +const COLUMNS_TEMPLATE_TWO: string = '1fr 1fr';
  6 +const COLUMNS_TEMPLATE_THREE: string = '1fr 1fr 1fr';
  7 +const COLUMNS_TEMPLATE_FOUR: string = '1fr 1fr 1fr 1fr';
  8 +const COLUMNS_TEMPLATE_SIX: string = '1fr 1fr 1fr 1fr 1fr 1fr';
  9 +
  10 +const TAG = 'DemoPreviewerComponent';
  11 +
  12 +/**
  13 + * xxxx 布局及功能说明
  14 + *
  15 + * 【查看ArkUI预览效果】在线参考文档:
  16 + * https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/previewer-0000001054328973-V3#section146052489820
  17 + */
  18 +@Entry
  19 +@Component
  20 +export struct DemoPreviewerComponent {
  21 + @State compDTO: CompDTO = {
  22 + compStyle: 'compStyle3',
  23 + operDataList: [
  24 + {
  25 + title: 'title0',
  26 + description: "description0",
  27 + coverUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg'
  28 + } as ContentDTO,
  29 + {
  30 + title: 'title1 title1 title1 title1 title1 title1 title1 title1 title1',
  31 + description: "description1",
  32 + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240104/image/display/c4a9b526e0994d1bbd3ac8450f5cfc6c.jpg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  33 + } as ContentDTO,
  34 + {
  35 + title: 'title2',
  36 + description: "description2",
  37 + coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231206/image/live/bbe6d821e92b48919d90c7dadfd1f05a.jpg?x-oss-process=image/resize,l_850/auto-orient,1/quality,q_95/format,jpg",
  38 + } as ContentDTO,
  39 + {
  40 + title: 'title3',
  41 + description: "description3",
  42 + coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231109/image/live/102e6eb9356b4ef19405b04c1f6ff875.png?x-oss-process=image/resize,l_850/auto-orient,1/quality,q_95/format,jpg'
  43 + } as ContentDTO,
  44 + {
  45 + title: 'title4',
  46 + description: "description4",
  47 + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/62bdbbb35dbd45689e00790c81f04c4b.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  48 + } as ContentDTO,
  49 + {
  50 + title: 'title5',
  51 + description: "description5",
  52 + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/f79bbaa5a33b4bd88176071c4f797ff6.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  53 + } as ContentDTO,
  54 + {
  55 + title: 'title6',
  56 + description: "description6",
  57 + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/2c1d917009584ce2bb4a35cbb3a860a0.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  58 + } as ContentDTO,
  59 + {
  60 + title: 'title7',
  61 + description: "description7",
  62 + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231222/image/display/117dc516ca5c42d5843c0d32050c9fc6.jpeg?x-oss-process=image/resize,w_240/quality,q_90/format,jpg",
  63 + } as ContentDTO,
  64 + {
  65 + title: 'title8',
  66 + description: "description8",
  67 + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231228/image/display/90a2db4077d44a1f887f068fc659d977.jpeg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg",
  68 + } as ContentDTO
  69 + ]
  70 + } as CompDTO
  71 +
  72 + aboutToAppear() {
  73 + // this.compDTO = {
  74 + // compStyle: 'compStyle3',
  75 + // operDataList: [
  76 + // {
  77 + // title: 'title0',
  78 + // description: "description0",
  79 + // coverUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg'
  80 + // } as ContentDTO
  81 + // ]
  82 + // } as CompDTO
  83 +
  84 + this.compDTO.operDataList[0].title = 'title_first_0'
  85 + }
  86 +
  87 + build() {
  88 + Grid() {
  89 + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
  90 + GridItem() {
  91 + this.gridItemView(item, index)
  92 + }
  93 + }, (item: ContentDTO, index: number) => JSON.stringify(item))
  94 + }
  95 + .height(FULL_PARENT)
  96 + .margin({ top: 10, bottom: 10, left: $r('app.float.main_margin'), right: $r('app.float.main_margin') })
  97 + .columnsTemplate(COLUMNS_TEMPLATE_TWO)
  98 + .columnsGap(4)
  99 + .rowsGap(2)
  100 + }
  101 +
  102 + /**
  103 + * 布局描述
  104 + *
  105 + * @param ContentDTO item 组件项
  106 + * @param index
  107 + */
  108 + @Builder
  109 + gridItemView(item: ContentDTO, index: number) {
  110 + Column() {
  111 + Image(item.coverUrl)
  112 + .width(FULL_PARENT)// .aspectRatio(3 / 4) // 宽/高比:纵向
  113 + // .aspectRatio(1 / 1) // 宽/高比:正方形
  114 + .aspectRatio(16 / 9)// 宽/高比:横向
  115 + .margin({ top: 8 })
  116 + .borderRadius(10)
  117 +
  118 + Text(item.title)
  119 + .width(FULL_PARENT)
  120 + .margin({ top: 4, left: 2, right: 2, bottom: 4 })
  121 + .backgroundColor(Color.White)
  122 + .fontWeight(FontWeight.Bold)// .textAlign(TextAlign.Center)
  123 + .fontSize($r('app.float.font_size_12'))
  124 + .fontColor('#808080')
  125 + .maxLines(1)
  126 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  127 + }
  128 + .width(FULL_PARENT)
  129 + .backgroundColor(Color.Yellow)
  130 + .justifyContent(FlexAlign.Center)
  131 + .onClick(() => {
  132 + console.info(TAG, `gridItemView onClick, index: ${index}`);
  133 + // MGRouterRule.jumpWithAction(item.action)
  134 + })
  135 + }
  136 +}
  1 +import { NewspaperListItemBean, NewspaperPositionItemBean } from 'wdBean';
  2 +import { StringUtils } from 'wdKit';
  3 +
  4 +@Component
  5 +export struct ENewspaperItemComponent {
  6 + private newspaperListItemBean: NewspaperListItemBean = {} as NewspaperListItemBean
  7 + private settings: RenderingContextSettings = new RenderingContextSettings(true);
  8 + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings);
  9 + private startX: number = 0
  10 + private startY: number = 0
  11 + private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean
  12 +
  13 + build() {
  14 + Stack() {
  15 + Image(this.newspaperListItemBean.pagePic)
  16 + .width('100%')
  17 + .aspectRatio(0.68688)
  18 + .objectFit(ImageFit.Contain)
  19 +
  20 + Canvas(this.context)
  21 + .width('100%')
  22 + .height('100%')
  23 + .backgroundColor(Color.Transparent)
  24 + .onReady(() => {
  25 +
  26 + })
  27 + }
  28 + .width('100%')
  29 + .aspectRatio(0.68688)
  30 + .onClick((event: ClickEvent) =>{
  31 + if (this.itemBeanClicked && this.itemBeanClicked.newsId){
  32 + // todo 跳转事件
  33 +
  34 +
  35 + this.itemBeanClicked = {} as NewspaperPositionItemBean
  36 + }
  37 + })
  38 + .onTouch((event: TouchEvent) => {
  39 + if (event.type === TouchType.Down) {
  40 + let x = event.touches[0].x;
  41 + let y = event.touches[0].y;
  42 + this.startX = x;
  43 + this.startY = y;
  44 + let points: number[][] = this.getArea(x, y, this.newspaperListItemBean.items);
  45 + if (points && points.length > 2){
  46 + let path = new Path2D();
  47 + path.moveTo(px2vp(points[0][0]), px2vp(points[0][1]));
  48 + for(let point of points.slice(1, points.length)){
  49 + path.lineTo(px2vp(point[0]), px2vp(point[1]));
  50 + }
  51 + path.closePath();
  52 + // 设定填充色为蓝色
  53 + this.context.fillStyle = '#33000000';
  54 + // 使用填充的方式,将Path2D描述的五边形绘制在canvas组件内部
  55 + this.context.fill(path);
  56 + }
  57 +
  58 + }
  59 + if (event.type === TouchType.Up) {
  60 + this.context.clearRect(0, 0, this.context.width, this.context.height)
  61 + }
  62 + if (event.type === TouchType.Move) {
  63 + let mx = event.touches[0].x;
  64 + let my = event.touches[0].y;
  65 + if (this.startX - mx > 5 || mx - this.startX > 5 || this.startY - my > 5 || my - this.startY > 5){
  66 + this.itemBeanClicked = {} as NewspaperPositionItemBean
  67 + this.context.clearRect(0, 0, this.context.width, this.context.height)
  68 + }
  69 +
  70 + }
  71 + })
  72 + }
  73 +
  74 + public getArea(x: number, y: number, itemBeans: NewspaperPositionItemBean[]): number[][] {
  75 + if (itemBeans && itemBeans.length > 0) {
  76 + for (let itemBean of itemBeans) {
  77 + if (itemBean.points) {
  78 + let area: string[] = itemBean.points.split(';')
  79 + if (area && area.length > 0) {
  80 + let xys: number[][] = []
  81 + let minX: number = -1;
  82 + let maxX: number = -1;
  83 + let minY: number = -1;
  84 + let maxY: number = -1;
  85 + for (let item of area) {
  86 + let pair: string[] = item.split(',');
  87 + if (pair && pair.length > 1) {
  88 + // todo 因为数据是根据安卓手机抓的,这里根据分辨率倍数做了数据放大处理,真实数据不用乘以放大倍数
  89 + let xy: number[] = [StringUtils.parseNumber(pair[0])*1.28, StringUtils.parseNumber(pair[1])*1.24]
  90 + if (minX < 0) {
  91 + minX = xy[0]
  92 + } else {
  93 + if (minX > xy[0]) {
  94 + minX = xy[0]
  95 + }
  96 + }
  97 + if (maxX < 0) {
  98 + maxX = xy[0]
  99 + } else {
  100 + if (maxX < xy[0]) {
  101 + maxX = xy[0]
  102 + }
  103 + }
  104 + if (minY < 0) {
  105 + minY = xy[1]
  106 + } else {
  107 + if (minY > xy[1]) {
  108 + minY = xy[1]
  109 + }
  110 + }
  111 + if (maxY < 0) {
  112 + maxY = xy[1]
  113 + } else {
  114 + if (maxY < xy[1]) {
  115 + maxY = xy[1]
  116 + }
  117 + }
  118 + xys.push(xy);
  119 + }
  120 +
  121 + }
  122 +
  123 + if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) {
  124 + this.itemBeanClicked = itemBean;
  125 + return xys;
  126 + }
  127 + }
  128 + }
  129 +
  130 + }
  131 + }
  132 + return []
  133 + }
  134 +}
  1 +import { NewspaperListBean, NewspaperListItemBean } from 'wdBean';
  2 +import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel';
  3 +import router from '@ohos.router';
  4 +import { Logger } from 'wdKit';
  5 +import { ENewspaperItemComponent } from './ENewspaperItemComponent';
  6 +import { ENewspaperListDialog } from '../dialog/ENewspaperListDialog';
  7 +
  8 +@Component
  9 +export struct ENewspaperPageComponent {
  10 + @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean
  11 + @State currentPageNum: string = '01'
  12 + @State pageNumPopup: boolean = false
  13 + private swiperController: SwiperController = new SwiperController()
  14 + listDialogController: CustomDialogController = new CustomDialogController({
  15 + builder: ENewspaperListDialog({ newspaperListBean: this.newspaperListBean,
  16 + currentPageNum: this.currentPageNum,
  17 + }),
  18 + alignment: DialogAlignment.Bottom
  19 + })
  20 +
  21 + @Builder
  22 + popupBuilder() {
  23 + Row() {
  24 + GridRow({ columns: 5 }) {
  25 + ForEach(this.newspaperListBean.list, (item: NewspaperListItemBean, index) => {
  26 + GridCol() {
  27 + Row() {
  28 + Text(item.pageNum)
  29 + .fontSize($r('app.float.normal_text_size'))
  30 + .fontColor(this.currentPageNum == item.pageNum ? Color.White : $r('app.color.color_222222'))
  31 + }
  32 + .alignItems(VerticalAlign.Center)
  33 + .justifyContent(FlexAlign.Center)
  34 + .width(30)
  35 + .height(30)
  36 + .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800'))
  37 + .onClick((event: ClickEvent) => {
  38 + this.pageNumPopup = !this.pageNumPopup
  39 + })
  40 + }
  41 + })
  42 + }
  43 + }
  44 + .padding({ top: 20, bottom: 20 })
  45 + .margin({ left: 10 })
  46 + .width(260)
  47 + }
  48 +
  49 + build() {
  50 + RelativeContainer() {
  51 + RelativeContainer() {
  52 + Image($r('app.media.icon_arrow_down'))
  53 + .height($r('app.float.top_arrow_size'))
  54 + .width($r('app.float.top_arrow_size'))
  55 + .alignRules({ left: { anchor: "__container__", align: HorizontalAlign.Start },
  56 + center: { anchor: "__container__", align: VerticalAlign.Center } })
  57 + .id('e_newspaper_back')
  58 + .onClick((event: ClickEvent) => {
  59 + Logger.info("sfsfsd", "" + vp2px(10))
  60 + router.back()
  61 + })
  62 +
  63 + Row() {
  64 + Text('2024.01.26')
  65 + .fontSize($r('app.float.font_size_20'))
  66 + .fontColor($r('app.color.white'))
  67 +
  68 + Image($r('app.media.icon_triangle'))
  69 + .width($r('app.float.border_radius_6'))
  70 + .height($r('app.float.border_radius_6'))
  71 + .margin({ left: 2, bottom: 5 })
  72 + }
  73 + .alignItems(VerticalAlign.Bottom)
  74 + .alignRules({ middle: { anchor: "__container__", align: HorizontalAlign.Center },
  75 + center: { anchor: "__container__", align: VerticalAlign.Center } })
  76 + .id('e_newspaper_date')
  77 +
  78 + Image($r('app.media.icon_share'))
  79 + .height($r('app.float.top_arrow_size'))
  80 + .width($r('app.float.top_arrow_size'))
  81 + .alignRules({ right: { anchor: "__container__", align: HorizontalAlign.End },
  82 + center: { anchor: "__container__", align: VerticalAlign.Center } })
  83 + .id('e_newspaper_share')
  84 + }
  85 + .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
  86 + .height($r('app.float.top_bar_height'))
  87 + .alignRules({ top: { anchor: '__container__', align: VerticalAlign.Top },
  88 + left: { anchor: '__container__', align: HorizontalAlign.Start },
  89 + right: { anchor: '__container__', align: HorizontalAlign.End } })
  90 + .id('e_newspaper_top')
  91 +
  92 + if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
  93 + Swiper(this.swiperController) {
  94 + ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => {
  95 + ENewspaperItemComponent({ newspaperListItemBean: item })
  96 + })
  97 + }
  98 + .width('100%')
  99 + .vertical(true)
  100 + .autoPlay(false)
  101 + .cachedCount(3)
  102 + .indicator(false)
  103 + .displayCount(1)
  104 + .aspectRatio(0.68688)
  105 + .margin({ top: $r('app.float.vp_55'), left: 10, right: 10 })
  106 + .id('e_newspaper_content')
  107 + .alignRules({ top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom },
  108 + middle: { anchor: "__container__", align: HorizontalAlign.Center } })
  109 + .onChange((index: number) => {
  110 + this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum
  111 + })
  112 +
  113 + Image($r('app.media.newspaper_shadow'))
  114 + .height($r('app.float.vp_12'))
  115 + .margin({ left: 12, right: 12, top: -5 })
  116 + .objectFit(ImageFit.Contain)
  117 + .alignRules({ top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
  118 + left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
  119 + right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } })
  120 + .id('e_newspaper_shadow')
  121 +
  122 + Row() {
  123 + Text('滑动查看下一版')
  124 + .fontColor(Color.White)
  125 + .fontSize($r('app.float.font_size_14'))
  126 + Image($r('app.media.icon_next_page'))
  127 + .width($r('app.float.vp_16'))
  128 + .height($r('app.float.vp_16'))
  129 + }
  130 + .justifyContent(FlexAlign.Center)
  131 + .margin({ top: $r('app.float.margin_16') })
  132 + .alignRules({ top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom },
  133 + middle: { anchor: "__container__", align: HorizontalAlign.Center } })
  134 + .id('e_newspaper_next')
  135 + .onClick((event: ClickEvent) => {
  136 + this.swiperController.showNext()
  137 + })
  138 + }
  139 +
  140 + Row() {
  141 + Text(this.currentPageNum)
  142 + .fontSize($r('app.float.font_size_36'))
  143 + .fontColor($r('app.color.white'))
  144 + Text('版')
  145 + .fontSize($r('app.float.font_size_16'))
  146 + .fontColor($r('app.color.white'))
  147 + .margin({ bottom: 6 })
  148 +
  149 + Image($r('app.media.icon_triangle'))
  150 + .width($r('app.float.border_radius_6'))
  151 + .height($r('app.float.border_radius_6'))
  152 + .margin({ left: 2, bottom: 6 })
  153 + }
  154 + .alignItems(VerticalAlign.Bottom)
  155 + .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') })
  156 + .alignRules({ bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
  157 + left: { anchor: '__container__', align: HorizontalAlign.Start } })
  158 + .id('e_newspaper_page_num')
  159 + .onClick((event: ClickEvent) => {
  160 + this.pageNumPopup = !this.pageNumPopup
  161 + })
  162 + .bindPopup(this.pageNumPopup, {
  163 + builder: this.popupBuilder,
  164 + placement: Placement.Top,
  165 + popupColor: Color.White
  166 + })
  167 +
  168 + Row() {
  169 + Image($r('app.media.icon_read_paper'))
  170 + .width($r('app.float.vp_20'))
  171 + .height($r('app.float.vp_20'))
  172 + .margin({ right: $r('app.float.vp_3') })
  173 + Text('读报纸')
  174 + .fontSize($r('app.float.font_size_14'))
  175 + .fontColor($r('app.color.white'))
  176 + }
  177 + .alignItems(VerticalAlign.Center)
  178 + .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') })
  179 + .alignRules({ bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
  180 + right: { anchor: '__container__', align: HorizontalAlign.End } })
  181 + .id('e_newspaper_read')
  182 + .onClick((event: ClickEvent) => {
  183 + this.listDialogController.open()
  184 + })
  185 + }
  186 + .width('100%')
  187 + .height('100%')
  188 + .backgroundColor($r('app.color.color_80000000'))
  189 + .id('e_newspaper_container')
  190 + }
  191 +
  192 + aboutToAppear() {
  193 + let listBean = NewspaperViewModel.getNewspaperListFromLocal(getContext(this));
  194 + this.newspaperListBean = listBean;
  195 +
  196 + }
  197 +
  198 + aboutToDisappear() {
  199 +
  200 + }
  201 +}
  1 +import { CompDTO } from 'wdBean';
  2 +import { CommonConstants } from 'wdConstant';
  3 +import { CompUtils } from '../utils/CompUtils';
  4 +
  5 +@Component
  6 +export struct HeadPictureCardComponent {
  7 + @State compDTO: CompDTO = {} as CompDTO
  8 +
  9 + build() {
  10 + Stack() {
  11 + Image(this.compDTO.backgroundImgUrl)
  12 + .width(CommonConstants.FULL_WIDTH)
  13 + .height(CommonConstants.FULL_HEIGHT)
  14 + Row()
  15 + .width(CommonConstants.FULL_WIDTH)
  16 + .height(59)
  17 + .linearGradient({
  18 + colors:[
  19 + ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
  20 + ]
  21 + })
  22 + Row() {
  23 + Text(CompUtils.getLabelTitle(this.compDTO.extraData))
  24 + .width(CommonConstants.FULL_WIDTH)
  25 + .height(CommonConstants.FULL_HEIGHT)
  26 + .fontColor(Color.White)
  27 + .fontSize($r('app.float.normal_text_size'))
  28 + .fontWeight(FontWeight.Bold)
  29 + }
  30 + .height(25)
  31 + .margin({left: 12, bottom: 10, right: 12})
  32 + }
  33 + .alignContent(Alignment.Bottom)
  34 + }
  35 +}
1 -import { CompDTO, CompStyle, GroupDTO, ViewType } from 'wdBean';  
2 -import { CommonConstants } from 'wdConstant';  
3 -import { LazyDataSource, Logger } from 'wdKit';  
4 -import { PageViewModel } from '../viewmodel/PageViewModel';  
5 -import { BannerComponent } from './BannerComponent';  
6 -import { EmptyComponent } from './EmptyComponent';  
7 -import { ErrorComponent } from './ErrorComponent';  
8 -import { GridLayout01Component } from './GridLayout01Component';  
9 -import { LabelComponent } from './LabelComponent';  
10 -import { LoadingComponent } from './LoadingComponent';  
11 -import { SingleColumnComponent } from './SingleColumnComponent';  
12 -import { SingleRow03Component } from './SingleRow03Component';  
13 -import { WaterFlowComponent } from './WaterFlowComponent';  
14 -  
15 -const TAG = 'PageComponent';  
16 -  
17 -@Component  
18 -export struct PageComponent {  
19 - @Prop viewType: number = ViewType.LOADED;  
20 - // Group数据及子组件数据  
21 - @State groupList: LazyDataSource<GroupDTO> = new LazyDataSource();  
22 - @State currentTopNavSelectedIndex: number = 0;  
23 -  
24 - build() {  
25 - if (this.viewType == ViewType.LOADING) {  
26 - LoadingComponent()  
27 - } else if (this.viewType == ViewType.ERROR) {  
28 - ErrorComponent()  
29 - } else if (this.viewType == ViewType.EMPTY) {  
30 - EmptyComponent()  
31 - } else {  
32 - List() {  
33 - LazyForEach(this.groupList, (groupDTO: GroupDTO, groupIndex: number) => {  
34 - ListItem() {  
35 - Column() {  
36 - ForEach(groupDTO.compList, (compDTO: CompDTO, compIndex: number) => {  
37 - this.componentBuilder(compDTO, groupIndex, compIndex)  
38 - })  
39 - }  
40 - }  
41 - })  
42 - }  
43 - .cachedCount(5)  
44 - .height(CommonConstants.FULL_PARENT)  
45 - }  
46 - }  
47 -  
48 - @Builder  
49 - componentBuilder(compDTO: CompDTO, groupIndex: number, compIndex: number) {  
50 - if (compDTO.compStyle === CompStyle.Label_03) {  
51 - LabelComponent({ compDTO: compDTO })  
52 - } else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) {  
53 - BannerComponent({ compDTO: compDTO })  
54 - } else if (compDTO.compStyle === CompStyle.Single_Row_03) {  
55 - SingleRow03Component({ dataList: compDTO.operDataList })  
56 - } else if (compDTO.compStyle === CompStyle.Single_Column_01 || compDTO.compStyle === CompStyle.Single_Column_02) {  
57 - SingleColumnComponent({ compDTO: compDTO })  
58 - } else if (compDTO.compStyle === CompStyle.Grid_Layout_01) {  
59 - GridLayout01Component({ dataList: compDTO.operDataList })  
60 - } else if (compDTO.compStyle === CompStyle.Masonry_Layout_01) {  
61 - WaterFlowComponent({ compDTO: compDTO })  
62 - } else {  
63 - // todo:组件未实现 / Component Not Implemented  
64 - Text(compDTO.compStyle)  
65 - .width(CommonConstants.FULL_PARENT)  
66 - .padding(10)  
67 - // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle  
68 - }  
69 - }  
70 -  
71 - aboutToAppear() {  
72 - Logger.info(TAG, `aboutToAppear, this.pageId: ${this.viewType} this.currentTopNavSelectedIndex: ${this.currentTopNavSelectedIndex}`);  
73 - if (this.currentTopNavSelectedIndex === 1) { // 顶导tab的第0个item是【热点】,第1个item是【推荐】  
74 - this.groupList.replaceAll()  
75 - let groupDto = PageViewModel.getGroup2DTO(getContext(this))  
76 - if (groupDto) {  
77 - this.groupList.push(groupDto)  
78 - }  
79 - } else {  
80 - let groupDto = PageViewModel.getGroupDTO(getContext(this))  
81 - if (groupDto) {  
82 - this.groupList.push(groupDto)  
83 - }  
84 - }  
85 - }  
86 -}  
87 -  
1 -import { BottomNavBean, BottomNavi } from 'wdBean';  
2 -import { CommonConstants } from 'wdConstant';  
3 -import { LazyDataSource, Logger } from 'wdKit'; 1 +import { BottomNavi, CommonConstants } from 'wdConstant';
  2 +import { BottomNavDTO } from 'wdBean';
  3 +import { Logger } from 'wdKit';
4 import { TopNavigationComponent } from './TopNavigationComponent'; 4 import { TopNavigationComponent } from './TopNavigationComponent';
5 -import { PageComponent } from './PageComponent'; 5 +import { MinePageComponent } from './MinePageComponent';
  6 +import { CompUtils } from '../../utils/CompUtils';
  7 +import PageViewModel from '../../viewmodel/PageViewModel';
6 8
7 const TAG = 'BottomNavigationComponent'; 9 const TAG = 'BottomNavigationComponent';
8 10
@@ -12,7 +14,7 @@ const TAG = 'BottomNavigationComponent'; @@ -12,7 +14,7 @@ const TAG = 'BottomNavigationComponent';
12 @Component 14 @Component
13 export struct BottomNavigationComponent { 15 export struct BottomNavigationComponent {
14 // 底导/顶导全部数据 16 // 底导/顶导全部数据
15 - @Prop @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavBean[] = [] 17 + @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = []
16 // 底导当前选中/焦点下标 18 // 底导当前选中/焦点下标
17 @Provide currentNavIndex: number = BottomNavi.NEWS; 19 @Provide currentNavIndex: number = BottomNavi.NEWS;
18 // 底导TabsController 20 // 底导TabsController
@@ -27,8 +29,13 @@ export struct BottomNavigationComponent { @@ -27,8 +29,13 @@ export struct BottomNavigationComponent {
27 */ 29 */
28 readonly SIXTY_OPACITY: number = 0.6; 30 readonly SIXTY_OPACITY: number = 0.6;
29 31
30 - aboutToAppear() { 32 + async aboutToAppear() {
31 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`); 33 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`);
  34 + let bottomNav = await PageViewModel.getBottomNavData(getContext(this))
  35 + if (bottomNav && bottomNav.bottomNavList != null) {
  36 + Logger.info(TAG, `aboutToAppear, bottomNav.length: ${bottomNav.bottomNavList.length}`);
  37 + this.bottomNavList = bottomNav.bottomNavList
  38 + }
32 } 39 }
33 40
34 aboutToDisappear() { 41 aboutToDisappear() {
@@ -37,11 +44,12 @@ export struct BottomNavigationComponent { @@ -37,11 +44,12 @@ export struct BottomNavigationComponent {
37 44
38 build() { 45 build() {
39 Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) { 46 Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) {
40 - ForEach(this.bottomNavList, (navItem: BottomNavBean, index: number) => { 47 + ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => {
41 TabContent() { 48 TabContent() {
42 Column() { 49 Column() {
43 - if (navItem.topNavChannelList && navItem.topNavChannelList.length == 0 && navItem.name == '我的') {  
44 - PageComponent({ groupList: new LazyDataSource() }) // todo:我的页面组件数据列表 50 + if (CompUtils.isMine(navItem)) {
  51 + // 我的页面组件数据列表
  52 + MinePageComponent()
45 } else { 53 } else {
46 TopNavigationComponent({ topNavList: navItem.topNavChannelList }) 54 TopNavigationComponent({ topNavList: navItem.topNavChannelList })
47 } 55 }
@@ -60,7 +68,7 @@ export struct BottomNavigationComponent { @@ -60,7 +68,7 @@ export struct BottomNavigationComponent {
60 } 68 }
61 69
62 @Builder 70 @Builder
63 - tabBarBuilder(navItem: BottomNavBean, index: number) { 71 + tabBarBuilder(navItem: BottomNavDTO, index: number) {
64 Stack({ alignContent: Alignment.Bottom }) { 72 Stack({ alignContent: Alignment.Bottom }) {
65 Image(this.currentNavIndex === index ? navItem.iconC : navItem.icon) 73 Image(this.currentNavIndex === index ? navItem.iconC : navItem.icon)
66 .height(CommonConstants.FULL_PARENT) 74 .height(CommonConstants.FULL_PARENT)