Showing
1 changed file
with
4 additions
and
85 deletions
| @@ -53,7 +53,8 @@ export struct LiveHorizontalCardComponent { | @@ -53,7 +53,8 @@ export struct LiveHorizontalCardComponent { | ||
| 53 | 53 | ||
| 54 | resetEdgeAnimation() { | 54 | resetEdgeAnimation() { |
| 55 | if (this.moreWidth > this.initMoreWidth) { | 55 | if (this.moreWidth > this.initMoreWidth) { |
| 56 | - this.moreWidth = 16 | 56 | + this.moreWidth = this.moreWidth - 1 |
| 57 | + this.resetEdgeAnimation(); | ||
| 57 | } | 58 | } |
| 58 | this.resetMoreTips() | 59 | this.resetMoreTips() |
| 59 | } | 60 | } |
| @@ -93,9 +94,9 @@ export struct LiveHorizontalCardComponent { | @@ -93,9 +94,9 @@ export struct LiveHorizontalCardComponent { | ||
| 93 | .fontWeight(600) | 94 | .fontWeight(600) |
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | - if (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '') { | 97 | + if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING' || this.compDTO.dataSourceType === 'OBJECT_POS') { |
| 97 | Row() { | 98 | Row() { |
| 98 | - Text("更多") | 99 | + Text("更多222222") |
| 99 | .fontSize($r("app.float.font_size_14")) | 100 | .fontSize($r("app.float.font_size_14")) |
| 100 | .fontColor($r("app.color.color_999999")) | 101 | .fontColor($r("app.color.color_999999")) |
| 101 | .margin({ right: 1 }) | 102 | .margin({ right: 1 }) |
| @@ -122,7 +123,6 @@ export struct LiveHorizontalCardComponent { | @@ -122,7 +123,6 @@ export struct LiveHorizontalCardComponent { | ||
| 122 | .margin({ top: 8, bottom: 8 }) | 123 | .margin({ top: 8, bottom: 8 }) |
| 123 | .width(CommonConstants.FULL_WIDTH) | 124 | .width(CommonConstants.FULL_WIDTH) |
| 124 | 125 | ||
| 125 | - Row(){ | ||
| 126 | // 多个 | 126 | // 多个 |
| 127 | if (this.compDTO.operDataList.length >= 2) { | 127 | if (this.compDTO.operDataList.length >= 2) { |
| 128 | Scroll(this.scroller) { | 128 | Scroll(this.scroller) { |
| @@ -209,87 +209,6 @@ export struct LiveHorizontalCardComponent { | @@ -209,87 +209,6 @@ export struct LiveHorizontalCardComponent { | ||
| 209 | .width(CommonConstants.FULL_WIDTH) | 209 | .width(CommonConstants.FULL_WIDTH) |
| 210 | .height(this.compDTO.operDataList.length == 2 ? 180 : 136) | 210 | .height(this.compDTO.operDataList.length == 2 ? 180 : 136) |
| 211 | } else if (this.compDTO.operDataList.length) { | 211 | } else if (this.compDTO.operDataList.length) { |
| 212 | - Row(){ | ||
| 213 | - LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] }) | ||
| 214 | - } | ||
| 215 | - } | ||
| 216 | - }.padding({left:10}) | ||
| 217 | - | ||
| 218 | - Text(item.newsTitle) | ||
| 219 | - .fontSize($r("app.float.font_size_14")) | ||
| 220 | - .fontColor($r("app.color.color_212228")) | ||
| 221 | - .fontWeight(400) | ||
| 222 | - .maxLines(2) | ||
| 223 | - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | ||
| 224 | - .textAlign(TextAlign.Start) | ||
| 225 | - .margin({ top: 8 }) | ||
| 226 | - .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | ||
| 227 | - .height(42) | ||
| 228 | - .lineHeight(21) | ||
| 229 | - } | ||
| 230 | - .padding({ right: 16 }) | ||
| 231 | - .onClick(() => { | ||
| 232 | - InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 233 | - if (item.objectType != '0') { | ||
| 234 | - console.log(item.objectId) | ||
| 235 | - this.gotoLive(item) | ||
| 236 | - } | ||
| 237 | - }) | ||
| 238 | - }) | ||
| 239 | - } | ||
| 240 | - if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | ||
| 241 | - Row() { | ||
| 242 | - Ellipse() | ||
| 243 | - .width(2* (this.moreWidth - this.initMoreWidth - 1)) | ||
| 244 | - .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | ||
| 245 | - .fill(0xf1f3f4) | ||
| 246 | - .position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 }) | ||
| 247 | - | ||
| 248 | - Column() { | ||
| 249 | - if (this.moreWidth > this.initMoreWidth + 2) { | ||
| 250 | - Text(this.moreTips) | ||
| 251 | - .fontSize(8) | ||
| 252 | - .fontColor(0x858585) | ||
| 253 | - .width(8) | ||
| 254 | - } | ||
| 255 | - } | ||
| 256 | - .justifyContent(FlexAlign.Center) | ||
| 257 | - .align(Alignment.Center) | ||
| 258 | - .height(this.compDTO.operDataList.length == 2 ? 180 : 146) | ||
| 259 | - .width(this.initMoreWidth) | ||
| 260 | - .backgroundColor(0xf1f3f4) | ||
| 261 | - .borderRadius({ topLeft: 5, bottomLeft: 5 }) | ||
| 262 | - } | ||
| 263 | - .margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)}) | ||
| 264 | - } | ||
| 265 | - } | ||
| 266 | - } | ||
| 267 | - .align(Alignment.Start) | ||
| 268 | - .scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None) | ||
| 269 | - .scrollBar(BarState.Off) | ||
| 270 | - .edgeEffect(EdgeEffect.None) | ||
| 271 | - .onReachEnd(() => { | ||
| 272 | - this.edgeAnimation() | ||
| 273 | - }) | ||
| 274 | - .onScrollStop(() => { | ||
| 275 | - // this.resetEdgeAnimation(); | ||
| 276 | - }) | ||
| 277 | - .onScroll((xOffset: number, yOffset: number) => { | ||
| 278 | - if (xOffset < 0) { | ||
| 279 | - this.reverseEdgeAnimation(); | ||
| 280 | - } | ||
| 281 | - }) | ||
| 282 | - .onTouch((event?: TouchEvent) => { | ||
| 283 | - if(event) { | ||
| 284 | - if (event.type === TouchType.Up) { | ||
| 285 | - this.toMore(); | ||
| 286 | - this.resetEdgeAnimation(); | ||
| 287 | - } | ||
| 288 | - } | ||
| 289 | - }) | ||
| 290 | - .width(CommonConstants.FULL_WIDTH) | ||
| 291 | - .height(this.compDTO.operDataList.length == 2 ? 180 : 136) | ||
| 292 | - } else if (this.compDTO.operDataList.length) { | ||
| 293 | // 一个 | 212 | // 一个 |
| 294 | LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] }) | 213 | LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] }) |
| 295 | } | 214 | } |
-
Please register or login to post a comment