Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
4 changed files
with
126 additions
and
161 deletions
| @@ -219,42 +219,44 @@ export struct ZhSingleRow03 { | @@ -219,42 +219,44 @@ export struct ZhSingleRow03 { | ||
| 219 | 219 | ||
| 220 | @Builder | 220 | @Builder |
| 221 | ItemCard(item: ContentDTO) { | 221 | ItemCard(item: ContentDTO) { |
| 222 | - Column() { | ||
| 223 | - Row() { | ||
| 224 | - Image(this.loadImg ? item.coverUrl : '') | ||
| 225 | - .width(106) | ||
| 226 | - .height(60) | ||
| 227 | - .margin({right: 12}) | ||
| 228 | - .backgroundColor(0xf5f5f5) | ||
| 229 | - | ||
| 230 | - Text(item.newsTitle) | ||
| 231 | - .width(154) | ||
| 232 | - .height(60) | ||
| 233 | - .maxLines(3) | ||
| 234 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 235 | - } | ||
| 236 | - .margin({bottom: 16}) | 222 | + if (this.compDTO.operDataList.length >= 2) { |
| 223 | + Column() { | ||
| 224 | + Row() { | ||
| 225 | + Image(this.loadImg ? item.coverUrl : '') | ||
| 226 | + .width(106) | ||
| 227 | + .height(60) | ||
| 228 | + .margin({right: 12}) | ||
| 229 | + .backgroundColor(0xf5f5f5) | ||
| 230 | + .margin({right: 12}) | ||
| 237 | 231 | ||
| 238 | - Row() { | ||
| 239 | - Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 240 | - Row() { | ||
| 241 | - Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 242 | - .margin({right: 6}) | ||
| 243 | - .fontColor(0x000000) | ||
| 244 | - .fontSize(13) | ||
| 245 | - .textAlign(TextAlign.Start) | ||
| 246 | - Image($r('app.media.timeline_rect')) | ||
| 247 | - .width(4) | ||
| 248 | - .height(3) | ||
| 249 | - .margin({right: 6}) | ||
| 250 | - Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 251 | - .margin({right: 6}) | ||
| 252 | - .fontColor(0x000000) | ||
| 253 | - .fontSize(13) | ||
| 254 | - Text('开始直播') | ||
| 255 | - .fontColor(0xC8C8C8) | ||
| 256 | - .fontSize(13) | ||
| 257 | - } | 232 | + Text(item.newsTitle) |
| 233 | + .width(154) | ||
| 234 | + .height(60) | ||
| 235 | + .maxLines(3) | ||
| 236 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 237 | + } | ||
| 238 | + .margin({bottom: 16}) | ||
| 239 | + | ||
| 240 | + Row() { | ||
| 241 | + Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 242 | + Row() { | ||
| 243 | + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 244 | + .margin({right: 6}) | ||
| 245 | + .fontColor(0x000000) | ||
| 246 | + .fontSize(13) | ||
| 247 | + .textAlign(TextAlign.Start) | ||
| 248 | + Image($r('app.media.timeline_rect')) | ||
| 249 | + .width(4) | ||
| 250 | + .height(3) | ||
| 251 | + .margin({right: 6}) | ||
| 252 | + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 253 | + .margin({right: 6}) | ||
| 254 | + .fontColor(0x000000) | ||
| 255 | + .fontSize(13) | ||
| 256 | + Text('开始直播') | ||
| 257 | + .fontColor(0xC8C8C8) | ||
| 258 | + .fontSize(13) | ||
| 259 | + } | ||
| 258 | 260 | ||
| 259 | Row() { | 261 | Row() { |
| 260 | Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | 262 | Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') |
| @@ -266,44 +268,92 @@ export struct ZhSingleRow03 { | @@ -266,44 +268,92 @@ export struct ZhSingleRow03 { | ||
| 266 | .textAlign(TextAlign.Center) | 268 | .textAlign(TextAlign.Center) |
| 267 | .borderRadius(3) | 269 | .borderRadius(3) |
| 268 | .onClick(() => { | 270 | .onClick(() => { |
| 269 | - const isSubscribe = !this.isReserved(Number(item.objectId)) | ||
| 270 | - | ||
| 271 | - // 直播预约埋点 | ||
| 272 | - const params: ParamType = { | ||
| 273 | - 'contentName': item.newsTitle, | ||
| 274 | - 'contentType': item.objectType, | ||
| 275 | - "liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2, | ||
| 276 | - "vliveId": item.objectId, | ||
| 277 | - "vliveName": item.newsTitle, | ||
| 278 | - "contentId": item.objectId, | ||
| 279 | - "compId": item.relId, | ||
| 280 | - "contentStyle": item.appStyle, | ||
| 281 | - "liveType": getLiveState(item), | ||
| 282 | - 'contentShowChannelId': item.channelId, | ||
| 283 | - 'linkUrl': item.linkUrl, | ||
| 284 | - "pageId": this.pageId, | ||
| 285 | - "pageName": '直播', | ||
| 286 | - } | ||
| 287 | - Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`); | ||
| 288 | - Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params) | ||
| 289 | - this.bookAndCancel(item.relId, item.objectId, isSubscribe) | 271 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) |
| 290 | }) | 272 | }) |
| 291 | 273 | ||
| 274 | + } | ||
| 275 | + .margin({top: -5}) | ||
| 292 | } | 276 | } |
| 293 | - .margin({top: -5}) | 277 | + |
| 278 | + } | ||
| 279 | + } | ||
| 280 | + .width(298) | ||
| 281 | + .height(116) | ||
| 282 | + .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 283 | + .backgroundColor(0xf9f9f9) | ||
| 284 | + .margin({right: 8}) | ||
| 285 | + .onClick(() => { | ||
| 286 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 287 | + ProcessUtils.processPage(item) | ||
| 288 | + }) | ||
| 289 | + } else { | ||
| 290 | + Column() { | ||
| 291 | + Row() { | ||
| 292 | + Image(this.loadImg ? item.coverUrl : '') | ||
| 293 | + .width(106) | ||
| 294 | + .height(60) | ||
| 295 | + .backgroundColor(0xf5f5f5) | ||
| 296 | + .margin({right: 12}) | ||
| 297 | + | ||
| 298 | + Text(item.newsTitle) | ||
| 299 | + .width(201) | ||
| 300 | + .height(60) | ||
| 301 | + .maxLines(3) | ||
| 302 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 294 | } | 303 | } |
| 304 | + .margin({bottom: 16}) | ||
| 305 | + .justifyContent(FlexAlign.Start) | ||
| 295 | 306 | ||
| 307 | + Row() { | ||
| 308 | + Flex({justifyContent: FlexAlign.SpaceBetween}){ | ||
| 309 | + Row() { | ||
| 310 | + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) | ||
| 311 | + .margin({right: 6}) | ||
| 312 | + .fontColor(0x000000) | ||
| 313 | + .fontSize(13) | ||
| 314 | + .textAlign(TextAlign.Start) | ||
| 315 | + Image($r('app.media.timeline_rect')) | ||
| 316 | + .width(4) | ||
| 317 | + .height(3) | ||
| 318 | + .margin({right: 6}) | ||
| 319 | + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5)) | ||
| 320 | + .margin({right: 6}) | ||
| 321 | + .fontColor(0x000000) | ||
| 322 | + .fontSize(13) | ||
| 323 | + Text('开始直播') | ||
| 324 | + .fontColor(0xC8C8C8) | ||
| 325 | + .fontSize(13) | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + Row() { | ||
| 329 | + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') | ||
| 330 | + .width(48) | ||
| 331 | + .height(24) | ||
| 332 | + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800) | ||
| 333 | + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff) | ||
| 334 | + .fontSize(12) | ||
| 335 | + .textAlign(TextAlign.Center) | ||
| 336 | + .borderRadius(3) | ||
| 337 | + .onClick(() => { | ||
| 338 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | ||
| 339 | + }) | ||
| 340 | + | ||
| 341 | + } | ||
| 342 | + .margin({top: -5}) | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + } | ||
| 296 | } | 346 | } |
| 347 | + .width('100%') | ||
| 348 | + .height(116) | ||
| 349 | + .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 350 | + .backgroundColor(0xf9f9f9) | ||
| 351 | + .margin({right: 8}) | ||
| 352 | + .onClick(() => { | ||
| 353 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 354 | + ProcessUtils.processPage(item) | ||
| 355 | + }) | ||
| 297 | } | 356 | } |
| 298 | - .width(298) | ||
| 299 | - .height(116) | ||
| 300 | - .padding({top: 12, bottom: 12, left: 12, right: 12}) | ||
| 301 | - .backgroundColor(0xf9f9f9) | ||
| 302 | - .margin({right: 8}) | ||
| 303 | - .onClick(() => { | ||
| 304 | - InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 305 | - ProcessUtils.processPage(item) | ||
| 306 | - }) | ||
| 307 | } | 357 | } |
| 308 | 358 | ||
| 309 | 359 | ||
| @@ -330,9 +380,6 @@ export struct ZhSingleRow03 { | @@ -330,9 +380,6 @@ export struct ZhSingleRow03 { | ||
| 330 | .width(14) | 380 | .width(14) |
| 331 | .height(14) | 381 | .height(14) |
| 332 | } | 382 | } |
| 333 | - .padding({ | ||
| 334 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 335 | - }) | ||
| 336 | .onClick(() => { | 383 | .onClick(() => { |
| 337 | this.jumpToMore(); | 384 | this.jumpToMore(); |
| 338 | }) | 385 | }) |
| @@ -362,85 +409,4 @@ export struct ZhSingleRow03 { | @@ -362,85 +409,4 @@ export struct ZhSingleRow03 { | ||
| 362 | 409 | ||
| 363 | } | 410 | } |
| 364 | 411 | ||
| 365 | -@Extend(Text) | ||
| 366 | -function textOverflowStyle(maxLine: number) { | ||
| 367 | - .maxLines(maxLine) | ||
| 368 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 369 | -} | ||
| 370 | 412 | ||
| 371 | -@Component | ||
| 372 | -struct CreatorItem { | ||
| 373 | - @Prop item: ContentDTO | ||
| 374 | - @State rmhIsAttention: number = 0 | ||
| 375 | - @State loadImg: boolean = false; | ||
| 376 | - | ||
| 377 | - async aboutToAppear(): Promise<void> { | ||
| 378 | - this.loadImg = await onlyWifiLoadImg(); | ||
| 379 | - } | ||
| 380 | - build() { | ||
| 381 | - ListItem() { | ||
| 382 | - Column() { | ||
| 383 | - Stack({ alignContent: Alignment.Bottom }) { | ||
| 384 | - Image(this.loadImg ? this.item.coverUrl : '') | ||
| 385 | - .backgroundColor(0xf5f5f5) | ||
| 386 | - .width(156) | ||
| 387 | - .height(208) | ||
| 388 | - .border({width: 1}) | ||
| 389 | - .borderRadius(3) | ||
| 390 | - Row() | ||
| 391 | - .width(156) | ||
| 392 | - .height(80) | ||
| 393 | - .linearGradient({ | ||
| 394 | - direction: GradientDirection.Bottom, | ||
| 395 | - colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] | ||
| 396 | - }) | ||
| 397 | - Text(this.item.newsTitle) | ||
| 398 | - .fontColor(0xffffff) | ||
| 399 | - .fontSize(14) | ||
| 400 | - .maxLines(2) | ||
| 401 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 402 | - .width(140) | ||
| 403 | - .margin({bottom: 8}) | ||
| 404 | - } | ||
| 405 | - } | ||
| 406 | - .width(156) | ||
| 407 | - .height(208) | ||
| 408 | - .margin({ right: 11 }) | ||
| 409 | - .borderColor($r('app.color.color_EDEDED')) | ||
| 410 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 411 | - } | ||
| 412 | - .onClick((event: ClickEvent) => { | ||
| 413 | - ProcessUtils.processPage(this.item) | ||
| 414 | - }) | ||
| 415 | - } | ||
| 416 | - | ||
| 417 | - /** | ||
| 418 | - * 关注号主 TODO 这里后面需要抽离 | ||
| 419 | - */ | ||
| 420 | - handleAccention(item: ContentDTO, status: number) { | ||
| 421 | - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 422 | - return | ||
| 423 | - // 未登录,跳转登录 | ||
| 424 | - if (!HttpUtils.getUserId()) { | ||
| 425 | - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 426 | - return | ||
| 427 | - } | ||
| 428 | - | ||
| 429 | - const params: postInteractAccentionOperateParams = { | ||
| 430 | - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 431 | - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 432 | - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 433 | - // userType: 1, | ||
| 434 | - // userId: '1', // TODO 用户id需要从本地获取 | ||
| 435 | - status: status, | ||
| 436 | - } | ||
| 437 | - PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 438 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 439 | - if (status === 1) { | ||
| 440 | - this.rmhIsAttention = 0 | ||
| 441 | - } else { | ||
| 442 | - this.rmhIsAttention = 1 | ||
| 443 | - } | ||
| 444 | - }) | ||
| 445 | - } | ||
| 446 | -} |
| @@ -148,7 +148,6 @@ export struct DetailPlayLiveCommon { | @@ -148,7 +148,6 @@ export struct DetailPlayLiveCommon { | ||
| 148 | onPageHide() { | 148 | onPageHide() { |
| 149 | this.pageHide = Math.random() | 149 | this.pageHide = Math.random() |
| 150 | Logger.info(TAG, 'onPageHide') | 150 | Logger.info(TAG, 'onPageHide') |
| 151 | - console.error("XXXXZZZZ", '---onPageHide------------') | ||
| 152 | //页面浏览 | 151 | //页面浏览 |
| 153 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, | 152 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, |
| 154 | TrackConstants.PageName.Live_Detail | 153 | TrackConstants.PageName.Live_Detail |
| @@ -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() { |
-
Please register or login to post a comment