Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yuzhilin
2024-04-15 16:24:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4270e243f415e9f02641d40641c75319527ebd3c
4270e243
1 parent
ad6393a1
增加专题页
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
179 additions
and
20 deletions
sight_harmony/commons/wdRouter/src/main/ets/router/Action2Page.ets
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
sight_harmony/features/wdComponent/Index.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextWebComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/utils/ProcessUtils.ets
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
sight_harmony/commons/wdRouter/src/main/ets/router/Action2Page.ets
View file @
4270e24
...
...
@@ -80,6 +80,8 @@ export function registerRouter() {
return WDRouterPage.imageTextDetailPage
} else if (action.params?.pageID == "BroadcastPage") {
return WDRouterPage.broadcastPage
} else if (action.params?.pageID == "SPACIAL_TOPIC_PAGE") {
return WDRouterPage.spacialTopicPage
}
return undefined
})
...
...
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
View file @
4270e24
...
...
@@ -32,6 +32,8 @@ export class WDRouterPage {
static morningEveningPaperPage = new WDRouterPage("phone", "ets/pages/MorningEveningPaperPage")
// 图文详情页
static imageTextDetailPage = new WDRouterPage("phone", "ets/pages/ImageAndTextDetailPage");
// 专题页
static spacialTopicPage = new WDRouterPage("phone", "ets/pages/SpacialTopicPage");
// 短视频详情页
static detailVideoListPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailVideoListPage");
static detailPlayShortVideoPage = new WDRouterPage("wdDetailPlayShortVideo", "ets/pages/DetailPlayShortVideoPage");
...
...
sight_harmony/features/wdComponent/Index.ets
View file @
4270e24
...
...
@@ -64,3 +64,5 @@ export { FirstTabTopSearchComponent } from "./src/main/ets/components/search/Fir
export { ListHasNoMoreDataUI } from "./src/main/ets/components/reusable/ListHasNoMoreDataUI"
export { LottieView } from './src/main/ets/lottie/LottieView'
export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent'
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextWebComponent.ets
View file @
4270e24
...
...
@@ -7,7 +7,7 @@ import {
ResponseBean
} from 'wdBean';
import { Logger } from 'wdKit';
import { WdWeb
Component, WdWeb
LocalComponent } from 'wdWebComponent';
import { WdWebLocalComponent } from 'wdWebComponent';
import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
import { BridgeWebViewControl } from 'wdJsBridge/Index';
...
...
@@ -85,11 +85,6 @@ export struct ImageAndTextWebComponent {
webResource: $rawfile('apph5/index.html'),
backVisibility: false,
})
// WdWebLocalComponent({
// webviewControl: this.webviewControl,
// webResource: "http://pd-people-uat.pdnews.cn/articletopic/35398-10000015965",
// backVisibility: false,
// })
}
}
...
...
@@ -97,7 +92,7 @@ export struct ImageAndTextWebComponent {
Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData');
this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,
JSON.stringify(h5ReceiveAppData), (data: string) => {
//
Logger.debug('ImageAndTextWebComponent', "from js data = " + data);
Logger.debug('ImageAndTextWebComponent', "from js data = " + data);
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
0 → 100644
View file @
4270e24
import { Action, ContentDetailDTO, ContentDTO, batchLikeAndCollectResult, InteractDataDTO, } from 'wdBean';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { OperRowListView } from './view/OperRowListView';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
const TAG = 'SpacialTopicPageComponent'
@Component
export struct SpacialTopicPageComponent {
scroller: Scroller = new Scroller();
action: Action = {} as Action
private webUrl?: string;
@State contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO []
@State recommendList: ContentDTO[] = []
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State interactData: InteractDataDTO = {} as InteractDataDTO
build() {
Column() {
Stack({ alignContent: Alignment.Bottom }) {
Column() {
WdWebComponent({
webUrl: this.webUrl,
backVisibility: false
})
}
.padding({bottom:56})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
//底部交互区
Row() {
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.onClick((event: ClickEvent) => {
router.back()
})
Row() {
Image($r('app.media.icon_comment'))
.width(24)
.height(24)
.margin({ right: 24 })
.id('comment')
Image($r('app.media.icon_star'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ right: 24 })
Image($r('app.media.icon_forward'))
.width(24)
.height(24)
}
}
.width(CommonConstants.FULL_WIDTH)
.height(56)
.padding({ left: 15, right: 15, bottom: 20, top: 20 })
.justifyContent(FlexAlign.SpaceBetween)
.backgroundColor(Color.White)
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
.backgroundColor(Color.White)
}
// private async getDetail() {
// let contentId: string = ''
// let relId: string = ''
// let relType: string = ''
// if (this.action && this.action.params) {
// if (this.action.params.contentID) {
// contentId = this.action.params.contentID;
// }
// if (this.action && this.action.params && this.action.params.extra) {
// if (this.action.params.extra.relId) {
// relId = this.action.params.extra.relId;
// }
// if (this.action.params.extra.relType) {
// relType = this.action.params.extra.relType
// }
//
// }
// let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
// if (detailBeans && detailBeans.length > 0) {
// this.contentDetailData = detailBeans;
// }
// }
// }
aboutToAppear() {
let action: Action = router.getParams() as Action
if (action) {
this.webUrl = action.params?.url
}
// this.getDetail()
}
aboutToDisappear() {
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
View file @
4270e24
...
...
@@ -45,9 +45,9 @@ export struct Card3Component {
.fontColor($r("app.color.color_B0B0B0"))
.margin({ right: 6 })
// TODO '评论取哪个字段'
// Text(`1806评`)
// .fontSize($r("app.float.font_size_12"))
// .fontColor($r("app.color.color_B0B0B0"))
Text(`${this.contentDTO?.interactData?.commentNum}评`)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
.margin({ top: 8 })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
View file @
4270e24
...
...
@@ -288,7 +288,6 @@ struct ChannelDialog {
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
.onClick(() => {
console.log('onTouch')
if (this.isEditIng) {
if (item.delPermitted === 1) {
this.delChannelItem(index)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
View file @
4270e24
...
...
@@ -182,14 +182,13 @@ export struct PageComponent {
} else {
this.pageModel.hasMore = false;
}
// // 二次请求,批查互动数据
// PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => {
// // 刷新,替换所有数据
// this.pageModel.compList.replaceAll(...data)
// this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
// })
// 二次请求,批查互动数据
PageViewModel.getInteractData(this.pageDto.compList).then((data: CompDTO[]) => {
// 刷新,替换所有数据
this.pageModel.compList.replaceAll(...data)
this.pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
})
this.isFirstIn = false
Logger.debug(TAG, 'cj111');
// } else {
// Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
// this.pageModel.viewType = ViewType.EMPTY;
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/ProcessUtils.ets
View file @
4270e24
...
...
@@ -103,9 +103,10 @@ export class ProcessUtils {
private static gotoSpecialTopic(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_
H5_BY_WEB_VIEW
',
type: 'JUMP_
INNER_NEW_PAGE
',
params: {
url: content.linkUrl
url: content.linkUrl,
pageID: 'SPACIAL_TOPIC_PAGE',
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
0 → 100644
View file @
4270e24
import { Action } from 'wdBean';
import { SpacialTopicPageComponent } from 'wdComponent'
import { Logger } from 'wdKit'
import router from '@ohos.router';
const TAG = 'SpacialPage';
@Entry
@Component
struct SpacialTopicPage {
action: Action = {} as Action
build() {
Column() {
SpacialTopicPageComponent()
}
}
pageTransition(){
// 定义页面进入时的效果,从右边侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Right)
// 定义页面退出时的效果,向右边侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Right)
}
aboutToAppear() {
Logger.info(TAG, 'aboutToAppear');
let action: Action = router.getParams() as Action
this.action = action
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
}
onPageShow() {
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
Logger.info(TAG, 'onPageHide');
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment