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-05-14 22:37:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c41f37b8c586915834771c07b1b723f6158041c9
c41f37b8
1 parent
adeaf898
fix:17297 健康频道>H5稿件,进入H5稿件详情,不应直接展示链接
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
65 deletions
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
sight_harmony/products/phone/src/main/ets/pages/web/DefaultWebPage.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
c41f37b
...
...
@@ -108,9 +108,9 @@ export class ProcessUtils {
break;
case ContentConstants.TYPE_TELETEXT:
// 图文详情,跳转h5
if(content?.linkUrl){ //有 linkUrl 走专题页展示逻辑
ProcessUtils.gotoSpecialTopic(content)
}else{
if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
ProcessUtils.gotoSpecialTopic(content,true)
} else {
ProcessUtils.gotoWeb(content);
}
break;
...
...
@@ -191,13 +191,14 @@ export class ProcessUtils {
WDRouterRule.jumpWithAction(taskAction)
}
public static gotoSpecialTopic(content: ContentDTO) {
public static gotoSpecialTopic(content: ContentDTO
, backVisibility?: boolean
) {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: content?.objectId,
url: content.linkUrl,
pageID: 'SPACIAL_TOPIC_PAGE',
backVisibility: backVisibility,
extra: {
relType: content?.relType,
relId: content?.relId,
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
View file @
c41f37b
...
...
@@ -12,26 +12,13 @@ const TAG = 'WdWebComponent';
@Component
export struct WdWebComponent {
webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
onWebPrepared: () => void = () => {}
@Prop backVisibility: boolean = false
onWebPrepared: () => void = () => {
}
@Prop webUrl: string = ''
@Link isPageEnd: boolean
build() {
Column() {
Row() {
Image($r("app.media.ic_back"))
.width(44)
.padding(13)
.aspectRatio(1)
.onClick(() => {
router.back();
})
}.backgroundColor(Color.Black)
.width('100%')
.height(44)
.visibility(this.backVisibility ? Visibility.Visible : Visibility.None)
Web({ src: this.webUrl, controller: this.webviewControl })
.domStorageAccess(true)
.databaseAccess(true)
...
...
@@ -76,6 +63,7 @@ export struct WdWebComponent {
this.webviewControl.registerHandler(handleName, { handle: handle });
}
}
/**
* 默认【CallNative】逻辑处理
*/
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
View file @
c41f37b
...
...
@@ -25,4 +25,5 @@ export interface Params {
creatorId
?:
string
;
//号主id
videoUrl
?:
string
;
videoCoverUrl
?:
string
;
backVisibility
?:
boolean
;
//展示顶部返回栏
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
c41f37b
...
...
@@ -161,9 +161,11 @@ export struct ImageAndTextPageComponent {
operationButtonList: this.operationButtonList,
styleType: 1,
})
.position({y: '100%'})
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.padding({ top: 38 })
// 发布时间
...
...
@@ -196,7 +198,6 @@ export struct ImageAndTextPageComponent {
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.backgroundColor(Color.White)
}
private async getDetail() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
View file @
c41f37b
...
...
@@ -9,7 +9,7 @@ import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
import { EmptyComponent } from '../components/view/EmptyComponent';
import { NetworkUtil } from 'wdKit';
import { NetworkUtil
, WindowModel
} from 'wdKit';
const TAG: string = 'SpacialTopicPageComponent'
...
...
@@ -78,7 +78,7 @@ export struct SpacialTopicPageComponent {
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment)
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment)
// }
this.trySendData2H5()
}
...
...
@@ -89,17 +89,25 @@ export struct SpacialTopicPageComponent {
Column() {
Stack({ alignContent: Alignment.Bottom }) {
Column() {
Text(this.contentDetailData?.newsTitle)
.backgroundColor(Color.White)
.width('100%')
.height(40)
.fontSize(18)
.textAlign(TextAlign.Center)
.fontWeight(500)
.visibility(this.action?.params?.backVisibility && this.isPageEnd ? Visibility.Visible : Visibility.None)
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
backVisibility: false,
onWebPrepared: this.onWebPrepared.bind(this),
isPageEnd: $isPageEnd
isPageEnd: $isPageEnd
,
})
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.padding({ bottom: 75 })
.padding({ bottom:
this.action?.params?.backVisibility ? 115 :
75 })
if (!this.isNetConnected) {
EmptyComponent({
...
...
@@ -111,7 +119,7 @@ export struct SpacialTopicPageComponent {
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailedSkeleton()
detailedSkeleton()
.padding({ bottom: this.bottomSafeHeight })
}
}
//底部交互区
...
...
@@ -120,17 +128,33 @@ export struct SpacialTopicPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
})
.padding({
bottom: `${this.bottomSafeHeight}px`
})
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
}
onPageShow() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(true)
}
}
aboutToAppear() {
if (this.action) {
this.webUrl = this.action.params?.url || ''
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(true)
}
this.webUrl = this.action?.params?.url || ''
this.getDetail()
}
onPageHide() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(false)
}
}
aboutToDisappear() {
if (!this.action?.params?.backVisibility) {
WindowModel.shared.setWindowLayoutFullScreen(false)
}
}
}
...
...
sight_harmony/products/phone/src/main/ets/pages/SpacialTopicPage.ets
View file @
c41f37b
import { Action } from 'wdBean';
import { SpacialTopicPageComponent } from 'wdComponent'
import { CommonConstants } from 'wdConstant'
import { Logger
, WindowModel
} from 'wdKit'
import { Logger } from 'wdKit'
import router from '@ohos.router';
const TAG = 'SpacialTopicPage';
...
...
@@ -30,28 +30,8 @@ struct SpacialTopicPage {
}
aboutToAppear() {
WindowModel.shared.setWindowLayoutFullScreen(true)
Logger.info(TAG, 'aboutToAppear');
let action: Action = router.getParams() as Action
this.action = action
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
WindowModel.shared.setWindowLayoutFullScreen(false)
}
onPageShow() {
WindowModel.shared.setWindowLayoutFullScreen(true)
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
Logger.info(TAG, 'onPageHide');
WindowModel.shared.setWindowLayoutFullScreen(false)
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/web/DefaultWebPage.ets
View file @
c41f37b
...
...
@@ -17,19 +17,14 @@ struct DefaultWebPage {
build() {
Column() {
Stack({ alignContent: Alignment.Bottom }) {
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
backVisibility: false,
isPageEnd: $isPageEnd
})
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
}
aboutToAppear() {
...
...
Please
register
or
login
to post a comment