Showing
2 changed files
with
13 additions
and
3 deletions
| @@ -97,13 +97,14 @@ struct createImg { | @@ -97,13 +97,14 @@ struct createImg { | ||
| 97 | @State loadImg: boolean = false; | 97 | @State loadImg: boolean = false; |
| 98 | 98 | ||
| 99 | async aboutToAppear(): Promise<void> { | 99 | async aboutToAppear(): Promise<void> { |
| 100 | + console.log("createImg", JSON.stringify(this.contentDTO.fullColumnImgUrls)) | ||
| 100 | this.loadImg = await onlyWifiLoadImg(); | 101 | this.loadImg = await onlyWifiLoadImg(); |
| 101 | } | 102 | } |
| 102 | 103 | ||
| 103 | 104 | ||
| 104 | build() { | 105 | build() { |
| 105 | GridRow() { | 106 | GridRow() { |
| 106 | - if (this.contentDTO.fullColumnImgUrls[0].landscape === 1 || this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height) { | 107 | + if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) { |
| 107 | // 横屏 | 108 | // 横屏 |
| 108 | GridCol({ | 109 | GridCol({ |
| 109 | span: { xs: 12 } | 110 | span: { xs: 12 } |
| @@ -131,6 +132,7 @@ struct createImg { | @@ -131,6 +132,7 @@ struct createImg { | ||
| 131 | .backgroundColor(0xf5f5f5) | 132 | .backgroundColor(0xf5f5f5) |
| 132 | .width(CommonConstants.FULL_WIDTH) | 133 | .width(CommonConstants.FULL_WIDTH) |
| 133 | .borderRadius($r('app.float.image_border_radius')) | 134 | .borderRadius($r('app.float.image_border_radius')) |
| 135 | + .aspectRatio(172 / 230) | ||
| 134 | CardMediaInfo({ contentDTO: this.contentDTO }) | 136 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 135 | } | 137 | } |
| 136 | .align(Alignment.BottomEnd) | 138 | .align(Alignment.BottomEnd) |
| @@ -190,12 +190,20 @@ export struct SearchResultContentComponent { | @@ -190,12 +190,20 @@ export struct SearchResultContentComponent { | ||
| 190 | }) | 190 | }) |
| 191 | let isRemain : boolean = false | 191 | let isRemain : boolean = false |
| 192 | SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { | 192 | SearcherAboutDataModel.getCreatorDetailListData({creatorIdList:creatorIdList}).then((rem) => { |
| 193 | - resultData.list.forEach((value) => { | 193 | + resultData.list.forEach((value: SearchResultContentItem) => { |
| 194 | + const landscape = value.data.landscape | ||
| 194 | let photos: FullColumnImgUrlDTO[] = [] | 195 | let photos: FullColumnImgUrlDTO[] = [] |
| 195 | // if (value.data.appStyle === 4) { | 196 | // if (value.data.appStyle === 4) { |
| 196 | value.data.appStyleImages.split("&&").forEach((value) => { | 197 | value.data.appStyleImages.split("&&").forEach((value) => { |
| 197 | const resizeParams = this.extractResizeParams(value) | 198 | const resizeParams = this.extractResizeParams(value) |
| 198 | - photos.push({ fullUrl: value,weight:resizeParams.width,height:resizeParams.height, } as FullColumnImgUrlDTO) | 199 | + photos.push( |
| 200 | + { | ||
| 201 | + fullUrl: value, | ||
| 202 | + weight:resizeParams.width, | ||
| 203 | + height:resizeParams.height, | ||
| 204 | + landscape: Number(landscape), | ||
| 205 | + } as FullColumnImgUrlDTO | ||
| 206 | + ) | ||
| 199 | }) | 207 | }) |
| 200 | // } | 208 | // } |
| 201 | let contentDTO = this.dataTransform(rem,value, photos); | 209 | let contentDTO = this.dataTransform(rem,value, photos); |
-
Please register or login to post a comment