zhangfengjin

Merge remote-tracking branch 'origin/main'

@@ -108,9 +108,9 @@ export class ProcessUtils { @@ -108,9 +108,9 @@ export class ProcessUtils {
108 break; 108 break;
109 case ContentConstants.TYPE_TELETEXT: 109 case ContentConstants.TYPE_TELETEXT:
110 // 图文详情,跳转h5 110 // 图文详情,跳转h5
111 - if(content?.linkUrl){ //有 linkUrl 走专题页展示逻辑  
112 - ProcessUtils.gotoSpecialTopic(content)  
113 - }else{ 111 + if (content?.linkUrl) { //有 linkUrl 走专题页展示逻辑
  112 + ProcessUtils.gotoSpecialTopic(content,true)
  113 + } else {
114 ProcessUtils.gotoWeb(content); 114 ProcessUtils.gotoWeb(content);
115 } 115 }
116 break; 116 break;
@@ -191,13 +191,14 @@ export class ProcessUtils { @@ -191,13 +191,14 @@ export class ProcessUtils {
191 WDRouterRule.jumpWithAction(taskAction) 191 WDRouterRule.jumpWithAction(taskAction)
192 } 192 }
193 193
194 - public static gotoSpecialTopic(content: ContentDTO) { 194 + public static gotoSpecialTopic(content: ContentDTO, backVisibility?: boolean) {
195 let taskAction: Action = { 195 let taskAction: Action = {
196 type: 'JUMP_INNER_NEW_PAGE', 196 type: 'JUMP_INNER_NEW_PAGE',
197 params: { 197 params: {
198 contentID: content?.objectId, 198 contentID: content?.objectId,
199 url: content.linkUrl, 199 url: content.linkUrl,
200 pageID: 'SPACIAL_TOPIC_PAGE', 200 pageID: 'SPACIAL_TOPIC_PAGE',
  201 + backVisibility: backVisibility,
201 extra: { 202 extra: {
202 relType: content?.relType, 203 relType: content?.relType,
203 relId: content?.relId, 204 relId: content?.relId,
@@ -12,26 +12,13 @@ const TAG = 'WdWebComponent'; @@ -12,26 +12,13 @@ const TAG = 'WdWebComponent';
12 @Component 12 @Component
13 export struct WdWebComponent { 13 export struct WdWebComponent {
14 webviewControl: BridgeWebViewControl = new BridgeWebViewControl() 14 webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
15 - onWebPrepared: () => void = () => {}  
16 - @Prop backVisibility: boolean = false 15 + onWebPrepared: () => void = () => {
  16 + }
17 @Prop webUrl: string = '' 17 @Prop webUrl: string = ''
18 @Link isPageEnd: boolean 18 @Link isPageEnd: boolean
19 19
20 build() { 20 build() {
21 Column() { 21 Column() {
22 - Row() {  
23 - Image($r("app.media.ic_back"))  
24 - .width(44)  
25 - .padding(13)  
26 - .aspectRatio(1)  
27 - .onClick(() => {  
28 - router.back();  
29 - })  
30 - }.backgroundColor(Color.Black)  
31 - .width('100%')  
32 - .height(44)  
33 - .visibility(this.backVisibility ? Visibility.Visible : Visibility.None)  
34 -  
35 Web({ src: this.webUrl, controller: this.webviewControl }) 22 Web({ src: this.webUrl, controller: this.webviewControl })
36 .domStorageAccess(true) 23 .domStorageAccess(true)
37 .databaseAccess(true) 24 .databaseAccess(true)
@@ -76,6 +63,7 @@ export struct WdWebComponent { @@ -76,6 +63,7 @@ export struct WdWebComponent {
76 this.webviewControl.registerHandler(handleName, { handle: handle }); 63 this.webviewControl.registerHandler(handleName, { handle: handle });
77 } 64 }
78 } 65 }
  66 +
79 /** 67 /**
80 * 默认【CallNative】逻辑处理 68 * 默认【CallNative】逻辑处理
81 */ 69 */
@@ -5,12 +5,14 @@ import { performJSCallNative } from './JsBridgeBiz'; @@ -5,12 +5,14 @@ import { performJSCallNative } from './JsBridgeBiz';
5 import { H5CallNativeType } from './H5CallNativeType'; 5 import { H5CallNativeType } from './H5CallNativeType';
6 import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; 6 import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
7 import { DateTimeUtils } from 'wdKit' 7 import { DateTimeUtils } from 'wdKit'
  8 +
8 const TAG = 'WdWebLocalComponent'; 9 const TAG = 'WdWebLocalComponent';
9 10
10 @Component 11 @Component
11 export struct WdWebLocalComponent { 12 export struct WdWebLocalComponent {
12 webviewControl: BridgeWebViewControl = new BridgeWebViewControl() 13 webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
13 - onWebPrepared: () => void = () => {} 14 + onWebPrepared: () => void = () => {
  15 + }
14 @Prop backVisibility: boolean = false 16 @Prop backVisibility: boolean = false
15 @Prop webResource: Resource = {} as Resource 17 @Prop webResource: Resource = {} as Resource
16 @State webHeight: string | number = '100%' 18 @State webHeight: string | number = '100%'
@@ -47,15 +49,14 @@ export struct WdWebLocalComponent { @@ -47,15 +49,14 @@ export struct WdWebLocalComponent {
47 Row() { 49 Row() {
48 RelativeContainer() { 50 RelativeContainer() {
49 // Web({ src: this.webResource, controller: this.webviewControl, renderMode: RenderMode.SYNC_RENDER }) 51 // Web({ src: this.webResource, controller: this.webviewControl, renderMode: RenderMode.SYNC_RENDER })
50 - Web({ src: this.webResource, controller: this.webviewControl}) 52 + Web({ src: this.webResource, controller: this.webviewControl })
51 .domStorageAccess(true) 53 .domStorageAccess(true)
52 .databaseAccess(true) 54 .databaseAccess(true)
53 .javaScriptAccess(true) 55 .javaScriptAccess(true)
54 .imageAccess(true) 56 .imageAccess(true)
55 .mixedMode(MixedMode.All) 57 .mixedMode(MixedMode.All)
56 .onlineImageAccess(true) 58 .onlineImageAccess(true)
57 - .enableNativeEmbedMode(true)  
58 - // .layoutMode(WebLayoutMode.FIT_CONTENT) 59 + .enableNativeEmbedMode(true)// .layoutMode(WebLayoutMode.FIT_CONTENT)
59 // .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST }) 60 // .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST })
60 .height(this.webHeight) 61 .height(this.webHeight)
61 .onPageBegin((event) => { 62 .onPageBegin((event) => {
@@ -113,18 +114,21 @@ export struct WdWebLocalComponent { @@ -113,18 +114,21 @@ export struct WdWebLocalComponent {
113 } 114 }
114 }) 115 })
115 Row() { 116 Row() {
116 - Image($r(this.isPause ? 'app.media.icon_play' : 'app.media.icon_pause')) 117 + Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause'))
117 .width(24) 118 .width(24)
118 .height(24) 119 .height(24)
119 - .onClick(()=>{  
120 - if(this.isPause){ 120 + .onClick(() => {
  121 + if (this.isPause) {
121 this.controller.start() 122 this.controller.start()
122 - }else{ 123 + } else {
123 this.controller.pause() 124 this.controller.pause()
124 } 125 }
125 }) 126 })
126 Row() { 127 Row() {
127 - Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000)).fontSize(12).fontColor(Color.White).fontWeight(600) 128 + Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000))
  129 + .fontSize(12)
  130 + .fontColor(Color.White)
  131 + .fontWeight(600)
128 Slider({ 132 Slider({
129 value: this.currentTime, 133 value: this.currentTime,
130 min: 0, 134 min: 0,
@@ -132,8 +136,7 @@ export struct WdWebLocalComponent { @@ -132,8 +136,7 @@ export struct WdWebLocalComponent {
132 }) 136 })
133 .width("50%") 137 .width("50%")
134 .selectedColor('#ED2800') 138 .selectedColor('#ED2800')
135 - .margin({ left: 4, right: 4 })  
136 - // .blockStyle({ 139 + .margin({ left: 4, right: 4 })// .blockStyle({
137 // type: SliderBlockType.IMAGE, 140 // type: SliderBlockType.IMAGE,
138 // image: $r('app.media.slider_block') 141 // image: $r('app.media.slider_block')
139 // }) 142 // })
@@ -141,14 +144,17 @@ export struct WdWebLocalComponent { @@ -141,14 +144,17 @@ export struct WdWebLocalComponent {
141 .onChange((value: number, mode: SliderChangeMode) => { 144 .onChange((value: number, mode: SliderChangeMode) => {
142 this.controller.setCurrentTime(value); 145 this.controller.setCurrentTime(value);
143 }) 146 })
144 - Text(DateTimeUtils.getFormattedDuration(this.durationTime * 1000)).fontSize(12).fontColor(Color.White).fontWeight(600) 147 + Text(DateTimeUtils.getFormattedDuration(this.durationTime * 1000))
  148 + .fontSize(12)
  149 + .fontColor(Color.White)
  150 + .fontWeight(600)
145 } 151 }
146 .justifyContent(FlexAlign.Center) 152 .justifyContent(FlexAlign.Center)
147 153
148 Image($r('app.media.icon_full_screen')) 154 Image($r('app.media.icon_full_screen'))
149 .width(24) 155 .width(24)
150 .height(24) 156 .height(24)
151 - .onClick(()=>{ 157 + .onClick(() => {
152 this.controller.requestFullscreen(true) 158 this.controller.requestFullscreen(true)
153 }) 159 })
154 } 160 }
@@ -25,4 +25,5 @@ export interface Params { @@ -25,4 +25,5 @@ export interface Params {
25 creatorId?: string; //号主id 25 creatorId?: string; //号主id
26 videoUrl?: string; 26 videoUrl?: string;
27 videoCoverUrl?: string; 27 videoCoverUrl?: string;
  28 + backVisibility?: boolean; //展示顶部返回栏
28 } 29 }
@@ -161,9 +161,11 @@ export struct ImageAndTextPageComponent { @@ -161,9 +161,11 @@ export struct ImageAndTextPageComponent {
161 operationButtonList: this.operationButtonList, 161 operationButtonList: this.operationButtonList,
162 styleType: 1, 162 styleType: 1,
163 }) 163 })
  164 + .position({y: '100%'})
164 } 165 }
165 .width(CommonConstants.FULL_WIDTH) 166 .width(CommonConstants.FULL_WIDTH)
166 .height(CommonConstants.FULL_HEIGHT) 167 .height(CommonConstants.FULL_HEIGHT)
  168 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
167 .padding({ top: 38 }) 169 .padding({ top: 38 })
168 170
169 // 发布时间 171 // 发布时间
@@ -196,7 +198,6 @@ export struct ImageAndTextPageComponent { @@ -196,7 +198,6 @@ export struct ImageAndTextPageComponent {
196 .width(CommonConstants.FULL_WIDTH) 198 .width(CommonConstants.FULL_WIDTH)
197 .height(CommonConstants.FULL_HEIGHT) 199 .height(CommonConstants.FULL_HEIGHT)
198 .backgroundColor(Color.White) 200 .backgroundColor(Color.White)
199 -  
200 } 201 }
201 202
202 private async getDetail() { 203 private async getDetail() {
@@ -9,7 +9,7 @@ import { OperRowListView } from './view/OperRowListView'; @@ -9,7 +9,7 @@ import { OperRowListView } from './view/OperRowListView';
9 import DetailViewModel from '../viewmodel/DetailViewModel'; 9 import DetailViewModel from '../viewmodel/DetailViewModel';
10 import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; 10 import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
11 import { EmptyComponent } from '../components/view/EmptyComponent'; 11 import { EmptyComponent } from '../components/view/EmptyComponent';
12 -import { NetworkUtil } from 'wdKit'; 12 +import { NetworkUtil, WindowModel } from 'wdKit';
13 13
14 const TAG: string = 'SpacialTopicPageComponent' 14 const TAG: string = 'SpacialTopicPageComponent'
15 15
@@ -89,17 +89,25 @@ export struct SpacialTopicPageComponent { @@ -89,17 +89,25 @@ export struct SpacialTopicPageComponent {
89 Column() { 89 Column() {
90 Stack({ alignContent: Alignment.Bottom }) { 90 Stack({ alignContent: Alignment.Bottom }) {
91 Column() { 91 Column() {
  92 + Text(this.contentDetailData?.newsTitle)
  93 + .backgroundColor(Color.White)
  94 + .width('100%')
  95 + .height(40)
  96 + .fontSize(18)
  97 + .textAlign(TextAlign.Center)
  98 + .fontWeight(500)
  99 + .visibility(this.action?.params?.backVisibility && this.isPageEnd ? Visibility.Visible : Visibility.None)
  100 +
92 WdWebComponent({ 101 WdWebComponent({
93 webviewControl: this.webviewControl, 102 webviewControl: this.webviewControl,
94 webUrl: this.webUrl, 103 webUrl: this.webUrl,
95 - backVisibility: false,  
96 onWebPrepared: this.onWebPrepared.bind(this), 104 onWebPrepared: this.onWebPrepared.bind(this),
97 - isPageEnd: $isPageEnd 105 + isPageEnd: $isPageEnd,
98 }) 106 })
99 } 107 }
100 .width(CommonConstants.FULL_WIDTH) 108 .width(CommonConstants.FULL_WIDTH)
101 .height(CommonConstants.FULL_HEIGHT) 109 .height(CommonConstants.FULL_HEIGHT)
102 - .padding({ bottom: 75 }) 110 + .padding({ bottom: this.action?.params?.backVisibility ? 115 : 75 })
103 111
104 if (!this.isNetConnected) { 112 if (!this.isNetConnected) {
105 EmptyComponent({ 113 EmptyComponent({
@@ -111,7 +119,7 @@ export struct SpacialTopicPageComponent { @@ -111,7 +119,7 @@ export struct SpacialTopicPageComponent {
111 }).padding({ bottom: 200 }) 119 }).padding({ bottom: 200 })
112 } else { 120 } else {
113 if (!this.isPageEnd) { 121 if (!this.isPageEnd) {
114 - detailedSkeleton() 122 + detailedSkeleton().padding({ bottom: this.bottomSafeHeight })
115 } 123 }
116 } 124 }
117 //底部交互区 125 //底部交互区
@@ -120,17 +128,33 @@ export struct SpacialTopicPageComponent { @@ -120,17 +128,33 @@ export struct SpacialTopicPageComponent {
120 publishCommentModel: this.publishCommentModel, 128 publishCommentModel: this.publishCommentModel,
121 operationButtonList: this.operationButtonList, 129 operationButtonList: this.operationButtonList,
122 }) 130 })
123 - .padding({  
124 - bottom: `${this.bottomSafeHeight}px`  
125 - })  
126 } 131 }
127 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) 132 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
128 } 133 }
129 134
  135 + onPageShow() {
  136 + if (!this.action?.params?.backVisibility) {
  137 + WindowModel.shared.setWindowLayoutFullScreen(true)
  138 + }
  139 + }
  140 +
130 aboutToAppear() { 141 aboutToAppear() {
131 - if (this.action) {  
132 - this.webUrl = this.action.params?.url || '' 142 + if (!this.action?.params?.backVisibility) {
  143 + WindowModel.shared.setWindowLayoutFullScreen(true)
133 } 144 }
  145 + this.webUrl = this.action?.params?.url || ''
134 this.getDetail() 146 this.getDetail()
135 } 147 }
  148 +
  149 + onPageHide() {
  150 + if (!this.action?.params?.backVisibility) {
  151 + WindowModel.shared.setWindowLayoutFullScreen(false)
  152 + }
  153 + }
  154 +
  155 + aboutToDisappear() {
  156 + if (!this.action?.params?.backVisibility) {
  157 + WindowModel.shared.setWindowLayoutFullScreen(false)
  158 + }
  159 + }
136 } 160 }
1 import { Action } from 'wdBean'; 1 import { Action } from 'wdBean';
2 import { SpacialTopicPageComponent } from 'wdComponent' 2 import { SpacialTopicPageComponent } from 'wdComponent'
3 import { CommonConstants } from 'wdConstant' 3 import { CommonConstants } from 'wdConstant'
4 -import { Logger, WindowModel } from 'wdKit' 4 +import { Logger } from 'wdKit'
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
6 6
7 const TAG = 'SpacialTopicPage'; 7 const TAG = 'SpacialTopicPage';
@@ -30,28 +30,8 @@ struct SpacialTopicPage { @@ -30,28 +30,8 @@ struct SpacialTopicPage {
30 } 30 }
31 31
32 aboutToAppear() { 32 aboutToAppear() {
33 - WindowModel.shared.setWindowLayoutFullScreen(true)  
34 Logger.info(TAG, 'aboutToAppear'); 33 Logger.info(TAG, 'aboutToAppear');
35 let action: Action = router.getParams() as Action 34 let action: Action = router.getParams() as Action
36 this.action = action 35 this.action = action
37 } 36 }
38 -  
39 - aboutToDisappear() {  
40 - Logger.info(TAG, 'aboutToDisappear');  
41 - WindowModel.shared.setWindowLayoutFullScreen(false)  
42 - }  
43 -  
44 - onPageShow() {  
45 - WindowModel.shared.setWindowLayoutFullScreen(true)  
46 - Logger.info(TAG, 'onPageShow');  
47 - }  
48 -  
49 - onPageHide() {  
50 - Logger.info(TAG, 'onPageHide');  
51 - WindowModel.shared.setWindowLayoutFullScreen(false)  
52 - }  
53 -  
54 - onBackPress() {  
55 - Logger.info(TAG, 'onBackPress');  
56 - }  
57 } 37 }
@@ -17,20 +17,15 @@ struct DefaultWebPage { @@ -17,20 +17,15 @@ struct DefaultWebPage {
17 17
18 build() { 18 build() {
19 Column() { 19 Column() {
20 - Stack({ alignContent: Alignment.Bottom }) {  
21 - Column() {  
22 WdWebComponent({ 20 WdWebComponent({
23 webviewControl: this.webviewControl, 21 webviewControl: this.webviewControl,
24 webUrl: this.webUrl, 22 webUrl: this.webUrl,
25 - backVisibility: false,  
26 isPageEnd: $isPageEnd 23 isPageEnd: $isPageEnd
27 }) 24 })
28 } 25 }
29 .width(CommonConstants.FULL_WIDTH) 26 .width(CommonConstants.FULL_WIDTH)
30 .height(CommonConstants.FULL_HEIGHT) 27 .height(CommonConstants.FULL_HEIGHT)
31 } 28 }
32 - }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)  
33 - }  
34 29
35 aboutToAppear() { 30 aboutToAppear() {
36 let action: Action = router.getParams() as Action 31 let action: Action = router.getParams() as Action