Showing
15 changed files
with
212 additions
and
68 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 | } |
| @@ -44,6 +44,7 @@ export struct CompParser { | @@ -44,6 +44,7 @@ export struct CompParser { | ||
| 44 | aboutToAppear(): void { | 44 | aboutToAppear(): void { |
| 45 | 45 | ||
| 46 | 46 | ||
| 47 | + | ||
| 47 | console.log('CompParser-compDTO', JSON.stringify(this.compDTO)) | 48 | console.log('CompParser-compDTO', JSON.stringify(this.compDTO)) |
| 48 | // 轮播图屏蔽音频类型稿件 | 49 | // 轮播图屏蔽音频类型稿件 |
| 49 | if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 50 | if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| @@ -93,7 +94,7 @@ export struct CompParser { | @@ -93,7 +94,7 @@ export struct CompParser { | ||
| 93 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 94 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 94 | 95 | ||
| 95 | LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 96 | LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 96 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 97 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 97 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 98 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 98 | if (this.compDTO.operDataList.length > 1) { | 99 | if (this.compDTO.operDataList.length > 1) { |
| 99 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 100 | HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| @@ -103,7 +104,7 @@ export struct CompParser { | @@ -103,7 +104,7 @@ export struct CompParser { | ||
| 103 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 104 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 104 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | 105 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { |
| 105 | ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 106 | ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 106 | - Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 107 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 107 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 108 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 108 | ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) | 109 | ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 109 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 110 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| @@ -229,7 +229,7 @@ export struct CardMediaInfo { | @@ -229,7 +229,7 @@ export struct CardMediaInfo { | ||
| 229 | @Extend(Text) | 229 | @Extend(Text) |
| 230 | function mediaText() { | 230 | function mediaText() { |
| 231 | .fontColor($r('app.color.color_fff')) | 231 | .fontColor($r('app.color.color_fff')) |
| 232 | - .fontSize($r('app.float.font_size_14')) | 232 | + .fontSize($r('app.float.font_size_13')) |
| 233 | .lineHeight(18) | 233 | .lineHeight(18) |
| 234 | .textShadow({ | 234 | .textShadow({ |
| 235 | radius: 2, | 235 | radius: 2, |
| @@ -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 | } |
| @@ -18,6 +18,7 @@ const TAG: string = 'Card6Component-Card13Component'; | @@ -18,6 +18,7 @@ const TAG: string = 'Card6Component-Card13Component'; | ||
| 18 | @Component | 18 | @Component |
| 19 | export struct Card6Component { | 19 | export struct Card6Component { |
| 20 | @State pageId: string = ''; | 20 | @State pageId: string = ''; |
| 21 | + @State textHeight: number = 0 ; //获取文本的高度 | ||
| 21 | @State pageName: string = ''; | 22 | @State pageName: string = ''; |
| 22 | @State loadImg: boolean = false; | 23 | @State loadImg: boolean = false; |
| 23 | @State clicked: boolean = false; | 24 | @State clicked: boolean = false; |
| @@ -61,9 +62,14 @@ export struct Card6Component { | @@ -61,9 +62,14 @@ export struct Card6Component { | ||
| 61 | if (this.contentDTO.newTags) { | 62 | if (this.contentDTO.newTags) { |
| 62 | Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) | 63 | Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 63 | } | 64 | } |
| 65 | + if (this.contentDTO.top === 1) { | ||
| 66 | + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center) | ||
| 67 | + } | ||
| 64 | } | 68 | } |
| 65 | 69 | ||
| 66 | - Text() { | 70 | + Text() |
| 71 | + { | ||
| 72 | + | ||
| 67 | if (this.titleMarked) { | 73 | if (this.titleMarked) { |
| 68 | ForEach(this.textArr, (textItem: textItem) => { | 74 | ForEach(this.textArr, (textItem: textItem) => { |
| 69 | if (textItem.isRed) { | 75 | if (textItem.isRed) { |
| @@ -77,19 +83,20 @@ export struct Card6Component { | @@ -77,19 +83,20 @@ export struct Card6Component { | ||
| 77 | Span(this.contentDTO.newsTitle) | 83 | Span(this.contentDTO.newsTitle) |
| 78 | } | 84 | } |
| 79 | } | 85 | } |
| 86 | + | ||
| 80 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 87 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| 81 | .fontSize(18) | 88 | .fontSize(18) |
| 82 | .lineHeight(27) | 89 | .lineHeight(27) |
| 83 | .fontWeight(FontWeight.Normal) | 90 | .fontWeight(FontWeight.Normal) |
| 84 | - .maxLines(3) | 91 | + .maxLines(2) |
| 85 | .alignSelf(ItemAlign.Start) | 92 | .alignSelf(ItemAlign.Start) |
| 86 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 87 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 88 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 95 | (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 : | 96 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 90 | 0 ) | 97 | 0 ) |
| 91 | }.alignContent(Alignment.TopStart) | 98 | }.alignContent(Alignment.TopStart) |
| 92 | - // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) | 99 | + |
| 93 | 100 | ||
| 94 | } | 101 | } |
| 95 | .justifyContent(FlexAlign.Start) | 102 | .justifyContent(FlexAlign.Start) |
| @@ -98,8 +105,12 @@ export struct Card6Component { | @@ -98,8 +105,12 @@ export struct Card6Component { | ||
| 98 | CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 105 | CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 99 | 106 | ||
| 100 | } | 107 | } |
| 108 | + | ||
| 101 | .alignItems(HorizontalAlign.Start) | 109 | .alignItems(HorizontalAlign.Start) |
| 102 | - .justifyContent(FlexAlign.Start) | 110 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78: 156) |
| 111 | + | ||
| 112 | + | ||
| 113 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 103 | .width('64%') | 114 | .width('64%') |
| 104 | 115 | ||
| 105 | 116 | ||
| @@ -132,3 +143,4 @@ export struct Card6Component { | @@ -132,3 +143,4 @@ export struct Card6Component { | ||
| 132 | .alignItems(VerticalAlign.Top) | 143 | .alignItems(VerticalAlign.Top) |
| 133 | } | 144 | } |
| 134 | } | 145 | } |
| 146 | + |
| @@ -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) |
| @@ -40,6 +40,7 @@ export struct ZhSingleRow02 { | @@ -40,6 +40,7 @@ export struct ZhSingleRow02 { | ||
| 40 | } | 40 | } |
| 41 | .listDirection(Axis.Horizontal) | 41 | .listDirection(Axis.Horizontal) |
| 42 | .scrollBar(BarState.Off) | 42 | .scrollBar(BarState.Off) |
| 43 | + .edgeEffect(EdgeEffect.None) | ||
| 43 | } | 44 | } |
| 44 | .width(CommonConstants.FULL_WIDTH) | 45 | .width(CommonConstants.FULL_WIDTH) |
| 45 | .height(208) | 46 | .height(208) |
| @@ -11,7 +11,6 @@ import { | @@ -11,7 +11,6 @@ import { | ||
| 11 | import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' | 11 | import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' |
| 12 | import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' | 12 | import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' |
| 13 | import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index' | 13 | import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index' |
| 14 | -import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 15 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 14 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 16 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | 15 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' |
| 17 | import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' | 16 | import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem' |
| @@ -30,6 +29,7 @@ import { SearchCreatorComponent } from './SearchCreatorComponent' | @@ -30,6 +29,7 @@ import { SearchCreatorComponent } from './SearchCreatorComponent' | ||
| 30 | import { JSON } from '@kit.ArkTS' | 29 | import { JSON } from '@kit.ArkTS' |
| 31 | import { MoreComponent } from '../cardview/MoreComponent' | 30 | import { MoreComponent } from '../cardview/MoreComponent' |
| 32 | import { Card9Component } from '../cardview/Card9Component' | 31 | import { Card9Component } from '../cardview/Card9Component' |
| 32 | +import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | ||
| 33 | 33 | ||
| 34 | const TAG = "SearchResultContentComponent" | 34 | const TAG = "SearchResultContentComponent" |
| 35 | 35 | ||
| @@ -46,6 +46,12 @@ export struct SearchResultContentComponent { | @@ -46,6 +46,12 @@ export struct SearchResultContentComponent { | ||
| 46 | curPageNum: number = 1; | 46 | curPageNum: number = 1; |
| 47 | @State bean: FollowListDetailItem = new FollowListDetailItem("", "", "", "", "", "", "", "", "", -1, -1, "") | 47 | @State bean: FollowListDetailItem = new FollowListDetailItem("", "", "", "", "", "", "", "", "", -1, -1, "") |
| 48 | scroller: Scroller = new Scroller() | 48 | scroller: Scroller = new Scroller() |
| 49 | + private scroller2: Scroller = new Scroller() | ||
| 50 | + @State ellipseW: number = 0 | ||
| 51 | + @State moreWidth:number = 20 | ||
| 52 | + @State listLeft: number = 0 | ||
| 53 | + @State isEnd: boolean = false | ||
| 54 | + | ||
| 49 | 55 | ||
| 50 | aboutToAppear(): void { | 56 | aboutToAppear(): void { |
| 51 | if (this.searchType == "全部") { | 57 | if (this.searchType == "全部") { |
| @@ -243,7 +249,7 @@ export struct SearchResultContentComponent { | @@ -243,7 +249,7 @@ export struct SearchResultContentComponent { | ||
| 243 | if (this.count == 0) { | 249 | if (this.count == 0) { |
| 244 | ListHasNoMoreDataUI({ style: 2 }) | 250 | ListHasNoMoreDataUI({ style: 2 }) |
| 245 | } else { | 251 | } else { |
| 246 | - List() { | 252 | + List({scroller:this.scroller2}) { |
| 247 | if (this.data_rmh != null && this.data_rmh.length > 0){ | 253 | if (this.data_rmh != null && this.data_rmh.length > 0){ |
| 248 | if (this.data_rmh.length === 1){ | 254 | if (this.data_rmh.length === 1){ |
| 249 | ListItem(){ | 255 | ListItem(){ |
| @@ -306,44 +312,70 @@ export struct SearchResultContentComponent { | @@ -306,44 +312,70 @@ export struct SearchResultContentComponent { | ||
| 306 | 312 | ||
| 307 | @Builder | 313 | @Builder |
| 308 | SearchListUI() { | 314 | SearchListUI() { |
| 309 | - List({space:'8lpx'}) { | ||
| 310 | - ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | ||
| 311 | - ListItem() { | ||
| 312 | - SearchCreatorComponent({item:item}) | ||
| 313 | - } | ||
| 314 | - .width('150lpx') | ||
| 315 | - .height('100%') | ||
| 316 | - }) | 315 | + List({initialIndex: 0,space:'8lpx',scroller: this.scroller}) { |
| 316 | + ListItemGroup(){ | ||
| 317 | + ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | ||
| 318 | + ListItem() { | ||
| 319 | + SearchCreatorComponent({item:item}) | ||
| 320 | + } | ||
| 321 | + .width('150lpx') | ||
| 322 | + .height('100%') | ||
| 323 | + }) | ||
| 324 | + }.offset({ left: this.listLeft }) | ||
| 317 | 325 | ||
| 318 | ListItem(){ | 326 | ListItem(){ |
| 319 | - Column(){ | ||
| 320 | - Text("查看更多") | ||
| 321 | - .width('19lpx') | ||
| 322 | - .fontSize('19lpx') | ||
| 323 | - .fontWeight('400lpx') | ||
| 324 | - .lineHeight('27lpx') | ||
| 325 | - .fontColor($r('app.color.color_9E9E9E')) | ||
| 326 | - }.borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'}) | ||
| 327 | - .height('180lpx') | ||
| 328 | - .width('77lpx') | ||
| 329 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 330 | - .justifyContent(FlexAlign.Center) | ||
| 331 | - | 327 | + this.itemEnd() |
| 332 | }.height('100%') | 328 | }.height('100%') |
| 333 | .margin({left:'23lpx'}) | 329 | .margin({left:'23lpx'}) |
| 334 | - .onClick(()=>{ | ||
| 335 | - let params: Params = { | ||
| 336 | - pageID: this.keywords | ||
| 337 | - } | ||
| 338 | - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params) | ||
| 339 | - }) | ||
| 340 | } | 330 | } |
| 341 | - .cachedCount(6) | ||
| 342 | .edgeEffect(EdgeEffect.None) | 331 | .edgeEffect(EdgeEffect.None) |
| 343 | .scrollBar(BarState.Off) | 332 | .scrollBar(BarState.Off) |
| 344 | .listDirection(Axis.Horizontal) | 333 | .listDirection(Axis.Horizontal) |
| 345 | .width('100%') | 334 | .width('100%') |
| 346 | .height('219lpx') | 335 | .height('219lpx') |
| 336 | + .onReachEnd(() => { | ||
| 337 | + this.isEnd = true | ||
| 338 | + console.log(TAG,'is end') | ||
| 339 | + }) | ||
| 340 | + .onScrollFrameBegin((offset: number, state: ScrollState) => { | ||
| 341 | + console.log(TAG,'offset', offset) | ||
| 342 | + if (!this.scroller.isAtEnd()) { | ||
| 343 | + this.isEnd = false | ||
| 344 | + } | ||
| 345 | + if (this.ellipseW > 0) { | ||
| 346 | + return { offsetRemain: 0 } | ||
| 347 | + } | ||
| 348 | + return { offsetRemain: offset } | ||
| 349 | + }) | ||
| 350 | + .parallelGesture( | ||
| 351 | + PanGesture({ direction: PanDirection.Horizontal, distance: 1 }) | ||
| 352 | + .onActionStart((event: GestureEvent) => { | ||
| 353 | + console.info(TAG,'Pan start') | ||
| 354 | + }) | ||
| 355 | + .onActionUpdate((event: GestureEvent) => { | ||
| 356 | + if (event && this.isEnd) { | ||
| 357 | + // console.log('event.offsetX',event.offsetX) | ||
| 358 | + this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX | ||
| 359 | + this.ellipseW = (-this.listLeft) / 1.5 | ||
| 360 | + | ||
| 361 | + console.log(TAG,"this.ellipseW==>" + this.ellipseW) | ||
| 362 | + } | ||
| 363 | + }) | ||
| 364 | + .onActionEnd((event: GestureEvent) => { | ||
| 365 | + console.info(TAG,'Pan end') | ||
| 366 | + this.listLeft = 0 | ||
| 367 | + // this.moreWidth = 20 | ||
| 368 | + | ||
| 369 | + if (event.offsetX < 0 && this.ellipseW >=20) { | ||
| 370 | + console.log(TAG,'跳转') | ||
| 371 | + let params: Params = { | ||
| 372 | + pageID: this.keywords | ||
| 373 | + } | ||
| 374 | + WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage,params) | ||
| 375 | + } | ||
| 376 | + this.ellipseW = 0 | ||
| 377 | + }) | ||
| 378 | + ) | ||
| 347 | 379 | ||
| 348 | Divider() | 380 | Divider() |
| 349 | .width('100%') | 381 | .width('100%') |
| @@ -352,6 +384,32 @@ export struct SearchResultContentComponent { | @@ -352,6 +384,32 @@ export struct SearchResultContentComponent { | ||
| 352 | .strokeWidth('12lpx') | 384 | .strokeWidth('12lpx') |
| 353 | } | 385 | } |
| 354 | 386 | ||
| 387 | + | ||
| 388 | + @Builder | ||
| 389 | + itemEnd() { | ||
| 390 | + Row() { | ||
| 391 | + Ellipse() | ||
| 392 | + .width(2* this.ellipseW) | ||
| 393 | + .height('100%') | ||
| 394 | + .fill('rgb(240,235,238)') | ||
| 395 | + .position({ left: -this.ellipseW, top: 0 }) | ||
| 396 | + | ||
| 397 | + Column(){ | ||
| 398 | + Text(this.ellipseW === 0 ? '' : this.ellipseW < 20? '查看更多' : '松手查看') | ||
| 399 | + .width('19lpx') | ||
| 400 | + .fontSize('19lpx') | ||
| 401 | + .fontWeight('400lpx') | ||
| 402 | + .lineHeight('27lpx') | ||
| 403 | + .fontColor("#9E9E9E") | ||
| 404 | + } | ||
| 405 | + .height('100%') | ||
| 406 | + .width(this.moreWidth) | ||
| 407 | + .backgroundColor("#EDEDED") | ||
| 408 | + .justifyContent(FlexAlign.Center) | ||
| 409 | + } | ||
| 410 | + .height('100%') | ||
| 411 | + } | ||
| 412 | + | ||
| 355 | private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { | 413 | private dataTransform(rem:CreatorDetailResponseItem[],value: SearchResultContentItem, photos: FullColumnImgUrlDTO[]): ContentDTO { |
| 356 | let rmhInfo = this.getRmhInfo(rem,value) | 414 | let rmhInfo = this.getRmhInfo(rem,value) |
| 357 | console.log('获取photos',JSON.stringify(photos)) | 415 | console.log('获取photos',JSON.stringify(photos)) |
| @@ -9,6 +9,8 @@ import { | @@ -9,6 +9,8 @@ import { | ||
| 9 | } from 'wdBean'; | 9 | } from 'wdBean'; |
| 10 | import { LiveModel } from '../../viewmodel/LiveModel'; | 10 | import { LiveModel } from '../../viewmodel/LiveModel'; |
| 11 | import { HttpUtils } from 'wdNetwork/Index'; | 11 | import { HttpUtils } from 'wdNetwork/Index'; |
| 12 | +import vibrator from '@ohos.vibrator'; | ||
| 13 | +import { BusinessError } from '@ohos.base'; | ||
| 12 | 14 | ||
| 13 | const TAG = 'LiveLikeComponent'; | 15 | const TAG = 'LiveLikeComponent'; |
| 14 | 16 | ||
| @@ -106,38 +108,63 @@ export struct LiveLikeComponent { | @@ -106,38 +108,63 @@ export struct LiveLikeComponent { | ||
| 106 | 108 | ||
| 107 | @Builder | 109 | @Builder |
| 108 | likeCompStyle() { | 110 | likeCompStyle() { |
| 109 | - Stack({ alignContent: Alignment.Bottom }) { | 111 | + Stack({ alignContent: Alignment.TopEnd }) { |
| 110 | Column() { | 112 | Column() { |
| 111 | Image(this.transLikeStyle().url) | 113 | Image(this.transLikeStyle().url) |
| 112 | .width(24) | 114 | .width(24) |
| 113 | .height(24) | 115 | .height(24) |
| 114 | - .onClick(() => { | ||
| 115 | - this.clickButtonEvent() | ||
| 116 | - }) | ||
| 117 | } | 116 | } |
| 118 | .justifyContent(FlexAlign.Center) | 117 | .justifyContent(FlexAlign.Center) |
| 119 | .width(36) | 118 | .width(36) |
| 120 | .height(36) | 119 | .height(36) |
| 121 | .borderRadius(18) | 120 | .borderRadius(18) |
| 122 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') | 121 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5') |
| 123 | - Row() { | ||
| 124 | - Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | ||
| 125 | - .fontSize(8) | ||
| 126 | - .fontColor(Color.White) | ||
| 127 | - .padding({ left: 8, right: 2 }) | 122 | + if (this.likeCount != 0) { |
| 123 | + RelativeContainer() { | ||
| 124 | + Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select')) | ||
| 125 | + .objectFit(ImageFit.Fill) | ||
| 126 | + .resizable({ | ||
| 127 | + slice: { | ||
| 128 | + top: 1, | ||
| 129 | + left: 20, | ||
| 130 | + right: 1, | ||
| 131 | + bottom: 1 | ||
| 132 | + } | ||
| 133 | + }) | ||
| 134 | + .alignRules({ | ||
| 135 | + top: { anchor: "Text", align: VerticalAlign.Top }, | ||
| 136 | + left: { anchor: "Text", align: HorizontalAlign.Start }, | ||
| 137 | + right: { anchor: "Text", align: HorizontalAlign.End }, | ||
| 138 | + bottom: { anchor: "Text", align: VerticalAlign.Bottom }, | ||
| 139 | + }) | ||
| 140 | + .id("Image") | ||
| 141 | + | ||
| 142 | + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444") | ||
| 143 | + .fontSize(8) | ||
| 144 | + .fontColor('#ffffff')// .backgroundColor('#ED2800') | ||
| 145 | + .height(12) | ||
| 146 | + .textAlign(TextAlign.Center) | ||
| 147 | + .alignRules({ | ||
| 148 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 149 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 150 | + })// .margin({left: 4,right:4 | ||
| 151 | + // }) | ||
| 152 | + /*动态计算文字宽度*/ | ||
| 153 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 154 | + 12)// .backgroundColor(Color.Green) | ||
| 155 | + .id("Text") | ||
| 156 | + .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 157 | + } | ||
| 158 | + .offset({ | ||
| 159 | + x: 18 | ||
| 160 | + }) | ||
| 128 | } | 161 | } |
| 129 | - .height(12) | ||
| 130 | - .alignItems(VerticalAlign.Center) | ||
| 131 | - .position({ x: '100%', y: 10 }) | ||
| 132 | - .markAnchor({ x: '100%' }) | ||
| 133 | - .backgroundImage($r('app.media.ic_like_back')) | ||
| 134 | - .backgroundImageSize({height: 13}) | ||
| 135 | - .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 136 | - 12) | ||
| 137 | - .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 138 | } | 162 | } |
| 139 | .width(36) | 163 | .width(36) |
| 140 | - .height(42) | 164 | + .height(36) |
| 165 | + .onClick(() => { | ||
| 166 | + this.clickButtonEvent() | ||
| 167 | + }) | ||
| 141 | .visibility(this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) | 168 | .visibility(this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible) |
| 142 | 169 | ||
| 143 | } | 170 | } |
| @@ -164,6 +191,25 @@ export struct LiveLikeComponent { | @@ -164,6 +191,25 @@ export struct LiveLikeComponent { | ||
| 164 | this.LiveModel.getLiveRoomNumberLike(this.likeBean['contentId'], 1, HttpUtils.getDeviceId()).then((data) => { | 191 | this.LiveModel.getLiveRoomNumberLike(this.likeBean['contentId'], 1, HttpUtils.getDeviceId()).then((data) => { |
| 165 | 192 | ||
| 166 | console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) | 193 | console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) |
| 194 | + try { | ||
| 195 | + // 触发马达振动 | ||
| 196 | + vibrator.startVibration({ | ||
| 197 | + type: 'time', | ||
| 198 | + duration: 100, | ||
| 199 | + }, { | ||
| 200 | + id: 0, | ||
| 201 | + usage: 'alarm' | ||
| 202 | + }, (error: BusinessError) => { | ||
| 203 | + if (error) { | ||
| 204 | + console.error(`Failed to start vibration. Code: ${error.code}, message: ${error.message}`); | ||
| 205 | + return; | ||
| 206 | + } | ||
| 207 | + console.info('Succeed in starting vibration'); | ||
| 208 | + }); | ||
| 209 | + } catch (err) { | ||
| 210 | + let e: BusinessError = err as BusinessError; | ||
| 211 | + console.error(`An unexpected error occurred. Code: ${e.code}, message: ${e.message}`); | ||
| 212 | + } | ||
| 167 | this.likeCount++ | 213 | this.likeCount++ |
| 168 | 214 | ||
| 169 | }).catch(() => { | 215 | }).catch(() => { |
| @@ -12,6 +12,9 @@ | @@ -12,6 +12,9 @@ | ||
| 12 | "requestPermissions": [ | 12 | "requestPermissions": [ |
| 13 | { | 13 | { |
| 14 | "name": "ohos.permission.INTERNET" | 14 | "name": "ohos.permission.INTERNET" |
| 15 | + }, | ||
| 16 | + { | ||
| 17 | + "name": "ohos.permission.VIBRATE" | ||
| 15 | } | 18 | } |
| 16 | ], | 19 | ], |
| 17 | "pages": "$profile:main_pages" | 20 | "pages": "$profile:main_pages" |
| @@ -7,7 +7,7 @@ import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/Mine | @@ -7,7 +7,7 @@ import { MinePageComponent } from 'wdComponent/src/main/ets/components/page/Mine | ||
| 7 | import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index'; | 7 | import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wdComponent/Index'; |
| 8 | import { VideoChannelPage } from './VideoChannelPage'; | 8 | import { VideoChannelPage } from './VideoChannelPage'; |
| 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; | 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; |
| 10 | -import { ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; | 10 | +import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; |
| 11 | 11 | ||
| 12 | const TAG = 'BottomNavigationComponent'; | 12 | const TAG = 'BottomNavigationComponent'; |
| 13 | PersistentStorage.persistProp('channelIds', ''); | 13 | PersistentStorage.persistProp('channelIds', ''); |
| @@ -188,8 +188,8 @@ export struct BottomNavigationComponent { | @@ -188,8 +188,8 @@ export struct BottomNavigationComponent { | ||
| 188 | errorholderSrc: defaultIcon, | 188 | errorholderSrc: defaultIcon, |
| 189 | // 是否开启一级内存缓存 | 189 | // 是否开启一级内存缓存 |
| 190 | isCacheable: true, | 190 | isCacheable: true, |
| 191 | - // 磁盘缓存none | ||
| 192 | - strategy: new NONE() | 191 | + // 磁盘缓存 |
| 192 | + strategy: new ALL() | ||
| 193 | }; | 193 | }; |
| 194 | return imageKnifeOption | 194 | return imageKnifeOption |
| 195 | } | 195 | } |
| @@ -263,6 +263,7 @@ export struct BottomNavigationComponent { | @@ -263,6 +263,7 @@ export struct BottomNavigationComponent { | ||
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | onBottomNavigationDataUpdated() { | 265 | onBottomNavigationDataUpdated() { |
| 266 | + Logger.error('yyyy','onBottomNavigationDataUpdated '+JSON.stringify(this.bottomNavList)) | ||
| 266 | // Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`); | 267 | // Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`); |
| 267 | } | 268 | } |
| 268 | 269 |
-
Please register or login to post a comment