王士厅

fix: 升级lottie三方库最新版本,修改沉浸式视频引导动画销毁逻辑

... ... @@ -49,7 +49,8 @@ export struct LottieView {
onDestroyAnimation(){
// 销毁动画,减少缓存
if (this.animateItem !== null) {
this.animateItem.destroy(this.name);
lottie.destroy(this.name)
// console.log('lottie', 'onDestroyAnimation')
this.animateItem = null;
}
... ... @@ -68,6 +69,7 @@ export struct LottieView {
}
})
.onDisAppear(()=>{
// console.log('lottie', 'onDisAppear')
this.onDestroyAnimation()
})
.onAppear(()=>{
... ...
... ... @@ -420,6 +420,7 @@ export struct DetailVideoListPage {
this.GestureLoadStrategy = 1
})
// 手势动画 初次进入显示
if(this.GestureLoadStrategy == 0) {
LottieView({
name: 'slider_up_view_more',
path: "lottie/slider_up_view_more.json",
... ... @@ -428,10 +429,7 @@ export struct DetailVideoListPage {
autoplay: true,
loop: true
})
.visibility(this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden)
.onTouch(() => {
this.GestureLoadStrategy = 1
})
}
}
}
.width('100%')
... ...
... ... @@ -16,7 +16,6 @@ import { window } from '@kit.ArkUI';
import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LottieView } from 'wdComponent/Index'
import lottie from '@ohos/lottie';
interface loadMoreData {
pageNum: number;
... ... @@ -349,6 +348,7 @@ export struct VideoChannelDetail {
this.GestureLoadStrategy = 1
})
// 手势动画 初次进入显示
if(this.isMouted && this.GestureLoadStrategy == 0) {
LottieView({
name: 'slider_up_view_more',
path: "lottie/slider_up_view_more.json",
... ... @@ -357,12 +357,7 @@ export struct VideoChannelDetail {
autoplay: true,
loop: true
})
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.None)
.onTouch(() => {
this.GestureLoadStrategy = 1
lottie.destroy('slider_up_view_more')
})
}
}
}
.width('100%')
... ...
... ... @@ -11,7 +11,7 @@
"version": "1.0.0",
"dependencies": {
"@ohos/pulltorefresh": "^2.0.6-rc.0",
"@ohos/lottie": "v2.0.11-rc.6",
"@ohos/lottie": "^v2.0.13",
"@ohos/imageknife": "^2.1.2",
},
"dynamicDependencies": {}
... ...