Showing
3 changed files
with
36 additions
and
22 deletions
| @@ -24,10 +24,8 @@ export struct DetailVideoListPage { | @@ -24,10 +24,8 @@ export struct DetailVideoListPage { | ||
| 24 | @Provide pageHide: number = -1 | 24 | @Provide pageHide: number = -1 |
| 25 | @Provide switchVideoStatus: boolean = false | 25 | @Provide switchVideoStatus: boolean = false |
| 26 | @State data: ContentDetailDTO[] = [] | 26 | @State data: ContentDetailDTO[] = [] |
| 27 | - @State testData: string[] = ['111', '222', '333'] | ||
| 28 | @State currentIndex: number = 0 | 27 | @State currentIndex: number = 0 |
| 29 | @State interactDataList: InteractDataDTO[] = [] | 28 | @State interactDataList: InteractDataDTO[] = [] |
| 30 | - @State isFullScreen: boolean = false | ||
| 31 | 29 | ||
| 32 | async aboutToAppear(): Promise<void> { | 30 | async aboutToAppear(): Promise<void> { |
| 33 | this.openFullScreen() | 31 | this.openFullScreen() |
| @@ -41,10 +39,7 @@ export struct DetailVideoListPage { | @@ -41,10 +39,7 @@ export struct DetailVideoListPage { | ||
| 41 | } | 39 | } |
| 42 | await this.getContentDetail(this.contentId, this.relId, this.relType) | 40 | await this.getContentDetail(this.contentId, this.relId, this.relType) |
| 43 | } | 41 | } |
| 44 | - | ||
| 45 | await this.queryVideoList() | 42 | await this.queryVideoList() |
| 46 | - await this.getContentInteract() | ||
| 47 | - | ||
| 48 | console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) | 43 | console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) |
| 49 | } | 44 | } |
| 50 | 45 | ||
| @@ -93,9 +88,22 @@ export struct DetailVideoListPage { | @@ -93,9 +88,22 @@ export struct DetailVideoListPage { | ||
| 93 | contentId: contentId, | 88 | contentId: contentId, |
| 94 | relId: relId, | 89 | relId: relId, |
| 95 | relType: relType | 90 | relType: relType |
| 96 | - }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => { | ||
| 97 | - console.error('getContentDetail==', JSON.stringify(resDTO.data)) | 91 | + }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { |
| 92 | + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | ||
| 98 | if (resDTO.data) { | 93 | if (resDTO.data) { |
| 94 | + const params: contentListParams = { | ||
| 95 | + contentList: [{ | ||
| 96 | + contentId: resDTO.data[0].newsId + '', | ||
| 97 | + contentType: resDTO.data[0].newsType | ||
| 98 | + }] | ||
| 99 | + } | ||
| 100 | + // 批量查询内容当前用户点赞、收藏状态 | ||
| 101 | + await ContentDetailRequest.getContentInteract(params).then(res => { | ||
| 102 | + if (res.data) { | ||
| 103 | + this.interactDataList = this.interactDataList.concat(res.data) | ||
| 104 | + } | ||
| 105 | + console.log('获取互动点赞等数据===', JSON.stringify(res)) | ||
| 106 | + }) | ||
| 99 | this.data.push(resDTO.data[0]) | 107 | this.data.push(resDTO.data[0]) |
| 100 | } | 108 | } |
| 101 | }) | 109 | }) |
| @@ -108,8 +116,9 @@ export struct DetailVideoListPage { | @@ -108,8 +116,9 @@ export struct DetailVideoListPage { | ||
| 108 | await ContentDetailRequest.postRecommendVideoList({ | 116 | await ContentDetailRequest.postRecommendVideoList({ |
| 109 | pageSize: 5, | 117 | pageSize: 5, |
| 110 | refreshCnt: 1 | 118 | refreshCnt: 1 |
| 111 | - }).then(res => { | 119 | + }).then(async res => { |
| 112 | if (res.data) { | 120 | if (res.data) { |
| 121 | + await this.getContentInteract(res.data) | ||
| 113 | this.data = this.data.concat(res.data) | 122 | this.data = this.data.concat(res.data) |
| 114 | console.log('视频列表===', JSON.stringify(res.data)) | 123 | console.log('视频列表===', JSON.stringify(res.data)) |
| 115 | } | 124 | } |
| @@ -119,12 +128,12 @@ export struct DetailVideoListPage { | @@ -119,12 +128,12 @@ export struct DetailVideoListPage { | ||
| 119 | /** | 128 | /** |
| 120 | * 批量查询内容当前用户点赞、收藏状态 | 129 | * 批量查询内容当前用户点赞、收藏状态 |
| 121 | */ | 130 | */ |
| 122 | - async getContentInteract() { | ||
| 123 | - if (this.data.length > 0) { | 131 | + async getContentInteract(data: ContentDetailDTO[]) { |
| 132 | + if (data.length > 0) { | ||
| 124 | const params: contentListParams = { | 133 | const params: contentListParams = { |
| 125 | contentList: [] | 134 | contentList: [] |
| 126 | } | 135 | } |
| 127 | - this.data.map(item => { | 136 | + data.map(item => { |
| 128 | params.contentList.push({ | 137 | params.contentList.push({ |
| 129 | contentId: item.newsId + '', | 138 | contentId: item.newsId + '', |
| 130 | contentType: item.newsType | 139 | contentType: item.newsType |
| @@ -133,7 +142,7 @@ export struct DetailVideoListPage { | @@ -133,7 +142,7 @@ export struct DetailVideoListPage { | ||
| 133 | // 批量查询内容当前用户点赞、收藏状态 | 142 | // 批量查询内容当前用户点赞、收藏状态 |
| 134 | await ContentDetailRequest.getContentInteract(params).then(res => { | 143 | await ContentDetailRequest.getContentInteract(params).then(res => { |
| 135 | if (res.data) { | 144 | if (res.data) { |
| 136 | - this.interactDataList = res.data || [] | 145 | + this.interactDataList = this.interactDataList.concat(res.data) |
| 137 | } | 146 | } |
| 138 | console.log('获取互动点赞等数据===', JSON.stringify(res)) | 147 | console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 139 | }) | 148 | }) |
| @@ -145,7 +145,7 @@ export struct VideoChannelDetail { | @@ -145,7 +145,7 @@ export struct VideoChannelDetail { | ||
| 145 | refreshTime: this.refreshTime, | 145 | refreshTime: this.refreshTime, |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | - await ContentDetailRequest.getRecCompInfo(params).then(res => { | 148 | + await ContentDetailRequest.getRecCompInfo(params).then(async res => { |
| 149 | this.isRequestError = false | 149 | this.isRequestError = false |
| 150 | console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') | 150 | console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') |
| 151 | 151 | ||
| @@ -174,8 +174,8 @@ export struct VideoChannelDetail { | @@ -174,8 +174,8 @@ export struct VideoChannelDetail { | ||
| 174 | }) | 174 | }) |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | - this.batchContentDetail(list1) | ||
| 178 | - this.getContentInteract(list2) | 177 | + await this.batchContentDetail(list1, list2) |
| 178 | + | ||
| 179 | setTimeout(() => { | 179 | setTimeout(() => { |
| 180 | this.isMouted = true | 180 | this.isMouted = true |
| 181 | }, 500) | 181 | }, 500) |
| @@ -189,11 +189,14 @@ export struct VideoChannelDetail { | @@ -189,11 +189,14 @@ export struct VideoChannelDetail { | ||
| 189 | /** | 189 | /** |
| 190 | * 根据视频楼层信息批量查询视频列表 | 190 | * 根据视频楼层信息批量查询视频列表 |
| 191 | */ | 191 | */ |
| 192 | - async batchContentDetail(list: batchContentDetailParams) { | 192 | + async batchContentDetail(list: batchContentDetailParams, list2: contentListParams) { |
| 193 | if (list.contents.length > 0) { | 193 | if (list.contents.length > 0) { |
| 194 | - await ContentDetailRequest.batchContentDetail(list).then(res => { | 194 | + await ContentDetailRequest.batchContentDetail(list).then(async res => { |
| 195 | + if (res.data) { | ||
| 196 | + await this.getContentInteract(list2) | ||
| 197 | + this.data = this.data.concat(res.data) | ||
| 198 | + } | ||
| 195 | console.log('根据视频楼层信息批量查询视频列表', res.data) | 199 | console.log('根据视频楼层信息批量查询视频列表', res.data) |
| 196 | - this.data = this.data.concat(res.data as []) | ||
| 197 | }) | 200 | }) |
| 198 | } | 201 | } |
| 199 | } | 202 | } |
| @@ -204,7 +207,9 @@ export struct VideoChannelDetail { | @@ -204,7 +207,9 @@ export struct VideoChannelDetail { | ||
| 204 | async getContentInteract(list: contentListParams) { | 207 | async getContentInteract(list: contentListParams) { |
| 205 | if (list.contentList.length > 0) { | 208 | if (list.contentList.length > 0) { |
| 206 | await ContentDetailRequest.getContentInteract(list).then(res => { | 209 | await ContentDetailRequest.getContentInteract(list).then(res => { |
| 207 | - this.interactDataList = res.data || [] | 210 | + if (res.data) { |
| 211 | + this.interactDataList = this.interactDataList.concat(res.data) | ||
| 212 | + } | ||
| 208 | console.log('根据视频信息批量查询点赞、收藏状态', res.data) | 213 | console.log('根据视频信息批量查询点赞、收藏状态', res.data) |
| 209 | }) | 214 | }) |
| 210 | } | 215 | } |
| @@ -14,6 +14,7 @@ import { SpConstants } from 'wdConstant/Index' | @@ -14,6 +14,7 @@ import { SpConstants } from 'wdConstant/Index' | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | const TAG = 'PlayerRightView'; | 16 | const TAG = 'PlayerRightView'; |
| 17 | + | ||
| 17 | //视频点播页右侧操作栏:点赞/收藏/评论/分享 竖着排列 | 18 | //视频点播页右侧操作栏:点赞/收藏/评论/分享 竖着排列 |
| 18 | @Component | 19 | @Component |
| 19 | export struct PlayerRightView { | 20 | export struct PlayerRightView { |
| @@ -150,18 +151,17 @@ export struct PlayerRightView { | @@ -150,18 +151,17 @@ export struct PlayerRightView { | ||
| 150 | 151 | ||
| 151 | build() { | 152 | build() { |
| 152 | Column() { | 153 | Column() { |
| 153 | - if (this.interactData.contentId) { | 154 | + |
| 154 | this.userBuilderView() | 155 | this.userBuilderView() |
| 155 | this.likeBuilderView() | 156 | this.likeBuilderView() |
| 156 | this.collectBuilderView() | 157 | this.collectBuilderView() |
| 157 | this.commentBuilderView() | 158 | this.commentBuilderView() |
| 158 | this.shareBuilderView() | 159 | this.shareBuilderView() |
| 159 | - } | ||
| 160 | 160 | ||
| 161 | } | 161 | } |
| 162 | // .backgroundColor(Color.Blue) | 162 | // .backgroundColor(Color.Blue) |
| 163 | // .height('100%') | 163 | // .height('100%') |
| 164 | - .width(48) | 164 | + .width(58) |
| 165 | .position({ x: '100%', y: '100%' }) | 165 | .position({ x: '100%', y: '100%' }) |
| 166 | .markAnchor({ x: '100%', y: '100%' }) | 166 | .markAnchor({ x: '100%', y: '100%' }) |
| 167 | .padding({ bottom: 72, right: 10 }) | 167 | .padding({ bottom: 72, right: 10 }) |
-
Please register or login to post a comment