yumaochao
@@ -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: {
@@ -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 =
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) => {
@@ -279,10 +279,10 @@ export struct PlayUIComponent { @@ -279,10 +279,10 @@ export struct PlayUIComponent {
279 }) 279 })
280 } 280 }
281 281
  282 + // 进度条
282 if (this.contentDetailData.liveInfo?.liveState == 'running') { 283 if (this.contentDetailData.liveInfo?.liveState == 'running') {
283 Blank() 284 Blank()
284 } else { 285 } else {
285 - // 进度条  
286 this.playProgressView() 286 this.playProgressView()
287 } 287 }
288 288