王士厅

fix: 动态视频>进入视频播放详情页-引导功能未实现

@@ -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,20 +230,20 @@ export struct DetailVideoListPage { @@ -228,20 +230,20 @@ export struct DetailVideoListPage {
228 } 230 }
229 231
230 build() { 232 build() {
231 - if (this.netStatus !== undefined || this.isOffLine) {  
232 - EmptyComponent({  
233 - emptyType: 15, emptyButton: true, retry: () => {  
234 - this.getContentDetail(this.contentId, this.relId, this.relType)  
235 - }  
236 - })  
237 - .id('e_empty_content')  
238 - .alignRules({  
239 - center: { anchor: "__container__", align: VerticalAlign.Center },  
240 - middle: { anchor: "__container__", align: HorizontalAlign.Center } 233 + Stack({ alignContent: Alignment.Center }) {
  234 + if (this.netStatus !== undefined || this.isOffLine) {
  235 + EmptyComponent({
  236 + emptyType: 15, emptyButton: true, retry: () => {
  237 + this.getContentDetail(this.contentId, this.relId, this.relType)
  238 + }
241 }) 239 })
242 - .backgroundColor(Color.Black)  
243 - } else {  
244 - Column() { 240 + .id('e_empty_content')
  241 + .alignRules({
  242 + center: { anchor: "__container__", align: VerticalAlign.Center },
  243 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  244 + })
  245 + .backgroundColor(Color.Black)
  246 + } else {
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 + })
270 } 295 }
271 - .width('100%')  
272 - .height('100%')  
273 - .backgroundColor(Color.Black)  
274 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
275 -  
276 - // .padding({  
277 - // bottom: this.bottomSafeHeight + 'px'  
278 - // })  
279 } 296 }
  297 + .width('100%')
  298 + .height('100%')
  299 + .backgroundColor(Color.Black)
280 300
281 } 301 }
282 } 302 }