Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
2 changed files
with
12 additions
and
8 deletions
| @@ -91,7 +91,8 @@ export struct ZhCarouselLayout01 { | @@ -91,7 +91,8 @@ export struct ZhCarouselLayout01 { | ||
| 91 | ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { | 91 | ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { |
| 92 | CarouselLayout01CardView({ | 92 | CarouselLayout01CardView({ |
| 93 | item: item, | 93 | item: item, |
| 94 | - length: this.compDTO.operDataList.length | 94 | + length: this.compDTO.operDataList.length, |
| 95 | + showPicBorderRadius: this.compDTO.operDataList.length == 1 | ||
| 95 | }) | 96 | }) |
| 96 | .onClick((event: ClickEvent) => { | 97 | .onClick((event: ClickEvent) => { |
| 97 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | 98 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) |
| @@ -188,6 +189,7 @@ struct CarouselLayout01CardView { | @@ -188,6 +189,7 @@ struct CarouselLayout01CardView { | ||
| 188 | @State loadImg: boolean = false; | 189 | @State loadImg: boolean = false; |
| 189 | private item: ContentDTO = new ContentDTO(); | 190 | private item: ContentDTO = new ContentDTO(); |
| 190 | private length: number = 1; // 轮播图数量 | 191 | private length: number = 1; // 轮播图数量 |
| 192 | + private showPicBorderRadius: boolean = false; | ||
| 191 | 193 | ||
| 192 | async aboutToAppear(): Promise<void> { | 194 | async aboutToAppear(): Promise<void> { |
| 193 | this.loadImg = await onlyWifiLoadImg(); | 195 | this.loadImg = await onlyWifiLoadImg(); |
| @@ -200,6 +202,7 @@ struct CarouselLayout01CardView { | @@ -200,6 +202,7 @@ struct CarouselLayout01CardView { | ||
| 200 | .height(CommonConstants.FULL_PARENT) | 202 | .height(CommonConstants.FULL_PARENT) |
| 201 | .objectFit(ImageFit.Cover) | 203 | .objectFit(ImageFit.Cover) |
| 202 | .backgroundColor(0xf5f5f5) | 204 | .backgroundColor(0xf5f5f5) |
| 205 | + .borderRadius(this.showPicBorderRadius ? $r('app.float.image_border_radius') : 0) | ||
| 203 | 206 | ||
| 204 | Row() | 207 | Row() |
| 205 | .width(CommonConstants.FULL_PARENT) | 208 | .width(CommonConstants.FULL_PARENT) |
| @@ -132,7 +132,7 @@ export struct ZhSingleColumn09 { | @@ -132,7 +132,7 @@ export struct ZhSingleColumn09 { | ||
| 132 | .width('100%') | 132 | .width('100%') |
| 133 | 133 | ||
| 134 | Grid() { | 134 | Grid() { |
| 135 | - ForEach(this.operDataList, (item: ContentDTO, index: number) => { | 135 | + ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => { |
| 136 | GridItem() { | 136 | GridItem() { |
| 137 | Stack({ alignContent: Alignment.TopEnd }) { | 137 | Stack({ alignContent: Alignment.TopEnd }) { |
| 138 | Image(this.loadImg ? item.coverUrl : '') | 138 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -161,7 +161,7 @@ export struct ZhSingleColumn09 { | @@ -161,7 +161,7 @@ export struct ZhSingleColumn09 { | ||
| 161 | .objectFit(ImageFit.Contain) | 161 | .objectFit(ImageFit.Contain) |
| 162 | } | 162 | } |
| 163 | .width('100%') | 163 | .width('100%') |
| 164 | - .height('100%') | 164 | + .aspectRatio(2 / 1) |
| 165 | } | 165 | } |
| 166 | .margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 }) | 166 | .margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 }) |
| 167 | .onClick(() => { | 167 | .onClick(() => { |
| @@ -174,9 +174,7 @@ export struct ZhSingleColumn09 { | @@ -174,9 +174,7 @@ export struct ZhSingleColumn09 { | ||
| 174 | }) | 174 | }) |
| 175 | }) | 175 | }) |
| 176 | } | 176 | } |
| 177 | - .height(90) | ||
| 178 | .columnsTemplate('1fr 1fr 1fr 1fr') | 177 | .columnsTemplate('1fr 1fr 1fr 1fr') |
| 179 | - .rowsTemplate('1fr 1fr') | ||
| 180 | .margin({ bottom: 5 }) | 178 | .margin({ bottom: 5 }) |
| 181 | 179 | ||
| 182 | Row() { | 180 | Row() { |
| @@ -192,11 +190,14 @@ export struct ZhSingleColumn09 { | @@ -192,11 +190,14 @@ export struct ZhSingleColumn09 { | ||
| 192 | .onClick(() => { | 190 | .onClick(() => { |
| 193 | if (this.currentOperDataListIndex > 0) { | 191 | if (this.currentOperDataListIndex > 0) { |
| 194 | this.currentOperDataListIndex-- | 192 | this.currentOperDataListIndex-- |
| 193 | + } else { | ||
| 194 | + return | ||
| 195 | } | 195 | } |
| 196 | if (this.compDTO?.operDataList.length > 8) { | 196 | if (this.compDTO?.operDataList.length > 8) { |
| 197 | - if (this.pageModel) { | ||
| 198 | - this.pageModel.compList.deleteItem(this.compIndex) | ||
| 199 | - } | 197 | + this.operDataList = this.shuffleArray(this.operDataList) |
| 198 | + // if (this.pageModel) { | ||
| 199 | + // this.pageModel.compList.deleteItem(this.compIndex) | ||
| 200 | + // } | ||
| 200 | this.activeIndexs = []; | 201 | this.activeIndexs = []; |
| 201 | } | 202 | } |
| 202 | }) | 203 | }) |
-
Please register or login to post a comment