yuzhilin

增加专题页

@@ -80,6 +80,8 @@ export function registerRouter() { @@ -80,6 +80,8 @@ export function registerRouter() {
80 return WDRouterPage.imageTextDetailPage 80 return WDRouterPage.imageTextDetailPage
81 } else if (action.params?.pageID == "BroadcastPage") { 81 } else if (action.params?.pageID == "BroadcastPage") {
82 return WDRouterPage.broadcastPage 82 return WDRouterPage.broadcastPage
  83 + } else if (action.params?.pageID == "SPACIAL_TOPIC_PAGE") {
  84 + return WDRouterPage.spacialTopicPage
83 } 85 }
84 return undefined 86 return undefined
85 }) 87 })
@@ -32,6 +32,8 @@ export class WDRouterPage { @@ -32,6 +32,8 @@ export class WDRouterPage {
32 static morningEveningPaperPage = new WDRouterPage("phone", "ets/pages/MorningEveningPaperPage") 32 static morningEveningPaperPage = new WDRouterPage("phone", "ets/pages/MorningEveningPaperPage")
33 // 图文详情页 33 // 图文详情页
34 static imageTextDetailPage = new WDRouterPage("phone", "ets/pages/ImageAndTextDetailPage"); 34 static imageTextDetailPage = new WDRouterPage("phone", "ets/pages/ImageAndTextDetailPage");
  35 + // 专题页
  36 + static spacialTopicPage = new WDRouterPage("phone", "ets/pages/SpacialTopicPage");
35 // 短视频详情页 37 // 短视频详情页
36 static detailVideoListPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailVideoListPage"); 38 static detailVideoListPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailVideoListPage");
37 static detailPlayShortVideoPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailPlayShortVideoPage"); 39 static detailPlayShortVideoPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailPlayShortVideoPage");
@@ -64,3 +64,5 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir @@ -64,3 +64,5 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir
64 export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI" 64 export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI"
65 65
66 export { LottieView } from './src/main/ets/lottie/LottieView' 66 export { LottieView } from './src/main/ets/lottie/LottieView'
  67 +
  68 +export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent'
@@ -7,7 +7,7 @@ import { @@ -7,7 +7,7 @@ import {
7 ResponseBean 7 ResponseBean
8 } from 'wdBean'; 8 } from 'wdBean';
9 import { Logger } from 'wdKit'; 9 import { Logger } from 'wdKit';
10 -import { WdWebComponent, WdWebLocalComponent } from 'wdWebComponent'; 10 +import { WdWebLocalComponent } from 'wdWebComponent';
11 import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; 11 import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
12 import { BridgeWebViewControl } from 'wdJsBridge/Index'; 12 import { BridgeWebViewControl } from 'wdJsBridge/Index';
13 13
@@ -85,11 +85,6 @@ export struct ImageAndTextWebComponent { @@ -85,11 +85,6 @@ export struct ImageAndTextWebComponent {
85 webResource: $rawfile('apph5/index.html'), 85 webResource: $rawfile('apph5/index.html'),
86 backVisibility: false, 86 backVisibility: false,
87 }) 87 })
88 - // WdWebLocalComponent({  
89 - // webviewControl: this.webviewControl,  
90 - // webResource: "http://pd-people-uat.pdnews.cn/articletopic/35398-10000015965",  
91 - // backVisibility: false,  
92 - // })  
93 } 88 }
94 } 89 }
95 90
@@ -97,7 +92,7 @@ export struct ImageAndTextWebComponent { @@ -97,7 +92,7 @@ export struct ImageAndTextWebComponent {
97 Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData'); 92 Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData');
98 this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, 93 this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,
99 JSON.stringify(h5ReceiveAppData), (data: string) => { 94 JSON.stringify(h5ReceiveAppData), (data: string) => {
100 - // Logger.debug('ImageAndTextWebComponent', "from js data = " + data); 95 + Logger.debug('ImageAndTextWebComponent', "from js data = " + data);
101 }) 96 })
102 } 97 }
103 } 98 }
  1 +import { Action, ContentDetailDTO, ContentDTO, batchLikeAndCollectResult, InteractDataDTO, } from 'wdBean';
  2 +import DetailViewModel from '../viewmodel/DetailViewModel';
  3 +import { OperRowListView } from './view/OperRowListView';
  4 +import { WdWebComponent } from 'wdWebComponent';
  5 +import router from '@ohos.router';
  6 +import { CommonConstants } from 'wdConstant'
  7 +
  8 +const TAG = 'SpacialTopicPageComponent'
  9 +
  10 +@Component
  11 +export struct SpacialTopicPageComponent {
  12 + scroller: Scroller = new Scroller();
  13 + action: Action = {} as Action
  14 + private webUrl?: string;
  15 + @State contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO []
  16 + @State recommendList: ContentDTO[] = []
  17 + @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
  18 + @State interactData: InteractDataDTO = {} as InteractDataDTO
  19 +
  20 + build() {
  21 + Column() {
  22 + Stack({ alignContent: Alignment.Bottom }) {
  23 + Column() {
  24 + WdWebComponent({
  25 + webUrl: this.webUrl,
  26 + backVisibility: false
  27 + })
  28 + }
  29 + .padding({bottom:56})
  30 + .width(CommonConstants.FULL_WIDTH)
  31 + .height(CommonConstants.FULL_HEIGHT)
  32 +
  33 + //底部交互区
  34 + Row() {
  35 + Image($r('app.media.icon_arrow_left'))
  36 + .width(24)
  37 + .height(24)
  38 + .onClick((event: ClickEvent) => {
  39 + router.back()
  40 + })
  41 +
  42 + Row() {
  43 + Image($r('app.media.icon_comment'))
  44 + .width(24)
  45 + .height(24)
  46 + .margin({ right: 24 })
  47 + .id('comment')
  48 +
  49 + Image($r('app.media.icon_star'))
  50 + .width(24)
  51 + .height(24)
  52 + .margin({ right: 24 })
  53 +
  54 + Image($r('app.media.icon_listen'))
  55 + .width(24)
  56 + .height(24)
  57 + .margin({ right: 24 })
  58 +
  59 + Image($r('app.media.icon_forward'))
  60 + .width(24)
  61 + .height(24)
  62 +
  63 + }
  64 + }
  65 + .width(CommonConstants.FULL_WIDTH)
  66 + .height(56)
  67 + .padding({ left: 15, right: 15, bottom: 20, top: 20 })
  68 + .justifyContent(FlexAlign.SpaceBetween)
  69 + .backgroundColor(Color.White)
  70 + }
  71 + }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
  72 + .backgroundColor(Color.White)
  73 + }
  74 +
  75 + // private async getDetail() {
  76 + // let contentId: string = ''
  77 + // let relId: string = ''
  78 + // let relType: string = ''
  79 + // if (this.action && this.action.params) {
  80 + // if (this.action.params.contentID) {
  81 + // contentId = this.action.params.contentID;
  82 + // }
  83 + // if (this.action && this.action.params && this.action.params.extra) {
  84 + // if (this.action.params.extra.relId) {
  85 + // relId = this.action.params.extra.relId;
  86 + // }
  87 + // if (this.action.params.extra.relType) {
  88 + // relType = this.action.params.extra.relType
  89 + // }
  90 + //
  91 + // }
  92 + // let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
  93 + // if (detailBeans && detailBeans.length > 0) {
  94 + // this.contentDetailData = detailBeans;
  95 + // }
  96 + // }
  97 + // }
  98 +
  99 + aboutToAppear() {
  100 + let action: Action = router.getParams() as Action
  101 + if (action) {
  102 + this.webUrl = action.params?.url
  103 + }
  104 + // this.getDetail()
  105 + }
  106 +
  107 + aboutToDisappear() {
  108 + }
  109 +}
@@ -45,9 +45,9 @@ export struct Card3Component { @@ -45,9 +45,9 @@ export struct Card3Component {
45 .fontColor($r("app.color.color_B0B0B0")) 45 .fontColor($r("app.color.color_B0B0B0"))
46 .margin({ right: 6 }) 46 .margin({ right: 6 })
47 // TODO '评论取哪个字段' 47 // TODO '评论取哪个字段'
48 - // Text(`1806评`)  
49 - // .fontSize($r("app.float.font_size_12"))  
50 - // .fontColor($r("app.color.color_B0B0B0")) 48 + Text(`${this.contentDTO?.interactData?.commentNum}评`)
  49 + .fontSize($r("app.float.font_size_12"))
  50 + .fontColor($r("app.color.color_B0B0B0"))
51 }.width(CommonConstants.FULL_WIDTH) 51 }.width(CommonConstants.FULL_WIDTH)
52 .justifyContent(FlexAlign.Start) 52 .justifyContent(FlexAlign.Start)
53 .margin({ top: 8 }) 53 .margin({ top: 8 })
@@ -288,7 +288,6 @@ struct ChannelDialog { @@ -288,7 +288,6 @@ struct ChannelDialog {
288 .justifyContent(FlexAlign.Center) 288 .justifyContent(FlexAlign.Center)
289 .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff') 289 .backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
290 .onClick(() => { 290 .onClick(() => {
291 - console.log('onTouch')  
292 if (this.isEditIng) { 291 if (this.isEditIng) {
293 if (item.delPermitted === 1) { 292 if (item.delPermitted === 1) {
294 this.delChannelItem(index) 293 this.delChannelItem(index)
@@ -182,14 +182,13 @@ export struct PageComponent { @@ -182,14 +182,13 @@ export struct PageComponent {
182 } else { 182 } else {
183 this.pageModel.hasMore = false; 183 this.pageModel.hasMore = false;
184 } 184 }
185 - // // 二次请求,批查互动数据  
186 - // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => {  
187 - // // 刷新,替换所有数据  
188 - // this.pageModel.compList.replaceAll(...data)  
189 - // this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
190 - // }) 185 + // 二次请求,批查互动数据
  186 + PageViewModel.getInteractData(this.pageDto.compList).then((data: CompDTO[]) => {
  187 + // 刷新,替换所有数据
  188 + this.pageModel.compList.replaceAll(...data)
  189 + this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
  190 + })
191 this.isFirstIn = false 191 this.isFirstIn = false
192 - Logger.debug(TAG, 'cj111');  
193 // } else { 192 // } else {
194 // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); 193 // Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
195 // this.pageModel.viewType = ViewType.EMPTY; 194 // this.pageModel.viewType = ViewType.EMPTY;
@@ -103,9 +103,10 @@ export class ProcessUtils { @@ -103,9 +103,10 @@ export class ProcessUtils {
103 103
104 private static gotoSpecialTopic(content: ContentDTO) { 104 private static gotoSpecialTopic(content: ContentDTO) {
105 let taskAction: Action = { 105 let taskAction: Action = {
106 - type: 'JUMP_H5_BY_WEB_VIEW', 106 + type: 'JUMP_INNER_NEW_PAGE',
107 params: { 107 params: {
108 - url: content.linkUrl 108 + url: content.linkUrl,
  109 + pageID: 'SPACIAL_TOPIC_PAGE',
109 } as Params, 110 } as Params,
110 }; 111 };
111 WDRouterRule.jumpWithAction(taskAction) 112 WDRouterRule.jumpWithAction(taskAction)
  1 +import { Action } from 'wdBean';
  2 +import { SpacialTopicPageComponent } from 'wdComponent'
  3 +import { Logger } from 'wdKit'
  4 +import router from '@ohos.router';
  5 +
  6 +const TAG = 'SpacialPage';
  7 +
  8 +@Entry
  9 +@Component
  10 +struct SpacialTopicPage {
  11 + action: Action = {} as Action
  12 +
  13 + build() {
  14 + Column() {
  15 + SpacialTopicPageComponent()
  16 + }
  17 + }
  18 +
  19 + pageTransition(){
  20 + // 定义页面进入时的效果,从右边侧滑入
  21 + PageTransitionEnter({ type: RouteType.None, duration: 300 })
  22 + .slide(SlideEffect.Right)
  23 + // 定义页面退出时的效果,向右边侧滑出
  24 + PageTransitionExit({ type: RouteType.None, duration: 300 })
  25 + .slide(SlideEffect.Right)
  26 + }
  27 +
  28 +
  29 + aboutToAppear() {
  30 + Logger.info(TAG, 'aboutToAppear');
  31 + let action: Action = router.getParams() as Action
  32 + this.action = action
  33 + }
  34 +
  35 + aboutToDisappear() {
  36 + Logger.info(TAG, 'aboutToDisappear');
  37 + }
  38 +
  39 + onPageShow() {
  40 + Logger.info(TAG, 'onPageShow');
  41 + }
  42 +
  43 + onPageHide() {
  44 + Logger.info(TAG, 'onPageHide');
  45 + }
  46 +
  47 + onBackPress() {
  48 + Logger.info(TAG, 'onBackPress');
  49 + }
  50 +}