Showing
1 changed file
with
28 additions
and
8 deletions
| @@ -7,7 +7,7 @@ import router from '@ohos.router'; | @@ -7,7 +7,7 @@ import router from '@ohos.router'; | ||
| 7 | import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 7 | import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { window } from '@kit.ArkUI'; | 9 | import { window } from '@kit.ArkUI'; |
| 10 | -import { EmptyComponent } from 'wdComponent/Index'; | 10 | +import { EmptyComponent, LottieView } from 'wdComponent/Index'; |
| 11 | import { DateTimeUtils } from 'wdKit/Index'; | 11 | import { DateTimeUtils } from 'wdKit/Index'; |
| 12 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | 12 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| 13 | import { AudioSuspensionModel } from 'wdComponent' | 13 | import { AudioSuspensionModel } from 'wdComponent' |
| @@ -15,6 +15,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; | @@ -15,6 +15,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 15 | 15 | ||
| 16 | const storage = LocalStorage.getShared(); | 16 | const storage = LocalStorage.getShared(); |
| 17 | const TAG = 'DetailVideoListPage' | 17 | const TAG = 'DetailVideoListPage' |
| 18 | +PersistentStorage.persistProp('DetailVideoListGestureLoadStrategy', 0); // 点播视频手势动画0为用户首次进入视频点播,1为用户已进入视频点播 | ||
| 18 | 19 | ||
| 19 | @Entry(storage) | 20 | @Entry(storage) |
| 20 | @Component | 21 | @Component |
| @@ -46,6 +47,7 @@ export struct DetailVideoListPage { | @@ -46,6 +47,7 @@ export struct DetailVideoListPage { | ||
| 46 | @Provide toastTextVisible: boolean = false | 47 | @Provide toastTextVisible: boolean = false |
| 47 | private AudioSuspension = new AudioSuspensionModel() | 48 | private AudioSuspension = new AudioSuspensionModel() |
| 48 | @State isShowAudioCom: boolean = false | 49 | @State isShowAudioCom: boolean = false |
| 50 | + @StorageLink('DetailVideoListGestureLoadStrategy') DetailVideoListGestureLoadStrategy: number = 0 | ||
| 49 | 51 | ||
| 50 | async aboutToAppear(): Promise<void> { | 52 | async aboutToAppear(): Promise<void> { |
| 51 | // 注册监听网络连接 | 53 | // 注册监听网络连接 |
| @@ -228,6 +230,7 @@ export struct DetailVideoListPage { | @@ -228,6 +230,7 @@ export struct DetailVideoListPage { | ||
| 228 | } | 230 | } |
| 229 | 231 | ||
| 230 | build() { | 232 | build() { |
| 233 | + Stack({ alignContent: Alignment.Center }) { | ||
| 231 | if (this.netStatus !== undefined || this.isOffLine) { | 234 | if (this.netStatus !== undefined || this.isOffLine) { |
| 232 | EmptyComponent({ | 235 | EmptyComponent({ |
| 233 | emptyType: 15, emptyButton: true, retry: () => { | 236 | emptyType: 15, emptyButton: true, retry: () => { |
| @@ -241,7 +244,6 @@ export struct DetailVideoListPage { | @@ -241,7 +244,6 @@ export struct DetailVideoListPage { | ||
| 241 | }) | 244 | }) |
| 242 | .backgroundColor(Color.Black) | 245 | .backgroundColor(Color.Black) |
| 243 | } else { | 246 | } else { |
| 244 | - Column() { | ||
| 245 | Swiper(this.swiperController) { | 247 | Swiper(this.swiperController) { |
| 246 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { | 248 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { |
| 247 | DetailPlayShortVideoPage({ | 249 | DetailPlayShortVideoPage({ |
| @@ -267,16 +269,34 @@ export struct DetailVideoListPage { | @@ -267,16 +269,34 @@ export struct DetailVideoListPage { | ||
| 267 | this.queryVideoList() | 269 | this.queryVideoList() |
| 268 | } | 270 | } |
| 269 | }) | 271 | }) |
| 272 | + // 作为手势动画的背景 | ||
| 273 | + Row() {} | ||
| 274 | + .justifyContent(FlexAlign.Center) | ||
| 275 | + .width('100%') | ||
| 276 | + .height('100%') | ||
| 277 | + .visibility(this.DetailVideoListGestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 278 | + .backgroundColor('rgba(0, 0, 0, 0.50)') | ||
| 279 | + .onTouch(() => { | ||
| 280 | + this.DetailVideoListGestureLoadStrategy = 1 | ||
| 281 | + }) | ||
| 282 | + // 手势动画 初次进入显示 | ||
| 283 | + LottieView({ | ||
| 284 | + name: 'slider_up_view_more', | ||
| 285 | + path: "lottie/slider_up_view_more.json", | ||
| 286 | + lottieWidth: 167, | ||
| 287 | + lottieHeight: 167, | ||
| 288 | + autoplay: true, | ||
| 289 | + loop: true | ||
| 290 | + }) | ||
| 291 | + .visibility(this.DetailVideoListGestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 292 | + .onTouch(() => { | ||
| 293 | + this.DetailVideoListGestureLoadStrategy = 1 | ||
| 294 | + }) | ||
| 295 | + } | ||
| 270 | } | 296 | } |
| 271 | .width('100%') | 297 | .width('100%') |
| 272 | .height('100%') | 298 | .height('100%') |
| 273 | .backgroundColor(Color.Black) | 299 | .backgroundColor(Color.Black) |
| 274 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 275 | - | ||
| 276 | - // .padding({ | ||
| 277 | - // bottom: this.bottomSafeHeight + 'px' | ||
| 278 | - // }) | ||
| 279 | - } | ||
| 280 | 300 | ||
| 281 | } | 301 | } |
| 282 | } | 302 | } |
-
Please register or login to post a comment