Showing
2 changed files
with
11 additions
and
4 deletions
| @@ -74,6 +74,10 @@ export struct ZhSingleRow02 { | @@ -74,6 +74,10 @@ export struct ZhSingleRow02 { | ||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | + showMore() { | ||
| 78 | + return !!this.compDTO.dataSourceType || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '') | ||
| 79 | + } | ||
| 80 | + | ||
| 77 | build() { | 81 | build() { |
| 78 | Column() { | 82 | Column() { |
| 79 | //顶部 | 83 | //顶部 |
| @@ -93,7 +97,7 @@ export struct ZhSingleRow02 { | @@ -93,7 +97,7 @@ export struct ZhSingleRow02 { | ||
| 93 | .margin({ right: 8 }) | 97 | .margin({ right: 8 }) |
| 94 | }) | 98 | }) |
| 95 | } | 99 | } |
| 96 | - if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | 100 | + if (this.compDTO.operDataList.length >= 2 && this.showMore()) { |
| 97 | Row() { | 101 | Row() { |
| 98 | Ellipse() | 102 | Ellipse() |
| 99 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) | 103 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) |
| @@ -182,7 +186,7 @@ export struct ZhSingleRow02 { | @@ -182,7 +186,7 @@ export struct ZhSingleRow02 { | ||
| 182 | .padding({ | 186 | .padding({ |
| 183 | right: $r('app.float.card_comp_pagePadding_lf'), | 187 | right: $r('app.float.card_comp_pagePadding_lf'), |
| 184 | }) | 188 | }) |
| 185 | - .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible) | 189 | + .visibility(this.showMore() ? Visibility.Visible : Visibility.None) |
| 186 | .onClick(() => { | 190 | .onClick(() => { |
| 187 | if (this.compDTO?.objectType === '11') { | 191 | if (this.compDTO?.objectType === '11') { |
| 188 | ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | 192 | ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) |
| @@ -150,7 +150,10 @@ export struct ZhSingleRow03 { | @@ -150,7 +150,10 @@ export struct ZhSingleRow03 { | ||
| 150 | return str.slice(0) | 150 | return str.slice(0) |
| 151 | } | 151 | } |
| 152 | } | 152 | } |
| 153 | + } | ||
| 153 | 154 | ||
| 155 | + showMore() { | ||
| 156 | + return !!this.compDTO.dataSourceType || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '') | ||
| 154 | } | 157 | } |
| 155 | 158 | ||
| 156 | build() { | 159 | build() { |
| @@ -165,7 +168,7 @@ export struct ZhSingleRow03 { | @@ -165,7 +168,7 @@ export struct ZhSingleRow03 { | ||
| 165 | this.ItemCard(item) | 168 | this.ItemCard(item) |
| 166 | }) | 169 | }) |
| 167 | } | 170 | } |
| 168 | - if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | 171 | + if (this.compDTO.operDataList.length >= 2 && this.showMore()) { |
| 169 | Row() { | 172 | Row() { |
| 170 | Ellipse() | 173 | Ellipse() |
| 171 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) | 174 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) |
| @@ -401,7 +404,7 @@ export struct ZhSingleRow03 { | @@ -401,7 +404,7 @@ export struct ZhSingleRow03 { | ||
| 401 | .fontWeight(600) | 404 | .fontWeight(600) |
| 402 | } | 405 | } |
| 403 | 406 | ||
| 404 | - if (!(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | 407 | + if (this.showMore()) { |
| 405 | Row() { | 408 | Row() { |
| 406 | Text("更多") | 409 | Text("更多") |
| 407 | .fontSize($r("app.float.font_size_14")) | 410 | .fontSize($r("app.float.font_size_14")) |
-
Please register or login to post a comment