Showing
3 changed files
with
44 additions
and
15 deletions
| @@ -137,19 +137,13 @@ export struct PeopleShipHomeArticleListComponent { | @@ -137,19 +137,13 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | aboutToAppear() { | 139 | aboutToAppear() { |
| 140 | - console.log(TAG, 'cj2024 aboutToAppear') | ||
| 141 | - AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', this.creatorId) | 140 | + // console.log(TAG, 'cj2024 aboutToAppear') |
| 142 | if (this.currentIndex == this.currentTopSelectedIndex) { | 141 | if (this.currentIndex == this.currentTopSelectedIndex) { |
| 143 | this.currentPage = 1 | 142 | this.currentPage = 1 |
| 144 | this.getPeopleShipPageArticleList() | 143 | this.getPeopleShipPageArticleList() |
| 145 | } | 144 | } |
| 146 | } | 145 | } |
| 147 | 146 | ||
| 148 | - aboutToDisappear(): void { | ||
| 149 | - console.log(TAG, 'cj2024 aboutToDisappear') | ||
| 150 | - AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据 | ||
| 151 | - } | ||
| 152 | - | ||
| 153 | onChange() { | 147 | onChange() { |
| 154 | if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) { | 148 | if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) { |
| 155 | this.currentPage = 1 | 149 | this.currentPage = 1 |
| @@ -159,7 +153,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -159,7 +153,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 159 | 153 | ||
| 160 | 154 | ||
| 161 | private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) { | 155 | private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) { |
| 162 | - Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) | 156 | + // Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) |
| 163 | if (this.isLoading) { | 157 | if (this.isLoading) { |
| 164 | if (resolve) { | 158 | if (resolve) { |
| 165 | resolve('') | 159 | resolve('') |
| @@ -169,8 +163,8 @@ export struct PeopleShipHomeArticleListComponent { | @@ -169,8 +163,8 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 169 | try { | 163 | try { |
| 170 | this.isLoading = true | 164 | this.isLoading = true |
| 171 | let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) | 165 | let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) |
| 172 | - Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`); | ||
| 173 | - Logger.debug(TAG, `已更新值最新, ${this.currentPage}`); | 166 | + // Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`); |
| 167 | + // Logger.debug(TAG, `已更新值最新, ${this.currentPage}`); | ||
| 174 | 168 | ||
| 175 | if (resolve ) { | 169 | if (resolve ) { |
| 176 | if (this.currentPage == 1) { | 170 | if (this.currentPage == 1) { |
| @@ -196,7 +190,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -196,7 +190,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 196 | if (listData.totalCount === 0) { | 190 | if (listData.totalCount === 0) { |
| 197 | this.viewType = 4 | 191 | this.viewType = 4 |
| 198 | } | 192 | } |
| 199 | - Logger.debug(TAG, '展示的总数'+`${this.arr.length}`) | 193 | + // Logger.debug(TAG, '展示的总数'+`${this.arr.length}`) |
| 200 | }catch (exception) { | 194 | }catch (exception) { |
| 201 | if (resolve) { | 195 | if (resolve) { |
| 202 | resolve('') | 196 | resolve('') |
| @@ -6,6 +6,13 @@ import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | @@ -6,6 +6,13 @@ import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | ||
| 6 | import { EmptyComponent } from '../view/EmptyComponent'; | 6 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 7 | import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | 7 | import { RefreshLayoutBean } from '../page/RefreshLayoutBean' |
| 8 | 8 | ||
| 9 | +const TAG = 'PeopleShipHomeListComponent' | ||
| 10 | + | ||
| 11 | +interface peopleParams { | ||
| 12 | + creatorId: string, | ||
| 13 | + tabName: string | ||
| 14 | +} | ||
| 15 | + | ||
| 9 | @Component | 16 | @Component |
| 10 | export struct PeopleShipHomeListComponent { | 17 | export struct PeopleShipHomeListComponent { |
| 11 | private controller: TabsController = new TabsController() | 18 | private controller: TabsController = new TabsController() |
| @@ -139,6 +146,12 @@ export struct PeopleShipHomeListComponent { | @@ -139,6 +146,12 @@ export struct PeopleShipHomeListComponent { | ||
| 139 | .onClick(() => { | 146 | .onClick(() => { |
| 140 | this.controller.changeIndex(index) | 147 | this.controller.changeIndex(index) |
| 141 | this.currentIndex = index | 148 | this.currentIndex = index |
| 149 | + console.log(TAG, 'name', name) | ||
| 150 | + const params: peopleParams = { | ||
| 151 | + creatorId: this.creatorId, | ||
| 152 | + tabName: name | ||
| 153 | + } | ||
| 154 | + AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', JSON.stringify(params)) | ||
| 142 | }) | 155 | }) |
| 143 | } | 156 | } |
| 144 | 157 | ||
| @@ -147,7 +160,7 @@ export struct PeopleShipHomeListComponent { | @@ -147,7 +160,7 @@ export struct PeopleShipHomeListComponent { | ||
| 147 | this.isLoading = true | 160 | this.isLoading = true |
| 148 | // 1:点播(视频),2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件 13:音频 14:动态图文 15:动态视频 | 161 | // 1:点播(视频),2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件 13:音频 14:动态图文 15:动态视频 |
| 149 | let articleModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleCountData(1, this.creatorId) | 162 | let articleModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleCountData(1, this.creatorId) |
| 150 | - Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`) | 163 | + // Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`) |
| 151 | this.updateTopBarData(articleModel) | 164 | this.updateTopBarData(articleModel) |
| 152 | this.isLoading = false | 165 | this.isLoading = false |
| 153 | } catch (exception) { | 166 | } catch (exception) { |
| @@ -155,6 +168,11 @@ export struct PeopleShipHomeListComponent { | @@ -155,6 +168,11 @@ export struct PeopleShipHomeListComponent { | ||
| 155 | } | 168 | } |
| 156 | } | 169 | } |
| 157 | 170 | ||
| 171 | + aboutToDisappear(): void { | ||
| 172 | + // console.log(TAG, 'cj2024 aboutToDisappear') | ||
| 173 | + AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据 | ||
| 174 | + } | ||
| 175 | + | ||
| 158 | // 设置顶部数据 | 176 | // 设置顶部数据 |
| 159 | updateTopBarData(articleModel: ArticleCountData) { | 177 | updateTopBarData(articleModel: ArticleCountData) { |
| 160 | if (articleModel) { | 178 | if (articleModel) { |
| 1 | -import { Action, ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index'; | 1 | +import { Action, |
| 2 | + ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index'; | ||
| 2 | import { NetworkUtil, WindowModel } from 'wdKit'; | 3 | import { NetworkUtil, WindowModel } from 'wdKit'; |
| 3 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | 4 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' |
| 4 | import { ResponseDTO } from 'wdNetwork/Index'; | 5 | import { ResponseDTO } from 'wdNetwork/Index'; |
| @@ -16,10 +17,16 @@ import { BusinessError, systemDateTime } from '@kit.BasicServicesKit'; | @@ -16,10 +17,16 @@ import { BusinessError, systemDateTime } from '@kit.BasicServicesKit'; | ||
| 16 | const storage = LocalStorage.getShared(); | 17 | const storage = LocalStorage.getShared(); |
| 17 | const TAG = 'DetailVideoListPage' | 18 | const TAG = 'DetailVideoListPage' |
| 18 | 19 | ||
| 20 | +interface peopleParams { | ||
| 21 | + creatorId: string, | ||
| 22 | + tabName: string | ||
| 23 | +} | ||
| 24 | + | ||
| 19 | @Entry(storage) | 25 | @Entry(storage) |
| 20 | @Component | 26 | @Component |
| 21 | export struct DetailVideoListPage { | 27 | export struct DetailVideoListPage { |
| 22 | @State peopleShipHomeCreatorId: string = ''; | 28 | @State peopleShipHomeCreatorId: string = ''; |
| 29 | + @State tabName: string = ''; // 人民好主页全部、文章、视频、动态等name | ||
| 23 | private contentId: string = '' | 30 | private contentId: string = '' |
| 24 | private relId: string = '' | 31 | private relId: string = '' |
| 25 | private relType: string = '' | 32 | private relType: string = '' |
| @@ -101,6 +108,10 @@ export struct DetailVideoListPage { | @@ -101,6 +108,10 @@ export struct DetailVideoListPage { | ||
| 101 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; | 108 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; |
| 102 | // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) | 109 | // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) |
| 103 | if (this.peopleShipHomeCreatorId) { | 110 | if (this.peopleShipHomeCreatorId) { |
| 111 | + const params: peopleParams = JSON.parse(this.peopleShipHomeCreatorId); | ||
| 112 | + this.tabName = params.tabName; | ||
| 113 | + this.peopleShipHomeCreatorId = params.creatorId; | ||
| 114 | + // console.info(TAG, `cj2024 tabName = ${this.tabName}`) | ||
| 104 | // 从人民号号主传过来的 | 115 | // 从人民号号主传过来的 |
| 105 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); | 116 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); |
| 106 | } else { | 117 | } else { |
| @@ -129,7 +140,6 @@ export struct DetailVideoListPage { | @@ -129,7 +140,6 @@ export struct DetailVideoListPage { | ||
| 129 | // console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`) | 140 | // console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`) |
| 130 | // console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`) | 141 | // console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`) |
| 131 | await this.getRmhContentDetail(this.contentId, this.relId, this.relType) | 142 | await this.getRmhContentDetail(this.contentId, this.relId, this.relType) |
| 132 | - this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); | ||
| 133 | } | 143 | } |
| 134 | // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) | 144 | // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) |
| 135 | } else { | 145 | } else { |
| @@ -276,7 +286,7 @@ export struct DetailVideoListPage { | @@ -276,7 +286,7 @@ export struct DetailVideoListPage { | ||
| 276 | relId: relId, | 286 | relId: relId, |
| 277 | relType: relType | 287 | relType: relType |
| 278 | }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | 288 | }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { |
| 279 | - // console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | 289 | + // console.log(TAG, 'getRmhContentDetail:', JSON.stringify(resDTO.data)) |
| 280 | // this.isOffLine = resDTO.data == null ? true : false | 290 | // this.isOffLine = resDTO.data == null ? true : false |
| 281 | if (resDTO.data) { | 291 | if (resDTO.data) { |
| 282 | const params: contentListParams = { | 292 | const params: contentListParams = { |
| @@ -293,6 +303,12 @@ export struct DetailVideoListPage { | @@ -293,6 +303,12 @@ export struct DetailVideoListPage { | ||
| 293 | // console.log('获取互动点赞等数据===', JSON.stringify(res)) | 303 | // console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 294 | }) | 304 | }) |
| 295 | this.data.push(resDTO.data[0]) | 305 | this.data.push(resDTO.data[0]) |
| 306 | + | ||
| 307 | + if(this.tabName == '全部' || this.tabName == '视频') { // 全部和视频查询号主关联视频 | ||
| 308 | + await this.getRmhPublishNexts(this.peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); | ||
| 309 | + } else { // 目前动态是查询随机视频 | ||
| 310 | + await this.queryVideoList() | ||
| 311 | + } | ||
| 296 | } | 312 | } |
| 297 | }) | 313 | }) |
| 298 | } | 314 | } |
| @@ -307,6 +323,7 @@ export struct DetailVideoListPage { | @@ -307,6 +323,7 @@ export struct DetailVideoListPage { | ||
| 307 | refreshTime 1694073009294 | 323 | refreshTime 1694073009294 |
| 308 | * */ | 324 | * */ |
| 309 | async getRmhPublishNexts(creatorId: string, contentId: string, contentType: number,nextFlag: number,pageSize: number,refreshTime:number) { | 325 | async getRmhPublishNexts(creatorId: string, contentId: string, contentType: number,nextFlag: number,pageSize: number,refreshTime:number) { |
| 326 | + // console.log(TAG, 'cj2024 getRmhPublishNexts:') | ||
| 310 | await ContentDetailRequest.getRmhPublishNexts({ | 327 | await ContentDetailRequest.getRmhPublishNexts({ |
| 311 | creatorId: creatorId, | 328 | creatorId: creatorId, |
| 312 | contentId: contentId, | 329 | contentId: contentId, |
-
Please register or login to post a comment