Showing
4 changed files
with
17 additions
and
5 deletions
| @@ -63,3 +63,5 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi | @@ -63,3 +63,5 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi | ||
| 63 | 63 | ||
| 64 | export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" | 64 | export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" |
| 65 | 65 | ||
| 66 | +export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" | ||
| 67 | + |
| @@ -2,6 +2,7 @@ import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from | @@ -2,6 +2,7 @@ import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from | ||
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | import { StringUtils } from 'wdKit'; | 3 | import { StringUtils } from 'wdKit'; |
| 4 | import { WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterRule } from 'wdRouter'; |
| 5 | +import { newsSkeleton } from './skeleton/newsSkeleton'; | ||
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | export struct ENewspaperItemComponent { | 8 | export struct ENewspaperItemComponent { |
| @@ -11,13 +12,20 @@ export struct ENewspaperItemComponent { | @@ -11,13 +12,20 @@ export struct ENewspaperItemComponent { | ||
| 11 | private startX: number = 0 | 12 | private startX: number = 0 |
| 12 | private startY: number = 0 | 13 | private startY: number = 0 |
| 13 | private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean | 14 | private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean |
| 15 | + @State isShowSkeleton: boolean = true | ||
| 14 | 16 | ||
| 15 | build() { | 17 | build() { |
| 16 | Stack() { | 18 | Stack() { |
| 19 | + newsSkeleton() | ||
| 20 | + .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) | ||
| 17 | Image(this.newspaperListItemBean.pagePic) | 21 | Image(this.newspaperListItemBean.pagePic) |
| 18 | .width('100%') | 22 | .width('100%') |
| 19 | .aspectRatio(378 / 566) | 23 | .aspectRatio(378 / 566) |
| 20 | .objectFit(ImageFit.Fill) | 24 | .objectFit(ImageFit.Fill) |
| 25 | + .onComplete(() => { | ||
| 26 | + this.isShowSkeleton = false | ||
| 27 | + }) | ||
| 28 | + .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) | ||
| 21 | 29 | ||
| 22 | Canvas(this.context) | 30 | Canvas(this.context) |
| 23 | .width('100%') | 31 | .width('100%') |
| @@ -62,7 +70,7 @@ export struct ENewspaperItemComponent { | @@ -62,7 +70,7 @@ export struct ENewspaperItemComponent { | ||
| 62 | pageID: 'IMAGE_TEXT_DETAIL', | 70 | pageID: 'IMAGE_TEXT_DETAIL', |
| 63 | extra: { | 71 | extra: { |
| 64 | relType: this.itemBeanClicked.relType ?? '', | 72 | relType: this.itemBeanClicked.relType ?? '', |
| 65 | - relId: ''+this.itemBeanClicked.relId, | 73 | + relId: '' + this.itemBeanClicked.relId, |
| 66 | sourcePage: '5' | 74 | sourcePage: '5' |
| 67 | } as ExtraDTO | 75 | } as ExtraDTO |
| 68 | } as Params, | 76 | } as Params, |
| @@ -110,11 +110,11 @@ export struct ENewspaperPageComponent { | @@ -110,11 +110,11 @@ export struct ENewspaperPageComponent { | ||
| 110 | }) | 110 | }) |
| 111 | 111 | ||
| 112 | Row() { | 112 | Row() { |
| 113 | - Text(this.calendarDate) | 113 | + Text(this.calendarDate?.replace('-', '.')?.replace('-', '.')) |
| 114 | .fontSize($r('app.float.font_size_20')) | 114 | .fontSize($r('app.float.font_size_20')) |
| 115 | .fontColor($r('app.color.white')) | 115 | .fontColor($r('app.color.white')) |
| 116 | .fontFamily('BebasNeue_Regular') | 116 | .fontFamily('BebasNeue_Regular') |
| 117 | - .fontWeight(FontWeight.Bold) | 117 | + .fontWeight(FontWeight.Regular) |
| 118 | 118 | ||
| 119 | Image($r('app.media.icon_triangle')) | 119 | Image($r('app.media.icon_triangle')) |
| 120 | .width($r('app.float.border_radius_6')) | 120 | .width($r('app.float.border_radius_6')) |
| @@ -167,6 +167,7 @@ export struct ENewspaperPageComponent { | @@ -167,6 +167,7 @@ export struct ENewspaperPageComponent { | ||
| 167 | .autoPlay(false) | 167 | .autoPlay(false) |
| 168 | .cachedCount(3) | 168 | .cachedCount(3) |
| 169 | .indicator(false) | 169 | .indicator(false) |
| 170 | + .loop(false) | ||
| 170 | .displayCount(1) | 171 | .displayCount(1) |
| 171 | .margin({ top: 35, left: 10, right: 10 }) | 172 | .margin({ top: 35, left: 10, right: 10 }) |
| 172 | .id('e_newspaper_content') | 173 | .id('e_newspaper_content') |
| @@ -191,12 +192,13 @@ export struct ENewspaperPageComponent { | @@ -191,12 +192,13 @@ export struct ENewspaperPageComponent { | ||
| 191 | .id('e_newspaper_shadow') | 192 | .id('e_newspaper_shadow') |
| 192 | 193 | ||
| 193 | Row() { | 194 | Row() { |
| 194 | - Text('滑动查看下一版') | 195 | + Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版') |
| 195 | .fontColor(Color.White) | 196 | .fontColor(Color.White) |
| 196 | .fontSize($r('app.float.font_size_14')) | 197 | .fontSize($r('app.float.font_size_14')) |
| 197 | Image($r('app.media.icon_next_page')) | 198 | Image($r('app.media.icon_next_page')) |
| 198 | .width($r('app.float.vp_16')) | 199 | .width($r('app.float.vp_16')) |
| 199 | .height($r('app.float.vp_16')) | 200 | .height($r('app.float.vp_16')) |
| 201 | + .visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible) | ||
| 200 | } | 202 | } |
| 201 | .justifyContent(FlexAlign.Center) | 203 | .justifyContent(FlexAlign.Center) |
| 202 | .margin({ top: $r('app.float.margin_16') }) | 204 | .margin({ top: $r('app.float.margin_16') }) |
-
Please register or login to post a comment