Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-09-27 14:40:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ef43792cccae1949cc960e8e7f71e1c1246178dd
ef43792c
1 parent
3dcbb20b
fix: 号主页全部、视频、下滑为号主视频,动态列表视频详情下滑为随机视频
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
15 deletions
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeArticleListComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeListComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeArticleListComponent.ets
View file @
ef43792
...
...
@@ -137,19 +137,13 @@ export struct PeopleShipHomeArticleListComponent {
}
aboutToAppear() {
console.log(TAG, 'cj2024 aboutToAppear')
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', this.creatorId)
// console.log(TAG, 'cj2024 aboutToAppear')
if (this.currentIndex == this.currentTopSelectedIndex) {
this.currentPage = 1
this.getPeopleShipPageArticleList()
}
}
aboutToDisappear(): void {
console.log(TAG, 'cj2024 aboutToDisappear')
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据
}
onChange() {
if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) {
this.currentPage = 1
...
...
@@ -159,7 +153,7 @@ export struct PeopleShipHomeArticleListComponent {
private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) {
Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`)
//
Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`)
if (this.isLoading) {
if (resolve) {
resolve('')
...
...
@@ -169,8 +163,8 @@ export struct PeopleShipHomeArticleListComponent {
try {
this.isLoading = true
let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type)
Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);
Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
// Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);
// Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
if (resolve ) {
if (this.currentPage == 1) {
...
...
@@ -196,7 +190,7 @@ export struct PeopleShipHomeArticleListComponent {
if (listData.totalCount === 0) {
this.viewType = 4
}
Logger.debug(TAG, '展示的总数'+`${this.arr.length}`)
//
Logger.debug(TAG, '展示的总数'+`${this.arr.length}`)
}catch (exception) {
if (resolve) {
resolve('')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeListComponent.ets
View file @
ef43792
...
...
@@ -6,6 +6,13 @@ import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
import { EmptyComponent } from '../view/EmptyComponent';
import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
const TAG = 'PeopleShipHomeListComponent'
interface peopleParams {
creatorId: string,
tabName: string
}
@Component
export struct PeopleShipHomeListComponent {
private controller: TabsController = new TabsController()
...
...
@@ -139,6 +146,12 @@ export struct PeopleShipHomeListComponent {
.onClick(() => {
this.controller.changeIndex(index)
this.currentIndex = index
console.log(TAG, 'name', name)
const params: peopleParams = {
creatorId: this.creatorId,
tabName: name
}
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', JSON.stringify(params))
})
}
...
...
@@ -147,7 +160,7 @@ export struct PeopleShipHomeListComponent {
this.isLoading = true
// 1:点播(视频),2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件 13:音频 14:动态图文 15:动态视频
let articleModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleCountData(1, this.creatorId)
Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`)
//
Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`)
this.updateTopBarData(articleModel)
this.isLoading = false
} catch (exception) {
...
...
@@ -155,6 +168,11 @@ export struct PeopleShipHomeListComponent {
}
}
aboutToDisappear(): void {
// console.log(TAG, 'cj2024 aboutToDisappear')
AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据
}
// 设置顶部数据
updateTopBarData(articleModel: ArticleCountData) {
if (articleModel) {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
ef43792
import { Action, ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index';
import { Action,
ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index';
import { NetworkUtil, WindowModel } from 'wdKit';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
...
...
@@ -16,10 +17,16 @@ import { BusinessError, systemDateTime } from '@kit.BasicServicesKit';
const storage = LocalStorage.getShared();
const TAG = 'DetailVideoListPage'
interface peopleParams {
creatorId: string,
tabName: string
}
@Entry(storage)
@Component
export struct DetailVideoListPage {
@State peopleShipHomeCreatorId: string = '';
@State tabName: string = ''; // 人民好主页全部、文章、视频、动态等name
private contentId: string = ''
private relId: string = ''
private relType: string = ''
...
...
@@ -101,6 +108,10 @@ export struct DetailVideoListPage {
this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
// console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
if (this.peopleShipHomeCreatorId) {
const params: peopleParams = JSON.parse(this.peopleShipHomeCreatorId);
this.tabName = params.tabName;
this.peopleShipHomeCreatorId = params.creatorId;
// console.info(TAG, `cj2024 tabName = ${this.tabName}`)
// 从人民号号主传过来的
this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
} else {
...
...
@@ -129,7 +140,6 @@ export struct DetailVideoListPage {
// console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`)
// console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`)
await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
}
// console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
} else {
...
...
@@ -276,7 +286,7 @@ export struct DetailVideoListPage {
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// console.log(TAG, 'get
Rmh
ContentDetail:', JSON.stringify(resDTO.data))
// this.isOffLine = resDTO.data == null ? true : false
if (resDTO.data) {
const params: contentListParams = {
...
...
@@ -293,6 +303,12 @@ export struct DetailVideoListPage {
// console.log('获取互动点赞等数据===', JSON.stringify(res))
})
this.data.push(resDTO.data[0])
if(this.tabName == '全部' || this.tabName == '视频') { // 全部和视频查询号主关联视频
await this.getRmhPublishNexts(this.peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
} else { // 目前动态是查询随机视频
await this.queryVideoList()
}
}
})
}
...
...
@@ -307,6 +323,7 @@ export struct DetailVideoListPage {
refreshTime 1694073009294
* */
async getRmhPublishNexts(creatorId: string, contentId: string, contentType: number,nextFlag: number,pageSize: number,refreshTime:number) {
// console.log(TAG, 'cj2024 getRmhPublishNexts:')
await ContentDetailRequest.getRmhPublishNexts({
creatorId: creatorId,
contentId: contentId,
...
...
Please
register
or
login
to post a comment