Showing
1 changed file
with
21 additions
and
9 deletions
| @@ -7,6 +7,7 @@ import { Notes } from './notes'; | @@ -7,6 +7,7 @@ import { Notes } from './notes'; | ||
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 10 | +import router from '@ohos.router' | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * 大专题卡--CompStyle: 10 | 13 | * 大专题卡--CompStyle: 10 |
| @@ -23,10 +24,19 @@ export struct Card10Component { | @@ -23,10 +24,19 @@ export struct Card10Component { | ||
| 23 | @ObjectLink compDTO: CompDTO | 24 | @ObjectLink compDTO: CompDTO |
| 24 | @State titleMarked: boolean = false; | 25 | @State titleMarked: boolean = false; |
| 25 | @State textArr: textItem[] = [] | 26 | @State textArr: textItem[] = [] |
| 27 | + @State hideDetail: boolean = false; | ||
| 26 | 28 | ||
| 27 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 28 | this.titleInit(); | 30 | this.titleInit(); |
| 29 | this.loadImg = await onlyWifiLoadImg(); | 31 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | + this.initHideDetail(); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + initHideDetail() { | ||
| 36 | + const curRouter = router.getState().name; | ||
| 37 | + if (curRouter === 'MyCollectionListPage') { | ||
| 38 | + this.hideDetail = true; | ||
| 39 | + } | ||
| 30 | } | 40 | } |
| 31 | 41 | ||
| 32 | titleInit() { | 42 | titleInit() { |
| @@ -83,19 +93,21 @@ export struct Card10Component { | @@ -83,19 +93,21 @@ export struct Card10Component { | ||
| 83 | }.alignContent(Alignment.BottomStart) | 93 | }.alignContent(Alignment.BottomStart) |
| 84 | 94 | ||
| 85 | // 专题列表--后端返回三个, | 95 | // 专题列表--后端返回三个, |
| 86 | - Column() { | ||
| 87 | - ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | ||
| 88 | - this.timelineItem(item, index) | ||
| 89 | - if (index < this.contentDTO.slideShows.length - 1) { | ||
| 90 | - // 在不是最后一个元素的情况下添加分隔符 | ||
| 91 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | ||
| 92 | - } | ||
| 93 | - }) | 96 | + if (!this.hideDetail) { |
| 97 | + Column() { | ||
| 98 | + ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | ||
| 99 | + this.timelineItem(item, index) | ||
| 100 | + if (index < this.contentDTO.slideShows.length - 1) { | ||
| 101 | + // 在不是最后一个元素的情况下添加分隔符 | ||
| 102 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 0, right: 0 }); | ||
| 103 | + } | ||
| 104 | + }) | ||
| 105 | + } | ||
| 94 | } | 106 | } |
| 95 | 107 | ||
| 96 | 108 | ||
| 97 | // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 | 109 | // 底部-查看更多。根据接口返回的isMore判断是否显示查看更多 |
| 98 | - if (this.contentDTO.hasMore == 1) { | 110 | + if (this.contentDTO.hasMore == 1 && !this.hideDetail) { |
| 99 | Row() { | 111 | Row() { |
| 100 | Text("查看更多") | 112 | Text("查看更多") |
| 101 | .fontSize($r("app.float.font_size_14")) | 113 | .fontSize($r("app.float.font_size_14")) |
-
Please register or login to post a comment