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-07-25 18:38:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ec42bd7e57951c15b7339d1d1f1c7b0575ca4ae
9ec42bd7
1 parent
ce341989
fix: 视频频道、点播视频详情页、图集详情页断网缺省图逻辑优化
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
24 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailItemComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MultiPictureDetailItemComponent.ets
View file @
9ec42bd
...
...
@@ -237,7 +237,6 @@ export struct MultiPictureDetailItemComponent {
.indicator(false)
.displayCount(1)
.loop(false)
.zIndex(10)
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => {
console.info("onGestureSwipe current offset: " + extraInfo.currentOffset)
this.currentOffset = Math.abs(extraInfo.currentOffset)
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
9ec42bd
import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import { NetworkUtil,
Logger, NetworkType, SPHelper, WindowModel, StringUtils
} from 'wdKit';
import { NetworkUtil,
WindowModel
} from 'wdKit';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
...
...
@@ -48,8 +48,9 @@ export struct DetailVideoListPage {
@State isShowAudioCom: boolean = false
@StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0
async
aboutToAppear(): Promise<void>
{
async
getDetail()
{
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen()
...
...
@@ -69,7 +70,10 @@ export struct DetailVideoListPage {
// 无网络
this.netStatus = 1
}
}
aboutToAppear() {
this.getDetail()
}
aboutToDisappear(): void {
...
...
@@ -233,7 +237,7 @@ export struct DetailVideoListPage {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.get
ContentDetail(this.contentId, this.relId, this.relType
)
this.get
Detail(
)
}
})
.id('e_empty_content')
...
...
@@ -244,7 +248,7 @@ export struct DetailVideoListPage {
} else if (this.isOffLine) {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.get
ContentDetail(this.contentId, this.relId, this.relType
)
this.get
Detail(
)
}
})
.id('e_empty_content')
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
9ec42bd
...
...
@@ -9,7 +9,7 @@ import {
contentListParams,
getRecCompInfoParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { Logger, WindowModel, DateTimeUtils } from 'wdKit/Index';
import {
NetworkUtil,
Logger, WindowModel, DateTimeUtils } from 'wdKit/Index';
import { PictureLoading } from './PictureLoading';
import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
...
...
@@ -61,7 +61,8 @@ export struct VideoChannelDetail {
@State interactDataList: InteractDataDTO[] = []
@State totalCount: number = 0
@State isMouted: boolean = false
@State isRequestError: boolean = false
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
@State isRequesting: boolean = false
pageShowTime: number = 0;
pageHideTime: number = 0;
...
...
@@ -120,10 +121,23 @@ export struct VideoChannelDetail {
}
}
getDetail() {
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
this.openFullScreen()
// 根据视频频道传参查询视频楼层信息
this.getRecCompInfo()
} else {
// 无网络
this.netStatus = 1
}
}
aboutToAppear() {
this.openFullScreen()
// 根据视频频道传参查询视频楼层信息
this.getRecCompInfo()
this.getDetail()
Logger.info(TAG, 'aboutToAppear');
}
...
...
@@ -193,7 +207,7 @@ export struct VideoChannelDetail {
}
await ContentDetailRequest.getRecCompInfo(params).then(async res => {
this.is
RequestError =
false
this.is
OffLine = res.data == null ? true :
false
console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
this.totalCount = res.data?.totalCount || 0
...
...
@@ -229,7 +243,6 @@ export struct VideoChannelDetail {
}).catch(() => {
// 获取内容失败请重试
this.isRequestError = true
this.isRequesting = false
})
}
...
...
@@ -272,11 +285,17 @@ export struct VideoChannelDetail {
build() {
Stack({ alignContent: Alignment.Center }) {
if (this.isRequestError) {
if (this.netStatus !== undefined) {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.getDetail()
}
})
} else if (this.isOffLine) {
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo,
retry: () => {
this.get
RecCompInfo
()
this.get
Detail
()
}
})
} else {
...
...
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
View file @
9ec42bd
...
...
@@ -72,13 +72,9 @@ export struct MultiPictureDetailPageComponent {
this.listScroller.scrollEdge(Edge.Top)
}
async aboutToAppear() {
//注册字体
// font.registerFont({
// familyName: 'BebasNeueBold',
// familySrc: $rawfile('font/BebasNeueBold.otf')
// })
getDetail() {
// 注册监听网络连接
this.netStatus = undefined
let netStatus = NetworkUtil.isNetConnected()
if (netStatus) {
// 有网络
...
...
@@ -87,6 +83,15 @@ export struct MultiPictureDetailPageComponent {
// 无网络
this.netStatus = 1
}
}
aboutToAppear() {
//注册字体
// font.registerFont({
// familyName: 'BebasNeueBold',
// familySrc: $rawfile('font/BebasNeueBold.otf')
// })
this.getDetail()
this.contentTrackingDict()
}
...
...
@@ -316,7 +321,6 @@ export struct MultiPictureDetailPageComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.zIndex(1)
.onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => {
this.swiperIndex = targetIndex
this.scroller.scrollEdge(Edge.Top)
...
...
@@ -503,7 +507,7 @@ export struct MultiPictureDetailPageComponent {
noNet() {
EmptyComponent({
emptyType: 1, emptyButton: true, isBlack: true, retry: () => {
this.get
ContentDetailData
()
this.get
Detail
()
}
})
.id('e_empty_content')
...
...
@@ -512,13 +516,14 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
.zIndex(10)
}
@Builder
offLine() {
EmptyComponent({
emptyType: 15, emptyButton: true, retry: () => {
this.get
ContentDetailData
this.get
Detail()
}
})
.id('e_empty_content')
...
...
@@ -527,6 +532,7 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.backgroundColor(Color.Black)
.zIndex(10)
}
getContentDetailData() {
...
...
@@ -575,7 +581,7 @@ export struct MultiPictureDetailPageComponent {
}
})
.catch((err: Error) => {
Logger.info
(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
console.log
(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
// 内容获取失败
this.netStatus = 9
this.operationButtonList = []
...
...
Please
register
or
login
to post a comment