Showing
1 changed file
with
10 additions
and
1 deletions
| @@ -5,7 +5,16 @@ import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | @@ -5,7 +5,16 @@ import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct SearchCreatorComponent{ | 6 | export struct SearchCreatorComponent{ |
| 7 | @ObjectLink item: SearchRmhDescription | 7 | @ObjectLink item: SearchRmhDescription |
| 8 | + userName: string = '' | ||
| 8 | 9 | ||
| 10 | + aboutToAppear(): void { | ||
| 11 | + const userNetName: string = this.item.creatorName; | ||
| 12 | + this.userName = userNetName; | ||
| 13 | + if (userNetName.includes('<em>') && userNetName.includes('</em>')) { | ||
| 14 | + this.userName = userNetName.replaceAll('<em>','').replaceAll('</em>',''); | ||
| 15 | + } | ||
| 16 | + } | ||
| 17 | + | ||
| 9 | build() { | 18 | build() { |
| 10 | Column(){ | 19 | Column(){ |
| 11 | Stack({alignContent: Alignment.Bottom}){ | 20 | Stack({alignContent: Alignment.Bottom}){ |
| @@ -26,7 +35,7 @@ export struct SearchCreatorComponent{ | @@ -26,7 +35,7 @@ export struct SearchCreatorComponent{ | ||
| 26 | .height('92lpx') | 35 | .height('92lpx') |
| 27 | .margin({bottom:'15lpx'}) | 36 | .margin({bottom:'15lpx'}) |
| 28 | 37 | ||
| 29 | - Text(this.item.creatorName) | 38 | + Text(this.userName) |
| 30 | .fontSize('25lpx') | 39 | .fontSize('25lpx') |
| 31 | .fontWeight('400lpx') | 40 | .fontWeight('400lpx') |
| 32 | .lineHeight('35lpx') | 41 | .lineHeight('35lpx') |
-
Please register or login to post a comment