Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix:bug[18528] 登录账户-修改密码文案提示鸿蒙与安卓不一致 fix:bug[18515] 未登录状态进入我的--评论下鸿蒙版未能显示游客评论内容 ref |> 横滑卡-配置外链类型数据点击外链不跳转 -fix 分享按钮展示bug修复 feat: 滑动跳转更多,同步显示 fix(18512):人民号图集详情页的标题位置与安卓布局不一致 -fix 评论展示bug修复 feat: 18513 必修-新代码下人民号动态详情页下的横图展示样式被修改;18425 必解-人民号小视频卡展现样式鸿蒙与安卓不一致标题显示的行数未能显示4行 feat:直播频道的tab背景色高度不够
Showing
24 changed files
with
601 additions
and
38 deletions
431 Bytes
| @@ -236,6 +236,10 @@ export class HttpUrlUtils { | @@ -236,6 +236,10 @@ export class HttpUrlUtils { | ||
| 236 | * 预约状态 | 236 | * 预约状态 |
| 237 | */ | 237 | */ |
| 238 | static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch"; | 238 | static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch"; |
| 239 | + /** | ||
| 240 | + * 游客 评论列表 | ||
| 241 | + */ | ||
| 242 | + static readonly VISITOR_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/visitorCommentList"; | ||
| 239 | 243 | ||
| 240 | /** | 244 | /** |
| 241 | * 查询是否被禁言 | 245 | * 查询是否被禁言 |
| @@ -868,4 +872,9 @@ export class HttpUrlUtils { | @@ -868,4 +872,9 @@ export class HttpUrlUtils { | ||
| 868 | let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device" | 872 | let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device" |
| 869 | return url | 873 | return url |
| 870 | } | 874 | } |
| 875 | + | ||
| 876 | + static getVisitorCommentListDataUrl() { | ||
| 877 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.VISITOR_COMMENT_LIST_DATA_PATH | ||
| 878 | + return url | ||
| 879 | + } | ||
| 871 | } | 880 | } |
| @@ -91,6 +91,8 @@ export class WDRouterPage { | @@ -91,6 +91,8 @@ export class WDRouterPage { | ||
| 91 | static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | 91 | static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); |
| 92 | //我的主页 | 92 | //我的主页 |
| 93 | static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage"); | 93 | static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage"); |
| 94 | + //游客评论列表 | ||
| 95 | + static visitorCommentPage = new WDRouterPage("wdComponent", "ets/pages/VisitorCommentPage"); | ||
| 94 | // 隐私设置页 | 96 | // 隐私设置页 |
| 95 | static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); | 97 | static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); |
| 96 | // 关于页 | 98 | // 关于页 |
| @@ -115,6 +115,7 @@ export class ProcessUtils { | @@ -115,6 +115,7 @@ export class ProcessUtils { | ||
| 115 | } | 115 | } |
| 116 | break; | 116 | break; |
| 117 | case ContentConstants.TYPE_LINK: | 117 | case ContentConstants.TYPE_LINK: |
| 118 | + content.openType = "1" | ||
| 118 | ProcessUtils.gotoDefaultWeb(content); | 119 | ProcessUtils.gotoDefaultWeb(content); |
| 119 | break; | 120 | break; |
| 120 | //图集详情页 | 121 | //图集详情页 |
| 1 | +import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index' | ||
| 2 | + | ||
| 3 | +import { CommentListDialogView, publishCommentModel } from '../../../../Index' | ||
| 4 | + | ||
| 5 | +@Component | ||
| 6 | +export struct CommentDialogView { | ||
| 7 | + @Link @Watch('showCommentListChange') showCommentList: boolean | ||
| 8 | + @Link index: number | ||
| 9 | + @Link currentIndex: number | ||
| 10 | + @Link publishCommentModel: publishCommentModel | ||
| 11 | + @Consume contentDetailData: ContentDetailDTO | ||
| 12 | + @Link interactData: InteractDataDTO | ||
| 13 | + @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | ||
| 14 | + @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | ||
| 15 | + | ||
| 16 | + @State @Watch("innerShowCommentChange") innerShowComment: boolean = false | ||
| 17 | + | ||
| 18 | + showCommentListChange(val: boolean) { | ||
| 19 | + if (this.showCommentList && this.index === this.currentIndex) { | ||
| 20 | + this.innerShowComment = true | ||
| 21 | + } else { | ||
| 22 | + this.innerShowComment = false | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + innerShowCommentChange() { | ||
| 27 | + this.showCommentList = this.innerShowComment | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + build() { | ||
| 31 | + CommentListDialogView({ | ||
| 32 | + showCommentList: this.innerShowComment, | ||
| 33 | + contentDetailData: this.contentDetailData, | ||
| 34 | + publishCommentModel: this.publishCommentModel, | ||
| 35 | + pageInfo: this.fakePageInfo, | ||
| 36 | + onClose: () => { | ||
| 37 | + this.showCommentList = false | ||
| 38 | + if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { | ||
| 39 | + this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + }) | ||
| 43 | + } | ||
| 44 | +} |
| @@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent { | @@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent { | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | async aboutToAppear() { | 14 | async aboutToAppear() { |
| 15 | - // Logger.info(TAG, 'pictures preview') | 15 | + // Logger.info(TAG, 'pictures preview' |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | build() { | 18 | build() { |
| 1 | -import { Action, H5ReceiveDetailBean, ContentDetailDTO } from 'wdBean'; | 1 | +import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; |
| 2 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| @@ -13,6 +13,7 @@ import { NetworkUtil, WindowModel } from 'wdKit'; | @@ -13,6 +13,7 @@ import { NetworkUtil, WindowModel } from 'wdKit'; | ||
| 13 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 13 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 14 | import { common } from '@kit.AbilityKit'; | 14 | import { common } from '@kit.AbilityKit'; |
| 15 | import { PageRepository } from '../repository/PageRepository'; | 15 | import { PageRepository } from '../repository/PageRepository'; |
| 16 | +import { CommentDialogView } from './CommentDialogView'; | ||
| 16 | 17 | ||
| 17 | const TAG: string = 'SpacialTopicPageComponent' | 18 | const TAG: string = 'SpacialTopicPageComponent' |
| 18 | 19 | ||
| @@ -23,7 +24,11 @@ export struct SpacialTopicPageComponent { | @@ -23,7 +24,11 @@ export struct SpacialTopicPageComponent { | ||
| 23 | action: Action = {} as Action | 24 | action: Action = {} as Action |
| 24 | @State webUrl: string = ''; | 25 | @State webUrl: string = ''; |
| 25 | @State subjectData: string = ''; | 26 | @State subjectData: string = ''; |
| 27 | + @State index: number = 0 | ||
| 28 | + @State currentIndex: number = 0 | ||
| 26 | @State isPageEnd: boolean = false | 29 | @State isPageEnd: boolean = false |
| 30 | + @State showCommentList: boolean = false | ||
| 31 | + @State interactData: InteractDataDTO = {} as InteractDataDTO | ||
| 27 | @Prop reload: number = 0; | 32 | @Prop reload: number = 0; |
| 28 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 33 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 29 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean | 34 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean |
| @@ -123,6 +128,7 @@ export struct SpacialTopicPageComponent { | @@ -123,6 +128,7 @@ export struct SpacialTopicPageComponent { | ||
| 123 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') | 128 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') |
| 124 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | 129 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') |
| 125 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 130 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') |
| 131 | + | ||
| 126 | // } | 132 | // } |
| 127 | this.subjectData = 'dasdasdadas' | 133 | this.subjectData = 'dasdasdadas' |
| 128 | 134 | ||
| @@ -130,8 +136,15 @@ export struct SpacialTopicPageComponent { | @@ -130,8 +136,15 @@ export struct SpacialTopicPageComponent { | ||
| 130 | // this.trySendData2H5() | 136 | // this.trySendData2H5() |
| 131 | } | 137 | } |
| 132 | if(pageInfoMsg && pageInfoMsg.data){ | 138 | if(pageInfoMsg && pageInfoMsg.data){ |
| 133 | - this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag) | ||
| 134 | - this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag) | 139 | + this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag) |
| 140 | + this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag) | ||
| 141 | + if(pageInfoMsg.data.topicInfo?.shareOpen === 1){ | ||
| 142 | + if (!this.operationButtonList.includes('share')) { | ||
| 143 | + this.operationButtonList.push('share'); | ||
| 144 | + } | ||
| 145 | + }else{ | ||
| 146 | + this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share') | ||
| 147 | + } | ||
| 135 | } | 148 | } |
| 136 | 149 | ||
| 137 | console.log('contentDetailData',this.contentDetailData) | 150 | console.log('contentDetailData',this.contentDetailData) |
| @@ -185,6 +198,17 @@ export struct SpacialTopicPageComponent { | @@ -185,6 +198,17 @@ export struct SpacialTopicPageComponent { | ||
| 185 | publishCommentModel: this.publishCommentModel, | 198 | publishCommentModel: this.publishCommentModel, |
| 186 | operationButtonList: this.operationButtonList, | 199 | operationButtonList: this.operationButtonList, |
| 187 | styleType: 1, | 200 | styleType: 1, |
| 201 | + onCommentIconClick:()=>{ | ||
| 202 | + this.showCommentList = true | ||
| 203 | + } | ||
| 204 | + }) | ||
| 205 | + //全部评论 | ||
| 206 | + CommentDialogView({ | ||
| 207 | + index: $index, | ||
| 208 | + currentIndex: $currentIndex, | ||
| 209 | + showCommentList: $showCommentList, | ||
| 210 | + publishCommentModel: $publishCommentModel, | ||
| 211 | + interactData: $interactData, | ||
| 188 | }) | 212 | }) |
| 189 | } | 213 | } |
| 190 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 214 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| @@ -219,8 +219,7 @@ struct createImg { | @@ -219,8 +219,7 @@ struct createImg { | ||
| 219 | }) { | 219 | }) { |
| 220 | Image(this.loadImg ? item.fullUrl : '') | 220 | Image(this.loadImg ? item.fullUrl : '') |
| 221 | .backgroundColor(0xf5f5f5) | 221 | .backgroundColor(0xf5f5f5) |
| 222 | - .width(113) | ||
| 223 | - .height(113) | 222 | + .aspectRatio(item.landscape === 1 ? 343 / 172 : 228 / 305) |
| 224 | .autoResize(true) | 223 | .autoResize(true) |
| 225 | .borderRadius(this.caclImageRadius(index)) | 224 | .borderRadius(this.caclImageRadius(index)) |
| 226 | .opacity(!item.weight && !item.height ? 0 : 1) | 225 | .opacity(!item.weight && !item.height ? 0 : 1) |
| @@ -88,7 +88,7 @@ export struct Card6Component { | @@ -88,7 +88,7 @@ export struct Card6Component { | ||
| 88 | .fontSize(18) | 88 | .fontSize(18) |
| 89 | .lineHeight(27) | 89 | .lineHeight(27) |
| 90 | .fontWeight(FontWeight.Normal) | 90 | .fontWeight(FontWeight.Normal) |
| 91 | - .maxLines(this.contentDTO.appStyle === '6' ? 5 : 2) | 91 | + .maxLines(this.contentDTO.appStyle === '6' ? 4 : 2) |
| 92 | .alignSelf(ItemAlign.Start) | 92 | .alignSelf(ItemAlign.Start) |
| 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 93 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 94 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| @@ -107,7 +107,7 @@ export struct Card6Component { | @@ -107,7 +107,7 @@ export struct Card6Component { | ||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | .alignItems(HorizontalAlign.Start) | 109 | .alignItems(HorizontalAlign.Start) |
| 110 | - .height(78) | 110 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) |
| 111 | 111 | ||
| 112 | 112 | ||
| 113 | .justifyContent(FlexAlign.SpaceBetween) | 113 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -119,7 +119,7 @@ export struct Card6Component { | @@ -119,7 +119,7 @@ export struct Card6Component { | ||
| 119 | .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | 119 | .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) |
| 120 | .borderRadius(5) | 120 | .borderRadius(5) |
| 121 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | 121 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) |
| 122 | - .height(78) | 122 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156) |
| 123 | CardMediaInfo({ contentDTO: this.contentDTO }) | 123 | CardMediaInfo({ contentDTO: this.contentDTO }) |
| 124 | } | 124 | } |
| 125 | 125 | ||
| @@ -138,8 +138,7 @@ export struct Card6Component { | @@ -138,8 +138,7 @@ export struct Card6Component { | ||
| 138 | }) | 138 | }) |
| 139 | 139 | ||
| 140 | .width(CommonConstants.FULL_WIDTH) | 140 | .width(CommonConstants.FULL_WIDTH) |
| 141 | - .height(106) | ||
| 142 | - .justifyContent(FlexAlign.SpaceBetween) | 141 | + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 106 : 184) .justifyContent(FlexAlign.SpaceBetween) |
| 143 | .alignItems(VerticalAlign.Top) | 142 | .alignItems(VerticalAlign.Top) |
| 144 | } | 143 | } |
| 145 | } | 144 | } |
| @@ -25,7 +25,6 @@ export struct ZhSingleRow02 { | @@ -25,7 +25,6 @@ export struct ZhSingleRow02 { | ||
| 25 | scroller: Scroller = new Scroller() | 25 | scroller: Scroller = new Scroller() |
| 26 | 26 | ||
| 27 | resetMoreTips() { | 27 | resetMoreTips() { |
| 28 | - console.log('resetMoreTips', this.moreWidth, this.initMoreWidth) | ||
| 29 | if (this.moreWidth < this.initMoreWidth * 2) { | 28 | if (this.moreWidth < this.initMoreWidth * 2) { |
| 30 | this.moreTips = '查看更多'; | 29 | this.moreTips = '查看更多'; |
| 31 | } | 30 | } |
| @@ -56,7 +55,6 @@ export struct ZhSingleRow02 { | @@ -56,7 +55,6 @@ export struct ZhSingleRow02 { | ||
| 56 | if (this.moreWidth > this.initMoreWidth) { | 55 | if (this.moreWidth > this.initMoreWidth) { |
| 57 | this.moreWidth = 16 | 56 | this.moreWidth = 16 |
| 58 | } | 57 | } |
| 59 | - this.resetMoreTips() | ||
| 60 | } | 58 | } |
| 61 | 59 | ||
| 62 | toMore() { | 60 | toMore() { |
| @@ -90,7 +88,7 @@ export struct ZhSingleRow02 { | @@ -90,7 +88,7 @@ export struct ZhSingleRow02 { | ||
| 90 | .margin({ right: 8 }) | 88 | .margin({ right: 8 }) |
| 91 | }) | 89 | }) |
| 92 | } | 90 | } |
| 93 | - if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | 91 | + if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { |
| 94 | Row() { | 92 | Row() { |
| 95 | Ellipse() | 93 | Ellipse() |
| 96 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) | 94 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) |
| @@ -165,7 +165,7 @@ export struct ZhSingleRow03 { | @@ -165,7 +165,7 @@ export struct ZhSingleRow03 { | ||
| 165 | this.ItemCard(item) | 165 | this.ItemCard(item) |
| 166 | }) | 166 | }) |
| 167 | } | 167 | } |
| 168 | - if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | 168 | + if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { |
| 169 | Row() { | 169 | Row() { |
| 170 | Ellipse() | 170 | Ellipse() |
| 171 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) | 171 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) |
| @@ -23,7 +23,7 @@ export default struct MinePagePersonFunctionUI { | @@ -23,7 +23,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 23 | switch (item.msg){ | 23 | switch (item.msg){ |
| 24 | case "评论":{ | 24 | case "评论":{ |
| 25 | if(!this.isLogin){ | 25 | if(!this.isLogin){ |
| 26 | - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 26 | + WDRouterRule.jumpWithPage(WDRouterPage.visitorCommentPage) |
| 27 | return | 27 | return |
| 28 | }else { | 28 | }else { |
| 29 | let params: Record<string, string> = {'comment': "1"}; | 29 | let params: Record<string, string> = {'comment': "1"}; |
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/VisitorCommentComponent.ets
0 → 100644
| 1 | +import { ContentDTO } from 'wdBean/Index' | ||
| 2 | +import { StringUtils, UserDataLocal } from 'wdKit/Index' | ||
| 3 | +import MinePageDatasModel from '../../../model/MinePageDatasModel' | ||
| 4 | +import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | ||
| 5 | +import { CommentListItem } from '../../../viewmodel/CommentListItem' | ||
| 6 | +import measure from '@ohos.measure' | ||
| 7 | + | ||
| 8 | +@Component | ||
| 9 | +export struct VisitorCommentComponent { | ||
| 10 | + @ObjectLink data: CommentListItem | ||
| 11 | + isLastItem: boolean = false | ||
| 12 | + @State isExpand: boolean = false; | ||
| 13 | + @State isExpandParent: boolean = false; | ||
| 14 | + @State isOverLines: boolean = false | ||
| 15 | + @State isOverLinesParent: boolean = false | ||
| 16 | + | ||
| 17 | + build() { | ||
| 18 | + Column() { | ||
| 19 | + Row() { | ||
| 20 | + if (this.isExpand) { | ||
| 21 | + Text() { | ||
| 22 | + Span(this.data.commentContent) | ||
| 23 | + } | ||
| 24 | + .textStyle() | ||
| 25 | + } else { | ||
| 26 | + Text() { | ||
| 27 | + Span(this.clipText(this.data.commentContent, 31, 5, 630, 0)) | ||
| 28 | + if (this.isOverLines) { | ||
| 29 | + Span('...展开') | ||
| 30 | + .fontColor($r('app.color.color_999999')) | ||
| 31 | + .onClick(() => { | ||
| 32 | + this.isExpand = true | ||
| 33 | + }) | ||
| 34 | + } | ||
| 35 | + }.maxLines(5) | ||
| 36 | + .wordBreak(WordBreak.BREAK_ALL) | ||
| 37 | + .textStyle() | ||
| 38 | + } | ||
| 39 | + }.padding({ left: '31lpx', right: '31lpx' }) | ||
| 40 | + .width('100%') | ||
| 41 | + | ||
| 42 | + Column() { | ||
| 43 | + if (StringUtils.isNotEmpty(this.data.parentCommentContent)) { | ||
| 44 | + //父评论 | ||
| 45 | + Row() { | ||
| 46 | + if (this.isExpandParent) { | ||
| 47 | + Text() { | ||
| 48 | + Span(`@${this.data.parentCommentUserName}:`) | ||
| 49 | + .fontColor($r('app.color.color_000000')) | ||
| 50 | + .fontWeight('500lpx') | ||
| 51 | + .fontSize('27lpx') | ||
| 52 | + .lineHeight('40lpx') | ||
| 53 | + Span(this.data.parentCommentContent) | ||
| 54 | + .fontColor($r('app.color.color_000000')) | ||
| 55 | + .fontWeight('400lpx') | ||
| 56 | + .fontSize('27lpx') | ||
| 57 | + .lineHeight('40lpx') | ||
| 58 | + } | ||
| 59 | + .width('100%') | ||
| 60 | + .textAlign(TextAlign.Start) | ||
| 61 | + } else { | ||
| 62 | + Text() { | ||
| 63 | + Span(`@${this.data.parentCommentUserName}:`) | ||
| 64 | + .fontColor($r('app.color.color_000000')) | ||
| 65 | + .fontWeight('500lpx') | ||
| 66 | + .fontSize('27lpx') | ||
| 67 | + .lineHeight('40lpx') | ||
| 68 | + | ||
| 69 | + Span(this.clipText(this.data.parentCommentContent, 31, 5, 630, 1)) | ||
| 70 | + .fontColor($r('app.color.color_000000')) | ||
| 71 | + .fontWeight('400lpx') | ||
| 72 | + .fontSize('27lpx') | ||
| 73 | + .lineHeight('40lpx') | ||
| 74 | + if (this.isOverLinesParent) { | ||
| 75 | + Span('...展开') | ||
| 76 | + .fontColor($r('app.color.color_999999')) | ||
| 77 | + .onClick(() => { | ||
| 78 | + this.isExpandParent = true | ||
| 79 | + }) | ||
| 80 | + } | ||
| 81 | + }.maxLines(5) | ||
| 82 | + .wordBreak(WordBreak.BREAK_ALL) | ||
| 83 | + .textAlign(TextAlign.Start) | ||
| 84 | + .width('100%') | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + .width('100%') | ||
| 88 | + .padding({ top: '23lpx', bottom: '15lpx', right: '23lpx' }) | ||
| 89 | + | ||
| 90 | + Divider() | ||
| 91 | + .width('100%') | ||
| 92 | + .height('1lpx') | ||
| 93 | + .strokeWidth('1lpx') | ||
| 94 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 95 | + .margin({ top: '4lpx', bottom: '4lpx' }) | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + Column() { | ||
| 99 | + Row() { | ||
| 100 | + Row() { | ||
| 101 | + Image($r('app.media.comment_link_icon')) | ||
| 102 | + .objectFit(ImageFit.Auto) | ||
| 103 | + .width('31lpx') | ||
| 104 | + .height('31lpx') | ||
| 105 | + .margin({ right: '10lpx' }) | ||
| 106 | + | ||
| 107 | + Column() { | ||
| 108 | + Row() { | ||
| 109 | + Text(`${this.data.targetTitle}`) | ||
| 110 | + .fontWeight('400lpx') | ||
| 111 | + .fontColor($r('app.color.color_666666')) | ||
| 112 | + .lineHeight('38lpx') | ||
| 113 | + .fontSize('27lpx') | ||
| 114 | + .layoutWeight(1) | ||
| 115 | + .maxLines(1) | ||
| 116 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 117 | + }.width('100%') | ||
| 118 | + } | ||
| 119 | + .layoutWeight(1) | ||
| 120 | + .alignItems(HorizontalAlign.Start) | ||
| 121 | + }.layoutWeight(1) | ||
| 122 | + | ||
| 123 | + Image($r('app.media.arrow_icon_right')) | ||
| 124 | + .margin({ right: '4lpx' }) | ||
| 125 | + .width('23lpx') | ||
| 126 | + .height('23lpx') | ||
| 127 | + .margin({right:'23lpx'}) | ||
| 128 | + } | ||
| 129 | + .width('100%') | ||
| 130 | + .height('69lpx') | ||
| 131 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 132 | + | ||
| 133 | + }.height('69lpx') | ||
| 134 | + .justifyContent(FlexAlign.Center) | ||
| 135 | + } | ||
| 136 | + .margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' }) | ||
| 137 | + .padding({ left: '23lpx' }) | ||
| 138 | + .width('662lpx') | ||
| 139 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 140 | + | ||
| 141 | + if (!this.isLastItem) { | ||
| 142 | + Divider().width('100%') | ||
| 143 | + .height('12lpx') | ||
| 144 | + .strokeWidth('12lpx') | ||
| 145 | + .color($r('app.color.color_F5F5F5')) | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + .justifyContent(FlexAlign.Center) | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + commentLikeOperation() { | ||
| 152 | + let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0) | ||
| 153 | + MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => { | ||
| 154 | + if (value != null) { | ||
| 155 | + if (value.code === 0 || value.code.toString() === "0") { | ||
| 156 | + this.data.like_status = this.data.like_status === 0 ? 1 : 0 | ||
| 157 | + this.data.likeNum = this.data.like_status === 0 ? this.data.likeNum - 1 : this.data.likeNum + 1 | ||
| 158 | + } | ||
| 159 | + } | ||
| 160 | + }) | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + /** | ||
| 164 | + * 截断文本 | ||
| 165 | + * @author liuzhendong(猩猩G) | ||
| 166 | + * @param {string} str 要截断的文本 '啊啊啊啊啊' | ||
| 167 | + * @param {number} fontSize 字体大小(px) | ||
| 168 | + * @param {number} maxLines 最大行数 3 | ||
| 169 | + * @param {number} textWidth 文本宽度(px) vp 需要转换vp2px() | ||
| 170 | + * @returns {string} clipStr 截断后的文本 '啊啊' | ||
| 171 | + * @param {type} 0 我的评论 1 父评论 | ||
| 172 | + */ | ||
| 173 | + clipText(str: string, fontSize: number, maxLines: number, textWidth: number, type: number): string { | ||
| 174 | + let strArr: string[] = str.split("") | ||
| 175 | + let truncateContent: string = '啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算 | ||
| 176 | + let measureTruncateWidth: number = measure.measureText({ | ||
| 177 | + textContent: truncateContent, | ||
| 178 | + fontSize: px2fp(fontSize), | ||
| 179 | + wordBreak:WordBreak.BREAK_ALL | ||
| 180 | + }) | ||
| 181 | + if(type === 1){ | ||
| 182 | + measureTruncateWidth = measureTruncateWidth + measure.measureText({ | ||
| 183 | + textContent: `@${this.data.parentCommentUserName}:`, | ||
| 184 | + fontSize: px2fp(fontSize), | ||
| 185 | + wordBreak:WordBreak.BREAK_ALL | ||
| 186 | + }) | ||
| 187 | + } | ||
| 188 | + let clipStr: string = '' | ||
| 189 | + for (let i = 0; i < strArr.length; i++) { | ||
| 190 | + if (measure.measureText({ | ||
| 191 | + textContent: clipStr, | ||
| 192 | + fontSize: px2fp(fontSize), | ||
| 193 | + wordBreak:WordBreak.BREAK_ALL | ||
| 194 | + }) >= textWidth * maxLines - measureTruncateWidth) { | ||
| 195 | + if (type === 0) { | ||
| 196 | + this.isOverLines = true | ||
| 197 | + } else { | ||
| 198 | + this.isOverLinesParent = true | ||
| 199 | + } | ||
| 200 | + break; | ||
| 201 | + } | ||
| 202 | + clipStr += strArr[i] | ||
| 203 | + } | ||
| 204 | + return clipStr | ||
| 205 | + } | ||
| 206 | +} | ||
| 207 | + | ||
| 208 | +@Extend(Text) | ||
| 209 | +function textStyle() { | ||
| 210 | + .width('630lpx') | ||
| 211 | + .fontSize('31lpx') | ||
| 212 | + .fontWeight('400lpx') | ||
| 213 | + .fontColor($r('app.color.color_222222')) | ||
| 214 | + .lineHeight('46lpx') | ||
| 215 | +} | ||
| 216 | + | ||
| 217 | +function getParams(item: CommentListItem) : ContentDTO{ | ||
| 218 | + let contentDTO = new ContentDTO(); | ||
| 219 | + | ||
| 220 | + // contentDTO.objectType = item.targetType + "" | ||
| 221 | + // contentDTO.objectId = item.targetId + "" | ||
| 222 | + // contentDTO.newsTitle = item.targetTitle | ||
| 223 | + // contentDTO.channelId = | ||
| 224 | + // contentDTO.rmhPlatform = | ||
| 225 | + | ||
| 226 | + contentDTO.objectId = item.targetId; | ||
| 227 | + contentDTO.relType = item.targetRelType + ""; | ||
| 228 | + contentDTO.relId = item.targetRelId; | ||
| 229 | + contentDTO.objectType = item.targetType + ""; | ||
| 230 | + contentDTO.newsTitle = item.targetTitle | ||
| 231 | + | ||
| 232 | + return contentDTO | ||
| 233 | +} |
| @@ -29,10 +29,10 @@ export struct CustomTitleUI { | @@ -29,10 +29,10 @@ export struct CustomTitleUI { | ||
| 29 | Text(this.titleName) | 29 | Text(this.titleName) |
| 30 | .maxLines(1) | 30 | .maxLines(1) |
| 31 | .id("title") | 31 | .id("title") |
| 32 | - .fontSize(`${this.calcHeight(30)}lpx`) | 32 | + .fontSize(`${this.calcHeight(35)}lpx`) |
| 33 | .fontWeight(400) | 33 | .fontWeight(400) |
| 34 | .fontColor($r('app.color.color_222222')) | 34 | .fontColor($r('app.color.color_222222')) |
| 35 | - .lineHeight(`${this.calcHeight(43)}lpx`) | 35 | + .lineHeight(`${this.calcHeight(50)}lpx`) |
| 36 | .alignRules({ | 36 | .alignRules({ |
| 37 | center: {anchor: "__container__", align: VerticalAlign.Center}, | 37 | center: {anchor: "__container__", align: VerticalAlign.Center}, |
| 38 | middle: {anchor: "__container__", align: HorizontalAlign.Center} | 38 | middle: {anchor: "__container__", align: HorizontalAlign.Center} |
| @@ -141,7 +141,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -141,7 +141,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 141 | }) | 141 | }) |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | - if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { | 144 | + if (this.compDTO.operDataList.length >= 2 && !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) { |
| 145 | Row() { | 145 | Row() { |
| 146 | Ellipse() | 146 | Ellipse() |
| 147 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) | 147 | .width(2* (this.moreWidth - this.initMoreWidth - 1)) |
| @@ -48,6 +48,7 @@ export struct OperRowListView { | @@ -48,6 +48,7 @@ export struct OperRowListView { | ||
| 48 | private onCommentFocus: () => void = () => { | 48 | private onCommentFocus: () => void = () => { |
| 49 | } | 49 | } |
| 50 | private onCommentIconClick: () => void = () => { | 50 | private onCommentIconClick: () => void = () => { |
| 51 | + | ||
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | @Provide inDialog: boolean = false | 54 | @Provide inDialog: boolean = false |
| @@ -252,6 +253,9 @@ export struct OperRowListView { | @@ -252,6 +253,9 @@ export struct OperRowListView { | ||
| 252 | @Builder | 253 | @Builder |
| 253 | builderComment() { | 254 | builderComment() { |
| 254 | Column() { | 255 | Column() { |
| 256 | + // Text((this.contentDetailData.openComment == 1).toString()) | ||
| 257 | + // Text((this.contentDetailData.commentDisplay == 1).toString()) | ||
| 258 | + // Text(this.publishCommentModel?.targetId.toString()) | ||
| 255 | if (this.contentDetailData.openComment == 1 | 259 | if (this.contentDetailData.openComment == 1 |
| 256 | && this.contentDetailData.commentDisplay == 1 | 260 | && this.contentDetailData.commentDisplay == 1 |
| 257 | && this.publishCommentModel?.targetId) { | 261 | && this.publishCommentModel?.targetId) { |
| @@ -284,9 +288,10 @@ export struct OperRowListView { | @@ -284,9 +288,10 @@ export struct OperRowListView { | ||
| 284 | contentDetail: this.contentDetailData | 288 | contentDetail: this.contentDetailData |
| 285 | }) | 289 | }) |
| 286 | .onClick(() => { | 290 | .onClick(() => { |
| 291 | + console.log('akdbakdbakdbaksjd') | ||
| 287 | this.onCommentIconClick() | 292 | this.onCommentIconClick() |
| 288 | 293 | ||
| 289 | - console.log(JSON.stringify(this.dialogController?.open)) | 294 | + // console.log('his.dialogController?.open',JSON.stringify(this.dialogController)) |
| 290 | 295 | ||
| 291 | // 评论弹框内部嵌入 | 296 | // 评论弹框内部嵌入 |
| 292 | !this.showBackIcon && this.dialogController?.open() | 297 | !this.showBackIcon && this.dialogController?.open() |
| @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI | @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI | ||
| 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; | 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; |
| 5 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 5 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 6 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; | 6 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; |
| 7 | -import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit'; | 7 | +import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper, DeviceUtil, DateTimeUtils } from 'wdKit'; |
| 8 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; | 8 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; |
| 9 | import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; | 9 | import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; |
| 10 | import { FollowListItem } from '../viewmodel/FollowListItem'; | 10 | import { FollowListItem } from '../viewmodel/FollowListItem'; |
| @@ -918,6 +918,37 @@ class MinePageDatasModel{ | @@ -918,6 +918,37 @@ class MinePageDatasModel{ | ||
| 918 | return rmhInfo | 918 | return rmhInfo |
| 919 | } | 919 | } |
| 920 | 920 | ||
| 921 | + /** | ||
| 922 | + * 游客评论列表 | ||
| 923 | + * @param pageSize | ||
| 924 | + * @param pageNum | ||
| 925 | + * @returns | ||
| 926 | + */ | ||
| 927 | + fetchVisitorCommentListData(pageNum:string,visitorFirstTime:string) { | ||
| 928 | + let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | ||
| 929 | + let deviceId = DeviceUtil.clientId() | ||
| 930 | + let url = HttpUrlUtils.getVisitorCommentListDataUrl()+ `?pageSize=${20}&pageNum=${pageNum}&visitorFirstTime=${visitorFirstTime}&time=${time}&deviceId=${deviceId}` | ||
| 931 | + return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url) | ||
| 932 | + }; | ||
| 933 | + | ||
| 934 | + visitorCommentListData(pageNum:string,visitorFirstTime:string): Promise<MineCommentListDetailItem> { | ||
| 935 | + return new Promise<MineCommentListDetailItem>((success, error) => { | ||
| 936 | + Logger.info(TAG, `visitorCommentListData start`); | ||
| 937 | + this.fetchVisitorCommentListData(pageNum,visitorFirstTime).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { | ||
| 938 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 939 | + error(null) | ||
| 940 | + return | ||
| 941 | + } | ||
| 942 | + Logger.info(TAG, "visitorCommentListData then,visitorCommentListData.timeStamp:" + navResDTO.timestamp); | ||
| 943 | + let navigationBean = navResDTO.data as MineCommentListDetailItem | ||
| 944 | + success(navigationBean); | ||
| 945 | + }).catch((err: Error) => { | ||
| 946 | + Logger.error(TAG, `visitorCommentListData catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 947 | + error(null) | ||
| 948 | + }) | ||
| 949 | + }) | ||
| 950 | + } | ||
| 951 | + | ||
| 921 | } | 952 | } |
| 922 | 953 | ||
| 923 | const minePageDatasModel = MinePageDatasModel.getInstance() | 954 | const minePageDatasModel = MinePageDatasModel.getInstance() |
| 1 | +import { TAG } from '@ohos/hypium/src/main/Constant'; | ||
| 2 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 3 | +import { SpConstants } from 'wdConstant/Index' | ||
| 4 | +import { DateTimeUtils, LazyDataSource, NetworkUtil, SPHelper, StringUtils} from 'wdKit/Index' | ||
| 5 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 6 | +import { VisitorCommentComponent } from '../components/mine/home/VisitorCommentComponent'; | ||
| 7 | +import { CustomPullToRefresh } from '../components/reusable/CustomPullToRefresh'; | ||
| 8 | +import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | ||
| 9 | +import { ListHasNoMoreDataUI } from '../components/reusable/ListHasNoMoreDataUI'; | ||
| 10 | +import { EmptyComponent } from '../components/view/EmptyComponent'; | ||
| 11 | +import MinePageDatasModel from '../model/MinePageDatasModel'; | ||
| 12 | +import { CommentListItem } from '../viewmodel/CommentListItem'; | ||
| 13 | + | ||
| 14 | +@Entry | ||
| 15 | +@Component | ||
| 16 | +struct VisitorCommentPage { | ||
| 17 | + @State data: LazyDataSource<CommentListItem> = new LazyDataSource(); | ||
| 18 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 19 | + @State count: number = 0; | ||
| 20 | + @State isLoading: boolean = false | ||
| 21 | + @State hasMore: boolean = true | ||
| 22 | + curPageNum: number = 1; | ||
| 23 | + @State isGetRequest: boolean = false | ||
| 24 | + private scroller: Scroller = new Scroller(); | ||
| 25 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 26 | + @State commentTime:string = "" | ||
| 27 | + | ||
| 28 | + aboutToAppear(): void { | ||
| 29 | + this.commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string | ||
| 30 | + if (StringUtils.isNotEmpty(this.commentTime)) { | ||
| 31 | + this.getNewPageData(this.commentTime) | ||
| 32 | + }else{ | ||
| 33 | + this.isGetRequest = true | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + build() { | ||
| 38 | + Column() { | ||
| 39 | + //标题栏目 | ||
| 40 | + CustomTitleUI({ titleName: "评论列表" }) | ||
| 41 | + if (this.count == 0) { | ||
| 42 | + if (this.isGetRequest == true) { | ||
| 43 | + if(this.isConnectNetwork){ | ||
| 44 | + EmptyComponent({ emptyType: 10 }) | ||
| 45 | + .height('100%') | ||
| 46 | + .width('100%') | ||
| 47 | + }else{ | ||
| 48 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 49 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 50 | + if(this.isConnectNetwork){ | ||
| 51 | + this.curPageNum = 1; | ||
| 52 | + this.hasMore = true | ||
| 53 | + this.isGetRequest = false | ||
| 54 | + this.data.clear() | ||
| 55 | + | ||
| 56 | + if (!this.isLoading) { | ||
| 57 | + this.getNewPageData(this.commentTime) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + }}) | ||
| 61 | + .layoutWeight(1) | ||
| 62 | + .width('100%') | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + } else { | ||
| 66 | + Stack(){ | ||
| 67 | + Row() | ||
| 68 | + .width("100%") | ||
| 69 | + .height("100%") | ||
| 70 | + .backgroundColor($r('app.color.white')) | ||
| 71 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 72 | + CustomPullToRefresh({ | ||
| 73 | + alldata:this.data, | ||
| 74 | + scroller:this.scroller, | ||
| 75 | + customList:()=>{ | ||
| 76 | + this.ListLayout() | ||
| 77 | + }, | ||
| 78 | + onRefresh:(resolve)=>{ | ||
| 79 | + this.curPageNum = 1; | ||
| 80 | + this.hasMore = true | ||
| 81 | + this.isGetRequest = false | ||
| 82 | + this.data.clear() | ||
| 83 | + | ||
| 84 | + if (!this.isLoading){ | ||
| 85 | + this.getNewPageData(this.commentTime) | ||
| 86 | + if(resolve) resolve('刷新成功') | ||
| 87 | + } | ||
| 88 | + }, | ||
| 89 | + onLoadMore:(resolve)=> { | ||
| 90 | + if (!this.isLoading) { | ||
| 91 | + this.isLoading = true | ||
| 92 | + this.getNewPageData(this.commentTime) | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + }) | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 100 | + .height('100%') | ||
| 101 | + .width('100%') | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + @Builder ListLayout(){ | ||
| 105 | + List({ space:6,scroller: this.scroller }) { | ||
| 106 | + LazyForEach(this.data, (item: CommentListItem, index: number) => { | ||
| 107 | + ListItem() { | ||
| 108 | + VisitorCommentComponent({ | ||
| 109 | + data: item, | ||
| 110 | + isLastItem: index === this.data.totalCount() - 1 | ||
| 111 | + }) | ||
| 112 | + } | ||
| 113 | + .onClick(() => { | ||
| 114 | + let content = getParams(item) | ||
| 115 | + ProcessUtils.processPage(content) | ||
| 116 | + }) | ||
| 117 | + }, (item: CommentListItem, index: number) => index.toString()) | ||
| 118 | + | ||
| 119 | + //没有更多数据 显示提示 | ||
| 120 | + if (!this.hasMore) { | ||
| 121 | + ListItem() { | ||
| 122 | + ListHasNoMoreDataUI() | ||
| 123 | + }.padding({bottom:px2vp(this.bottomSafeHeight) + 20}) | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + .cachedCount(4) | ||
| 127 | + .scrollBar(BarState.Off) | ||
| 128 | + .edgeEffect(EdgeEffect.None) | ||
| 129 | + .margin({ top: '23lpx'}) | ||
| 130 | + .layoutWeight(1) | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + getNewPageData(commentTime:string) { | ||
| 134 | + this.isLoading = true | ||
| 135 | + if (this.hasMore) { | ||
| 136 | + MinePageDatasModel.visitorCommentListData( `${this.curPageNum}`, encodeURI(commentTime)).then((value) => { | ||
| 137 | + if (!this.data || value.list.length == 0) { | ||
| 138 | + this.hasMore = false | ||
| 139 | + } else { | ||
| 140 | + value.list.forEach((item) => { | ||
| 141 | + let commentContent = item.commentContent | ||
| 142 | + if (item.sensitiveShow === 0 && item.sensitiveExist === 1) { | ||
| 143 | + commentContent = item.commentContentSensitive | ||
| 144 | + } | ||
| 145 | + let parentCommentContent = "" | ||
| 146 | + if (item.parentCommentVo != null) { | ||
| 147 | + parentCommentContent = item.parentCommentVo.commentContent | ||
| 148 | + } | ||
| 149 | + let parentCommentUserName = "" | ||
| 150 | + if (item.parentCommentVo != null) { | ||
| 151 | + parentCommentUserName = item.parentCommentVo.fromUserName | ||
| 152 | + } | ||
| 153 | + let publishTime = | ||
| 154 | + DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | ||
| 155 | + | ||
| 156 | + this.data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, publishTime, | ||
| 157 | + commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, | ||
| 158 | + item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, | ||
| 159 | + parentCommentUserName)) | ||
| 160 | + | ||
| 161 | + }) | ||
| 162 | + this.data.notifyDataReload() | ||
| 163 | + this.count = this.data.totalCount() | ||
| 164 | + if (this.data.totalCount() < value.totalCount) { | ||
| 165 | + this.curPageNum++ | ||
| 166 | + } else { | ||
| 167 | + this.hasMore = false | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + this.isGetRequest = true | ||
| 171 | + this.isLoading = false | ||
| 172 | + }).catch((err: Error) => { | ||
| 173 | + console.log(TAG, JSON.stringify(err)) | ||
| 174 | + this.isGetRequest = true | ||
| 175 | + this.isLoading = false | ||
| 176 | + }) | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | +} | ||
| 180 | + | ||
| 181 | +function getParams(item: CommentListItem) : ContentDTO{ | ||
| 182 | + let contentDTO = new ContentDTO(); | ||
| 183 | + | ||
| 184 | + // contentDTO.objectType = item.targetType + "" | ||
| 185 | + // contentDTO.objectId = item.targetId + "" | ||
| 186 | + // contentDTO.newsTitle = item.targetTitle | ||
| 187 | + // contentDTO.channelId = | ||
| 188 | + // contentDTO.rmhPlatform = | ||
| 189 | + | ||
| 190 | + contentDTO.objectId = item.targetId; | ||
| 191 | + contentDTO.relType = item.targetRelType + ""; | ||
| 192 | + contentDTO.relId = item.targetRelId; | ||
| 193 | + contentDTO.objectType = item.targetType + ""; | ||
| 194 | + contentDTO.newsTitle = item.targetTitle | ||
| 195 | + | ||
| 196 | + return contentDTO | ||
| 197 | +} |
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | "pages/MineMessagePage", | 26 | "pages/MineMessagePage", |
| 27 | "components/page/InteractMessagePage", | 27 | "components/page/InteractMessagePage", |
| 28 | "pages/ShowHomePageHeaderPage", | 28 | "pages/ShowHomePageHeaderPage", |
| 29 | - "pages/SubscribeMessagePage" | 29 | + "pages/SubscribeMessagePage", |
| 30 | + "pages/VisitorCommentPage" | ||
| 30 | ] | 31 | ] |
| 31 | } | 32 | } |
| @@ -125,8 +125,8 @@ export struct TopPlayComponent { | @@ -125,8 +125,8 @@ export struct TopPlayComponent { | ||
| 125 | } | 125 | } |
| 126 | // 直播结束 | 126 | // 直播结束 |
| 127 | if (this.contentDetailData?.liveInfo?.liveState === 'end') { | 127 | if (this.contentDetailData?.liveInfo?.liveState === 'end') { |
| 128 | - this.isHideLoading = true | ||
| 129 | - this.isWait = StringUtils.isNotEmpty(this.playUrl) | 128 | + this.isHideLoading = !StringUtils.isNotEmpty(this.playUrl) |
| 129 | + this.isWait = !StringUtils.isNotEmpty(this.playUrl) | ||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | 132 | ||
| @@ -140,7 +140,7 @@ export struct TopPlayComponent { | @@ -140,7 +140,7 @@ export struct TopPlayComponent { | ||
| 140 | this.previewUrl = '' | 140 | this.previewUrl = '' |
| 141 | } | 141 | } |
| 142 | } | 142 | } |
| 143 | - //Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource) | 143 | + // Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource) |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | tryToPlay() { | 146 | tryToPlay() { |
| @@ -183,7 +183,7 @@ struct ModifyPasswordPage { | @@ -183,7 +183,7 @@ struct ModifyPasswordPage { | ||
| 183 | .alignItems(VerticalAlign.Center) | 183 | .alignItems(VerticalAlign.Center) |
| 184 | 184 | ||
| 185 | Column() { | 185 | Column() { |
| 186 | - Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) | 186 | + Text("提示:密码长度8~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) |
| 187 | } | 187 | } |
| 188 | .width('100%') | 188 | .width('100%') |
| 189 | .height(`${this.calcHeight(85)}lpx`) | 189 | .height(`${this.calcHeight(85)}lpx`) |
| @@ -92,9 +92,8 @@ struct MultiPictureDetailPage { | @@ -92,9 +92,8 @@ struct MultiPictureDetailPage { | ||
| 92 | * TODO:颜色待根据业务接口修改 | 92 | * TODO:颜色待根据业务接口修改 |
| 93 | */ | 93 | */ |
| 94 | openFullScreen() { | 94 | openFullScreen() { |
| 95 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 95 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 96 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 96 | - // WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 97 | - // WindowModel.shared.setWindowSystemBarEnable([]) | ||
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | /** | 99 | /** |
| @@ -102,9 +101,8 @@ struct MultiPictureDetailPage { | @@ -102,9 +101,8 @@ struct MultiPictureDetailPage { | ||
| 102 | * TODO:颜色待根据业务接口修改 | 101 | * TODO:颜色待根据业务接口修改 |
| 103 | */ | 102 | */ |
| 104 | closeFullScreen() { | 103 | closeFullScreen() { |
| 104 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 105 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 105 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 106 | - // WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 107 | - // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) | ||
| 108 | } | 106 | } |
| 109 | 107 | ||
| 110 | } | 108 | } |
| @@ -353,7 +353,12 @@ export struct MultiPictureDetailPageComponent { | @@ -353,7 +353,12 @@ export struct MultiPictureDetailPageComponent { | ||
| 353 | .lineHeight(19) | 353 | .lineHeight(19) |
| 354 | } | 354 | } |
| 355 | .fontColor(Color.White) | 355 | .fontColor(Color.White) |
| 356 | - .margin(4) | 356 | + .margin({ |
| 357 | + top: 4, | ||
| 358 | + left: 18, | ||
| 359 | + bottom: 4, | ||
| 360 | + right: 4 | ||
| 361 | + }) | ||
| 357 | } | 362 | } |
| 358 | if (this.contentDetailData.newsTitle) { | 363 | if (this.contentDetailData.newsTitle) { |
| 359 | Text(`${this.contentDetailData.newsTitle}`) | 364 | Text(`${this.contentDetailData.newsTitle}`) |
| @@ -364,9 +369,9 @@ export struct MultiPictureDetailPageComponent { | @@ -364,9 +369,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 364 | .lineHeight(24) | 369 | .lineHeight(24) |
| 365 | .margin({ | 370 | .margin({ |
| 366 | top: 4, | 371 | top: 4, |
| 367 | - left: 0, | 372 | + left: 18, |
| 368 | bottom: 4, | 373 | bottom: 4, |
| 369 | - right: 0 | 374 | + right: 18 |
| 370 | }) | 375 | }) |
| 371 | } | 376 | } |
| 372 | if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { | 377 | if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { |
| @@ -17,11 +17,28 @@ struct DefaultWebPage { | @@ -17,11 +17,28 @@ struct DefaultWebPage { | ||
| 17 | 17 | ||
| 18 | build() { | 18 | build() { |
| 19 | Column() { | 19 | Column() { |
| 20 | - WdWebComponent({ | ||
| 21 | - webviewControl: this.webviewControl, | ||
| 22 | - webUrl: this.webUrl, | ||
| 23 | - isPageEnd: $isPageEnd | ||
| 24 | - }) | 20 | + Column() { |
| 21 | + WdWebComponent({ | ||
| 22 | + webviewControl: this.webviewControl, | ||
| 23 | + webUrl: this.webUrl, | ||
| 24 | + isPageEnd: $isPageEnd | ||
| 25 | + }) | ||
| 26 | + }.layoutWeight(1) | ||
| 27 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 28 | + | ||
| 29 | + Row() { | ||
| 30 | + Button({type: ButtonType.Normal}) { | ||
| 31 | + Image($r("app.media.back_icon_black")) | ||
| 32 | + .width(20).height(25) | ||
| 33 | + }.height(44).width(44) | ||
| 34 | + .backgroundColor(Color.White) | ||
| 35 | + .onClick(() => { | ||
| 36 | + router.back() | ||
| 37 | + }) | ||
| 38 | + Blank() | ||
| 39 | + }.width("100%").height(44) | ||
| 40 | + .alignItems(VerticalAlign.Center) | ||
| 41 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 25 | } | 42 | } |
| 26 | .width(CommonConstants.FULL_WIDTH) | 43 | .width(CommonConstants.FULL_WIDTH) |
| 27 | .height(CommonConstants.FULL_HEIGHT) | 44 | .height(CommonConstants.FULL_HEIGHT) |
-
Please register or login to post a comment