Merge remote-tracking branch 'origin/main'
# Conflicts: # sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
Showing
13 changed files
with
213 additions
and
71 deletions
| @@ -32,8 +32,8 @@ export class HttpBizUtil { | @@ -32,8 +32,8 @@ export class HttpBizUtil { | ||
| 32 | if (!headers) { | 32 | if (!headers) { |
| 33 | headers = new HashMap() | 33 | headers = new HashMap() |
| 34 | } | 34 | } |
| 35 | - headers?.replace('RMRB-X-TOKEN', token) | ||
| 36 | - headers?.replace('cookie', 'RMRB-X-TOKEN=' + token) | 35 | + headers?.set('RMRB-X-TOKEN', token) |
| 36 | + headers?.set('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 37 | Logger.debug(TAG, 'get again send: ' + token) | 37 | Logger.debug(TAG, 'get again send: ' + token) |
| 38 | // refreshToken为空场景不处理,直接请求接口。 | 38 | // refreshToken为空场景不处理,直接请求接口。 |
| 39 | WDHttp.get<T>(url, headers).then((againResDTO: T) => { | 39 | WDHttp.get<T>(url, headers).then((againResDTO: T) => { |
| @@ -71,8 +71,8 @@ export class HttpBizUtil { | @@ -71,8 +71,8 @@ export class HttpBizUtil { | ||
| 71 | if (!headers) { | 71 | if (!headers) { |
| 72 | headers = new HashMap() | 72 | headers = new HashMap() |
| 73 | } | 73 | } |
| 74 | - headers?.replace('RMRB-X-TOKEN', token) | ||
| 75 | - headers?.replace('cookie', 'RMRB-X-TOKEN=' + token) | 74 | + headers?.set('RMRB-X-TOKEN', token) |
| 75 | + headers?.set('cookie', 'RMRB-X-TOKEN=' + token) | ||
| 76 | Logger.debug(TAG, 'post again send: ' + token) | 76 | Logger.debug(TAG, 'post again send: ' + token) |
| 77 | // refreshToken为空场景不处理,直接请求接口。 | 77 | // refreshToken为空场景不处理,直接请求接口。 |
| 78 | WDHttp.post<T>(url, data, headers).then((againResDTO: T) => { | 78 | WDHttp.post<T>(url, data, headers).then((againResDTO: T) => { |
| @@ -152,9 +152,7 @@ export struct SingleColumn999Component { | @@ -152,9 +152,7 @@ export struct SingleColumn999Component { | ||
| 152 | scrollBackward: NestedScrollMode.SELF_FIRST | 152 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 153 | }) | 153 | }) |
| 154 | } else { | 154 | } else { |
| 155 | - if (this.compListItem && this.compListItem?.operDataList) { | ||
| 156 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent}) | ||
| 157 | - } | 155 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent}) |
| 158 | } | 156 | } |
| 159 | } | 157 | } |
| 160 | 158 | ||
| @@ -176,6 +174,5 @@ export struct SingleColumn999Component { | @@ -176,6 +174,5 @@ export struct SingleColumn999Component { | ||
| 176 | index: index, | 174 | index: index, |
| 177 | }) | 175 | }) |
| 178 | } | 176 | } |
| 179 | - | ||
| 180 | } | 177 | } |
| 181 | } | 178 | } |
| @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit'; | @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit'; | ||
| 10 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 10 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| 12 | import { InfomationCardClick } from '../../utils/infomationCardClick'; | 12 | import { InfomationCardClick } from '../../utils/infomationCardClick'; |
| 13 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | * 直播预约卡 | 16 | * 直播预约卡 |
| @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'; | @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 17 | */ | 18 | */ |
| 18 | const TAG = 'Zh_Single_Row-03' | 19 | const TAG = 'Zh_Single_Row-03' |
| 19 | 20 | ||
| 20 | - | 21 | +function getLiveState(contentDTO: ContentDTO) { |
| 22 | + if (contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 23 | + return 'liveSubscribe' | ||
| 24 | + } else if (contentDTO?.liveInfo?.liveState === 'running') { | ||
| 25 | + return 'livePlaying' | ||
| 26 | + } else if (contentDTO?.liveInfo?.liveState === 'end') { | ||
| 27 | + return 'liveEnd' | ||
| 28 | + } else { | ||
| 29 | + return '' | ||
| 30 | + } | ||
| 31 | +} | ||
| 21 | interface reserveReqItem { | 32 | interface reserveReqItem { |
| 22 | liveId: string, | 33 | liveId: string, |
| 23 | relationId: string, | 34 | relationId: string, |
| @@ -247,18 +258,18 @@ export struct ZhSingleRow03 { | @@ -247,18 +258,18 @@ export struct ZhSingleRow03 { | ||
| 247 | .fontSize(13) | 258 | .fontSize(13) |
| 248 | } | 259 | } |
| 249 | 260 | ||
| 250 | - Row() { | ||
| 251 | - Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | ||
| 252 | - .width(48) | ||
| 253 | - .height(24) | ||
| 254 | - .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800) | ||
| 255 | - .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff) | ||
| 256 | - .fontSize(12) | ||
| 257 | - .textAlign(TextAlign.Center) | ||
| 258 | - .borderRadius(3) | ||
| 259 | - .onClick(() => { | ||
| 260 | - this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | ||
| 261 | - }) | 261 | + Row() { |
| 262 | + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | ||
| 263 | + .width(48) | ||
| 264 | + .height(24) | ||
| 265 | + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800) | ||
| 266 | + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff) | ||
| 267 | + .fontSize(12) | ||
| 268 | + .textAlign(TextAlign.Center) | ||
| 269 | + .borderRadius(3) | ||
| 270 | + .onClick(() => { | ||
| 271 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | ||
| 272 | + }) | ||
| 262 | 273 | ||
| 263 | } | 274 | } |
| 264 | .margin({top: -5}) | 275 | .margin({top: -5}) |
| @@ -404,3 +415,79 @@ function textOverflowStyle(maxLine: number) { | @@ -404,3 +415,79 @@ function textOverflowStyle(maxLine: number) { | ||
| 404 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 415 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 405 | } | 416 | } |
| 406 | 417 | ||
| 418 | +@Component | ||
| 419 | +struct CreatorItem { | ||
| 420 | + @Prop item: ContentDTO | ||
| 421 | + @State rmhIsAttention: number = 0 | ||
| 422 | + @State loadImg: boolean = false; | ||
| 423 | + | ||
| 424 | + async aboutToAppear(): Promise<void> { | ||
| 425 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 426 | + } | ||
| 427 | + build() { | ||
| 428 | + ListItem() { | ||
| 429 | + Column() { | ||
| 430 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 431 | + Image(this.loadImg ? this.item.coverUrl : '') | ||
| 432 | + .backgroundColor(0xf5f5f5) | ||
| 433 | + .width(156) | ||
| 434 | + .height(208) | ||
| 435 | + .border({width: 1}) | ||
| 436 | + .borderRadius(3) | ||
| 437 | + Row() | ||
| 438 | + .width(156) | ||
| 439 | + .height(80) | ||
| 440 | + .linearGradient({ | ||
| 441 | + direction: GradientDirection.Bottom, | ||
| 442 | + colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] | ||
| 443 | + }) | ||
| 444 | + Text(this.item.newsTitle) | ||
| 445 | + .fontColor(0xffffff) | ||
| 446 | + .fontSize(14) | ||
| 447 | + .maxLines(2) | ||
| 448 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 449 | + .width(140) | ||
| 450 | + .margin({bottom: 8}) | ||
| 451 | + } | ||
| 452 | + } | ||
| 453 | + .width(156) | ||
| 454 | + .height(208) | ||
| 455 | + .margin({ right: 11 }) | ||
| 456 | + .borderColor($r('app.color.color_EDEDED')) | ||
| 457 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 458 | + } | ||
| 459 | + .onClick((event: ClickEvent) => { | ||
| 460 | + ProcessUtils.processPage(this.item) | ||
| 461 | + }) | ||
| 462 | + } | ||
| 463 | + | ||
| 464 | + /** | ||
| 465 | + * 关注号主 TODO 这里后面需要抽离 | ||
| 466 | + */ | ||
| 467 | + handleAccention(item: ContentDTO, status: number) { | ||
| 468 | + this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 469 | + return | ||
| 470 | + // 未登录,跳转登录 | ||
| 471 | + if (!HttpUtils.getUserId()) { | ||
| 472 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 473 | + return | ||
| 474 | + } | ||
| 475 | + | ||
| 476 | + const params: postInteractAccentionOperateParams = { | ||
| 477 | + attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 478 | + attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 479 | + attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 480 | + // userType: 1, | ||
| 481 | + // userId: '1', // TODO 用户id需要从本地获取 | ||
| 482 | + status: status, | ||
| 483 | + } | ||
| 484 | + PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 485 | + console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 486 | + if (status === 1) { | ||
| 487 | + this.rmhIsAttention = 0 | ||
| 488 | + } else { | ||
| 489 | + this.rmhIsAttention = 1 | ||
| 490 | + } | ||
| 491 | + }) | ||
| 492 | + } | ||
| 493 | +} |
| @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew { | @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew { | ||
| 45 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 45 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 46 | @Link _currentNavIndex?: number; | 46 | @Link _currentNavIndex?: number; |
| 47 | // 顶导当前选中/焦点下标 | 47 | // 顶导当前选中/焦点下标 |
| 48 | - @State currentTopNavSelectedIndex: number = 0; | 48 | + @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0; |
| 49 | // 顶导数据 | 49 | // 顶导数据 |
| 50 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 50 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 51 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 51 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew { | @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew { | ||
| 114 | .onChange((index) => { | 114 | .onChange((index) => { |
| 115 | Logger.info(TAG, `onChange index : ${index}`); | 115 | Logger.info(TAG, `onChange index : ${index}`); |
| 116 | 116 | ||
| 117 | - // 顶部tab埋点 | ||
| 118 | - if(this.currentBottomNavName === '新闻') { | ||
| 119 | - const tab = this.myChannelList[index] | ||
| 120 | - Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`); | ||
| 121 | - | ||
| 122 | - const params: ParamType = { | ||
| 123 | - "pageName": tab.name, | ||
| 124 | - "tabName": tab.name, | ||
| 125 | - "pageId": tab.pageId, | ||
| 126 | - } | ||
| 127 | - Tracking.event("home_page_tab_click ", params) | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - | ||
| 131 | if (this.isBroadcastByIndex(index)) { | 117 | if (this.isBroadcastByIndex(index)) { |
| 132 | // 跳转到播报页面 | 118 | // 跳转到播报页面 |
| 133 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 119 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew { | @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew { | ||
| 217 | moreChannelList: $moreChannelList, | 203 | moreChannelList: $moreChannelList, |
| 218 | localChannelList: $localChannelList, | 204 | localChannelList: $localChannelList, |
| 219 | changeTab: (index) => { | 205 | changeTab: (index) => { |
| 206 | + | ||
| 220 | this.changePage(index) | 207 | this.changePage(index) |
| 221 | } | 208 | } |
| 222 | }) | 209 | }) |
| @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew { | @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew { | ||
| 496 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); | 483 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); |
| 497 | } | 484 | } |
| 498 | 485 | ||
| 486 | + updateCurrentTopNavSelectedIndex() { | ||
| 487 | + Logger.info(TAG, `currentTopNavSelectedIndex : ${this.currentTopNavSelectedIndex}、${this.currentBottomNavName}`); | ||
| 488 | + | ||
| 489 | + // 顶部tab埋点 | ||
| 490 | + if(this.currentBottomNavName === '新闻') { | ||
| 491 | + const tab = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 492 | + Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`); | ||
| 493 | + | ||
| 494 | + const params: ParamType = { | ||
| 495 | + "pageName": tab.name, | ||
| 496 | + "tabName": tab.name, | ||
| 497 | + "pageId": tab.pageId, | ||
| 498 | + } | ||
| 499 | + Tracking.event("home_page_tab_click ", params) | ||
| 500 | + } else if(this.currentBottomNavName === '人民号') { | ||
| 501 | + const tab = this.topNavList[this.currentTopNavSelectedIndex] | ||
| 502 | + Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`); | ||
| 503 | + | ||
| 504 | + const params: ParamType = { | ||
| 505 | + "pageName": tab.name, | ||
| 506 | + "tabName": tab.name, | ||
| 507 | + "pageId": tab.pageId, | ||
| 508 | + } | ||
| 509 | + Tracking.event("People_account_page_tab_click", params) | ||
| 510 | + } | ||
| 511 | + } | ||
| 499 | onAutoRefresh() { | 512 | onAutoRefresh() { |
| 500 | if (this.bottomNavIndex != this._currentNavIndex) { | 513 | if (this.bottomNavIndex != this._currentNavIndex) { |
| 501 | return | 514 | return |
| @@ -4,9 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -4,9 +4,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 4 | import { SpConstants } from 'wdConstant/Index'; | 4 | import { SpConstants } from 'wdConstant/Index'; |
| 5 | import measure from '@ohos.measure' | 5 | import measure from '@ohos.measure' |
| 6 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 6 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 7 | -import { | ||
| 8 | - ContentDetailDTO, | ||
| 9 | -} from 'wdBean'; | 7 | +import { ContentDetailDTO, } from 'wdBean'; |
| 10 | import { LiveModel } from '../../viewmodel/LiveModel'; | 8 | import { LiveModel } from '../../viewmodel/LiveModel'; |
| 11 | import { HttpUtils } from 'wdNetwork/Index'; | 9 | import { HttpUtils } from 'wdNetwork/Index'; |
| 12 | import vibrator from '@ohos.vibrator'; | 10 | import vibrator from '@ohos.vibrator'; |
| @@ -47,6 +45,7 @@ export struct LiveLikeComponent { | @@ -47,6 +45,7 @@ export struct LiveLikeComponent { | ||
| 47 | this.onDetailUpdated() | 45 | this.onDetailUpdated() |
| 48 | this.contentTrackingDict() | 46 | this.contentTrackingDict() |
| 49 | } | 47 | } |
| 48 | + | ||
| 50 | async onDetailUpdated() { | 49 | async onDetailUpdated() { |
| 51 | // 2:竖屏直播页 4:横屏直播页 | 50 | // 2:竖屏直播页 4:横屏直播页 |
| 52 | // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | 51 | // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 |
| @@ -61,13 +60,13 @@ export struct LiveLikeComponent { | @@ -61,13 +60,13 @@ export struct LiveLikeComponent { | ||
| 61 | this.getLikeCount() | 60 | this.getLikeCount() |
| 62 | } | 61 | } |
| 63 | 62 | ||
| 64 | - contentTrackingDict(){ | 63 | + contentTrackingDict() { |
| 65 | this.pageParam = { | 64 | this.pageParam = { |
| 66 | 'contentType': `${this.contentDetailData.newsType}`, | 65 | 'contentType': `${this.contentDetailData.newsType}`, |
| 67 | 'contentId': `${this.contentDetailData.newsId}`, | 66 | 'contentId': `${this.contentDetailData.newsId}`, |
| 68 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, | 67 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, |
| 69 | } | 68 | } |
| 70 | - if(this.contentDetailData.newsType == 2) { | 69 | + if (this.contentDetailData.newsType == 2) { |
| 71 | this.PageName = TrackConstants.PageName.Live_Detail // 直播 | 70 | this.PageName = TrackConstants.PageName.Live_Detail // 直播 |
| 72 | } | 71 | } |
| 73 | } | 72 | } |
| @@ -118,7 +117,9 @@ export struct LiveLikeComponent { | @@ -118,7 +117,9 @@ export struct LiveLikeComponent { | ||
| 118 | .width(36) | 117 | .width(36) |
| 119 | .height(36) | 118 | .height(36) |
| 120 | .borderRadius(18) | 119 | .borderRadius(18) |
| 121 | - .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | 120 | + .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : |
| 121 | + this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | ||
| 122 | + | ||
| 122 | if (this.likeCount != 0) { | 123 | if (this.likeCount != 0) { |
| 123 | RelativeContainer() { | 124 | RelativeContainer() { |
| 124 | Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) | 125 | Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) |
| @@ -211,6 +212,16 @@ export struct LiveLikeComponent { | @@ -211,6 +212,16 @@ export struct LiveLikeComponent { | ||
| 211 | console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`); | 212 | console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`); |
| 212 | } | 213 | } |
| 213 | this.likeCount++ | 214 | this.likeCount++ |
| 215 | + this.likeStatus = true | ||
| 216 | + | ||
| 217 | + //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 218 | + TrackingContent.like(true, TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, | ||
| 219 | + { | ||
| 220 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 221 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 222 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 223 | + }) | ||
| 224 | + | ||
| 214 | 225 | ||
| 215 | }).catch(() => { | 226 | }).catch(() => { |
| 216 | }) | 227 | }) |
| @@ -245,6 +256,7 @@ export struct LiveLikeComponent { | @@ -245,6 +256,7 @@ export struct LiveLikeComponent { | ||
| 245 | this.likeCount = 0 | 256 | this.likeCount = 0 |
| 246 | }) | 257 | }) |
| 247 | } | 258 | } |
| 259 | + | ||
| 248 | private getMeasureText(text: string) { | 260 | private getMeasureText(text: string) { |
| 249 | let width = measure.measureText({ | 261 | let width = measure.measureText({ |
| 250 | textContent: text, | 262 | textContent: text, |
| @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon' | @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon' | ||
| 23 | @Component | 23 | @Component |
| 24 | export struct DetailPlayLiveCommon { | 24 | export struct DetailPlayLiveCommon { |
| 25 | private liveViewModel: LiveViewModel = new LiveViewModel() | 25 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 26 | - pageShowTime:number = 0; | 26 | + pageShowTime: number = 0; |
| 27 | @Provide relId: string = '' | 27 | @Provide relId: string = '' |
| 28 | @Provide contentId: string = '' | 28 | @Provide contentId: string = '' |
| 29 | @Provide relType: string = '' | 29 | @Provide relType: string = '' |
| @@ -38,7 +38,6 @@ export struct DetailPlayLiveCommon { | @@ -38,7 +38,6 @@ export struct DetailPlayLiveCommon { | ||
| 38 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() | 38 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() |
| 39 | // 横屏或竖屏 general-竖屏,news-横屏 | 39 | // 横屏或竖屏 general-竖屏,news-横屏 |
| 40 | @State liveLandscape: string = '' | 40 | @State liveLandscape: string = '' |
| 41 | - | ||
| 42 | @State isLoading: boolean = false | 41 | @State isLoading: boolean = false |
| 43 | 42 | ||
| 44 | async aboutToAppear(): Promise<void> { | 43 | async aboutToAppear(): Promise<void> { |
| @@ -56,7 +55,6 @@ export struct DetailPlayLiveCommon { | @@ -56,7 +55,6 @@ export struct DetailPlayLiveCommon { | ||
| 56 | 55 | ||
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | - | ||
| 60 | build() { | 58 | build() { |
| 61 | Column() { | 59 | Column() { |
| 62 | // 直播预约或横屏直播统一进横屏直播 | 60 | // 直播预约或横屏直播统一进横屏直播 |
| @@ -66,7 +64,7 @@ export struct DetailPlayLiveCommon { | @@ -66,7 +64,7 @@ export struct DetailPlayLiveCommon { | ||
| 66 | } else if (this.liveLandscape === 'general') { | 64 | } else if (this.liveLandscape === 'general') { |
| 67 | // 沉浸式直播 | 65 | // 沉浸式直播 |
| 68 | DetailPlayVLivePage() | 66 | DetailPlayVLivePage() |
| 69 | - }else { | 67 | + } else { |
| 70 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 68 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 71 | } | 69 | } |
| 72 | } | 70 | } |
| @@ -86,12 +84,12 @@ export struct DetailPlayLiveCommon { | @@ -86,12 +84,12 @@ export struct DetailPlayLiveCommon { | ||
| 86 | if (data) { | 84 | if (data) { |
| 87 | let detailData = data[0] | 85 | let detailData = data[0] |
| 88 | //人民号类型单独获取直播地址 | 86 | //人民号类型单独获取直播地址 |
| 89 | - if (detailData.rmhPlatform === 1) { | 87 | + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { |
| 90 | 88 | ||
| 91 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string | 89 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string |
| 92 | console.error(TAG, 'vliveId==' + vliveId) | 90 | console.error(TAG, 'vliveId==' + vliveId) |
| 93 | let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean | 91 | let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean |
| 94 | - | 92 | + console.error(TAG, 'vliveId==' + vliveId) |
| 95 | if (pullStreamAddressData) { | 93 | if (pullStreamAddressData) { |
| 96 | console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) | 94 | console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) |
| 97 | let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url | 95 | let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url |
| @@ -133,7 +131,7 @@ export struct DetailPlayLiveCommon { | @@ -133,7 +131,7 @@ export struct DetailPlayLiveCommon { | ||
| 133 | ToastUtils.shortToast('内容不存在') | 131 | ToastUtils.shortToast('内容不存在') |
| 134 | router.back() | 132 | router.back() |
| 135 | } | 133 | } |
| 136 | - },()=>{ | 134 | + }, () => { |
| 137 | this.isLoading | 135 | this.isLoading |
| 138 | ToastUtils.shortToast('内容不存在') | 136 | ToastUtils.shortToast('内容不存在') |
| 139 | router.back() | 137 | router.back() |
| @@ -141,8 +139,6 @@ export struct DetailPlayLiveCommon { | @@ -141,8 +139,6 @@ export struct DetailPlayLiveCommon { | ||
| 141 | }) | 139 | }) |
| 142 | } | 140 | } |
| 143 | 141 | ||
| 144 | - | ||
| 145 | - | ||
| 146 | onPageShow() { | 142 | onPageShow() { |
| 147 | this.pageShow = Math.random() | 143 | this.pageShow = Math.random() |
| 148 | Logger.info(TAG, 'onPageShow') | 144 | Logger.info(TAG, 'onPageShow') |
| @@ -152,10 +148,10 @@ export struct DetailPlayLiveCommon { | @@ -152,10 +148,10 @@ export struct DetailPlayLiveCommon { | ||
| 152 | onPageHide() { | 148 | onPageHide() { |
| 153 | this.pageHide = Math.random() | 149 | this.pageHide = Math.random() |
| 154 | Logger.info(TAG, 'onPageHide') | 150 | Logger.info(TAG, 'onPageHide') |
| 155 | - console.error("XXXXZZZZ", '---onPageHide------------') | ||
| 156 | //页面浏览 | 151 | //页面浏览 |
| 157 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,TrackConstants.PageName.Live_Detail | ||
| 158 | - ,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) | 152 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, |
| 153 | + TrackConstants.PageName.Live_Detail | ||
| 154 | + , Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000)) | ||
| 159 | 155 | ||
| 160 | } | 156 | } |
| 161 | 157 |
| @@ -9,6 +9,7 @@ import { router, window } from '@kit.ArkUI'; | @@ -9,6 +9,7 @@ import { router, window } from '@kit.ArkUI'; | ||
| 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; | 9 | import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 10 | import { LiveOperRowListView } from 'wdComponent'; | 10 | import { LiveOperRowListView } from 'wdComponent'; |
| 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 12 | +import { TrackConstants, TrackingContent } from 'wdTracking/Index'; | ||
| 12 | 13 | ||
| 13 | let TAG: string = 'DetailPlayLivePage'; | 14 | let TAG: string = 'DetailPlayLivePage'; |
| 14 | 15 | ||
| @@ -34,10 +35,9 @@ export struct DetailPlayLivePage { | @@ -34,10 +35,9 @@ export struct DetailPlayLivePage { | ||
| 34 | @Consume @Watch('onBackPressCus') pageBackPress: number | 35 | @Consume @Watch('onBackPressCus') pageBackPress: number |
| 35 | @Consume contentDetailData: ContentDetailDTO | 36 | @Consume contentDetailData: ContentDetailDTO |
| 36 | @Consume publishCommentModel: publishCommentModel | 37 | @Consume publishCommentModel: publishCommentModel |
| 37 | - | ||
| 38 | // 尽量不要动属性。用来作为输入了评论之后,值传递 | 38 | // 尽量不要动属性。用来作为输入了评论之后,值传递 |
| 39 | - @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 | ||
| 40 | - @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | 39 | + @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 |
| 40 | + @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | ||
| 41 | 41 | ||
| 42 | aboutToAppear(): void { | 42 | aboutToAppear(): void { |
| 43 | Logger.info(TAG, `wyj-aboutToAppear`) | 43 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -69,10 +69,12 @@ export struct DetailPlayLivePage { | @@ -69,10 +69,12 @@ export struct DetailPlayLivePage { | ||
| 69 | TopPlayComponent({ playerController: this.playerController }) | 69 | TopPlayComponent({ playerController: this.playerController }) |
| 70 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') | 70 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 71 | 71 | ||
| 72 | - TabComponent({ tabs: this.tabs, | 72 | + TabComponent({ |
| 73 | + tabs: this.tabs, | ||
| 73 | changeToTab: this.changeToTab, | 74 | changeToTab: this.changeToTab, |
| 74 | lastInputedLiveComment: this.lastInputedLiveComment, | 75 | lastInputedLiveComment: this.lastInputedLiveComment, |
| 75 | - lastInputedChatComment: this.lastInputedChatComment}) | 76 | + lastInputedChatComment: this.lastInputedChatComment |
| 77 | + }) | ||
| 76 | .layoutWeight(1) | 78 | .layoutWeight(1) |
| 77 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 79 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 78 | 80 | ||
| @@ -95,6 +97,13 @@ export struct DetailPlayLivePage { | @@ -95,6 +97,13 @@ export struct DetailPlayLivePage { | ||
| 95 | } else { | 97 | } else { |
| 96 | this.lastInputedChatComment = result | 98 | this.lastInputedChatComment = result |
| 97 | } | 99 | } |
| 100 | + // 发布评论埋点 | ||
| 101 | + TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, | ||
| 102 | + { | ||
| 103 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 104 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 105 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 106 | + }); | ||
| 98 | }) | 107 | }) |
| 99 | } | 108 | } |
| 100 | } | 109 | } |
| @@ -7,6 +7,7 @@ import { WDAliPlayerController } from 'wdPlayer/Index'; | @@ -7,6 +7,7 @@ import { WDAliPlayerController } from 'wdPlayer/Index'; | ||
| 7 | import { DisplayDirection } from 'wdConstant/Index'; | 7 | import { DisplayDirection } from 'wdConstant/Index'; |
| 8 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; | 8 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; |
| 9 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; | 9 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; |
| 10 | +import { TrackConstants, TrackingButton } from 'wdTracking/Index'; | ||
| 10 | 11 | ||
| 11 | const storage = LocalStorage.getShared(); | 12 | const storage = LocalStorage.getShared(); |
| 12 | const TAG = 'DetailPlayVLivePage' | 13 | const TAG = 'DetailPlayVLivePage' |
| @@ -96,6 +97,9 @@ export struct DetailPlayVLivePage { | @@ -96,6 +97,9 @@ export struct DetailPlayVLivePage { | ||
| 96 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) | 97 | .markAnchor({ x: 56, y: this.bottomSafeHeight }) |
| 97 | .onClick(() => { | 98 | .onClick(() => { |
| 98 | this.swiperController.showNext() | 99 | this.swiperController.showNext() |
| 100 | + // 埋点 | ||
| 101 | + TrackingButton.click('clearScreen', TrackConstants.PageName.Live_Detail, | ||
| 102 | + TrackConstants.PageName.Live_Detail) | ||
| 99 | }) | 103 | }) |
| 100 | 104 | ||
| 101 | } | 105 | } |
| @@ -116,7 +120,5 @@ export struct DetailPlayVLivePage { | @@ -116,7 +120,5 @@ export struct DetailPlayVLivePage { | ||
| 116 | console.error(TAG, 'getLiveDetails catch', message) | 120 | console.error(TAG, 'getLiveDetails catch', message) |
| 117 | }) | 121 | }) |
| 118 | } | 122 | } |
| 119 | - | ||
| 120 | - | ||
| 121 | } | 123 | } |
| 122 | 124 |
| @@ -39,6 +39,8 @@ export class LiveViewModel { | @@ -39,6 +39,8 @@ export class LiveViewModel { | ||
| 39 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | 39 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) |
| 40 | if (resDTO.data) { | 40 | if (resDTO.data) { |
| 41 | success(resDTO.data) | 41 | success(resDTO.data) |
| 42 | + }else { | ||
| 43 | + fail("数据为空") | ||
| 42 | } | 44 | } |
| 43 | }).catch(() => { | 45 | }).catch(() => { |
| 44 | fail("数据为空") | 46 | fail("数据为空") |
| @@ -56,7 +56,7 @@ export struct PlayUIComponent { | @@ -56,7 +56,7 @@ export struct PlayUIComponent { | ||
| 56 | /* | 56 | /* |
| 57 | 初始话播放器设置 | 57 | 初始话播放器设置 |
| 58 | */ | 58 | */ |
| 59 | - initPlayerSet(){ | 59 | + initPlayerSet() { |
| 60 | 60 | ||
| 61 | //播放进度监听 | 61 | //播放进度监听 |
| 62 | if (this.playerController) { | 62 | if (this.playerController) { |
| @@ -279,8 +279,13 @@ export struct PlayUIComponent { | @@ -279,8 +279,13 @@ export struct PlayUIComponent { | ||
| 279 | }) | 279 | }) |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | - // 进度条 | ||
| 283 | - this.playProgressView() | 282 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 283 | + Blank() | ||
| 284 | + } else { | ||
| 285 | + // 进度条 | ||
| 286 | + this.playProgressView() | ||
| 287 | + } | ||
| 288 | + | ||
| 284 | // 总的播放时间 | 289 | // 总的播放时间 |
| 285 | if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { | 290 | if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { |
| 286 | Text(this.totalTime) | 291 | Text(this.totalTime) |
| @@ -32,7 +32,6 @@ export struct TopPlayComponent { | @@ -32,7 +32,6 @@ export struct TopPlayComponent { | ||
| 32 | @Provide playSourceState: number = 0 | 32 | @Provide playSourceState: number = 0 |
| 33 | private playUrl: string = "" | 33 | private playUrl: string = "" |
| 34 | private xComponentIsLoaded: boolean = false | 34 | private xComponentIsLoaded: boolean = false |
| 35 | - pageParam: ParamType = {} | ||
| 36 | 35 | ||
| 37 | aboutToAppear(): void { | 36 | aboutToAppear(): void { |
| 38 | if (this.playerController) { | 37 | if (this.playerController) { |
| @@ -148,16 +147,12 @@ export struct TopPlayComponent { | @@ -148,16 +147,12 @@ export struct TopPlayComponent { | ||
| 148 | Logger.debug(TAG, "播放地址为空") | 147 | Logger.debug(TAG, "播放地址为空") |
| 149 | return | 148 | return |
| 150 | } | 149 | } |
| 151 | - this.contentTrackingDict() | ||
| 152 | - this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam); | ||
| 153 | - } | ||
| 154 | 150 | ||
| 155 | - contentTrackingDict() { | ||
| 156 | - this.pageParam = { | 151 | + this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, { |
| 157 | 'contentType': `${this.contentDetailData.newsType}`, | 152 | 'contentType': `${this.contentDetailData.newsType}`, |
| 158 | 'contentId': `${this.contentDetailData.newsId}`, | 153 | 'contentId': `${this.contentDetailData.newsId}`, |
| 159 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, | 154 | 'contentName': `${this.contentDetailData.newsTitle || ''}`, |
| 160 | - } | 155 | + }); |
| 161 | } | 156 | } |
| 162 | 157 | ||
| 163 | build() { | 158 | build() { |
| @@ -11,6 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent' | @@ -11,6 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent' | ||
| 11 | import { ChatItemComponent } from './ChartItemComponent' | 11 | import { ChatItemComponent } from './ChartItemComponent' |
| 12 | import { router } from '@kit.ArkUI' | 12 | import { router } from '@kit.ArkUI' |
| 13 | import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index' | 13 | import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index' |
| 14 | +import { TrackConstants, TrackingContent } from 'wdTracking/Index' | ||
| 14 | 15 | ||
| 15 | const TAG = "PlayerCommentComponent" | 16 | const TAG = "PlayerCommentComponent" |
| 16 | /** | 17 | /** |
| @@ -105,6 +106,7 @@ export struct PlayerCommentComponent { | @@ -105,6 +106,7 @@ export struct PlayerCommentComponent { | ||
| 105 | contentDetailData: this.contentDetailData, | 106 | contentDetailData: this.contentDetailData, |
| 106 | onCommentInputFocus: () => { | 107 | onCommentInputFocus: () => { |
| 107 | 108 | ||
| 109 | + | ||
| 108 | }, | 110 | }, |
| 109 | onCommentInputed: (content) => { | 111 | onCommentInputed: (content) => { |
| 110 | if (content.comment) { | 112 | if (content.comment) { |
| @@ -116,6 +118,14 @@ export struct PlayerCommentComponent { | @@ -116,6 +118,14 @@ export struct PlayerCommentComponent { | ||
| 116 | this.liveChatList.push(result) | 118 | this.liveChatList.push(result) |
| 117 | this.scroller.scrollEdge(Edge.Bottom) | 119 | this.scroller.scrollEdge(Edge.Bottom) |
| 118 | }) | 120 | }) |
| 121 | + | ||
| 122 | + // 发布评论埋点 | ||
| 123 | + TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, | ||
| 124 | + { | ||
| 125 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 126 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 127 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 128 | + }); | ||
| 119 | } | 129 | } |
| 120 | }, | 130 | }, |
| 121 | onBack: () => { | 131 | onBack: () => { |
| @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'; | @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'; | ||
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { PageComponent } from 'wdComponent/Index'; | 9 | import { PageComponent } from 'wdComponent/Index'; |
| 10 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 10 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; |
| 11 | +import { Logger } from 'wdKit'; | ||
| 12 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 11 | 13 | ||
| 12 | const TAG = 'VideoChannelPage' | 14 | const TAG = 'VideoChannelPage' |
| 13 | 15 | ||
| @@ -100,6 +102,18 @@ export struct VideoChannelPage { | @@ -100,6 +102,18 @@ export struct VideoChannelPage { | ||
| 100 | right: $r('app.float.top_tab_item_padding_horizontal'), | 102 | right: $r('app.float.top_tab_item_padding_horizontal'), |
| 101 | }) | 103 | }) |
| 102 | .onClick(() => { | 104 | .onClick(() => { |
| 105 | + | ||
| 106 | + // 视频tab埋点 | ||
| 107 | + const tab = this.topNavList[index] | ||
| 108 | + Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`); | ||
| 109 | + | ||
| 110 | + const params: ParamType = { | ||
| 111 | + "pageName": tab.name, | ||
| 112 | + "tabName": tab.name, | ||
| 113 | + "pageId": tab.pageId, | ||
| 114 | + } | ||
| 115 | + Tracking.event("video_page_tab_click", params) | ||
| 116 | + | ||
| 103 | if (this.currentTopNavSelectedIndex === index) { | 117 | if (this.currentTopNavSelectedIndex === index) { |
| 104 | this.autoRefresh++ | 118 | this.autoRefresh++ |
| 105 | } | 119 | } |
-
Please register or login to post a comment