Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
13 changed files
with
334 additions
and
85 deletions
| @@ -12,6 +12,7 @@ export class H5CallNativeType { | @@ -12,6 +12,7 @@ export class H5CallNativeType { | ||
| 12 | static jsCall_receiveH5Data = 'jsCall_receiveH5Data' | 12 | static jsCall_receiveH5Data = 'jsCall_receiveH5Data' |
| 13 | static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo' | 13 | static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo' |
| 14 | static jsCall_appNotifyEvent = 'jsCall_appNotifyEvent' | 14 | static jsCall_appNotifyEvent = 'jsCall_appNotifyEvent' |
| 15 | + static jsCall_receiveSubjectData = 'jsCall_receiveSubjectData' | ||
| 15 | 16 | ||
| 16 | // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。 | 17 | // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。 |
| 17 | 18 | ||
| @@ -24,6 +25,7 @@ export class H5CallNativeType { | @@ -24,6 +25,7 @@ export class H5CallNativeType { | ||
| 24 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data) | 25 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data) |
| 25 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo) | 26 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo) |
| 26 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appNotifyEvent) | 27 | H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appNotifyEvent) |
| 28 | + H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveSubjectData) | ||
| 27 | } | 29 | } |
| 28 | } | 30 | } |
| 29 | 31 |
| @@ -17,6 +17,7 @@ export struct WdWebComponent { | @@ -17,6 +17,7 @@ export struct WdWebComponent { | ||
| 17 | @Prop webUrl: string = '' | 17 | @Prop webUrl: string = '' |
| 18 | @Prop @Watch('onReloadStateChanged') reload: number = 0 | 18 | @Prop @Watch('onReloadStateChanged') reload: number = 0 |
| 19 | @Link isPageEnd: boolean | 19 | @Link isPageEnd: boolean |
| 20 | + @State subjectData : string = '' | ||
| 20 | 21 | ||
| 21 | build() { | 22 | build() { |
| 22 | Column() { | 23 | Column() { |
| @@ -48,6 +49,10 @@ export struct WdWebComponent { | @@ -48,6 +49,10 @@ export struct WdWebComponent { | ||
| 48 | this.webviewControl.flushMessageQueue() | 49 | this.webviewControl.flushMessageQueue() |
| 49 | return true | 50 | return true |
| 50 | } | 51 | } |
| 52 | + if (url.includes('__bridge_loaded__')) { | ||
| 53 | + BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 54 | + return true | ||
| 55 | + } | ||
| 51 | return this.onLoadIntercept(event.data.getRequestUrl().toString()); | 56 | return this.onLoadIntercept(event.data.getRequestUrl().toString()); |
| 52 | }) | 57 | }) |
| 53 | } | 58 | } |
| @@ -60,6 +65,7 @@ export struct WdWebComponent { | @@ -60,6 +65,7 @@ export struct WdWebComponent { | ||
| 60 | let handle = (data: Message, f: Callback) => { | 65 | let handle = (data: Message, f: Callback) => { |
| 61 | Logger.debug('registerHandlers handlerName: ' + JSON.stringify(data)) | 66 | Logger.debug('registerHandlers handlerName: ' + JSON.stringify(data)) |
| 62 | this.defaultPerformJSCallNative(data, f) | 67 | this.defaultPerformJSCallNative(data, f) |
| 68 | + this.defaultGetReceiveSubjectData(data, f) | ||
| 63 | }; | 69 | }; |
| 64 | this.webviewControl.registerHandler(handleName, { handle: handle }); | 70 | this.webviewControl.registerHandler(handleName, { handle: handle }); |
| 65 | } | 71 | } |
| @@ -71,13 +77,21 @@ export struct WdWebComponent { | @@ -71,13 +77,21 @@ export struct WdWebComponent { | ||
| 71 | private defaultPerformJSCallNative: (data: Message, f: Callback) => void = (data: Message, f: Callback) => { | 77 | private defaultPerformJSCallNative: (data: Message, f: Callback) => void = (data: Message, f: Callback) => { |
| 72 | performJSCallNative(data, f) | 78 | performJSCallNative(data, f) |
| 73 | } | 79 | } |
| 80 | + | ||
| 81 | + /** | ||
| 82 | + */ | ||
| 83 | + private defaultGetReceiveSubjectData: (data: Message, f: Callback) => void = (data: Message, f: Callback) => { | ||
| 84 | + if(data.handlerName === H5CallNativeType.jsCall_receiveSubjectData){ | ||
| 85 | + f('') | ||
| 86 | + } | ||
| 87 | + } | ||
| 74 | onPageBegin: (url?: string) => void = () => { | 88 | onPageBegin: (url?: string) => void = () => { |
| 75 | Logger.debug(TAG, 'onPageBegin'); | 89 | Logger.debug(TAG, 'onPageBegin'); |
| 76 | this.registerHandlers(); | 90 | this.registerHandlers(); |
| 77 | //有时序问题 必须延时执行 | 91 | //有时序问题 必须延时执行 |
| 78 | - setTimeout(() => { | ||
| 79 | - BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 80 | - }, 200) | 92 | + // setTimeout(() => { |
| 93 | + // BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | ||
| 94 | + // }, 200) | ||
| 81 | } | 95 | } |
| 82 | onPageEnd: (url?: string) => void = () => { | 96 | onPageEnd: (url?: string) => void = () => { |
| 83 | Logger.debug(TAG, 'onPageEnd'); | 97 | Logger.debug(TAG, 'onPageEnd'); |
| @@ -9,7 +9,7 @@ import font from '@ohos.font'; | @@ -9,7 +9,7 @@ import font from '@ohos.font'; | ||
| 9 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | 9 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; |
| 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; | 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; |
| 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 12 | -import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; | 12 | +import { Logger, ToastUtils, NetworkUtil, CustomToast } from 'wdKit/Index'; |
| 13 | import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; | 13 | import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; |
| 14 | import { WDShare } from 'wdShare/Index'; | 14 | import { WDShare } from 'wdShare/Index'; |
| 15 | import { window } from '@kit.ArkUI'; | 15 | import { window } from '@kit.ArkUI'; |
| @@ -36,6 +36,25 @@ export struct ENewspaperPageComponent { | @@ -36,6 +36,25 @@ export struct ENewspaperPageComponent { | ||
| 36 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 36 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 37 | @State ratio: string = '100%' | 37 | @State ratio: string = '100%' |
| 38 | 38 | ||
| 39 | + @State toastText:ResourceStr = "" | ||
| 40 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 41 | + builder: CustomToast({ | ||
| 42 | + bgColor:$r("app.color.color_B3000000"), | ||
| 43 | + opacityValue:1, | ||
| 44 | + fontSizeValue:"25lpx", | ||
| 45 | + lineHeightValue:"36lpx", | ||
| 46 | + msg: this.toastText, | ||
| 47 | + }), | ||
| 48 | + autoCancel: false, | ||
| 49 | + alignment: DialogAlignment.Center, | ||
| 50 | + customStyle: true, | ||
| 51 | + maskColor:"#00000000" | ||
| 52 | + }) | ||
| 53 | + | ||
| 54 | + showToastTip(msg:ResourceStr){ | ||
| 55 | + this.toastText = msg | ||
| 56 | + this.dialogToast.open() | ||
| 57 | + } | ||
| 39 | //watch监听报纸页码回调 | 58 | //watch监听报纸页码回调 |
| 40 | onCurrentPageNumUpdated(): void { | 59 | onCurrentPageNumUpdated(): void { |
| 41 | console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | 60 | console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) |
| @@ -323,7 +342,7 @@ export struct ENewspaperPageComponent { | @@ -323,7 +342,7 @@ export struct ENewspaperPageComponent { | ||
| 323 | .id('e_newspaper_page_num') | 342 | .id('e_newspaper_page_num') |
| 324 | .onClick((event: ClickEvent) => { | 343 | .onClick((event: ClickEvent) => { |
| 325 | if(!NetworkUtil.isNetConnected()){ | 344 | if(!NetworkUtil.isNetConnected()){ |
| 326 | - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 345 | + this.showToastTip('网络出小差了,请检查网络后重试') |
| 327 | return | 346 | return |
| 328 | } | 347 | } |
| 329 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 348 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| @@ -334,7 +353,7 @@ export struct ENewspaperPageComponent { | @@ -334,7 +353,7 @@ export struct ENewspaperPageComponent { | ||
| 334 | this.pageDialogController.close() | 353 | this.pageDialogController.close() |
| 335 | } | 354 | } |
| 336 | }else { | 355 | }else { |
| 337 | - ToastUtils.showToast('暂无数据', 1000) | 356 | + this.showToastTip('暂无数据') |
| 338 | } | 357 | } |
| 339 | }) | 358 | }) |
| 340 | 359 | ||
| @@ -362,7 +381,7 @@ export struct ENewspaperPageComponent { | @@ -362,7 +381,7 @@ export struct ENewspaperPageComponent { | ||
| 362 | .id('e_newspaper_read') | 381 | .id('e_newspaper_read') |
| 363 | .onClick((event: ClickEvent) => { | 382 | .onClick((event: ClickEvent) => { |
| 364 | if(!NetworkUtil.isNetConnected()){ | 383 | if(!NetworkUtil.isNetConnected()){ |
| 365 | - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 384 | + this.showToastTip('网络出小差了,请检查网络后重试') |
| 366 | return | 385 | return |
| 367 | } | 386 | } |
| 368 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 387 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| @@ -376,7 +395,7 @@ export struct ENewspaperPageComponent { | @@ -376,7 +395,7 @@ export struct ENewspaperPageComponent { | ||
| 376 | 'currentNumber':this.swiperIndex, | 395 | 'currentNumber':this.swiperIndex, |
| 377 | }) | 396 | }) |
| 378 | }else { | 397 | }else { |
| 379 | - ToastUtils.showToast('暂无数据', 1000) | 398 | + this.showToastTip('暂无数据') |
| 380 | } | 399 | } |
| 381 | }) | 400 | }) |
| 382 | } | 401 | } |
| @@ -414,7 +433,7 @@ export struct ENewspaperPageComponent { | @@ -414,7 +433,7 @@ export struct ENewspaperPageComponent { | ||
| 414 | let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) | 433 | let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) |
| 415 | this.newspaperListBean = listBean; | 434 | this.newspaperListBean = listBean; |
| 416 | } else { | 435 | } else { |
| 417 | - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 436 | + this.showToastTip('网络出小差了,请检查网络后重试') |
| 418 | } | 437 | } |
| 419 | } catch (exception) { | 438 | } catch (exception) { |
| 420 | 439 |
| @@ -22,6 +22,7 @@ export struct SpacialTopicPageComponent { | @@ -22,6 +22,7 @@ export struct SpacialTopicPageComponent { | ||
| 22 | scroller: Scroller = new Scroller(); | 22 | scroller: Scroller = new Scroller(); |
| 23 | action: Action = {} as Action | 23 | action: Action = {} as Action |
| 24 | @State webUrl: string = ''; | 24 | @State webUrl: string = ''; |
| 25 | + @State subjectData: string = ''; | ||
| 25 | @State isPageEnd: boolean = false | 26 | @State isPageEnd: boolean = false |
| 26 | @Prop reload: number = 0; | 27 | @Prop reload: number = 0; |
| 27 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 28 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| @@ -57,6 +58,36 @@ export struct SpacialTopicPageComponent { | @@ -57,6 +58,36 @@ export struct SpacialTopicPageComponent { | ||
| 57 | let context = getContext(this) as common.UIAbilityContext; | 58 | let context = getContext(this) as common.UIAbilityContext; |
| 58 | viewBlogItemInsightIntentShare(context,this.contentDetailData) | 59 | viewBlogItemInsightIntentShare(context,this.contentDetailData) |
| 59 | } | 60 | } |
| 61 | + async getWebviewPageData (){ | ||
| 62 | + let pageId = this.action.params?.extra?.pageId | ||
| 63 | + let relId: string = '' | ||
| 64 | + let relType: string = '' | ||
| 65 | + let contentId: string = '' | ||
| 66 | + if (this.action && this.action.params) { | ||
| 67 | + if (this.action.params.contentID) { | ||
| 68 | + contentId = this.action.params.contentID; | ||
| 69 | + } | ||
| 70 | + if (this.action && this.action.params && this.action.params.extra) { | ||
| 71 | + if (this.action.params.extra.relId) { | ||
| 72 | + relId = this.action.params.extra.relId; | ||
| 73 | + } | ||
| 74 | + if (this.action.params.extra.relType) { | ||
| 75 | + relType = this.action.params.extra.relType | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + if(pageId){ | ||
| 80 | + // let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId) | ||
| 81 | + // let pageCompInfoMsg = await PageRepository.fetchMorningEveningCompInfo(Number(pageId), groupId, refreshTime, topicId, 1, 20) | ||
| 82 | + // let res = { | ||
| 83 | + // dataJson: { | ||
| 84 | + // pageInfoResponseMap: pageInfoMsg, | ||
| 85 | + // compInfoResponseMap: pageCompInfoMsg, | ||
| 86 | + // }, | ||
| 87 | + // } | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + | ||
| 60 | 91 | ||
| 61 | private async getDetail() { | 92 | private async getDetail() { |
| 62 | this.isNetConnected = NetworkUtil.isNetConnected() | 93 | this.isNetConnected = NetworkUtil.isNetConnected() |
| @@ -93,12 +124,17 @@ export struct SpacialTopicPageComponent { | @@ -93,12 +124,17 @@ export struct SpacialTopicPageComponent { | ||
| 93 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | 124 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') |
| 94 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 125 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') |
| 95 | // } | 126 | // } |
| 96 | - this.trySendData2H5() | 127 | + this.subjectData = 'dasdasdadas' |
| 128 | + | ||
| 129 | + //TODO | ||
| 130 | + // this.trySendData2H5() | ||
| 97 | } | 131 | } |
| 98 | if(pageInfoMsg && pageInfoMsg.data){ | 132 | if(pageInfoMsg && pageInfoMsg.data){ |
| 99 | this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag) | 133 | this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag) |
| 100 | this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag) | 134 | this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag) |
| 101 | } | 135 | } |
| 136 | + | ||
| 137 | + console.log('contentDetailData',this.contentDetailData) | ||
| 102 | } | 138 | } |
| 103 | } | 139 | } |
| 104 | } | 140 | } |
| @@ -115,14 +151,16 @@ export struct SpacialTopicPageComponent { | @@ -115,14 +151,16 @@ export struct SpacialTopicPageComponent { | ||
| 115 | .textAlign(TextAlign.Center) | 151 | .textAlign(TextAlign.Center) |
| 116 | .fontWeight(500) | 152 | .fontWeight(500) |
| 117 | .visibility(this.action?.params?.backVisibility && this.isPageEnd ? Visibility.Visible : Visibility.None) | 153 | .visibility(this.action?.params?.backVisibility && this.isPageEnd ? Visibility.Visible : Visibility.None) |
| 118 | - | ||
| 119 | - WdWebComponent({ | ||
| 120 | - webviewControl: this.webviewControl, | ||
| 121 | - webUrl: this.webUrl, | ||
| 122 | - reload: this.reload, | ||
| 123 | - onWebPrepared: this.onWebPrepared.bind(this), | ||
| 124 | - isPageEnd: $isPageEnd, | ||
| 125 | - }) | 154 | + if(this.subjectData.length > 0){ |
| 155 | + WdWebComponent({ | ||
| 156 | + webviewControl: this.webviewControl, | ||
| 157 | + webUrl: this.webUrl, | ||
| 158 | + reload: this.reload, | ||
| 159 | + onWebPrepared: this.onWebPrepared.bind(this), | ||
| 160 | + isPageEnd: $isPageEnd, | ||
| 161 | + subjectData: this.subjectData | ||
| 162 | + }) | ||
| 163 | + } | ||
| 126 | } | 164 | } |
| 127 | .width(CommonConstants.FULL_WIDTH) | 165 | .width(CommonConstants.FULL_WIDTH) |
| 128 | .height(CommonConstants.FULL_HEIGHT) | 166 | .height(CommonConstants.FULL_HEIGHT) |
| @@ -219,7 +219,8 @@ struct createImg { | @@ -219,7 +219,8 @@ struct createImg { | ||
| 219 | }) { | 219 | }) { |
| 220 | Image(this.loadImg ? item.fullUrl : '') | 220 | Image(this.loadImg ? item.fullUrl : '') |
| 221 | .backgroundColor(0xf5f5f5) | 221 | .backgroundColor(0xf5f5f5) |
| 222 | - .width('100%') | 222 | + .width(113) |
| 223 | + .height(113) | ||
| 223 | .autoResize(true) | 224 | .autoResize(true) |
| 224 | .borderRadius(this.caclImageRadius(index)) | 225 | .borderRadius(this.caclImageRadius(index)) |
| 225 | .opacity(!item.weight && !item.height ? 0 : 1) | 226 | .opacity(!item.weight && !item.height ? 0 : 1) |
| @@ -233,6 +234,8 @@ struct createImg { | @@ -233,6 +234,8 @@ struct createImg { | ||
| 233 | Image(this.loadImg ? item.fullUrl : '') | 234 | Image(this.loadImg ? item.fullUrl : '') |
| 234 | .backgroundColor(0xf5f5f5) | 235 | .backgroundColor(0xf5f5f5) |
| 235 | .aspectRatio(1) | 236 | .aspectRatio(1) |
| 237 | + .width(113) | ||
| 238 | + .height(113) | ||
| 236 | .borderRadius(this.caclImageRadius(index)) | 239 | .borderRadius(this.caclImageRadius(index)) |
| 237 | if(this.getPicType(item.weight, item.height) !== 3){ | 240 | if(this.getPicType(item.weight, item.height) !== 3){ |
| 238 | Flex({ direction: FlexDirection.Row }) { | 241 | Flex({ direction: FlexDirection.Row }) { |
| @@ -88,7 +88,7 @@ export struct Card6Component { | @@ -88,7 +88,7 @@ export struct Card6Component { | ||
| 88 | .fontSize(18) | 88 | .fontSize(18) |
| 89 | .lineHeight(27) | 89 | .lineHeight(27) |
| 90 | .fontWeight(FontWeight.Normal) | 90 | .fontWeight(FontWeight.Normal) |
| 91 | - .maxLines(2) | 91 | + .maxLines(this.contentDTO.appStyle === '6' ? 5 : 2) |
| 92 | .alignSelf(ItemAlign.Start) | 92 | .alignSelf(ItemAlign.Start) |
| 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| @@ -54,8 +54,7 @@ export struct ZhSingleRow02 { | @@ -54,8 +54,7 @@ export struct ZhSingleRow02 { | ||
| 54 | 54 | ||
| 55 | resetEdgeAnimation() { | 55 | resetEdgeAnimation() { |
| 56 | if (this.moreWidth > this.initMoreWidth) { | 56 | if (this.moreWidth > this.initMoreWidth) { |
| 57 | - this.moreWidth = this.moreWidth - 1 | ||
| 58 | - this.resetEdgeAnimation(); | 57 | + this.moreWidth = 16 |
| 59 | } | 58 | } |
| 60 | this.resetMoreTips() | 59 | this.resetMoreTips() |
| 61 | } | 60 | } |
| @@ -91,21 +90,30 @@ export struct ZhSingleRow02 { | @@ -91,21 +90,30 @@ export struct ZhSingleRow02 { | ||
| 91 | .margin({ right: 8 }) | 90 | .margin({ right: 8 }) |
| 92 | }) | 91 | }) |
| 93 | } | 92 | } |
| 94 | - if (this.compDTO.operDataList.length >= 2) { | ||
| 95 | - Column() { | ||
| 96 | - if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 97 | - Text(this.moreTips) | ||
| 98 | - .fontSize(8) | ||
| 99 | - .fontColor(0x858585) | ||
| 100 | - .width(8) | 93 | + if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { |
| 94 | + Row() { | ||
| 95 | + Ellipse() | ||
| 96 | + .width(2* (this.moreWidth - this.initMoreWidth - 1)) | ||
| 97 | + .height('100%') | ||
| 98 | + .fill(0xe9e9e9) | ||
| 99 | + .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 , top: 0 }) | ||
| 100 | + | ||
| 101 | + Column() { | ||
| 102 | + if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 103 | + Text(this.moreTips) | ||
| 104 | + .fontSize(8) | ||
| 105 | + .fontColor(0x858585) | ||
| 106 | + .width(8) | ||
| 107 | + } | ||
| 101 | } | 108 | } |
| 109 | + .justifyContent(FlexAlign.Center) | ||
| 110 | + .align(Alignment.Center) | ||
| 111 | + .height('100%') | ||
| 112 | + .width(this.initMoreWidth) | ||
| 113 | + .backgroundColor(0xe9e9e9) | ||
| 114 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 102 | } | 115 | } |
| 103 | - .justifyContent(FlexAlign.Center) | ||
| 104 | - .align(Alignment.Center) | ||
| 105 | - .height('100%') | ||
| 106 | - .width(this.moreWidth) | ||
| 107 | - .backgroundColor(0xe9e9e9) | ||
| 108 | - .borderRadius({ topLeft: 5, bottomLeft: 5 }) | 116 | + .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)}) |
| 109 | } | 117 | } |
| 110 | } | 118 | } |
| 111 | } | 119 | } |
| @@ -78,8 +78,7 @@ export struct ZhSingleRow03 { | @@ -78,8 +78,7 @@ export struct ZhSingleRow03 { | ||
| 78 | 78 | ||
| 79 | resetEdgeAnimation() { | 79 | resetEdgeAnimation() { |
| 80 | if (this.moreWidth > this.initMoreWidth) { | 80 | if (this.moreWidth > this.initMoreWidth) { |
| 81 | - this.moreWidth = this.moreWidth - 1 | ||
| 82 | - this.resetEdgeAnimation(); | 81 | + this.moreWidth = 16 |
| 83 | } | 82 | } |
| 84 | this.resetMoreTips() | 83 | this.resetMoreTips() |
| 85 | } | 84 | } |
| @@ -166,21 +165,30 @@ export struct ZhSingleRow03 { | @@ -166,21 +165,30 @@ export struct ZhSingleRow03 { | ||
| 166 | this.ItemCard(item) | 165 | this.ItemCard(item) |
| 167 | }) | 166 | }) |
| 168 | } | 167 | } |
| 169 | - if (this.compDTO.operDataList.length >= 2) { | ||
| 170 | - Column() { | ||
| 171 | - if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 172 | - Text(this.moreTips) | ||
| 173 | - .fontSize(8) | ||
| 174 | - .fontColor(0x858585) | ||
| 175 | - .width(8) | 168 | + if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { |
| 169 | + Row() { | ||
| 170 | + Ellipse() | ||
| 171 | + .width(2* (this.moreWidth - this.initMoreWidth - 1)) | ||
| 172 | + .height(116) | ||
| 173 | + .fill(0xf9f9f9) | ||
| 174 | + .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 , top: 0 }) | ||
| 175 | + | ||
| 176 | + Column() { | ||
| 177 | + if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 178 | + Text(this.moreTips) | ||
| 179 | + .fontSize(8) | ||
| 180 | + .fontColor(0x858585) | ||
| 181 | + .width(8) | ||
| 182 | + } | ||
| 176 | } | 183 | } |
| 184 | + .justifyContent(FlexAlign.Center) | ||
| 185 | + .align(Alignment.Center) | ||
| 186 | + .height(116) | ||
| 187 | + .width(this.initMoreWidth) | ||
| 188 | + .backgroundColor(0xf9f9f9) | ||
| 189 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 177 | } | 190 | } |
| 178 | - .justifyContent(FlexAlign.Center) | ||
| 179 | - .align(Alignment.Center) | ||
| 180 | - .width(this.moreWidth) | ||
| 181 | - .backgroundColor(0xf9f9f9) | ||
| 182 | - .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 183 | - .height(116) | 191 | + .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)}) |
| 184 | } | 192 | } |
| 185 | } | 193 | } |
| 186 | } | 194 | } |
| @@ -393,18 +401,20 @@ export struct ZhSingleRow03 { | @@ -393,18 +401,20 @@ export struct ZhSingleRow03 { | ||
| 393 | .fontWeight(600) | 401 | .fontWeight(600) |
| 394 | } | 402 | } |
| 395 | 403 | ||
| 396 | - Row() { | ||
| 397 | - Text("更多") | ||
| 398 | - .fontSize($r("app.float.font_size_14")) | ||
| 399 | - .fontColor($r("app.color.color_999999")) | ||
| 400 | - .margin({ right: 1 }) | ||
| 401 | - Image($r("app.media.more")) | ||
| 402 | - .width(14) | ||
| 403 | - .height(14) | 404 | + if (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '') { |
| 405 | + Row() { | ||
| 406 | + Text("更多") | ||
| 407 | + .fontSize($r("app.float.font_size_14")) | ||
| 408 | + .fontColor($r("app.color.color_999999")) | ||
| 409 | + .margin({ right: 1 }) | ||
| 410 | + Image($r("app.media.more")) | ||
| 411 | + .width(14) | ||
| 412 | + .height(14) | ||
| 413 | + } | ||
| 414 | + .onClick(() => { | ||
| 415 | + this.jumpToMore(); | ||
| 416 | + }) | ||
| 404 | } | 417 | } |
| 405 | - .onClick(() => { | ||
| 406 | - this.jumpToMore(); | ||
| 407 | - }) | ||
| 408 | } | 418 | } |
| 409 | .justifyContent(FlexAlign.SpaceBetween) | 419 | .justifyContent(FlexAlign.SpaceBetween) |
| 410 | .margin({ top: 8, bottom: 8 }) | 420 | .margin({ top: 8, bottom: 8 }) |
| @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter' | @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter' | ||
| 14 | import { LazyDataSource } from 'wdKit/Index'; | 14 | import { LazyDataSource } from 'wdKit/Index'; |
| 15 | import LoadMoreLayout from '../page/LoadMoreLayout' | 15 | import LoadMoreLayout from '../page/LoadMoreLayout' |
| 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 17 | +import { TrackConstants, Tracking, TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; | ||
| 17 | 18 | ||
| 18 | const TAG: string = 'ReserveMorePage'; | 19 | const TAG: string = 'ReserveMorePage'; |
| 19 | 20 | ||
| @@ -47,6 +48,9 @@ struct ReserveMorePage { | @@ -47,6 +48,9 @@ struct ReserveMorePage { | ||
| 47 | @State private liveId: string = '' | 48 | @State private liveId: string = '' |
| 48 | @State isLoadingAttention: boolean = false | 49 | @State isLoadingAttention: boolean = false |
| 49 | @State loadImg: boolean = false; | 50 | @State loadImg: boolean = false; |
| 51 | + private pageId: string = TrackConstants.PageName.Live_Appointment_List | ||
| 52 | + private pageName: string = TrackConstants.PageName.Live_Appointment_List | ||
| 53 | + private pageShowStartTime: number = 0 | ||
| 50 | 54 | ||
| 51 | build() { | 55 | build() { |
| 52 | Column() { | 56 | Column() { |
| @@ -249,8 +253,24 @@ struct ReserveMorePage { | @@ -249,8 +253,24 @@ struct ReserveMorePage { | ||
| 249 | top: index == 0 ? '12vp' : '8vp' | 253 | top: index == 0 ? '12vp' : '8vp' |
| 250 | }) | 254 | }) |
| 251 | .onClick(() => { | 255 | .onClick(() => { |
| 256 | + | ||
| 257 | + // 内容点击埋点 | ||
| 258 | + TrackingContent.common(TrackConstants.EventType.Click, | ||
| 259 | + item.pageId, | ||
| 260 | + item.pageId, | ||
| 261 | + TrackParamConvert.program(item)) | ||
| 262 | + | ||
| 252 | ProcessUtils.processPage(item) | 263 | ProcessUtils.processPage(item) |
| 253 | }) | 264 | }) |
| 265 | + .onVisibleAreaChange([0, 1], (isVisiable: boolean, ratio: number) => { | ||
| 266 | + if (isVisiable) { | ||
| 267 | + // 内容曝光埋点 | ||
| 268 | + TrackingContent.common(TrackConstants.EventType.Show, | ||
| 269 | + item.pageId, | ||
| 270 | + item.pageId, | ||
| 271 | + TrackParamConvert.program(item)) | ||
| 272 | + } | ||
| 273 | + }) | ||
| 254 | } | 274 | } |
| 255 | 275 | ||
| 256 | /*导航栏*/ | 276 | /*导航栏*/ |
| @@ -358,12 +378,18 @@ struct ReserveMorePage { | @@ -358,12 +378,18 @@ struct ReserveMorePage { | ||
| 358 | } | 378 | } |
| 359 | 379 | ||
| 360 | onPageShow(): void { | 380 | onPageShow(): void { |
| 381 | + this.pageShowStartTime = Date.now() | ||
| 361 | if (this.isShow) { | 382 | if (this.isShow) { |
| 362 | this.data.reloadData() | 383 | this.data.reloadData() |
| 363 | this.isShow = false | 384 | this.isShow = false |
| 364 | } | 385 | } |
| 365 | } | 386 | } |
| 366 | 387 | ||
| 388 | + onPageHide(): void { | ||
| 389 | + const duration = Date.now() - this.pageShowStartTime | ||
| 390 | + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageId, this.pageName, duration) | ||
| 391 | + } | ||
| 392 | + | ||
| 367 | private async getData(resolve?: (value: string | PromiseLike<string>) => void) { | 393 | private async getData(resolve?: (value: string | PromiseLike<string>) => void) { |
| 368 | if (this.isLoading) { | 394 | if (this.isLoading) { |
| 369 | if (resolve) { | 395 | if (resolve) { |
| @@ -386,6 +412,8 @@ struct ReserveMorePage { | @@ -386,6 +412,8 @@ struct ReserveMorePage { | ||
| 386 | this.reserveList = [] | 412 | this.reserveList = [] |
| 387 | this.reservedIds = [] | 413 | this.reservedIds = [] |
| 388 | } | 414 | } |
| 415 | + | ||
| 416 | + liveReviewDTO.list.forEach((content) => { content.pageId = this.pageId }) | ||
| 389 | this.data.push(...liveReviewDTO.list) | 417 | this.data.push(...liveReviewDTO.list) |
| 390 | //批量查询关注状态 | 418 | //批量查询关注状态 |
| 391 | this.getAppointmentInfo(liveReviewDTO.list) | 419 | this.getAppointmentInfo(liveReviewDTO.list) |
| @@ -488,6 +516,11 @@ struct ReserveMorePage { | @@ -488,6 +516,11 @@ struct ReserveMorePage { | ||
| 488 | this.isLoadingAttention = true | 516 | this.isLoadingAttention = true |
| 489 | this.liveId = reserveItem.liveId.toString() | 517 | this.liveId = reserveItem.liveId.toString() |
| 490 | try { | 518 | try { |
| 519 | + | ||
| 520 | + // 埋点 | ||
| 521 | + Tracking.event(!reserveItem.subscribe ? "live_subscribe_click":"cancel_live_subscribe_click", | ||
| 522 | + TrackParamConvert.program(item)) | ||
| 523 | + | ||
| 491 | const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(), | 524 | const res = await LiveModel.liveAppointment(reserveItem.relationId, reserveItem.liveId.toString(), |
| 492 | !reserveItem.subscribe); | 525 | !reserveItem.subscribe); |
| 493 | if (res.code == 0) { | 526 | if (res.code == 0) { |
| @@ -43,8 +43,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -43,8 +43,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 43 | 43 | ||
| 44 | resetEdgeAnimation() { | 44 | resetEdgeAnimation() { |
| 45 | if (this.moreWidth > this.initMoreWidth) { | 45 | if (this.moreWidth > this.initMoreWidth) { |
| 46 | - this.moreWidth = this.moreWidth - 1 | ||
| 47 | - this.resetEdgeAnimation(); | 46 | + this.moreWidth = 16 |
| 48 | } | 47 | } |
| 49 | this.resetMoreTips() | 48 | this.resetMoreTips() |
| 50 | } | 49 | } |
| @@ -141,21 +140,31 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -141,21 +140,31 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 141 | }) | 140 | }) |
| 142 | }) | 141 | }) |
| 143 | } | 142 | } |
| 144 | - if (this.compDTO.operDataList.length > 2) { | ||
| 145 | - Column() { | ||
| 146 | - if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 147 | - Text(this.moreTips) | ||
| 148 | - .fontSize(8) | ||
| 149 | - .fontColor(0x858585) | ||
| 150 | - .width(8) | 143 | + |
| 144 | + if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | ||
| 145 | + Row() { | ||
| 146 | + Ellipse() | ||
| 147 | + .width(2* (this.moreWidth - this.initMoreWidth - 1)) | ||
| 148 | + .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | ||
| 149 | + .fill(0xf1f3f4) | ||
| 150 | + .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 }) | ||
| 151 | + | ||
| 152 | + Column() { | ||
| 153 | + if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 154 | + Text(this.moreTips) | ||
| 155 | + .fontSize(8) | ||
| 156 | + .fontColor(0x858585) | ||
| 157 | + .width(8) | ||
| 158 | + } | ||
| 151 | } | 159 | } |
| 160 | + .justifyContent(FlexAlign.Center) | ||
| 161 | + .align(Alignment.Center) | ||
| 162 | + .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | ||
| 163 | + .width(this.initMoreWidth) | ||
| 164 | + .backgroundColor(0xf1f3f4) | ||
| 165 | + .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 152 | } | 166 | } |
| 153 | - .justifyContent(FlexAlign.Center) | ||
| 154 | - .align(Alignment.Center) | ||
| 155 | - .width(this.moreWidth) | ||
| 156 | - .backgroundColor(0xf1f3f4) | ||
| 157 | - .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 158 | - .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | 167 | + .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)}) |
| 159 | } | 168 | } |
| 160 | } | 169 | } |
| 161 | } | 170 | } |
| @@ -135,6 +135,9 @@ export namespace TrackConstants { | @@ -135,6 +135,9 @@ export namespace TrackConstants { | ||
| 135 | /// 我的预约 | 135 | /// 我的预约 |
| 136 | My_Saved_Live = "mySavedLivePage", | 136 | My_Saved_Live = "mySavedLivePage", |
| 137 | 137 | ||
| 138 | + /// 直播预约更多列表 | ||
| 139 | + Live_Appointment_List = "liveSubscribeListPage", | ||
| 140 | + | ||
| 138 | /// 兴趣选择 | 141 | /// 兴趣选择 |
| 139 | Preference_Selection = "preferenceSelectionPage", | 142 | Preference_Selection = "preferenceSelectionPage", |
| 140 | /// 升级页面 | 143 | /// 升级页面 |
| 1 | import { CompInfoBean, ContentDetailDTO, ContentDTO, PageInfoBean, PageInfoDTO } from 'wdBean/Index'; | 1 | import { CompInfoBean, ContentDetailDTO, ContentDTO, PageInfoBean, PageInfoDTO } from 'wdBean/Index'; |
| 2 | +import { StringUtils } from 'wdKit/Index'; | ||
| 2 | import { ParamType } from './PublicParams'; | 3 | import { ParamType } from './PublicParams'; |
| 3 | import { TrackConstants } from './TrackConstants'; | 4 | import { TrackConstants } from './TrackConstants'; |
| 4 | import { TrackingUtils } from './TrackingUtils'; | 5 | import { TrackingUtils } from './TrackingUtils'; |
| @@ -22,17 +23,40 @@ export class TrackParamConvert { | @@ -22,17 +23,40 @@ export class TrackParamConvert { | ||
| 22 | 23 | ||
| 23 | static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType { | 24 | static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType { |
| 24 | let params = TrackingUtils.generateParams() | 25 | let params = TrackingUtils.generateParams() |
| 26 | + | ||
| 27 | + //TODO: 转换参数 | ||
| 28 | + if (pageInfo) { | ||
| 29 | + params["pageName"] = pageInfo.name | ||
| 30 | + params["pageId"] = pageInfo.id + '' | ||
| 31 | + TrackParamConvert.appendRecommendPageInfo(pageInfo, params) | ||
| 32 | + } | ||
| 33 | + | ||
| 25 | if (program) { | 34 | if (program) { |
| 35 | + | ||
| 26 | params["contentType"] = program.objectType | 36 | params["contentType"] = program.objectType |
| 27 | params["contentId"] = program.objectId | 37 | params["contentId"] = program.objectId |
| 28 | params["contentName"] = program.newsTitle | 38 | params["contentName"] = program.newsTitle |
| 29 | params["channelSourceId"] = program.channelId | 39 | params["channelSourceId"] = program.channelId |
| 30 | params["rmhPlatform"] = program.rmhPlatform | 40 | params["rmhPlatform"] = program.rmhPlatform |
| 31 | 41 | ||
| 32 | - TrackParamConvert.appendRecommend(program, params) | ||
| 33 | - } | ||
| 34 | - //TODO: 转换参数 | 42 | + if (program.liveInfo) { |
| 43 | + params["liveType"] = program.liveInfo.liveState | ||
| 44 | + params["liveStreamType"] = ((program.liveInfo.vrType + '') == "1") ? "2" : "1" | ||
| 45 | + params["vliveId"] = program.objectId | ||
| 46 | + params["vliveName"] = program.newsTitle | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + if (!StringUtils.isEmpty(program.linkUrl)) { | ||
| 50 | + params["linkUrl"] = program.linkUrl | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + if (program.rmhInfo && program.rmhInfo.rmhId) { | ||
| 54 | + params["saAuthorId"] = program.rmhInfo.rmhId || "" | ||
| 55 | + params["saAuthorName"] = program.rmhInfo.rmhName || "" | ||
| 56 | + } | ||
| 35 | 57 | ||
| 58 | + TrackParamConvert.appendRecommendProgram(program, params) | ||
| 59 | + } | ||
| 36 | return params | 60 | return params |
| 37 | } | 61 | } |
| 38 | 62 | ||
| @@ -79,10 +103,68 @@ export class TrackParamConvert { | @@ -79,10 +103,68 @@ export class TrackParamConvert { | ||
| 79 | return param | 103 | return param |
| 80 | } | 104 | } |
| 81 | 105 | ||
| 82 | - private static appendRecommend(detail: object, to: ParamType) { | ||
| 83 | - | 106 | + private static appendRecommend(detail: ContentDetailDTO, to: ParamType) { |
| 84 | //TODO: ContentDetailDTO 增加推荐字段 | 107 | //TODO: ContentDetailDTO 增加推荐字段 |
| 85 | 108 | ||
| 109 | + to["sceneId"] = !StringUtils.isEmpty(detail.sceneId) ? detail.sceneId : "9999" | ||
| 110 | + to["subSceneId"] = !StringUtils.isEmpty(detail.subSceneId) ? detail.subSceneId : "" | ||
| 111 | + //to["cnsTraceId"] = !StringUtils.isEmpty(detail.cnsTraceId) ? detail.cnsTraceId : "selfHold" | ||
| 112 | + to["cnsTraceId"] = "selfHold" | ||
| 113 | + to["itemId"] = !StringUtils.isEmpty(detail.itemId) ? detail.itemId : "" | ||
| 114 | + // to["expIds"] = !StringUtils.isEmpty(detail.expIds) ? detail.expIds : "" | ||
| 115 | + to["expIds"] = "" | ||
| 116 | + | ||
| 117 | + /// 这里填写默认值,后续在分享处 再重写 | ||
| 118 | + to["shareChannel"] = "" | ||
| 119 | + /// 这里填写默认值,后续在action=browse时,再重写 | ||
| 120 | + to["duration"] = 0 | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + private static appendRecommendProgram(program: ContentDTO, to: ParamType) { | ||
| 124 | + | ||
| 125 | + to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999" | ||
| 126 | + to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 127 | + to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold" | ||
| 128 | + to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 129 | + to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 130 | + | ||
| 131 | + /// 这里填写默认值,后续在分享处 再重写 | ||
| 132 | + to["shareChannel"] = "" | ||
| 133 | + /// 这里填写默认值,后续在action=browse时,再重写 | ||
| 134 | + to["duration"] = 0 | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + private static appendRecommendCompInfo(program: CompInfoBean, to: ParamType) { | ||
| 138 | + | ||
| 139 | + // TODO: | ||
| 140 | + // to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999" | ||
| 141 | + // to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 142 | + // to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold" | ||
| 143 | + // to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 144 | + // to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 145 | + | ||
| 146 | + /// 这里填写默认值,后续在分享处 再重写 | ||
| 147 | + to["shareChannel"] = "" | ||
| 148 | + /// 这里填写默认值,后续在action=browse时,再重写 | ||
| 149 | + to["duration"] = 0 | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + private static appendRecommendPageInfo(program: PageInfoDTO, to: ParamType) { | ||
| 153 | + | ||
| 154 | + // TODO: | ||
| 155 | + // to["sceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "9999" | ||
| 156 | + // to["subSceneId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 157 | + // to["cnsTraceId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "selfHold" | ||
| 158 | + // to["itemId"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 159 | + // to["expIds"] = !StringUtils.isEmpty(program.itemId) ? program.itemId : "" | ||
| 160 | + | ||
| 161 | + /// 这里填写默认值,后续在分享处 再重写 | ||
| 162 | + to["shareChannel"] = "" | ||
| 163 | + /// 这里填写默认值,后续在action=browse时,再重写 | ||
| 164 | + to["duration"] = 0 | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + private static appendRecommendPageInfoBean(program: PageInfoBean, to: ParamType) { | ||
| 86 | to["sceneId"] = "9999" | 168 | to["sceneId"] = "9999" |
| 87 | to["subSceneId"] = "" | 169 | to["subSceneId"] = "" |
| 88 | to["cnsTraceId"] = "selfHold" | 170 | to["cnsTraceId"] = "selfHold" |
| @@ -95,6 +177,13 @@ export class TrackParamConvert { | @@ -95,6 +177,13 @@ export class TrackParamConvert { | ||
| 95 | to["duration"] = 0 | 177 | to["duration"] = 0 |
| 96 | } | 178 | } |
| 97 | 179 | ||
| 180 | + // 'sceneId': contentDTO.sceneId, | ||
| 181 | + // 'subSceneId': contentDTO.subSceneId, | ||
| 182 | + // 'cnsTraceId': contentDTO.cnsTraceId, | ||
| 183 | + // 'cardItemId': compDTO.cardItemId, | ||
| 184 | + // 'itemId': compDTO.itemId || contentDTO.itemId, | ||
| 185 | + // 'expIds': compDTO.expIds || contentDTO.expIds | ||
| 186 | + | ||
| 98 | 187 | ||
| 99 | ///早晚报 专题 | 188 | ///早晚报 专题 |
| 100 | static pageInfoBean_ParamType(pageInfo: PageInfoBean) : ParamType { | 189 | static pageInfoBean_ParamType(pageInfo: PageInfoBean) : ParamType { |
| @@ -128,7 +217,8 @@ export class TrackParamConvert { | @@ -128,7 +217,8 @@ export class TrackParamConvert { | ||
| 128 | "channelSourceId": pageInfo.name, | 217 | "channelSourceId": pageInfo.name, |
| 129 | "pageId": 'summaryDetailPage', | 218 | "pageId": 'summaryDetailPage', |
| 130 | } | 219 | } |
| 131 | - TrackParamConvert.appendRecommend(pageInfo, param) | 220 | + |
| 221 | + TrackParamConvert.appendRecommendPageInfoBean(pageInfo, param) | ||
| 132 | 222 | ||
| 133 | return param | 223 | return param |
| 134 | } | 224 | } |
| 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' | ||
| 4 | -import { Logger } from 'wdKit' | 3 | +import { CommonConstants, SpConstants } from 'wdConstant' |
| 4 | +import { Logger, SPHelper, StringUtils } from 'wdKit' | ||
| 5 | import router from '@ohos.router'; | 5 | import router from '@ohos.router'; |
| 6 | +import dataPreferences from '@ohos.data.preferences'; | ||
| 6 | import { TrackConstants } from 'wdTracking/Index'; | 7 | import { TrackConstants } from 'wdTracking/Index'; |
| 7 | 8 | ||
| 8 | const TAG = 'SpacialTopicPage'; | 9 | const TAG = 'SpacialTopicPage'; |
| @@ -13,6 +14,18 @@ struct SpacialTopicPage { | @@ -13,6 +14,18 @@ struct SpacialTopicPage { | ||
| 13 | @State action: Action = {} as Action | 14 | @State action: Action = {} as Action |
| 14 | @State reload: number = 0 | 15 | @State reload: number = 0 |
| 15 | @State count: number = 0 | 16 | @State count: number = 0 |
| 17 | + preferences: dataPreferences.Preferences | null = null; | ||
| 18 | + observer = (key: string) => { | ||
| 19 | + if(key == SpConstants.USER_ID){ | ||
| 20 | + if(StringUtils.isEmpty(SPHelper.default.getSync(SpConstants.USER_ID,""))){ | ||
| 21 | + // 未登录 | ||
| 22 | + }else { | ||
| 23 | + // 登录 | ||
| 24 | + this.reload = this.reload + 1 | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + | ||
| 16 | 29 | ||
| 17 | @Provide pageName: string = TrackConstants.PageName.Summary_Detail | 30 | @Provide pageName: string = TrackConstants.PageName.Summary_Detail |
| 18 | @Provide pageId: string = TrackConstants.PageName.Summary_Detail | 31 | @Provide pageId: string = TrackConstants.PageName.Summary_Detail |
| @@ -39,9 +52,16 @@ struct SpacialTopicPage { | @@ -39,9 +52,16 @@ struct SpacialTopicPage { | ||
| 39 | Logger.info(TAG, `aboutToAppearcount:${this.reload}`); | 52 | Logger.info(TAG, `aboutToAppearcount:${this.reload}`); |
| 40 | let action: Action = router.getParams() as Action | 53 | let action: Action = router.getParams() as Action |
| 41 | this.action = action | 54 | this.action = action |
| 55 | + this.addLoginStatusObserver() | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + async addLoginStatusObserver(){ | ||
| 59 | + this.preferences = await SPHelper.default.getPreferences(); | ||
| 60 | + this.preferences.on('change', this.observer); | ||
| 42 | } | 61 | } |
| 43 | onPageShow() { | 62 | onPageShow() { |
| 44 | - this.reload = this.reload + 1 | 63 | + // this.reload = this.reload + 1 |
| 45 | Logger.info(TAG, `onPageShowcount:${this.reload}`); | 64 | Logger.info(TAG, `onPageShowcount:${this.reload}`); |
| 65 | + | ||
| 46 | } | 66 | } |
| 47 | } | 67 | } |
-
Please register or login to post a comment