Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
8 changed files
with
59 additions
and
31 deletions
| @@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent { | @@ -65,7 +65,6 @@ export struct ImageAndTextPageComponent { | ||
| 65 | @State reachEndIncreament: number = 0 | 65 | @State reachEndIncreament: number = 0 |
| 66 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 66 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 67 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 67 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 68 | - @State isScrollTop: boolean = true | ||
| 69 | @State offsetY: number = 0 | 68 | @State offsetY: number = 0 |
| 70 | @State executedStartTime: number = new Date().getTime() | 69 | @State executedStartTime: number = new Date().getTime() |
| 71 | private screenHeight: number = 0 | 70 | private screenHeight: number = 0 |
| @@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent { | @@ -208,8 +207,9 @@ export struct ImageAndTextPageComponent { | ||
| 208 | 207 | ||
| 209 | .onAreaChange((oldValue: Area, newValue: Area) => { | 208 | .onAreaChange((oldValue: Area, newValue: Area) => { |
| 210 | this.info = newValue | 209 | this.info = newValue |
| 211 | - // console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset) | ||
| 212 | - // console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number) | 210 | + // console.log(TAG, ">>>>>当前页面滚动位置:", this.scroller.currentOffset().yOffset) |
| 211 | + // console.log(TAG, ">>>>>当前评论区位置:", newValue.globalPosition.y as number) | ||
| 212 | + // console.log(TAG, ">>>>>当前屏幕宽度和底部高度:", this.screenHeight,this.bottomHeight) | ||
| 213 | this.checkToScrollCommentArea() | 213 | this.checkToScrollCommentArea() |
| 214 | }) | 214 | }) |
| 215 | // .onMeasureSize() | 215 | // .onMeasureSize() |
| @@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent { | @@ -467,7 +467,7 @@ export struct ImageAndTextPageComponent { | ||
| 467 | * 查询点赞、收藏数量 | 467 | * 查询点赞、收藏数量 |
| 468 | */ | 468 | */ |
| 469 | queryContentInteractCount() { | 469 | queryContentInteractCount() { |
| 470 | - console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) | 470 | + // console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) |
| 471 | 471 | ||
| 472 | const params: contentInteractParams = { | 472 | const params: contentInteractParams = { |
| 473 | contentId: this.contentDetailData?.newsId + '', | 473 | contentId: this.contentDetailData?.newsId + '', |
| @@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent { | @@ -504,16 +504,16 @@ export struct ImageAndTextPageComponent { | ||
| 504 | 504 | ||
| 505 | private pageScrollToCommonent() { | 505 | private pageScrollToCommonent() { |
| 506 | const info = componentUtils.getRectangleById('comment'); | 506 | const info = componentUtils.getRectangleById('comment'); |
| 507 | - console.log(TAG, "点击滑动页面", JSON.stringify(info)) | ||
| 508 | //评论区当前位置 | 507 | //评论区当前位置 |
| 509 | - let currentCommonentOffSetY = this.info?.globalPosition.y as number | 508 | + let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70 |
| 509 | + // 当前页面滚动位置 | ||
| 510 | + let currentScrollOffSetY = this.scroller.currentOffset().yOffset | ||
| 510 | let offSetY = 0 | 511 | let offSetY = 0 |
| 511 | if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | 512 | if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { |
| 512 | - offSetY = currentCommonentOffSetY-200 | 513 | + offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400 |
| 513 | } | 514 | } |
| 514 | - | ||
| 515 | // 定位到评论区域 | 515 | // 定位到评论区域 |
| 516 | - if (this.isScrollTop) { | 516 | + if (!this.showMainText) { |
| 517 | this.scroller.scrollTo({ | 517 | this.scroller.scrollTo({ |
| 518 | xOffset: 0, | 518 | xOffset: 0, |
| 519 | yOffset: offSetY, | 519 | yOffset: offSetY, |
| @@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent { | @@ -522,11 +522,10 @@ export struct ImageAndTextPageComponent { | ||
| 522 | } else { | 522 | } else { |
| 523 | this.scroller.scrollEdge(Edge.Top) | 523 | this.scroller.scrollEdge(Edge.Top) |
| 524 | } | 524 | } |
| 525 | - this.isScrollTop = !this.isScrollTop | ||
| 526 | } | 525 | } |
| 527 | 526 | ||
| 528 | aboutToAppear() { | 527 | aboutToAppear() { |
| 529 | - Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); | 528 | + // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); |
| 530 | this.getDetail() | 529 | this.getDetail() |
| 531 | this.screenHeight = DisplayUtils.getDeviceHeight() | 530 | this.screenHeight = DisplayUtils.getDeviceHeight() |
| 532 | this.initAnimationConfig(); | 531 | this.initAnimationConfig(); |
| @@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent { | @@ -576,8 +575,7 @@ export struct ImageAndTextPageComponent { | ||
| 576 | // 需要评论区位置,调用前 请确保它有值 | 575 | // 需要评论区位置,调用前 请确保它有值 |
| 577 | return | 576 | return |
| 578 | } | 577 | } |
| 579 | - let offSetY = this.info?.globalPosition.y as number -60 | ||
| 580 | - Logger.debug(TAG, "即将滚动至yOffset: " + offSetY) | 578 | + let offSetY = this.info?.globalPosition.y as number -70 |
| 581 | if (offSetY >= (this.screenHeight-this.bottomHeight) ) { | 579 | if (offSetY >= (this.screenHeight-this.bottomHeight) ) { |
| 582 | this.showMainText = false | 580 | this.showMainText = false |
| 583 | }else { | 581 | }else { |
| @@ -139,6 +139,38 @@ export struct CardSourceInfo { | @@ -139,6 +139,38 @@ export struct CardSourceInfo { | ||
| 139 | return parseInt(date) < twoDaysAgo.getTime() | 139 | return parseInt(date) < twoDaysAgo.getTime() |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | + showDot() { | ||
| 143 | + // return (this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && | ||
| 144 | + // this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | ||
| 145 | + // (this.getContentDtoBean()?.interactData?.commentNum | ||
| 146 | + // // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' | ||
| 147 | + // || (this.contentDTO.isSearch || this.contentDTO.isCollection || | ||
| 148 | + // !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | ||
| 149 | + // (Number | ||
| 150 | + // .parseFloat(this | ||
| 151 | + // .contentDTO.publishTime)) | ||
| 152 | + // .indexOf | ||
| 153 | + // ('-') === -1) | ||
| 154 | + // ) | ||
| 155 | + let flag = false; | ||
| 156 | + if (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) { | ||
| 157 | + if (this.showTime() && !this.isEllipsisActive) { | ||
| 158 | + flag = true | ||
| 159 | + } else if (!this.isEllipsisActive) { | ||
| 160 | + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | ||
| 161 | + this.showCommentNum()) { | ||
| 162 | + flag = true; | ||
| 163 | + } else if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | ||
| 164 | + flag = true; | ||
| 165 | + } | ||
| 166 | + } else if (this.contentDTO?.author&&this.contentDTO?.author.length > 0) { | ||
| 167 | + flag = true; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + return flag; | ||
| 172 | + } | ||
| 173 | + | ||
| 142 | build() { | 174 | build() { |
| 143 | Column(){ | 175 | Column(){ |
| 144 | Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) { | 176 | Flex({ justifyContent: FlexAlign.Start, direction: FlexDirection.Row }) { |
| @@ -161,18 +193,7 @@ export struct CardSourceInfo { | @@ -161,18 +193,7 @@ export struct CardSourceInfo { | ||
| 161 | } | 193 | } |
| 162 | 194 | ||
| 163 | // 点 | 195 | // 点 |
| 164 | - if ((this.showTime() && (this.contentDTO.rmhPlatform === 1 || this.contentDTO.source)) || ((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && | ||
| 165 | - this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && | ||
| 166 | - (this.getContentDtoBean()?.interactData?.commentNum | ||
| 167 | - // || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '' | ||
| 168 | - || (this.contentDTO.isSearch || this.contentDTO.isCollection || | ||
| 169 | - !this.contentDTO.isSearch && DateTimeUtils.getCommentTime | ||
| 170 | - (Number | ||
| 171 | - .parseFloat(this | ||
| 172 | - .contentDTO.publishTime)) | ||
| 173 | - .indexOf | ||
| 174 | - ('-') === -1) | ||
| 175 | - )) { | 196 | + if (this.showDot()) { |
| 176 | 197 | ||
| 177 | Image($r("app.media.point")) | 198 | Image($r("app.media.point")) |
| 178 | .width(11) | 199 | .width(11) |
| @@ -54,7 +54,7 @@ export struct behindDivider { | @@ -54,7 +54,7 @@ export struct behindDivider { | ||
| 54 | Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | 54 | Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) |
| 55 | } | 55 | } |
| 56 | } else { | 56 | } else { |
| 57 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 57 | + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) |
| 58 | } | 58 | } |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| @@ -30,8 +30,7 @@ export struct ZhGridLayout03 { | @@ -30,8 +30,7 @@ export struct ZhGridLayout03 { | ||
| 30 | 30 | ||
| 31 | build() { | 31 | build() { |
| 32 | GridRow({ | 32 | GridRow({ |
| 33 | - columns: { sm: listSize, md: 8 }, | ||
| 34 | - breakpoints: { value: ['320vp', '520vp', '840vp'] } | 33 | + columns: listSize, |
| 35 | }) { | 34 | }) { |
| 36 | ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | 35 | ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { |
| 37 | GridCol() { | 36 | GridCol() { |
| @@ -103,7 +103,7 @@ struct InteractMessagePage { | @@ -103,7 +103,7 @@ struct InteractMessagePage { | ||
| 103 | Row(){ | 103 | Row(){ |
| 104 | Text('共获') | 104 | Text('共获') |
| 105 | .fontSize(18).height(40).align(Alignment.Bottom) | 105 | .fontSize(18).height(40).align(Alignment.Bottom) |
| 106 | - Text(this.likeNum.toString()) | 106 | + Text(this.likeNum?.toString()) |
| 107 | .fontSize(40) | 107 | .fontSize(40) |
| 108 | .fontColor(Color.Red) | 108 | .fontColor(Color.Red) |
| 109 | .fontFamily('BebasNeue') | 109 | .fontFamily('BebasNeue') |
| 1 | -import { Logger} from 'wdKit' | 1 | +import { Logger, ToastUtils} from 'wdKit' |
| 2 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | 2 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' |
| 3 | import { | 3 | import { |
| 4 | ContentDTO, | 4 | ContentDTO, |
| @@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent { | @@ -49,7 +49,10 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 49 | // LoadingComponent() | 49 | // LoadingComponent() |
| 50 | this.LoadingLayout() | 50 | this.LoadingLayout() |
| 51 | } else if (this.viewType == 2) { | 51 | } else if (this.viewType == 2) { |
| 52 | - ErrorComponent() | 52 | + Column(){ |
| 53 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%') | ||
| 54 | + }.width('100%') | ||
| 55 | + .height('100%') | ||
| 53 | }else if(this.viewType == 4){ | 56 | }else if(this.viewType == 4){ |
| 54 | Column(){ | 57 | Column(){ |
| 55 | EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%') | 58 | EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCreation}).height('40%') |
| @@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -201,6 +204,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 201 | this.isLoading = false | 204 | this.isLoading = false |
| 202 | if (this.arr.length == 0) { | 205 | if (this.arr.length == 0) { |
| 203 | this.viewType = 2 | 206 | this.viewType = 2 |
| 207 | + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | ||
| 204 | } | 208 | } |
| 205 | } | 209 | } |
| 206 | } | 210 | } |
| @@ -82,6 +82,8 @@ export struct PlayerEndView { | @@ -82,6 +82,8 @@ export struct PlayerEndView { | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | build() { | 84 | build() { |
| 85 | + Stack() { | ||
| 86 | + Image(($r('app.media.live_detail_end_bg'))) | ||
| 85 | Column() { | 87 | Column() { |
| 86 | Text('直播已结束').fontWeight(500) | 88 | Text('直播已结束').fontWeight(500) |
| 87 | .fontSize(20) | 89 | .fontSize(20) |
| @@ -181,6 +183,10 @@ export struct PlayerEndView { | @@ -181,6 +183,10 @@ export struct PlayerEndView { | ||
| 181 | } | 183 | } |
| 182 | .height('100%') | 184 | .height('100%') |
| 183 | .width('100%') | 185 | .width('100%') |
| 186 | + } | ||
| 187 | + .height('100%') | ||
| 188 | + .width('100%') | ||
| 189 | + | ||
| 184 | 190 | ||
| 185 | } | 191 | } |
| 186 | } | 192 | } |
-
Please register or login to post a comment