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
yumaochao
2024-05-16 14:19:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
75e15a29e217ba05c7595afb18d2bc8bb918b62e
75e15a29
1 parent
5274385a
fix: 视频增加网络连接错误的缺省图
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
75e15a2
import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils } from 'wdKit';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
...
...
@@ -7,7 +8,7 @@ import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentD
import { WindowModel } from 'wdKit';
import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
import { EmptyComponent } from 'wdComponent/Index';
const storage = LocalStorage.getShared();
const TAG = 'DetailVideoListPage'
...
...
@@ -29,9 +30,13 @@ export struct DetailVideoListPage {
@Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
@State data: ContentDetailDTO[] = []
@State currentIndex: number = 0
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State interactDataList: InteractDataDTO[] = []
async aboutToAppear(): Promise<void> {
// 注册监听网络连接
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen()
const action: Action = router.getParams() as Action
...
...
@@ -45,6 +50,12 @@ export struct DetailVideoListPage {
}
await this.queryVideoList()
console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
} else {
// 无网络
this.netStatus = 1
}
}
aboutToDisappear(): void {
...
...
@@ -163,6 +174,18 @@ export struct DetailVideoListPage {
}
build() {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: this.netStatus, emptyButton: true, retry: () => {
this.getContentDetail()
}
})
.id('e_empty_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
Column() {
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
...
...
Please
register
or
login
to post a comment