Showing
2 changed files
with
42 additions
and
40 deletions
| @@ -178,43 +178,43 @@ export struct LikeComponent { | @@ -178,43 +178,43 @@ export struct LikeComponent { | ||
| 178 | .width(24) | 178 | .width(24) |
| 179 | .height(24) | 179 | .height(24) |
| 180 | if (this.likeCount > 0){ | 180 | if (this.likeCount > 0){ |
| 181 | - RelativeContainer() { | ||
| 182 | - Image(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 183 | - .objectFit(ImageFit.Fill) | ||
| 184 | - .resizable({ | ||
| 185 | - slice: { | ||
| 186 | - top: 1, | ||
| 187 | - left: 20, | ||
| 188 | - right: 1, | ||
| 189 | - bottom: 1 | ||
| 190 | - } | ||
| 191 | - }) | ||
| 192 | - .alignRules({ | ||
| 193 | - top: { anchor: "Text", align: VerticalAlign.Top }, | ||
| 194 | - left: { anchor: "Text", align: HorizontalAlign.Start }, | ||
| 195 | - right: { anchor: "Text", align: HorizontalAlign.End }, | ||
| 196 | - bottom: { anchor: "Text", align: VerticalAlign.Bottom }, | ||
| 197 | - }) | ||
| 198 | - .id("Image") | 181 | + RelativeContainer() { |
| 182 | + Image(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 183 | + .objectFit(ImageFit.Fill) | ||
| 184 | + .resizable({ | ||
| 185 | + slice: { | ||
| 186 | + top: 1, | ||
| 187 | + left: 20, | ||
| 188 | + right: 1, | ||
| 189 | + bottom: 1 | ||
| 190 | + } | ||
| 191 | + }) | ||
| 192 | + .alignRules({ | ||
| 193 | + top: { anchor: "Text", align: VerticalAlign.Top }, | ||
| 194 | + left: { anchor: "Text", align: HorizontalAlign.Start }, | ||
| 195 | + right: { anchor: "Text", align: HorizontalAlign.End }, | ||
| 196 | + bottom: { anchor: "Text", align: VerticalAlign.Bottom }, | ||
| 197 | + }) | ||
| 198 | + .id("Image") | ||
| 199 | 199 | ||
| 200 | - Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444") | ||
| 201 | - .fontSize(8) | ||
| 202 | - .fontColor('#ffffff')// .backgroundColor('#ED2800') | ||
| 203 | - .height(12) | ||
| 204 | - .textAlign(TextAlign.Center) | ||
| 205 | - .alignRules({ | ||
| 206 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 207 | - left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 208 | - })/*动态计算文字宽度*/ | ||
| 209 | - .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 210 | - 12)// .backgroundColor(Color.Green) | ||
| 211 | - .id("Text") | ||
| 212 | - .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | 200 | + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444") |
| 201 | + .fontSize(8) | ||
| 202 | + .fontColor('#ffffff')// .backgroundColor('#ED2800') | ||
| 203 | + .height(12) | ||
| 204 | + .textAlign(TextAlign.Center) | ||
| 205 | + .alignRules({ | ||
| 206 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 207 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 208 | + })/*动态计算文字宽度*/ | ||
| 209 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 210 | + 12)// .backgroundColor(Color.Green) | ||
| 211 | + .id("Text") | ||
| 212 | + .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 213 | + } | ||
| 214 | + .offset({ | ||
| 215 | + x: 12 | ||
| 216 | + }) | ||
| 213 | } | 217 | } |
| 214 | - .offset({ | ||
| 215 | - x: 12 | ||
| 216 | - }) | ||
| 217 | - } | ||
| 218 | 218 | ||
| 219 | // Column() { | 219 | // Column() { |
| 220 | // // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | 220 | // // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) |
| @@ -259,19 +259,21 @@ export struct LikeComponent { | @@ -259,19 +259,21 @@ export struct LikeComponent { | ||
| 259 | .width(36) | 259 | .width(36) |
| 260 | .height(36) | 260 | .height(36) |
| 261 | .borderRadius(18) | 261 | .borderRadius(18) |
| 262 | - .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5') | 262 | + .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') |
| 263 | Row() { | 263 | Row() { |
| 264 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | 264 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) |
| 265 | .fontSize(8) | 265 | .fontSize(8) |
| 266 | .fontColor(Color.White) | 266 | .fontColor(Color.White) |
| 267 | - .padding({ left: 4, right: 2 }) | 267 | + .padding({ left: 8, right: 2 }) |
| 268 | } | 268 | } |
| 269 | .height(12) | 269 | .height(12) |
| 270 | .alignItems(VerticalAlign.Center) | 270 | .alignItems(VerticalAlign.Center) |
| 271 | - .position({ x: '100%', }) | 271 | + .position({ x: '100%', y: 10 }) |
| 272 | .markAnchor({ x: '100%' }) | 272 | .markAnchor({ x: '100%' }) |
| 273 | .backgroundImage($r('app.media.ic_like_back')) | 273 | .backgroundImage($r('app.media.ic_like_back')) |
| 274 | - .backgroundImageSize(ImageSize.Auto) | 274 | + .backgroundImageSize({height: 13}) |
| 275 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 276 | + 12) | ||
| 275 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | 277 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) |
| 276 | } | 278 | } |
| 277 | .width(36) | 279 | .width(36) |
| @@ -90,7 +90,7 @@ export struct DetailDialog { | @@ -90,7 +90,7 @@ export struct DetailDialog { | ||
| 90 | }).layoutWeight(1) | 90 | }).layoutWeight(1) |
| 91 | 91 | ||
| 92 | OperRowListView({ | 92 | OperRowListView({ |
| 93 | - componentType: 1, | 93 | + componentType: 4, |
| 94 | pageComponentType: 8, | 94 | pageComponentType: 8, |
| 95 | showBackIcon: false, | 95 | showBackIcon: false, |
| 96 | operationButtonList: ['comment', 'like', 'collect', 'share'], | 96 | operationButtonList: ['comment', 'like', 'collect', 'share'], |
-
Please register or login to post a comment