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
wangliang_wd
2024-10-15 15:01:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
77161a5c70b8914c551041bcf3cb25e820d9ed71
77161a5c
1 parent
79f0a016
feat:增加沉浸式视频下拉刷新
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
12 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
77161a5
...
...
@@ -74,12 +74,17 @@ export struct VideoChannelDetail {
@StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0
@State timer: number = -1
///视频下拉刷新
@State currentOffset: number = 0
@State endIndex: number = 0
@Link isRefreshList: boolean
autoRefreshChange() {
if (this.topNavIndex === 0 && !this.isRequesting) {
this.data = []
this.interactDataList = []
this.totalCount = 0
this.isMouted = false
this.isRefreshList = true
this.getRecCompInfo()
}
...
...
@@ -267,6 +272,7 @@ export struct VideoChannelDetail {
}).catch(() => {
// 获取内容失败请重试
this.isRequesting = false
this.isRefreshList = false
})
}
...
...
@@ -276,6 +282,7 @@ export struct VideoChannelDetail {
async batchContentDetail(list: batchContentDetailParams, list2: contentListParams) {
if (list.contents.length > 0) {
await ContentDetailRequest.batchContentDetail(list).then(async res => {
this.isRefreshList = false
if (res.data) {
await this.getContentInteract(list2)
this.data = this.data.concat(res.data)
...
...
@@ -289,6 +296,7 @@ export struct VideoChannelDetail {
})
} else {
this.isRefreshList = false
this.isRequesting = false
}
}
...
...
@@ -362,6 +370,16 @@ export struct VideoChannelDetail {
this.getRecCompInfo()
}
})
.onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) =>{
console.log('视频tab下拉', index.toString() + extraInfo.currentOffset)
this.currentOffset = extraInfo.currentOffset
})
.onAnimationEnd((index: number)=>{
if (this.currentOffset > 0 && this.endIndex === 0) {
this.autoRefreshChange()
}
this.endIndex = index
})
// 作为手势动画的背景
Row() {}
.justifyContent(FlexAlign.Center)
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
77161a5
...
...
@@ -6,7 +6,7 @@ import { BottomNavDTO, TopNavDTO } from 'wdBean/Index';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection ,BottomNavi} from 'wdConstant/Index';
import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index';
import { CompUtils, GrayManageModel,
LottieView,
PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { ParamType, Tracking } from 'wdTracking/Index';
import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
...
...
@@ -52,6 +52,7 @@ export struct VideoChannelPage {
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0
@State isRefreshList: boolean = false
async aboutToAppear() {
// 背景图高度
this.backgroundImageH = px2vp(this.topSafeHeight) + 44
...
...
@@ -242,12 +243,29 @@ export struct VideoChannelPage {
// 搜索按钮
Row() {
Image($r(this.isImmerseChannel() ? 'app.media.icon_search_gray_svg' :
'app.media.icon_search'))
.colorFilter(this.isImmerseChannel() ? undefined :
ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width('24vp')
.height('24vp')
if (this.isRefreshList){
LottieView({
name: 'VideoChannelPageLottie',
path: "lottie/refresh_step2.json",
lottieWidth: 40,
lottieHeight: 40,
autoplay: true,
loop: true,
})
}else {
Image($r(this.isImmerseChannel() ? 'app.media.icon_search_gray_svg' :
'app.media.icon_search'))
.colorFilter(this.isImmerseChannel() ? undefined :
ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width('24vp')
.height('24vp')
.onClick(() => {
TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS")
let params = { 'tabName': "VIDEOS" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
})
}
// .opacity(this.isImmerseChannel() ? 0.8 : 1.0)
}
.width('40vp')
...
...
@@ -257,11 +275,6 @@ export struct VideoChannelPage {
})
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(() => {
TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS")
let params = { 'tabName': "VIDEOS" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
})
.backgroundColor(Color.Transparent)
}
...
...
@@ -317,6 +330,7 @@ export struct VideoChannelPage {
pageName: item.name + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh,
isRefreshList: this.isRefreshList
})
} else {
Column() {
...
...
Please
register
or
login
to post a comment