Showing
4 changed files
with
8 additions
and
13 deletions
| @@ -49,7 +49,8 @@ export struct LottieView { | @@ -49,7 +49,8 @@ export struct LottieView { | ||
| 49 | onDestroyAnimation(){ | 49 | onDestroyAnimation(){ |
| 50 | // 销毁动画,减少缓存 | 50 | // 销毁动画,减少缓存 |
| 51 | if (this.animateItem !== null) { | 51 | if (this.animateItem !== null) { |
| 52 | - this.animateItem.destroy(this.name); | 52 | + lottie.destroy(this.name) |
| 53 | + // console.log('lottie', 'onDestroyAnimation') | ||
| 53 | this.animateItem = null; | 54 | this.animateItem = null; |
| 54 | } | 55 | } |
| 55 | 56 | ||
| @@ -68,6 +69,7 @@ export struct LottieView { | @@ -68,6 +69,7 @@ export struct LottieView { | ||
| 68 | } | 69 | } |
| 69 | }) | 70 | }) |
| 70 | .onDisAppear(()=>{ | 71 | .onDisAppear(()=>{ |
| 72 | + // console.log('lottie', 'onDisAppear') | ||
| 71 | this.onDestroyAnimation() | 73 | this.onDestroyAnimation() |
| 72 | }) | 74 | }) |
| 73 | .onAppear(()=>{ | 75 | .onAppear(()=>{ |
| @@ -420,6 +420,7 @@ export struct DetailVideoListPage { | @@ -420,6 +420,7 @@ export struct DetailVideoListPage { | ||
| 420 | this.GestureLoadStrategy = 1 | 420 | this.GestureLoadStrategy = 1 |
| 421 | }) | 421 | }) |
| 422 | // 手势动画 初次进入显示 | 422 | // 手势动画 初次进入显示 |
| 423 | + if(this.GestureLoadStrategy == 0) { | ||
| 423 | LottieView({ | 424 | LottieView({ |
| 424 | name: 'slider_up_view_more', | 425 | name: 'slider_up_view_more', |
| 425 | path: "lottie/slider_up_view_more.json", | 426 | path: "lottie/slider_up_view_more.json", |
| @@ -428,10 +429,7 @@ export struct DetailVideoListPage { | @@ -428,10 +429,7 @@ export struct DetailVideoListPage { | ||
| 428 | autoplay: true, | 429 | autoplay: true, |
| 429 | loop: true | 430 | loop: true |
| 430 | }) | 431 | }) |
| 431 | - .visibility(this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 432 | - .onTouch(() => { | ||
| 433 | - this.GestureLoadStrategy = 1 | ||
| 434 | - }) | 432 | + } |
| 435 | } | 433 | } |
| 436 | } | 434 | } |
| 437 | .width('100%') | 435 | .width('100%') |
| @@ -16,7 +16,6 @@ import { window } from '@kit.ArkUI'; | @@ -16,7 +16,6 @@ import { window } from '@kit.ArkUI'; | ||
| 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; | 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; |
| 17 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | 17 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 18 | import { LottieView } from 'wdComponent/Index' | 18 | import { LottieView } from 'wdComponent/Index' |
| 19 | -import lottie from '@ohos/lottie'; | ||
| 20 | 19 | ||
| 21 | interface loadMoreData { | 20 | interface loadMoreData { |
| 22 | pageNum: number; | 21 | pageNum: number; |
| @@ -349,6 +348,7 @@ export struct VideoChannelDetail { | @@ -349,6 +348,7 @@ export struct VideoChannelDetail { | ||
| 349 | this.GestureLoadStrategy = 1 | 348 | this.GestureLoadStrategy = 1 |
| 350 | }) | 349 | }) |
| 351 | // 手势动画 初次进入显示 | 350 | // 手势动画 初次进入显示 |
| 351 | + if(this.isMouted && this.GestureLoadStrategy == 0) { | ||
| 352 | LottieView({ | 352 | LottieView({ |
| 353 | name: 'slider_up_view_more', | 353 | name: 'slider_up_view_more', |
| 354 | path: "lottie/slider_up_view_more.json", | 354 | path: "lottie/slider_up_view_more.json", |
| @@ -357,12 +357,7 @@ export struct VideoChannelDetail { | @@ -357,12 +357,7 @@ export struct VideoChannelDetail { | ||
| 357 | autoplay: true, | 357 | autoplay: true, |
| 358 | loop: true | 358 | loop: true |
| 359 | }) | 359 | }) |
| 360 | - .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.None) | ||
| 361 | - .onTouch(() => { | ||
| 362 | - this.GestureLoadStrategy = 1 | ||
| 363 | - lottie.destroy('slider_up_view_more') | ||
| 364 | - }) | ||
| 365 | - | 360 | + } |
| 366 | } | 361 | } |
| 367 | } | 362 | } |
| 368 | .width('100%') | 363 | .width('100%') |
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | "version": "1.0.0", | 11 | "version": "1.0.0", |
| 12 | "dependencies": { | 12 | "dependencies": { |
| 13 | "@ohos/pulltorefresh": "^2.0.6-rc.0", | 13 | "@ohos/pulltorefresh": "^2.0.6-rc.0", |
| 14 | - "@ohos/lottie": "v2.0.11-rc.6", | 14 | + "@ohos/lottie": "^v2.0.13", |
| 15 | "@ohos/imageknife": "^2.1.2", | 15 | "@ohos/imageknife": "^2.1.2", |
| 16 | }, | 16 | }, |
| 17 | "dynamicDependencies": {} | 17 | "dynamicDependencies": {} |
-
Please register or login to post a comment