Showing
5 changed files
with
44 additions
and
12 deletions
| @@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent { | @@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent { | ||
| 68 | @Provide progressVal: number = 0; | 68 | @Provide progressVal: number = 0; |
| 69 | @State mixedBgColor: string = '' | 69 | @State mixedBgColor: string = '' |
| 70 | // 顶部安全高度赋值 | 70 | // 顶部安全高度赋值 |
| 71 | - @State topSafeHeight: number = 0; | ||
| 72 | - @State bottomSafeHeight: number = 0; | 71 | + @State topSafeHeight: number = px2vp(AppStorage.get<number>('topSafeHeight') || 0) |
| 72 | + @State bottomSafeHeight: number = px2vp(AppStorage.get<number>('bottomSafeHeight') || 0) | ||
| 73 | @State isHasTopView: boolean = false; | 73 | @State isHasTopView: boolean = false; |
| 74 | @State scrollOffset: number = 0 | 74 | @State scrollOffset: number = 0 |
| 75 | @State currentStatus: number | string |undefined = 0; | 75 | @State currentStatus: number | string |undefined = 0; |
| @@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent { | @@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent { | ||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | async aboutToAppear() { | 123 | async aboutToAppear() { |
| 124 | - let windowHight: window.Window = await window.getLastWindow(getContext(this)); | 124 | + // let windowHight: window.Window = await window.getLastWindow(getContext(this)); |
| 125 | // await windowHight.setWindowLayoutFullScreen(true); | 125 | // await windowHight.setWindowLayoutFullScreen(true); |
| 126 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 126 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 127 | - this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) | ||
| 128 | - this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | 127 | + // this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) |
| 128 | + // this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | ||
| 129 | 129 | ||
| 130 | const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String | 130 | const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String |
| 131 | console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) | 131 | console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) |
| @@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent { | @@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent { | ||
| 331 | .height('100%') | 331 | .height('100%') |
| 332 | .objectFit(ImageFit.Contain) | 332 | .objectFit(ImageFit.Contain) |
| 333 | Image($r('app.media.icon_listen')) | 333 | Image($r('app.media.icon_listen')) |
| 334 | - .width(24) | ||
| 335 | - .height(24) | ||
| 336 | - .margin({ left: 10 }) | 334 | + .width(20) |
| 335 | + .height(20) | ||
| 336 | + .margin({ left: 20 }) | ||
| 337 | .alignSelf(ItemAlign.Start) | 337 | .alignSelf(ItemAlign.Start) |
| 338 | 338 | ||
| 339 | Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) | 339 | Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`) |
| 340 | .fontSize(14) | 340 | .fontSize(14) |
| 341 | + .fontWeight(FontWeight.Medium) | ||
| 341 | .margin({ left: 50 }) | 342 | .margin({ left: 50 }) |
| 342 | .fontColor(Color.Black) | 343 | .fontColor(Color.Black) |
| 343 | .maxLines(1) | 344 | .maxLines(1) |
| @@ -33,9 +33,9 @@ export struct ZhSingleColumn09 { | @@ -33,9 +33,9 @@ export struct ZhSingleColumn09 { | ||
| 33 | try { | 33 | try { |
| 34 | const contentDTO = this.compDTO.operDataList[0]; | 34 | const contentDTO = this.compDTO.operDataList[0]; |
| 35 | const extParams: ParamType = { | 35 | const extParams: ParamType = { |
| 36 | - 'value': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard', | 36 | + 'action': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard', |
| 37 | 'duration': 0, | 37 | 'duration': 0, |
| 38 | - 'action': 'detailPageShow', | 38 | + // 'action': 'detailPageShow', |
| 39 | 'shareChannel': '', | 39 | 'shareChannel': '', |
| 40 | 'contentName': '兴趣选项卡', | 40 | 'contentName': '兴趣选项卡', |
| 41 | 'contentType': this.compDTO.objectType || '', | 41 | 'contentType': this.compDTO.objectType || '', |
| @@ -346,7 +346,9 @@ export struct SearchResultContentComponent { | @@ -346,7 +346,9 @@ export struct SearchResultContentComponent { | ||
| 346 | }.offset({ left: this.listLeft }) | 346 | }.offset({ left: this.listLeft }) |
| 347 | 347 | ||
| 348 | ListItem(){ | 348 | ListItem(){ |
| 349 | + if (this.data_rmh.length === 10){ | ||
| 349 | this.itemEnd() | 350 | this.itemEnd() |
| 351 | + } | ||
| 350 | }.height('100%') | 352 | }.height('100%') |
| 351 | .margin({left:'23lpx'}) | 353 | .margin({left:'23lpx'}) |
| 352 | } | 354 | } |
| @@ -375,6 +377,8 @@ export struct SearchResultContentComponent { | @@ -375,6 +377,8 @@ export struct SearchResultContentComponent { | ||
| 375 | console.info(TAG,'Pan start') | 377 | console.info(TAG,'Pan start') |
| 376 | }) | 378 | }) |
| 377 | .onActionUpdate((event: GestureEvent) => { | 379 | .onActionUpdate((event: GestureEvent) => { |
| 380 | + ///小于10个不展示滑动 | ||
| 381 | + if (this.data_rmh.length < 10) return; | ||
| 378 | if (event && this.isEnd) { | 382 | if (event && this.isEnd) { |
| 379 | // console.log('event.offsetX',event.offsetX) | 383 | // console.log('event.offsetX',event.offsetX) |
| 380 | this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX | 384 | this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX |
| @@ -384,6 +388,7 @@ export struct SearchResultContentComponent { | @@ -384,6 +388,7 @@ export struct SearchResultContentComponent { | ||
| 384 | } | 388 | } |
| 385 | }) | 389 | }) |
| 386 | .onActionEnd((event: GestureEvent) => { | 390 | .onActionEnd((event: GestureEvent) => { |
| 391 | + if (this.data_rmh.length < 10) return; | ||
| 387 | console.info(TAG,'Pan end') | 392 | console.info(TAG,'Pan end') |
| 388 | this.listLeft = 0 | 393 | this.listLeft = 0 |
| 389 | // this.moreWidth = 20 | 394 | // this.moreWidth = 20 |
| @@ -15,6 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index'; | @@ -15,6 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index'; | ||
| 15 | import { window } from '@kit.ArkUI'; | 15 | 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 | 19 | ||
| 19 | interface loadMoreData { | 20 | interface loadMoreData { |
| 20 | pageNum: number; | 21 | pageNum: number; |
| @@ -24,6 +25,7 @@ interface loadMoreData { | @@ -24,6 +25,7 @@ interface loadMoreData { | ||
| 24 | 25 | ||
| 25 | const TAG = 'VideoChannelDetail' | 26 | const TAG = 'VideoChannelDetail' |
| 26 | const storage = LocalStorage.getShared(); | 27 | const storage = LocalStorage.getShared(); |
| 28 | +PersistentStorage.persistProp('GestureLoadStrategy', 0); // 点播视频手势动画0为用户首次进入视频点播,1为用户已进入视频点播 | ||
| 27 | 29 | ||
| 28 | @Entry(storage) | 30 | @Entry(storage) |
| 29 | @Component | 31 | @Component |
| @@ -66,6 +68,7 @@ export struct VideoChannelDetail { | @@ -66,6 +68,7 @@ export struct VideoChannelDetail { | ||
| 66 | pageHideTime: number = 0; | 68 | pageHideTime: number = 0; |
| 67 | @Provide onlyWifiLoadVideo: boolean = false | 69 | @Provide onlyWifiLoadVideo: boolean = false |
| 68 | @Provide toastTextVisible: boolean = false | 70 | @Provide toastTextVisible: boolean = false |
| 71 | + @StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0 | ||
| 69 | 72 | ||
| 70 | autoRefreshChange() { | 73 | autoRefreshChange() { |
| 71 | if (this.topNavIndex === 0 && !this.isRequesting) { | 74 | if (this.topNavIndex === 0 && !this.isRequesting) { |
| @@ -277,7 +280,7 @@ export struct VideoChannelDetail { | @@ -277,7 +280,7 @@ export struct VideoChannelDetail { | ||
| 277 | } | 280 | } |
| 278 | 281 | ||
| 279 | build() { | 282 | build() { |
| 280 | - Column() { | 283 | + Stack({ alignContent: Alignment.Center }) { |
| 281 | if (this.isRequestError) { | 284 | if (this.isRequestError) { |
| 282 | EmptyComponent({ | 285 | EmptyComponent({ |
| 283 | emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo, | 286 | emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo, |
| @@ -289,6 +292,7 @@ export struct VideoChannelDetail { | @@ -289,6 +292,7 @@ export struct VideoChannelDetail { | ||
| 289 | 292 | ||
| 290 | PictureLoading() | 293 | PictureLoading() |
| 291 | .visibility(this.isMouted ? Visibility.None : Visibility.Visible) | 294 | .visibility(this.isMouted ? Visibility.None : Visibility.Visible) |
| 295 | + | ||
| 292 | Swiper(this.swiperController) { | 296 | Swiper(this.swiperController) { |
| 293 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { | 297 | ForEach(this.data, (item: ContentDetailDTO, index: number) => { |
| 294 | DetailPlayShortVideoPage({ | 298 | DetailPlayShortVideoPage({ |
| @@ -319,6 +323,29 @@ export struct VideoChannelDetail { | @@ -319,6 +323,29 @@ export struct VideoChannelDetail { | ||
| 319 | this.getRecCompInfo() | 323 | this.getRecCompInfo() |
| 320 | } | 324 | } |
| 321 | }) | 325 | }) |
| 326 | + // 作为手势动画的背景 | ||
| 327 | + Row() {} | ||
| 328 | + .justifyContent(FlexAlign.Center) | ||
| 329 | + .width('100%') | ||
| 330 | + .height('100%') | ||
| 331 | + .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 332 | + .backgroundColor('rgba(0, 0, 0, 0.50)') | ||
| 333 | + .onTouch(() => { | ||
| 334 | + this.GestureLoadStrategy = 1 | ||
| 335 | + }) | ||
| 336 | + // 手势动画 初次进入显示 | ||
| 337 | + LottieView({ | ||
| 338 | + name: 'slider_up_view_more', | ||
| 339 | + path: "lottie/slider_up_view_more.json", | ||
| 340 | + lottieWidth: 167, | ||
| 341 | + lottieHeight: 167, | ||
| 342 | + autoplay: true, | ||
| 343 | + loop: true | ||
| 344 | + }) | ||
| 345 | + .visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 346 | + .onTouch(() => { | ||
| 347 | + this.GestureLoadStrategy = 1 | ||
| 348 | + }) | ||
| 322 | 349 | ||
| 323 | } | 350 | } |
| 324 | } | 351 | } |
| @@ -51,7 +51,6 @@ export struct PlayerTitleView { | @@ -51,7 +51,6 @@ export struct PlayerTitleView { | ||
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * 截断文本 | 53 | * 截断文本 |
| 54 | - * @author liuzhendong(猩猩G) | ||
| 55 | * @param {string} str 要截断的文本 '啊啊啊啊啊' | 54 | * @param {string} str 要截断的文本 '啊啊啊啊啊' |
| 56 | * @param {number} fontSize 字体大小(px) | 55 | * @param {number} fontSize 字体大小(px) |
| 57 | * @param {number} maxLines 最大行数 3 | 56 | * @param {number} maxLines 最大行数 3 |
-
Please register or login to post a comment