zhenghy

修改模块引入

... ... @@ -5,10 +5,10 @@ import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import router from '@ohos.router';
import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { WindowModel } from 'wdKit';
import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
import { EmptyComponent } from 'wdComponent/Index';
import { EmptyComponent } from '../../../../../wdComponent/src/main/ets/components/view/EmptyComponent';
const storage = LocalStorage.getShared();
const TAG = 'DetailVideoListPage'
... ... @@ -39,23 +39,23 @@ export struct DetailVideoListPage {
if (netStatus) {
this.openFullScreen()
const action: Action = router.getParams() as Action
if (action) {
this.contentId = action.params?.contentID || ''
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId || ''
this.relType = action.params.extra.relType || ''
const action: Action = router.getParams() as Action
if (action) {
this.contentId = action.params?.contentID || ''
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId || ''
this.relType = action.params.extra.relType || ''
}
await this.getContentDetail(this.contentId, this.relId, this.relType)
}
await this.getContentDetail(this.contentId, this.relId, this.relType)
}
await this.queryVideoList()
console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
await this.queryVideoList()
console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
} else {
// 无网络
this.netStatus = 1
}
}
aboutToDisappear(): void {
... ... @@ -174,10 +174,10 @@ export struct DetailVideoListPage {
}
build() {
if (this.netStatus !== undefined) {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: this.netStatus, emptyButton: true, retry: () => {
this.getContentDetail()
this.getContentDetail(this.contentId, this.relId, this.relType)
}
})
.id('e_empty_content')
... ... @@ -185,40 +185,42 @@ export struct DetailVideoListPage {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
Column() {
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
DetailPlayShortVideoPage({
contentDetailData: item,
currentIndex: this.currentIndex,
index: index,
interactData: this.interactDataList[index]
})
}, (item: ContentDetailDTO) => item.newsId + '')
} else {
Column() {
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
DetailPlayShortVideoPage({
contentDetailData: item,
currentIndex: this.currentIndex,
index: index,
interactData: this.interactDataList[index]
})
}, (item: ContentDetailDTO) => item.newsId + '')
}
.disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true)
.indicator(false)
.vertical(true)
.loop(false)
.width('100%')
.height('100%')
.displayCount(1, true)
.onChange((index: number) => {
this.currentIndex = index
if (this.currentIndex === this.data.length - 1) {
// TODO:下拉刷新“努力加载中”
this.queryVideoList()
}
})
}
.disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true)
.indicator(false)
.vertical(true)
.loop(false)
.width('100%')
.height('100%')
.displayCount(1, true)
.onChange((index: number) => {
this.currentIndex = index
if (this.currentIndex === this.data.length - 1) {
// TODO:下拉刷新“努力加载中”
this.queryVideoList()
}
})
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .padding({
// bottom: this.bottomSafeHeight + 'px'
// })
}
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .padding({
// bottom: this.bottomSafeHeight + 'px'
// })
}
}
\ No newline at end of file
... ...