Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
13 changed files
with
61 additions
and
41 deletions
| @@ -189,7 +189,7 @@ export class ProcessUtils { | @@ -189,7 +189,7 @@ export class ProcessUtils { | ||
| 189 | if (typeof type == "number") { | 189 | if (typeof type == "number") { |
| 190 | type = `${type}` | 190 | type = `${type}` |
| 191 | } | 191 | } |
| 192 | - // console.log(TAG, 'objectType', `${JSON.stringify(content)}`); | 192 | + // Logger.debug(TAG, `objectType, ${JSON.stringify(content)}`); |
| 193 | switch (type) { | 193 | switch (type) { |
| 194 | case ContentConstants.TYPE_NONE: | 194 | case ContentConstants.TYPE_NONE: |
| 195 | // Logger.debug(TAG, "processPage, do nothing"); | 195 | // Logger.debug(TAG, "processPage, do nothing"); |
| @@ -432,7 +432,8 @@ export class ProcessUtils { | @@ -432,7 +432,8 @@ export class ProcessUtils { | ||
| 432 | commentId: content?.commentInfo?.commentId, | 432 | commentId: content?.commentInfo?.commentId, |
| 433 | title: content?.newsTitle | 433 | title: content?.newsTitle |
| 434 | } as ExtraDTO, | 434 | } as ExtraDTO, |
| 435 | - targetLayout: content.customParamTargetLayout | 435 | + targetLayout: content.customParamTargetLayout, |
| 436 | + clickComment: content.clickComment | ||
| 436 | } as Params, | 437 | } as Params, |
| 437 | }; | 438 | }; |
| 438 | WDRouterRule.jumpWithAction(taskAction) | 439 | WDRouterRule.jumpWithAction(taskAction) |
| @@ -454,7 +455,8 @@ export class ProcessUtils { | @@ -454,7 +455,8 @@ export class ProcessUtils { | ||
| 454 | sourcePage: '5', | 455 | sourcePage: '5', |
| 455 | commentId: content?.commentInfo?.commentId | 456 | commentId: content?.commentInfo?.commentId |
| 456 | } as ExtraDTO, | 457 | } as ExtraDTO, |
| 457 | - targetLayout: content.customParamTargetLayout | 458 | + targetLayout: content.customParamTargetLayout, |
| 459 | + clickComment: content.clickComment | ||
| 458 | } as Params, | 460 | } as Params, |
| 459 | }; | 461 | }; |
| 460 | WDRouterRule.jumpWithAction(taskAction) | 462 | WDRouterRule.jumpWithAction(taskAction) |
| @@ -144,6 +144,7 @@ export class ContentDTO implements BaseDTO { | @@ -144,6 +144,7 @@ export class ContentDTO implements BaseDTO { | ||
| 144 | isMourning?: boolean = false; | 144 | isMourning?: boolean = false; |
| 145 | 145 | ||
| 146 | author: string = ""; ///撰稿人 | 146 | author: string = ""; ///撰稿人 |
| 147 | + clickComment:boolean = false; | ||
| 147 | 148 | ||
| 148 | static clone(old: ContentDTO): ContentDTO { | 149 | static clone(old: ContentDTO): ContentDTO { |
| 149 | let content = new ContentDTO(); | 150 | let content = new ContentDTO(); |
| @@ -24,6 +24,6 @@ export interface Params { | @@ -24,6 +24,6 @@ export interface Params { | ||
| 24 | videoCoverUrl?: string; | 24 | videoCoverUrl?: string; |
| 25 | pageId?: string; | 25 | pageId?: string; |
| 26 | backVisibility?: boolean; //展示顶部返回栏 | 26 | backVisibility?: boolean; //展示顶部返回栏 |
| 27 | - | 27 | + clickComment?:boolean;//点击评论按钮进入稿件详情页定位到评论区 |
| 28 | targetLayout?: string; // "comment" 表示进入对应页面后,跳转至评论区 | 28 | targetLayout?: string; // "comment" 表示进入对应页面后,跳转至评论区 |
| 29 | } | 29 | } |
| @@ -101,6 +101,7 @@ export struct CarderInteraction { | @@ -101,6 +101,7 @@ export struct CarderInteraction { | ||
| 101 | } | 101 | } |
| 102 | .justifyContent(FlexAlign.Center) | 102 | .justifyContent(FlexAlign.Center) |
| 103 | .onClick(() => { | 103 | .onClick(() => { |
| 104 | + this.contentDTO.clickComment = true | ||
| 104 | ProcessUtils.processPage(this.contentDTO); | 105 | ProcessUtils.processPage(this.contentDTO); |
| 105 | }) | 106 | }) |
| 106 | } | 107 | } |
| @@ -52,7 +52,7 @@ export struct ImageAndTextPageComponent { | @@ -52,7 +52,7 @@ export struct ImageAndTextPageComponent { | ||
| 52 | @State recommendList: ContentDTO[] = [] | 52 | @State recommendList: ContentDTO[] = [] |
| 53 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 53 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 54 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 54 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 55 | - @State isPageEnd: boolean = false | 55 | + // @State isPageEnd: boolean = false |
| 56 | @State publishTime: string = '' | 56 | @State publishTime: string = '' |
| 57 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 57 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 58 | // @State operationButtonList: string[] = ['comment', 'collect', 'share'] | 58 | // @State operationButtonList: string[] = ['comment', 'collect', 'share'] |
| @@ -77,6 +77,7 @@ export struct ImageAndTextPageComponent { | @@ -77,6 +77,7 @@ export struct ImageAndTextPageComponent { | ||
| 77 | lastTimeoutId?: number | 77 | lastTimeoutId?: number |
| 78 | @State needAnimation: boolean = false; | 78 | @State needAnimation: boolean = false; |
| 79 | 79 | ||
| 80 | + @State @Watch("webPageIsPageEnd") isPageEnd: boolean = false | ||
| 80 | @Consume @Watch('pageShowForUpdateData') pageShow :number | 81 | @Consume @Watch('pageShowForUpdateData') pageShow :number |
| 81 | @Consume @Watch('pageHideForUpdateData') pageHide :number | 82 | @Consume @Watch('pageHideForUpdateData') pageHide :number |
| 82 | 83 | ||
| @@ -92,6 +93,15 @@ export struct ImageAndTextPageComponent { | @@ -92,6 +93,15 @@ export struct ImageAndTextPageComponent { | ||
| 92 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | 93 | TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 96 | + webPageIsPageEnd() { | ||
| 97 | + if (this.action.params?.clickComment) { | ||
| 98 | + setTimeout(()=>{ | ||
| 99 | + this.pageScrollToCommonent() | ||
| 100 | + }, | ||
| 101 | + 900) | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 95 | build() { | 105 | build() { |
| 96 | Stack({ alignContent: Alignment.Top }) { | 106 | Stack({ alignContent: Alignment.Top }) { |
| 97 | Stack({ alignContent: Alignment.Bottom }) { | 107 | Stack({ alignContent: Alignment.Bottom }) { |
| @@ -198,8 +208,8 @@ export struct ImageAndTextPageComponent { | @@ -198,8 +208,8 @@ export struct ImageAndTextPageComponent { | ||
| 198 | 208 | ||
| 199 | .onAreaChange((oldValue: Area, newValue: Area) => { | 209 | .onAreaChange((oldValue: Area, newValue: Area) => { |
| 200 | this.info = newValue | 210 | this.info = newValue |
| 201 | - console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset) | ||
| 202 | - console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number) | 211 | + // console.log(TAG, "总页面滑动偏移量", this.scroller.currentOffset().yOffset) |
| 212 | + // console.log(TAG, "总页面滑动偏移量111", newValue.globalPosition.y as number) | ||
| 203 | this.checkToScrollCommentArea() | 213 | this.checkToScrollCommentArea() |
| 204 | }) | 214 | }) |
| 205 | // .onMeasureSize() | 215 | // .onMeasureSize() |
| @@ -245,30 +255,7 @@ export struct ImageAndTextPageComponent { | @@ -245,30 +255,7 @@ export struct ImageAndTextPageComponent { | ||
| 245 | showMainText:this.showMainText, | 255 | showMainText:this.showMainText, |
| 246 | styleType: 1, | 256 | styleType: 1, |
| 247 | onCommentIconClick: () => { | 257 | onCommentIconClick: () => { |
| 248 | - const info = componentUtils.getRectangleById('comment'); | ||
| 249 | - console.log(TAG, "点击滑动页面", JSON.stringify(info)) | ||
| 250 | - | ||
| 251 | - //评论区当前位置 | ||
| 252 | - let currentCommonentOffSetY = this.info?.globalPosition.y as number | ||
| 253 | - let offSetY = 0 | ||
| 254 | - if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 255 | - offSetY = currentCommonentOffSetY-200 | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - // if (!this.offsetY) { | ||
| 259 | - // this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y | ||
| 260 | - // } | ||
| 261 | - // 定位到评论区域 | ||
| 262 | - if (this.isScrollTop) { | ||
| 263 | - this.scroller.scrollTo({ | ||
| 264 | - xOffset: 0, | ||
| 265 | - yOffset: offSetY, | ||
| 266 | - animation: { duration: 1000, curve: Curve.Ease } | ||
| 267 | - }) | ||
| 268 | - } else { | ||
| 269 | - this.scroller.scrollEdge(Edge.Top) | ||
| 270 | - } | ||
| 271 | - this.isScrollTop = !this.isScrollTop | 258 | + this.pageScrollToCommonent() |
| 272 | } | 259 | } |
| 273 | }) | 260 | }) |
| 274 | } | 261 | } |
| @@ -288,6 +275,7 @@ export struct ImageAndTextPageComponent { | @@ -288,6 +275,7 @@ export struct ImageAndTextPageComponent { | ||
| 288 | Text(this.publishTime) | 275 | Text(this.publishTime) |
| 289 | .fontColor($r('app.color.color_B0B0B0')) | 276 | .fontColor($r('app.color.color_B0B0B0')) |
| 290 | .fontSize(13) | 277 | .fontSize(13) |
| 278 | + .height(20) | ||
| 291 | } | 279 | } |
| 292 | } | 280 | } |
| 293 | .width(CommonConstants.FULL_WIDTH) | 281 | .width(CommonConstants.FULL_WIDTH) |
| @@ -514,6 +502,29 @@ export struct ImageAndTextPageComponent { | @@ -514,6 +502,29 @@ export struct ImageAndTextPageComponent { | ||
| 514 | } | 502 | } |
| 515 | } | 503 | } |
| 516 | 504 | ||
| 505 | + private pageScrollToCommonent() { | ||
| 506 | + const info = componentUtils.getRectangleById('comment'); | ||
| 507 | + console.log(TAG, "点击滑动页面", JSON.stringify(info)) | ||
| 508 | + //评论区当前位置 | ||
| 509 | + let currentCommonentOffSetY = this.info?.globalPosition.y as number | ||
| 510 | + let offSetY = 0 | ||
| 511 | + if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 512 | + offSetY = currentCommonentOffSetY-200 | ||
| 513 | + } | ||
| 514 | + | ||
| 515 | + // 定位到评论区域 | ||
| 516 | + if (this.isScrollTop) { | ||
| 517 | + this.scroller.scrollTo({ | ||
| 518 | + xOffset: 0, | ||
| 519 | + yOffset: offSetY, | ||
| 520 | + animation: { duration: 1000, curve: Curve.Ease } | ||
| 521 | + }) | ||
| 522 | + } else { | ||
| 523 | + this.scroller.scrollEdge(Edge.Top) | ||
| 524 | + } | ||
| 525 | + this.isScrollTop = !this.isScrollTop | ||
| 526 | + } | ||
| 527 | + | ||
| 517 | aboutToAppear() { | 528 | aboutToAppear() { |
| 518 | Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); | 529 | Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); |
| 519 | this.getDetail() | 530 | this.getDetail() |
| @@ -327,7 +327,7 @@ export struct MorningEveningPaperComponent { | @@ -327,7 +327,7 @@ export struct MorningEveningPaperComponent { | ||
| 327 | compListItem: this.compListItem, | 327 | compListItem: this.compListItem, |
| 328 | }) | 328 | }) |
| 329 | .margin({ | 329 | .margin({ |
| 330 | - top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 10 : 44+this.topSafeHeight | 330 | + top: this.isHasTopView || this.audioPlayUrl.length > 0 ? 0 : 44+this.topSafeHeight |
| 331 | }) | 331 | }) |
| 332 | } | 332 | } |
| 333 | } | 333 | } |
| @@ -55,8 +55,8 @@ export default struct MinePageUserSimpleInfoUI { | @@ -55,8 +55,8 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 55 | 55 | ||
| 56 | if(StringUtils.isNotEmpty(this.levelHead)){ | 56 | if(StringUtils.isNotEmpty(this.levelHead)){ |
| 57 | Image(this.levelHead) | 57 | Image(this.levelHead) |
| 58 | - .width(72.86) | ||
| 59 | - .height(72.86) | 58 | + .width(75.86) |
| 59 | + .height(75.86) | ||
| 60 | .objectFit(ImageFit.Cover) | 60 | .objectFit(ImageFit.Cover) |
| 61 | .borderRadius(50) | 61 | .borderRadius(50) |
| 62 | } | 62 | } |
| @@ -101,7 +101,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -101,7 +101,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 101 | .fontFamily('PingFang SC-Semibold') | 101 | .fontFamily('PingFang SC-Semibold') |
| 102 | .fontSize(10) | 102 | .fontSize(10) |
| 103 | .fontWeight(600) | 103 | .fontWeight(600) |
| 104 | - .margin({ left: 6 }) | 104 | + .margin({ left: 0,top:8 }) |
| 105 | .backgroundImage($r("app.media.mine_grade_bg")) | 105 | .backgroundImage($r("app.media.mine_grade_bg")) |
| 106 | .backgroundImageSize(ImageSize.FILL) | 106 | .backgroundImageSize(ImageSize.FILL) |
| 107 | .padding({left: 6,right: 6}) | 107 | .padding({left: 6,right: 6}) |
| @@ -37,7 +37,7 @@ export struct HomePageBottomCommentComponent { | @@ -37,7 +37,7 @@ export struct HomePageBottomCommentComponent { | ||
| 37 | if (this.isGetRequest == true) { | 37 | if (this.isGetRequest == true) { |
| 38 | Text().backgroundColor($r('app.color.color_EDEDED')) | 38 | Text().backgroundColor($r('app.color.color_EDEDED')) |
| 39 | .width('100%') | 39 | .width('100%') |
| 40 | - .height(2) | 40 | + .height(1) |
| 41 | } | 41 | } |
| 42 | if (this.count === 0) { | 42 | if (this.count === 0) { |
| 43 | if (this.isGetRequest == true) { | 43 | if (this.isGetRequest == true) { |
| @@ -69,9 +69,9 @@ export struct HomePageBottomFollowComponent { | @@ -69,9 +69,9 @@ export struct HomePageBottomFollowComponent { | ||
| 69 | 69 | ||
| 70 | Column() { | 70 | Column() { |
| 71 | if (this.isGetRequest == true) { | 71 | if (this.isGetRequest == true) { |
| 72 | - Text().backgroundColor($r('app.color.color_EDEDED')) | 72 | + Text().backgroundColor(Color.Red) |
| 73 | .width('100%') | 73 | .width('100%') |
| 74 | - .height(2) | 74 | + .height(1) |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | if (this.count === 0) { | 77 | if (this.count === 0) { |
| @@ -31,6 +31,10 @@ export struct PeopleShipHomePageHeadComponent { | @@ -31,6 +31,10 @@ export struct PeopleShipHomePageHeadComponent { | ||
| 31 | .height(this.iconDiameter) | 31 | .height(this.iconDiameter) |
| 32 | .borderRadius(this.iconDiameter/2) | 32 | .borderRadius(this.iconDiameter/2) |
| 33 | .objectFit(ImageFit.Cover) | 33 | .objectFit(ImageFit.Cover) |
| 34 | + .margin({ | ||
| 35 | + right: '0vp', | ||
| 36 | + bottom:'0vp' | ||
| 37 | + }) | ||
| 34 | } | 38 | } |
| 35 | } | 39 | } |
| 36 | } | 40 | } |
| @@ -54,7 +54,6 @@ export struct PeopleShipHomePageTopComponent { | @@ -54,7 +54,6 @@ export struct PeopleShipHomePageTopComponent { | ||
| 54 | WDRouterRule.jumpWithPage(WDRouterPage.showHomePageHeaderPage, params) | 54 | WDRouterRule.jumpWithPage(WDRouterPage.showHomePageHeaderPage, params) |
| 55 | }) | 55 | }) |
| 56 | 56 | ||
| 57 | - | ||
| 58 | // 文字 | 57 | // 文字 |
| 59 | Text(this.detailModel.userName) | 58 | Text(this.detailModel.userName) |
| 60 | .height('50vp') | 59 | .height('50vp') |
| @@ -122,11 +122,12 @@ struct MineHomePage { | @@ -122,11 +122,12 @@ struct MineHomePage { | ||
| 122 | Row() { | 122 | Row() { |
| 123 | Text(`${this.userName}`) | 123 | Text(`${this.userName}`) |
| 124 | .fontColor($r('app.color.white')) | 124 | .fontColor($r('app.color.white')) |
| 125 | - .maxLines(1) | 125 | + .maxLines(2) |
| 126 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 126 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 127 | .fontSize(20) | 127 | .fontSize(20) |
| 128 | .lineHeight(26) | 128 | .lineHeight(26) |
| 129 | .fontWeight(500) | 129 | .fontWeight(500) |
| 130 | + .constraintSize({maxWidth:180}) | ||
| 130 | .onClick(()=>{ | 131 | .onClick(()=>{ |
| 131 | let params: editModelParams = { | 132 | let params: editModelParams = { |
| 132 | editContent: this.userName | 133 | editContent: this.userName |
| @@ -206,7 +207,7 @@ struct MineHomePage { | @@ -206,7 +207,7 @@ struct MineHomePage { | ||
| 206 | .backgroundColor($r('app.color.color_transparent')) | 207 | .backgroundColor($r('app.color.color_transparent')) |
| 207 | .height(86) | 208 | .height(86) |
| 208 | .width('100%') | 209 | .width('100%') |
| 209 | - .padding({ left: 16 }) | 210 | + .padding({ left: 10 }) |
| 210 | 211 | ||
| 211 | 212 | ||
| 212 | Column(){ | 213 | Column(){ |
| @@ -39,6 +39,7 @@ export class WDShare { | @@ -39,6 +39,7 @@ export class WDShare { | ||
| 39 | desc: program.shareInfo.shareSummary, | 39 | desc: program.shareInfo.shareSummary, |
| 40 | link: program.shareInfo.shareUrl, | 40 | link: program.shareInfo.shareUrl, |
| 41 | deeplink:AppInnerLinkGenerator.generateDeepLinkWithProgram(program), | 41 | deeplink:AppInnerLinkGenerator.generateDeepLinkWithProgram(program), |
| 42 | + posterImg:$r("app.media.test_share_poster") | ||
| 42 | } | 43 | } |
| 43 | }) | 44 | }) |
| 44 | } | 45 | } |
-
Please register or login to post a comment