Showing
8 changed files
with
34 additions
and
9 deletions
| @@ -32,6 +32,10 @@ export struct CardParser { | @@ -32,6 +32,10 @@ export struct CardParser { | ||
| 32 | pageShowTime:number = 0; | 32 | pageShowTime:number = 0; |
| 33 | pageHideTime:number = 0; | 33 | pageHideTime:number = 0; |
| 34 | 34 | ||
| 35 | + aboutToAppear(): void { | ||
| 36 | + console.log('CardParser', JSON.stringify(this.contentDTO)) | ||
| 37 | + } | ||
| 38 | + | ||
| 35 | onPageShow() { | 39 | onPageShow() { |
| 36 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 40 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 37 | } | 41 | } |
| @@ -39,13 +39,16 @@ export struct Card11Component { | @@ -39,13 +39,16 @@ export struct Card11Component { | ||
| 39 | Column() { | 39 | Column() { |
| 40 | Stack() { | 40 | Stack() { |
| 41 | if(this.contentDTO.objectType == '5'){ | 41 | if(this.contentDTO.objectType == '5'){ |
| 42 | - Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) | 42 | + Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center) |
| 43 | } else { | 43 | } else { |
| 44 | if (this.contentDTO.seoTags) { | 44 | if (this.contentDTO.seoTags) { |
| 45 | - Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) | 45 | + Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center) |
| 46 | } | 46 | } |
| 47 | if (this.contentDTO.newTags) { | 47 | if (this.contentDTO.newTags) { |
| 48 | - Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 48 | + Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 49 | + } | ||
| 50 | + if (this.contentDTO.top === 1) { | ||
| 51 | + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center) | ||
| 49 | } | 52 | } |
| 50 | } | 53 | } |
| 51 | Text() { | 54 | Text() { |
| @@ -70,7 +73,7 @@ export struct Card11Component { | @@ -70,7 +73,7 @@ export struct Card11Component { | ||
| 70 | .width(CommonConstants.FULL_WIDTH) | 73 | .width(CommonConstants.FULL_WIDTH) |
| 71 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 74 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 72 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 75 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 73 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 76 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 74 | 0 ) | 77 | 0 ) |
| 75 | 78 | ||
| 76 | }.alignContent(Alignment.TopStart) | 79 | }.alignContent(Alignment.TopStart) |
| @@ -69,6 +69,9 @@ export struct Card2Component { | @@ -69,6 +69,9 @@ export struct Card2Component { | ||
| 69 | if (this.contentDTO.newTags) { | 69 | if (this.contentDTO.newTags) { |
| 70 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) | 70 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) |
| 71 | } | 71 | } |
| 72 | + if (this.contentDTO.top === 1) { | ||
| 73 | + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center) | ||
| 74 | + } | ||
| 72 | } | 75 | } |
| 73 | //新闻标题 | 76 | //新闻标题 |
| 74 | // if (this.contentDTO.newTags) { | 77 | // if (this.contentDTO.newTags) { |
| @@ -101,7 +104,7 @@ export struct Card2Component { | @@ -101,7 +104,7 @@ export struct Card2Component { | ||
| 101 | .align(Alignment.Start) | 104 | .align(Alignment.Start) |
| 102 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 105 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 103 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 106 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 104 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 107 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 105 | 0 ) | 108 | 0 ) |
| 106 | }.alignContent(Alignment.TopStart) | 109 | }.alignContent(Alignment.TopStart) |
| 107 | 110 |
| @@ -50,6 +50,9 @@ export struct Card3Component { | @@ -50,6 +50,9 @@ export struct Card3Component { | ||
| 50 | if (this.contentDTO.newTags) { | 50 | if (this.contentDTO.newTags) { |
| 51 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) | 51 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) |
| 52 | } | 52 | } |
| 53 | + if (this.contentDTO.top === 1) { | ||
| 54 | + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center) | ||
| 55 | + } | ||
| 53 | } | 56 | } |
| 54 | Text() { | 57 | Text() { |
| 55 | if (this.titleMarked) { | 58 | if (this.titleMarked) { |
| @@ -71,7 +74,7 @@ export struct Card3Component { | @@ -71,7 +74,7 @@ export struct Card3Component { | ||
| 71 | .width(CommonConstants.FULL_WIDTH) | 74 | .width(CommonConstants.FULL_WIDTH) |
| 72 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 75 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 73 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 76 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 74 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 77 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 75 | 0 ) | 78 | 0 ) |
| 76 | }.alignContent(Alignment.TopStart) | 79 | }.alignContent(Alignment.TopStart) |
| 77 | 80 |
| @@ -55,6 +55,9 @@ export struct Card4Component { | @@ -55,6 +55,9 @@ export struct Card4Component { | ||
| 55 | if (this.contentDTO.newTags) { | 55 | if (this.contentDTO.newTags) { |
| 56 | Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) | 56 | Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) |
| 57 | } | 57 | } |
| 58 | + if (this.contentDTO.top === 1) { | ||
| 59 | + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | ||
| 60 | + } | ||
| 58 | } | 61 | } |
| 59 | Text() { | 62 | Text() { |
| 60 | if (this.titleMarked) { | 63 | if (this.titleMarked) { |
| @@ -76,7 +79,7 @@ export struct Card4Component { | @@ -76,7 +79,7 @@ export struct Card4Component { | ||
| 76 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 79 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 77 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 80 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 78 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 81 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 79 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 82 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 80 | 0 ) | 83 | 0 ) |
| 81 | }.alignContent(Alignment.TopStart) | 84 | }.alignContent(Alignment.TopStart) |
| 82 | //新闻标题 | 85 | //新闻标题 |
| @@ -82,6 +82,9 @@ export struct Card5Component { | @@ -82,6 +82,9 @@ export struct Card5Component { | ||
| 82 | if (this.contentDTO.newTags) { | 82 | if (this.contentDTO.newTags) { |
| 83 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 83 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 84 | } | 84 | } |
| 85 | + if (this.contentDTO.top === 1) { | ||
| 86 | + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | ||
| 87 | + } | ||
| 85 | } | 88 | } |
| 86 | 89 | ||
| 87 | Text() { | 90 | Text() { |
| @@ -106,7 +109,7 @@ export struct Card5Component { | @@ -106,7 +109,7 @@ export struct Card5Component { | ||
| 106 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 109 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 107 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 110 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 108 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 111 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 109 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 112 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 110 | 0 ) | 113 | 0 ) |
| 111 | }.alignContent(Alignment.TopStart) | 114 | }.alignContent(Alignment.TopStart) |
| 112 | } | 115 | } |
| @@ -61,6 +61,9 @@ export struct Card6Component { | @@ -61,6 +61,9 @@ export struct Card6Component { | ||
| 61 | if (this.contentDTO.newTags) { | 61 | if (this.contentDTO.newTags) { |
| 62 | Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) | 62 | Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 63 | } | 63 | } |
| 64 | + if (this.contentDTO.top === 1) { | ||
| 65 | + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center) | ||
| 66 | + } | ||
| 64 | } | 67 | } |
| 65 | 68 | ||
| 66 | Text() { | 69 | Text() { |
| @@ -86,7 +89,7 @@ export struct Card6Component { | @@ -86,7 +89,7 @@ export struct Card6Component { | ||
| 86 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 89 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 87 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 90 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 88 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 91 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 89 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 92 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 90 | 0 ) | 93 | 0 ) |
| 91 | }.alignContent(Alignment.TopStart) | 94 | }.alignContent(Alignment.TopStart) |
| 92 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) | 95 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) |
| @@ -98,6 +98,9 @@ export struct Card9Component { | @@ -98,6 +98,9 @@ export struct Card9Component { | ||
| 98 | if (this.contentDTO.newTags) { | 98 | if (this.contentDTO.newTags) { |
| 99 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 99 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 100 | } | 100 | } |
| 101 | + if (this.contentDTO.top === 1) { | ||
| 102 | + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | ||
| 103 | + } | ||
| 101 | } | 104 | } |
| 102 | 105 | ||
| 103 | }.alignContent(Alignment.BottomStart) | 106 | }.alignContent(Alignment.BottomStart) |
-
Please register or login to post a comment