Showing
1 changed file
with
18 additions
and
17 deletions
| @@ -62,20 +62,7 @@ export struct Card19Component { | @@ -62,20 +62,7 @@ export struct Card19Component { | ||
| 62 | } | 62 | } |
| 63 | // 图片-从无图到9图展示 | 63 | // 图片-从无图到9图展示 |
| 64 | createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls }) | 64 | createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls }) |
| 65 | - .onClick(() => { | ||
| 66 | - const photoList: PhotoListBean[] = this.contentDTO.fullColumnImgUrls.map(item => { | ||
| 67 | - const photo: PhotoListBean = { | ||
| 68 | - width: item.weight, | ||
| 69 | - height: item.height, | ||
| 70 | - picPath: item.fullUrl||item.url, | ||
| 71 | - picDesc: '', | ||
| 72 | - itemType:2, | ||
| 73 | - id:0 | ||
| 74 | - } | ||
| 75 | - return photo | ||
| 76 | - }) | ||
| 77 | - ProcessUtils.gotoMultiPictureListPage(photoList, 0) | ||
| 78 | - }) | 65 | + |
| 79 | CarderInteraction({ contentDTO: this.contentDTO }) | 66 | CarderInteraction({ contentDTO: this.contentDTO }) |
| 80 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 67 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 81 | } | 68 | } |
| @@ -107,12 +94,12 @@ struct createImg { | @@ -107,12 +94,12 @@ struct createImg { | ||
| 107 | @State loadImg: boolean = false; | 94 | @State loadImg: boolean = false; |
| 108 | 95 | ||
| 109 | async aboutToAppear(): Promise<void> { | 96 | async aboutToAppear(): Promise<void> { |
| 110 | - this.loadImg = await onlyWifiLoadImg(); | ||
| 111 | if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 | 97 | if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 |
| 112 | this.fullColumnImgUrls.splice(2, 0, { | 98 | this.fullColumnImgUrls.splice(2, 0, { |
| 113 | fullUrl: '' | 99 | fullUrl: '' |
| 114 | } as FullColumnImgUrlDTO) | 100 | } as FullColumnImgUrlDTO) |
| 115 | } | 101 | } |
| 102 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 116 | console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls)) | 103 | console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls)) |
| 117 | } | 104 | } |
| 118 | 105 | ||
| @@ -167,14 +154,14 @@ struct createImg { | @@ -167,14 +154,14 @@ struct createImg { | ||
| 167 | alignContent: Alignment.BottomEnd | 154 | alignContent: Alignment.BottomEnd |
| 168 | }) { | 155 | }) { |
| 169 | if (this.getPicType() === 1) { | 156 | if (this.getPicType() === 1) { |
| 170 | - Image(this.loadImg ? item.fullUrl||item.url : '') | 157 | + Image(this.loadImg ? item.fullUrl || item.url : '') |
| 171 | .backgroundColor(0xf5f5f5) | 158 | .backgroundColor(0xf5f5f5) |
| 172 | .width('100%') | 159 | .width('100%') |
| 173 | .height(172) | 160 | .height(172) |
| 174 | .autoResize(true) | 161 | .autoResize(true) |
| 175 | .borderRadius(this.caclImageRadius(index)) | 162 | .borderRadius(this.caclImageRadius(index)) |
| 176 | } else if (this.getPicType() === 2) { | 163 | } else if (this.getPicType() === 2) { |
| 177 | - Image(this.loadImg ? item.fullUrl||item.url : '') | 164 | + Image(this.loadImg ? item.fullUrl || item.url : '') |
| 178 | .width('100%') | 165 | .width('100%') |
| 179 | .height(305) | 166 | .height(305) |
| 180 | .autoResize(true) | 167 | .autoResize(true) |
| @@ -291,6 +278,20 @@ struct createImg { | @@ -291,6 +278,20 @@ struct createImg { | ||
| 291 | .padding({ bottom: 3 }) | 278 | .padding({ bottom: 3 }) |
| 292 | } | 279 | } |
| 293 | } | 280 | } |
| 281 | + .onClick(() => { | ||
| 282 | + const photoList: PhotoListBean[] = this.fullColumnImgUrls.map(item => { | ||
| 283 | + const photo: PhotoListBean = { | ||
| 284 | + width: item.weight, | ||
| 285 | + height: item.height, | ||
| 286 | + picPath: item.fullUrl||item.url, | ||
| 287 | + picDesc: '', | ||
| 288 | + itemType:2, | ||
| 289 | + id:0 | ||
| 290 | + } | ||
| 291 | + return photo | ||
| 292 | + }) | ||
| 293 | + ProcessUtils.gotoMultiPictureListPage(photoList, index) | ||
| 294 | + }) | ||
| 294 | } | 295 | } |
| 295 | } | 296 | } |
| 296 | }) | 297 | }) |
-
Please register or login to post a comment