Merge remote-tracking branch 'origin/main' into main
Showing
8 changed files
with
135 additions
and
146 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) => { |
| @@ -166,6 +166,25 @@ export class ProcessUtils { | @@ -166,6 +166,25 @@ export class ProcessUtils { | ||
| 166 | * @param content | 166 | * @param content |
| 167 | * */ | 167 | * */ |
| 168 | public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?: number) { | 168 | public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?: number) { |
| 169 | + let tempP = [] as PhotoListBean[] | ||
| 170 | + let relIndex = 0; | ||
| 171 | + for (let index = 0; index < photoList.length; index++) { | ||
| 172 | + const element = photoList[index]; | ||
| 173 | + if(!StringUtils.isEmpty(element.picPath)){ | ||
| 174 | + relIndex = relIndex+1 | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + tempP.length = relIndex | ||
| 178 | + relIndex = 0 | ||
| 179 | + for (let index = 0; index < photoList.length; index++) { | ||
| 180 | + const element = photoList[index]; | ||
| 181 | + if(!StringUtils.isEmpty(element.picPath)){ | ||
| 182 | + tempP[relIndex] = element | ||
| 183 | + relIndex = relIndex+1 | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + photoList.length = tempP.length | ||
| 187 | + photoList = tempP | ||
| 169 | let taskAction: Action = { | 188 | let taskAction: Action = { |
| 170 | type: 'JUMP_DETAIL_PAGE', | 189 | type: 'JUMP_DETAIL_PAGE', |
| 171 | params: { | 190 | params: { |
| @@ -289,9 +289,9 @@ struct indicatorAnimations { | @@ -289,9 +289,9 @@ struct indicatorAnimations { | ||
| 289 | build() { | 289 | build() { |
| 290 | Flex({ alignItems: ItemAlign.End }) { | 290 | Flex({ alignItems: ItemAlign.End }) { |
| 291 | Stack() { | 291 | Stack() { |
| 292 | - Image($r('app.media.swiper_indicator_gray')) | ||
| 293 | - .width('100%') | ||
| 294 | - .height(2) | 292 | + // Image($r('app.media.swiper_indicator_gray')) |
| 293 | + // .width('100%') | ||
| 294 | + // .height(2) | ||
| 295 | Image($r('app.media.swiper_indicator_white')) | 295 | Image($r('app.media.swiper_indicator_white')) |
| 296 | .width(this.leftW) | 296 | .width(this.leftW) |
| 297 | .height(2) | 297 | .height(2) |
| @@ -312,6 +312,7 @@ struct indicatorAnimations { | @@ -312,6 +312,7 @@ struct indicatorAnimations { | ||
| 312 | .margin({ | 312 | .margin({ |
| 313 | bottom: -2 | 313 | bottom: -2 |
| 314 | }) | 314 | }) |
| 315 | + .fontFamily('BebasNeue') | ||
| 315 | .flexShrink(0) | 316 | .flexShrink(0) |
| 316 | .animation({ | 317 | .animation({ |
| 317 | duration: 300, | 318 | duration: 300, |
| @@ -319,9 +320,9 @@ struct indicatorAnimations { | @@ -319,9 +320,9 @@ struct indicatorAnimations { | ||
| 319 | playMode: PlayMode.Normal | 320 | playMode: PlayMode.Normal |
| 320 | }) | 321 | }) |
| 321 | Stack() { | 322 | Stack() { |
| 322 | - Image($r('app.media.swiper_indicator_gray')) | ||
| 323 | - .width('100%') | ||
| 324 | - .height(2) | 323 | + // Image($r('app.media.swiper_indicator_gray')) |
| 324 | + // .width('100%') | ||
| 325 | + // .height(2) | ||
| 325 | Image($r('app.media.swiper_indicator_white')) | 326 | Image($r('app.media.swiper_indicator_white')) |
| 326 | .width(this.rightW) | 327 | .width(this.rightW) |
| 327 | .height(2) | 328 | .height(2) |
| @@ -219,6 +219,7 @@ export struct ZhSingleRow03 { | @@ -219,6 +219,7 @@ export struct ZhSingleRow03 { | ||
| 219 | 219 | ||
| 220 | @Builder | 220 | @Builder |
| 221 | ItemCard(item: ContentDTO) { | 221 | ItemCard(item: ContentDTO) { |
| 222 | + if (this.compDTO.operDataList.length >= 2) { | ||
| 222 | Column() { | 223 | Column() { |
| 223 | Row() { | 224 | Row() { |
| 224 | Image(this.loadImg ? item.coverUrl : '') | 225 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -226,6 +227,7 @@ export struct ZhSingleRow03 { | @@ -226,6 +227,7 @@ export struct ZhSingleRow03 { | ||
| 226 | .height(60) | 227 | .height(60) |
| 227 | .margin({right: 12}) | 228 | .margin({right: 12}) |
| 228 | .backgroundColor(0xf5f5f5) | 229 | .backgroundColor(0xf5f5f5) |
| 230 | + .margin({right: 12}) | ||
| 229 | 231 | ||
| 230 | Text(item.newsTitle) | 232 | Text(item.newsTitle) |
| 231 | .width(154) | 233 | .width(154) |
| @@ -266,27 +268,7 @@ export struct ZhSingleRow03 { | @@ -266,27 +268,7 @@ 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 | ||
| 292 | } | 274 | } |
| @@ -304,6 +286,74 @@ export struct ZhSingleRow03 { | @@ -304,6 +286,74 @@ export struct ZhSingleRow03 { | ||
| 304 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | 286 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) |
| 305 | ProcessUtils.processPage(item) | 287 | ProcessUtils.processPage(item) |
| 306 | }) | 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}) | ||
| 303 | + } | ||
| 304 | + .margin({bottom: 16}) | ||
| 305 | + .justifyContent(FlexAlign.Start) | ||
| 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 | + } | ||
| 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 | + }) | ||
| 356 | + } | ||
| 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 | -} |
| @@ -50,11 +50,6 @@ export struct DetailPlayLiveCommon { | @@ -50,11 +50,6 @@ export struct DetailPlayLiveCommon { | ||
| 50 | 50 | ||
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | - aboutToDisappear(): void { | ||
| 54 | - console.error("XXXXZZZZ", '---aboutToDisappear------------') | ||
| 55 | - | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | build() { | 53 | build() { |
| 59 | Column() { | 54 | Column() { |
| 60 | // 直播预约或横屏直播统一进横屏直播 | 55 | // 直播预约或横屏直播统一进横屏直播 |
| @@ -84,20 +79,16 @@ export struct DetailPlayLiveCommon { | @@ -84,20 +79,16 @@ export struct DetailPlayLiveCommon { | ||
| 84 | if (data) { | 79 | if (data) { |
| 85 | let detailData = data[0] | 80 | let detailData = data[0] |
| 86 | //人民号类型单独获取直播地址 | 81 | //人民号类型单独获取直播地址 |
| 87 | - if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { | ||
| 88 | - | 82 | + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { // |
| 89 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string | 83 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string |
| 90 | - console.error(TAG, 'vliveId==' + vliveId) | ||
| 91 | let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean | 84 | let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean |
| 92 | - console.error(TAG, 'vliveId==' + vliveId) | ||
| 93 | if (pullStreamAddressData) { | 85 | if (pullStreamAddressData) { |
| 94 | - console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) | 86 | + // console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) |
| 95 | let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url | 87 | let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url |
| 96 | detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl | 88 | detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl |
| 97 | this.playUrl = m3u8uUrl | 89 | this.playUrl = m3u8uUrl |
| 98 | - console.log(TAG, ' GetPullAddressBean:', m3u8uUrl) | 90 | + // console.log(TAG, ' GetPullAddressBean:', m3u8uUrl) |
| 99 | } | 91 | } |
| 100 | - | ||
| 101 | } | 92 | } |
| 102 | 93 | ||
| 103 | this.liveLandscape = | 94 | this.liveLandscape = |
| @@ -148,7 +139,6 @@ export struct DetailPlayLiveCommon { | @@ -148,7 +139,6 @@ export struct DetailPlayLiveCommon { | ||
| 148 | onPageHide() { | 139 | onPageHide() { |
| 149 | this.pageHide = Math.random() | 140 | this.pageHide = Math.random() |
| 150 | Logger.info(TAG, 'onPageHide') | 141 | Logger.info(TAG, 'onPageHide') |
| 151 | - console.error("XXXXZZZZ", '---onPageHide------------') | ||
| 152 | //页面浏览 | 142 | //页面浏览 |
| 153 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, | 143 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, |
| 154 | TrackConstants.PageName.Live_Detail | 144 | TrackConstants.PageName.Live_Detail |
| 1 | -import { ContentDetailDTO, | 1 | +import { |
| 2 | + ContentDetailDTO, | ||
| 2 | GetPullAddressBean, | 3 | GetPullAddressBean, |
| 3 | - LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, | 4 | + LiveDetailsBean, |
| 5 | + LiveRoomBean, | ||
| 6 | + LiveRoomDataBean, | ||
| 4 | LiveRoomItemBean, | 7 | LiveRoomItemBean, |
| 5 | - ValueType } from 'wdBean/Index' | 8 | + ValueType |
| 9 | +} from 'wdBean/Index' | ||
| 6 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | 10 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' |
| 7 | import { Logger } from 'wdKit/Index' | 11 | import { Logger } from 'wdKit/Index' |
| 8 | import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils' | 12 | import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils' |
| @@ -32,18 +36,25 @@ export class LiveViewModel { | @@ -32,18 +36,25 @@ export class LiveViewModel { | ||
| 32 | 36 | ||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | - async getLiveRoomPullAddress(vliveId:string) : Promise<GetPullAddressBean>{ | 39 | + /** |
| 40 | + * 获取直播间的拉流地址 | ||
| 41 | + * @param vliveId | ||
| 42 | + * @returns | ||
| 43 | + */ | ||
| 44 | + async getLiveRoomPullAddress(vliveId: string): Promise<GetPullAddressBean | null> { | ||
| 36 | 45 | ||
| 37 | - return new Promise<GetPullAddressBean>((success, fail) => { | ||
| 38 | - ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => { | 46 | + return new Promise<GetPullAddressBean | null>((success, fail) => { |
| 47 | + ContentDetailRequest.getLiveRoomPullStream(vliveId) | ||
| 48 | + .then(async (resDTO: ResponseDTO<GetPullAddressBean>) => { | ||
| 39 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | 49 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) |
| 40 | if (resDTO.data) { | 50 | if (resDTO.data) { |
| 41 | success(resDTO.data) | 51 | success(resDTO.data) |
| 42 | - }else { | ||
| 43 | - fail("数据为空") | 52 | + } else { |
| 53 | + success(null) | ||
| 44 | } | 54 | } |
| 45 | - }).catch(() => { | ||
| 46 | - fail("数据为空") | 55 | + }) |
| 56 | + .catch(() => { | ||
| 57 | + success(null) | ||
| 47 | }) | 58 | }) |
| 48 | 59 | ||
| 49 | }) | 60 | }) |
| @@ -104,6 +115,7 @@ export class LiveViewModel { | @@ -104,6 +115,7 @@ export class LiveViewModel { | ||
| 104 | }) | 115 | }) |
| 105 | }) | 116 | }) |
| 106 | } | 117 | } |
| 118 | + | ||
| 107 | // 直播详情-C端点赞接口 | 119 | // 直播详情-C端点赞接口 |
| 108 | getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) { | 120 | getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) { |
| 109 | return new Promise<number>((success, fail) => { | 121 | return new Promise<number>((success, fail) => { |
| @@ -114,6 +126,7 @@ export class LiveViewModel { | @@ -114,6 +126,7 @@ export class LiveViewModel { | ||
| 114 | }) | 126 | }) |
| 115 | }) | 127 | }) |
| 116 | } | 128 | } |
| 129 | + | ||
| 117 | // 直播详情-查询是否点赞接口 | 130 | // 直播详情-查询是否点赞接口 |
| 118 | getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) { | 131 | getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) { |
| 119 | return new Promise<boolean>((success, fail) => { | 132 | return new Promise<boolean>((success, 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) { |
| @@ -280,7 +280,12 @@ export struct PlayUIComponent { | @@ -280,7 +280,12 @@ export struct PlayUIComponent { | ||
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | // 进度条 | 282 | // 进度条 |
| 283 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { | ||
| 284 | + Blank() | ||
| 285 | + } else { | ||
| 283 | this.playProgressView() | 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