Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: ref |> 类型是图文的外链页面详情开发
Showing
7 changed files
with
348 additions
and
3 deletions
| @@ -97,6 +97,8 @@ export function registerRouter() { | @@ -97,6 +97,8 @@ export function registerRouter() { | ||
| 97 | return WDRouterPage.reserveMorePage | 97 | return WDRouterPage.reserveMorePage |
| 98 | } else if (action.params?.pageID == "FeedBackActivity") { | 98 | } else if (action.params?.pageID == "FeedBackActivity") { |
| 99 | return WDRouterPage.feedBackActivity | 99 | return WDRouterPage.feedBackActivity |
| 100 | + } else if (action.params?.pageID == "H5_NEWS_PAGE") { | ||
| 101 | + return WDRouterPage.h5NewsWebPage | ||
| 100 | } | 102 | } |
| 101 | return undefined | 103 | return undefined |
| 102 | }) | 104 | }) |
| @@ -38,6 +38,8 @@ export class WDRouterPage { | @@ -38,6 +38,8 @@ export class WDRouterPage { | ||
| 38 | static defaultWebPage = new WDRouterPage("phone", "ets/pages/web/DefaultWebPage"); | 38 | static defaultWebPage = new WDRouterPage("phone", "ets/pages/web/DefaultWebPage"); |
| 39 | // H5提示页面 | 39 | // H5提示页面 |
| 40 | static h5TipsPage = new WDRouterPage("phone", "ets/pages/web/H5TipsPage"); | 40 | static h5TipsPage = new WDRouterPage("phone", "ets/pages/web/H5TipsPage"); |
| 41 | + // H5外链展示页面 | ||
| 42 | + static h5NewsWebPage = new WDRouterPage("phone", "ets/pages/web/H5NewsWebPage"); | ||
| 41 | // 电子报页面 | 43 | // 电子报页面 |
| 42 | static eNewspaper = new WDRouterPage("phone", "ets/pages/ENewspaper") | 44 | static eNewspaper = new WDRouterPage("phone", "ets/pages/ENewspaper") |
| 43 | // 早晚报页面 | 45 | // 早晚报页面 |
| @@ -48,7 +48,11 @@ export class ProcessUtils { | @@ -48,7 +48,11 @@ export class ProcessUtils { | ||
| 48 | // 内链 | 48 | // 内链 |
| 49 | let content: ContentDTO = new ContentDTO(); | 49 | let content: ContentDTO = new ContentDTO(); |
| 50 | content.linkUrl = linkUrl; | 50 | content.linkUrl = linkUrl; |
| 51 | + if (content.linkUrl) { | ||
| 52 | + ProcessUtils.gotoH5NewsWeb(content); | ||
| 53 | + }else { | ||
| 51 | ProcessUtils.gotoWeb(content); | 54 | ProcessUtils.gotoWeb(content); |
| 55 | + } | ||
| 52 | } else if ('2' == type) { | 56 | } else if ('2' == type) { |
| 53 | // 外链 | 57 | // 外链 |
| 54 | ProcessUtils.jumpExternalWebPage(linkUrl); | 58 | ProcessUtils.jumpExternalWebPage(linkUrl); |
| @@ -206,7 +210,9 @@ export class ProcessUtils { | @@ -206,7 +210,9 @@ export class ProcessUtils { | ||
| 206 | case ContentConstants.TYPE_TELETEXT: | 210 | case ContentConstants.TYPE_TELETEXT: |
| 207 | 211 | ||
| 208 | if (content?.linkUrl) { | 212 | if (content?.linkUrl) { |
| 209 | - ProcessUtils.gotoDefaultWebPage(content?.linkUrl); | 213 | + // let bean={url:content?.linkUrl} as Params |
| 214 | + // WDRouterRule.jumpWithPage(WDRouterPage.h5TipsPage,bean); | ||
| 215 | + ProcessUtils.gotoH5NewsWeb(content); | ||
| 210 | }else { | 216 | }else { |
| 211 | ProcessUtils.gotoWeb(content); | 217 | ProcessUtils.gotoWeb(content); |
| 212 | } | 218 | } |
| @@ -407,6 +413,28 @@ export class ProcessUtils { | @@ -407,6 +413,28 @@ export class ProcessUtils { | ||
| 407 | // Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`); | 413 | // Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`); |
| 408 | } | 414 | } |
| 409 | 415 | ||
| 416 | + public static gotoH5NewsWeb(content: ContentDTO) { | ||
| 417 | + let taskAction: Action = { | ||
| 418 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 419 | + params: { | ||
| 420 | + contentID: content?.objectId, | ||
| 421 | + url:content?.linkUrl, | ||
| 422 | + pageID: 'H5_NEWS_PAGE', | ||
| 423 | + extra: { | ||
| 424 | + relType: content?.relType, | ||
| 425 | + relId: content?.relId, | ||
| 426 | + channelId: content?.channelId, | ||
| 427 | + sourcePage: '5', | ||
| 428 | + commentId: content?.commentInfo?.commentId, | ||
| 429 | + title: content?.newsTitle | ||
| 430 | + } as ExtraDTO, | ||
| 431 | + targetLayout: content.customParamTargetLayout | ||
| 432 | + } as Params, | ||
| 433 | + }; | ||
| 434 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 435 | + Logger.debug(TAG, `gotoH5NewsWeb, ${content.objectId}`); | ||
| 436 | + } | ||
| 437 | + | ||
| 410 | public static gotoWeb(content: ContentDTO) { | 438 | public static gotoWeb(content: ContentDTO) { |
| 411 | let taskAction: Action = { | 439 | let taskAction: Action = { |
| 412 | type: 'JUMP_INNER_NEW_PAGE', | 440 | type: 'JUMP_INNER_NEW_PAGE', |
| @@ -414,7 +442,7 @@ export class ProcessUtils { | @@ -414,7 +442,7 @@ export class ProcessUtils { | ||
| 414 | contentID: content?.objectId, | 442 | contentID: content?.objectId, |
| 415 | //fixme 图文外链,需要单独处理 | 443 | //fixme 图文外链,需要单独处理 |
| 416 | url:content?.linkUrl, | 444 | url:content?.linkUrl, |
| 417 | - pageID: 'IMAGE_TEXT_DETAIL', | 445 | + pageID:'IMAGE_TEXT_DETAIL', |
| 418 | extra: { | 446 | extra: { |
| 419 | relType: content?.relType, | 447 | relType: content?.relType, |
| 420 | relId: content?.relId, | 448 | relId: content?.relId, |
| @@ -67,13 +67,14 @@ export { LottieView } from './src/main/ets/components/lottie/LottieView' | @@ -67,13 +67,14 @@ export { LottieView } from './src/main/ets/components/lottie/LottieView' | ||
| 67 | 67 | ||
| 68 | export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent' | 68 | export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopicPageComponent' |
| 69 | 69 | ||
| 70 | +export { H5NewsWebPageComponent } from './src/main/ets/components/H5NewsWebPageComponent' | ||
| 71 | + | ||
| 70 | export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" | 72 | export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" |
| 71 | 73 | ||
| 72 | export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" | 74 | export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" |
| 73 | 75 | ||
| 74 | export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent" | 76 | export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent" |
| 75 | 77 | ||
| 76 | - | ||
| 77 | export { PermissionDesComponent } from "./src/main/ets/components/view/PermissionDesComponent" | 78 | export { PermissionDesComponent } from "./src/main/ets/components/view/PermissionDesComponent" |
| 78 | 79 | ||
| 79 | export { AudioRowComponent } from "./src/main/ets/components/live/AudioRowComponent" | 80 | export { AudioRowComponent } from "./src/main/ets/components/live/AudioRowComponent" |
| 1 | +import { | ||
| 2 | + Logger, | ||
| 3 | + NumberFormatterUtils, | ||
| 4 | + DateTimeUtils, | ||
| 5 | + EmitterUtils, | ||
| 6 | + EmitterEventId, | ||
| 7 | + NetworkUtil, | ||
| 8 | +} from 'wdKit'; | ||
| 9 | +import { | ||
| 10 | + Action, | ||
| 11 | + ContentDetailDTO, | ||
| 12 | + ContentDTO, | ||
| 13 | + postRecommendListParams, | ||
| 14 | + postExecuteLikeParams, | ||
| 15 | + batchLikeAndCollectResult, | ||
| 16 | + batchLikeAndCollectParams, | ||
| 17 | + InteractDataDTO, | ||
| 18 | + contentListParams, | ||
| 19 | +} from 'wdBean'; | ||
| 20 | +import { WdWebComponent } from 'wdWebComponent'; | ||
| 21 | +import DetailViewModel from '../viewmodel/DetailViewModel'; | ||
| 22 | +import router from '@ohos.router'; | ||
| 23 | +import { CommonConstants } from 'wdConstant' | ||
| 24 | +import { BridgeWebViewControl } from 'wdJsBridge'; | ||
| 25 | +import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; | ||
| 26 | +import { HttpUtils } from 'wdNetwork/Index'; | ||
| 27 | +import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | ||
| 28 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 29 | +import { PageRepository } from '../repository/PageRepository'; | ||
| 30 | +import { OperRowListView } from './view/OperRowListView'; | ||
| 31 | +import { CommentDialogView } from './CommentDialogView'; | ||
| 32 | +import { CustomTitleUI } from 'wdcomponent/ets/components/reusable/CustomTitleUI'; | ||
| 33 | + | ||
| 34 | +const TAG = 'H5NewsWebPageComponent' | ||
| 35 | + | ||
| 36 | +@Component | ||
| 37 | +export struct H5NewsWebPageComponent { | ||
| 38 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | ||
| 39 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 40 | + webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | ||
| 41 | + scroller: Scroller = new Scroller(); | ||
| 42 | + action: Action = {} as Action | ||
| 43 | + @State webUrl: string = ''; | ||
| 44 | + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | ||
| 45 | + @State recommendList: ContentDTO[] = [] | ||
| 46 | + @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | ||
| 47 | + @State interactData: InteractDataDTO = {} as InteractDataDTO | ||
| 48 | + @State isPageEnd: boolean = false | ||
| 49 | + @State publishTime: string = '' | ||
| 50 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 51 | + @State isNetConnected: boolean = true | ||
| 52 | + @State emptyType: number = 1 // 缺省图类型 | ||
| 53 | + @State detailContentEmpty: boolean = false | ||
| 54 | + @State info: Area | null = null | ||
| 55 | + @State likeNum: number = 0 | ||
| 56 | + @State operationButtonList: string[] = [] | ||
| 57 | + @State showComment: boolean = false | ||
| 58 | + @State showCommentList: boolean = false | ||
| 59 | + @State index: number = 0 | ||
| 60 | + @State currentIndex: number = 0 | ||
| 61 | + private navTitle = '人民日报'; | ||
| 62 | + | ||
| 63 | + build() { | ||
| 64 | + Column() { | ||
| 65 | + Blank().height(`${this.topSafeHeight}px`) | ||
| 66 | + //标题栏目 | ||
| 67 | + CustomTitleUI({ titleName: this.navTitle }) | ||
| 68 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 69 | + Column() { | ||
| 70 | + WdWebComponent({ | ||
| 71 | + webviewControl: this.webviewControl, | ||
| 72 | + webUrl: this.webUrl, | ||
| 73 | + isPageEnd: $isPageEnd | ||
| 74 | + }) | ||
| 75 | + } | ||
| 76 | + .width(CommonConstants.FULL_WIDTH) | ||
| 77 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 78 | + .padding({ bottom: 150}) | ||
| 79 | + | ||
| 80 | + //底部交互区 | ||
| 81 | + OperRowListView({ | ||
| 82 | + contentDetailData: this.contentDetailData, | ||
| 83 | + publishCommentModel: this.publishCommentModel, | ||
| 84 | + operationButtonList: this.operationButtonList, | ||
| 85 | + styleType: 1, | ||
| 86 | + onCommentIconClick: () => { | ||
| 87 | + this.showCommentList = true | ||
| 88 | + } | ||
| 89 | + }) | ||
| 90 | + .width(CommonConstants.FULL_WIDTH) | ||
| 91 | + .backgroundColor(Color.White) | ||
| 92 | + .height(150) | ||
| 93 | + | ||
| 94 | + //全部评论 | ||
| 95 | + CommentDialogView({ | ||
| 96 | + index: $index, | ||
| 97 | + currentIndex: $currentIndex, | ||
| 98 | + showCommentList: $showCommentList, | ||
| 99 | + publishCommentModel: $publishCommentModel, | ||
| 100 | + interactData: $interactData, | ||
| 101 | + }).visibility(this.showComment ? Visibility.Visible : Visibility.Hidden) | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + } | ||
| 105 | + .width(CommonConstants.FULL_WIDTH) | ||
| 106 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + private async getDetail() { | ||
| 110 | + this.isNetConnected = NetworkUtil.isNetConnected() | ||
| 111 | + if (!this.isNetConnected) { | ||
| 112 | + this.emptyType = 1 | ||
| 113 | + } | ||
| 114 | + let contentId: string = '' | ||
| 115 | + let relId: string = '' | ||
| 116 | + let relType: string = '' | ||
| 117 | + if (this.action && this.action.params) { | ||
| 118 | + if (this.action.params.contentID) { | ||
| 119 | + contentId = this.action.params.contentID; | ||
| 120 | + } | ||
| 121 | + if (this.action && this.action.params && this.action.params.extra) { | ||
| 122 | + this.navTitle = this.action.params.extra.title | ||
| 123 | + if (this.action.params.extra.relId) { | ||
| 124 | + relId = this.action.params.extra.relId; | ||
| 125 | + } | ||
| 126 | + if (this.action.params.extra.relType) { | ||
| 127 | + relType = this.action.params.extra.relType | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + } | ||
| 131 | + let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) | ||
| 132 | + // 判断内容是否已下线,空数组表示下线 | ||
| 133 | + this.detailContentEmpty = detailBeans.length === 0 ? true : false | ||
| 134 | + if (this.detailContentEmpty) { | ||
| 135 | + this.emptyType = 18 | ||
| 136 | + } | ||
| 137 | + console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0])) | ||
| 138 | + if (detailBeans && detailBeans.length > 0) { | ||
| 139 | + this.contentDetailData = detailBeans[0]; | ||
| 140 | + let dateTime = | ||
| 141 | + DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); | ||
| 142 | + // let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | ||
| 143 | + // this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) | ||
| 144 | + if (this.contentDetailData?.recommendShow === 1) { | ||
| 145 | + this.getRecommend() | ||
| 146 | + } | ||
| 147 | + if (this.contentDetailData?.openLikes === 1) { | ||
| 148 | + console.log(TAG, '点赞this.getInteractDataStatus()') | ||
| 149 | + this.getInteractDataStatus() | ||
| 150 | + this.queryContentInteractCount() | ||
| 151 | + } | ||
| 152 | + if (this.contentDetailData?.openComment) { | ||
| 153 | + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 154 | + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '') | ||
| 155 | + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 156 | + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '') | ||
| 157 | + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '') | ||
| 158 | + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') | ||
| 159 | + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | ||
| 160 | + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | ||
| 161 | + } | ||
| 162 | + if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length && | ||
| 163 | + this.contentDetailData?.audioList[0].audioUrl) { | ||
| 164 | + this.operationButtonList = ['comment', 'collect', 'listen', 'share'] | ||
| 165 | + } else { | ||
| 166 | + this.operationButtonList = ['comment', 'collect', 'share'] | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + private async getRecommend() { | ||
| 173 | + let params: postRecommendListParams = { | ||
| 174 | + imei: HttpUtils.getImei(), | ||
| 175 | + userId: HttpUtils.getUserId(), | ||
| 176 | + contentId: String(this.contentDetailData?.newsId), | ||
| 177 | + recType: 1, | ||
| 178 | + contentType: this.contentDetailData?.newsType, | ||
| 179 | + relId: this.contentDetailData?.reLInfo?.relId, | ||
| 180 | + // channelId: String(this.contentDetailData?.reLInfo?.channelId) | ||
| 181 | + } | ||
| 182 | + let recommendList = await DetailViewModel.postRecommendList(params) | ||
| 183 | + if (recommendList.length > 0) { | ||
| 184 | + //推荐列表过滤音频和活动入口 | ||
| 185 | + this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13'); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + // 已登录->查询用户对作品点赞、收藏状态 | ||
| 191 | + private async getInteractDataStatus() { | ||
| 192 | + try { | ||
| 193 | + const params: batchLikeAndCollectParams = { | ||
| 194 | + contentList: [ | ||
| 195 | + { | ||
| 196 | + contentId: this.contentDetailData?.newsId + '', | ||
| 197 | + contentType: this.contentDetailData?.newsType + '', | ||
| 198 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 199 | + } | ||
| 200 | + ] | ||
| 201 | + } | ||
| 202 | + // console.log(TAG,'contentDetailData', JSON.stringify(params.contentList)) | ||
| 203 | + let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) | ||
| 204 | + console.log(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data)) | ||
| 205 | + this.newsStatusOfUser = data[0]; | ||
| 206 | + // console.log(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`) | ||
| 207 | + } catch (exception) { | ||
| 208 | + console.error(TAG,'exception', JSON.stringify(exception)) | ||
| 209 | + } | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + /** | ||
| 213 | + * 点赞、取消点赞 | ||
| 214 | + */ | ||
| 215 | + toggleLikeStatus() { | ||
| 216 | + // 未登录,跳转登录 | ||
| 217 | + if (!HttpUtils.getUserId()) { | ||
| 218 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 219 | + return | ||
| 220 | + } | ||
| 221 | + const params: postExecuteLikeParams = { | ||
| 222 | + status: this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1', | ||
| 223 | + contentId: this.contentDetailData?.newsId + '', | ||
| 224 | + contentType: this.contentDetailData?.newsType + '', | ||
| 225 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 226 | + } | ||
| 227 | + console.log(TAG, '点赞、取消点赞params', JSON.stringify(params)) | ||
| 228 | + PageRepository.postExecuteLike(params).then(res => { | ||
| 229 | + // console.log(TAG, '点赞、res', JSON.stringify(res)) | ||
| 230 | + console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | ||
| 231 | + if (this.newsStatusOfUser) { | ||
| 232 | + //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 233 | + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | ||
| 234 | + if (this.newsStatusOfUser.likeStatus === '1') { | ||
| 235 | + this.likeNum = Number(this.likeNum) + 1 | ||
| 236 | + } else { | ||
| 237 | + this.likeNum = Number(this.likeNum) - 1 | ||
| 238 | + } | ||
| 239 | + console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) | ||
| 240 | + // this.queryContentInteractCount() | ||
| 241 | + // TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 242 | + } else { | ||
| 243 | + // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 | ||
| 244 | + this.getInteractDataStatus() | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + }) | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + /** | ||
| 251 | + * 查询点赞、收藏数量 | ||
| 252 | + */ | ||
| 253 | + queryContentInteractCount() { | ||
| 254 | + console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) | ||
| 255 | + const params: contentListParams = { | ||
| 256 | + contentList: [{ | ||
| 257 | + contentId: this.contentDetailData?.newsId + '', | ||
| 258 | + contentType: this.contentDetailData?.newsType, | ||
| 259 | + }] | ||
| 260 | + } | ||
| 261 | + PageRepository.getContentInteract(params).then(res => { | ||
| 262 | + console.error(TAG, 'queryContentInteractCount', JSON.stringify(res)) | ||
| 263 | + if (res.data) { | ||
| 264 | + this.interactData = res.data[0] | ||
| 265 | + this.likeNum = Number(res.data[0]?.likeNum) || 0 | ||
| 266 | + } | ||
| 267 | + }) | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + aboutToAppear() { | ||
| 271 | + let action: Action = router.getParams() as Action | ||
| 272 | + if (action) { | ||
| 273 | + this.webUrl = action.params?.url || '' | ||
| 274 | + } | ||
| 275 | + this.getDetail() | ||
| 276 | + | ||
| 277 | + // 登录成功 | ||
| 278 | + EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { | ||
| 279 | + this.getInteractDataStatus() | ||
| 280 | + }) | ||
| 281 | + } | ||
| 282 | +} |
| 1 | +import { Action } from 'wdBean'; | ||
| 2 | +import { H5NewsWebPageComponent } from 'wdComponent' | ||
| 3 | +import router from '@ohos.router'; | ||
| 4 | +import { TrackConstants } from 'wdTracking/Index'; | ||
| 5 | + | ||
| 6 | +const TAG = 'H5NewsWebPage' | ||
| 7 | + | ||
| 8 | +@Entry | ||
| 9 | +@Component | ||
| 10 | +struct H5NewsWebPage { | ||
| 11 | + action: Action = {} as Action | ||
| 12 | + | ||
| 13 | + @Provide pageShow: number = -1 | ||
| 14 | + @Provide pageHide: number = -1 | ||
| 15 | + | ||
| 16 | + @Provide pageName: string = TrackConstants.PageName.Article_Detail | ||
| 17 | + @Provide pageId: string = TrackConstants.PageName.Article_Detail | ||
| 18 | + | ||
| 19 | + build() { | ||
| 20 | + Column() { | ||
| 21 | + H5NewsWebPageComponent({action: this.action}) | ||
| 22 | + } | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + aboutToAppear() { | ||
| 26 | + let action: Action = router.getParams() as Action | ||
| 27 | + this.action = action | ||
| 28 | + } | ||
| 29 | +} |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | "pages/MainPage", | 3 | "pages/MainPage", |
| 4 | "pages/web/DefaultWebPage", | 4 | "pages/web/DefaultWebPage", |
| 5 | "pages/web/H5TipsPage", | 5 | "pages/web/H5TipsPage", |
| 6 | + "pages/web/H5NewsWebPage", | ||
| 6 | "pages/ENewspaper", | 7 | "pages/ENewspaper", |
| 7 | "pages/ImageAndTextDetailPage", | 8 | "pages/ImageAndTextDetailPage", |
| 8 | "pages/MorningEveningPaperPage", | 9 | "pages/MorningEveningPaperPage", |
-
Please register or login to post a comment