Showing
100 changed files
with
1167 additions
and
268 deletions
Too many changes to show.
To preserve performance only 100 of 100+ files are displayed.
| @@ -135,6 +135,14 @@ export class HttpUrlUtils { | @@ -135,6 +135,14 @@ export class HttpUrlUtils { | ||
| 135 | */ | 135 | */ |
| 136 | static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord"; | 136 | static readonly APPOINTMENT_ExecuteCollcet_PATH: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord"; |
| 137 | /** | 137 | /** |
| 138 | + * 个人中心 - 消息 | ||
| 139 | + */ | ||
| 140 | + static readonly APPOINTMENT_MessageList_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private"; | ||
| 141 | + /** | ||
| 142 | + * 个人中心 - 消息 点赞数 | ||
| 143 | + */ | ||
| 144 | + static readonly APPOINTMENT_getMessageLikeCount_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/getLikeCount"; | ||
| 145 | + /** | ||
| 138 | * 个人中心 我的评论列表 | 146 | * 个人中心 我的评论列表 |
| 139 | */ | 147 | */ |
| 140 | static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; | 148 | static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; |
| @@ -316,6 +324,10 @@ export class HttpUrlUtils { | @@ -316,6 +324,10 @@ export class HttpUrlUtils { | ||
| 316 | */ | 324 | */ |
| 317 | static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list"; | 325 | static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list"; |
| 318 | 326 | ||
| 327 | + /** | ||
| 328 | + * 查询点赞、回复我的、系统消息的未读数量以及回复/评论人 | ||
| 329 | + */ | ||
| 330 | + static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime="; | ||
| 319 | 331 | ||
| 320 | static getHost(): string { | 332 | static getHost(): string { |
| 321 | return HostManager.getHost(); | 333 | return HostManager.getHost(); |
| @@ -478,6 +490,16 @@ export class HttpUrlUtils { | @@ -478,6 +490,16 @@ export class HttpUrlUtils { | ||
| 478 | return url | 490 | return url |
| 479 | } | 491 | } |
| 480 | 492 | ||
| 493 | + static getMessageListDataUrl() { | ||
| 494 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MessageList_PATH | ||
| 495 | + return url | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + static getMessageLikeCount() { | ||
| 499 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_getMessageLikeCount_PATH | ||
| 500 | + return url | ||
| 501 | + } | ||
| 502 | + | ||
| 481 | static getExecuteCollcetUrl() { | 503 | static getExecuteCollcetUrl() { |
| 482 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH | 504 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH |
| 483 | return url | 505 | return url |
| @@ -714,4 +736,14 @@ export class HttpUrlUtils { | @@ -714,4 +736,14 @@ export class HttpUrlUtils { | ||
| 714 | return url; | 736 | return url; |
| 715 | } | 737 | } |
| 716 | 738 | ||
| 717 | -} | ||
| 739 | + //获取消息未读接口 | ||
| 740 | + static getMessageUnReadDataUrl() { | ||
| 741 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MESSAGE_UN_READ_DATA_PATH | ||
| 742 | + return url | ||
| 743 | + } | ||
| 744 | + | ||
| 745 | + static reportDeviceInfo() { | ||
| 746 | + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/common/user/c/device/push"; | ||
| 747 | + return url; | ||
| 748 | + } | ||
| 749 | +} |
| @@ -136,4 +136,9 @@ export class WDRouterPage { | @@ -136,4 +136,9 @@ export class WDRouterPage { | ||
| 136 | 136 | ||
| 137 | //意见反馈 | 137 | //意见反馈 |
| 138 | static feedBackActivity = new WDRouterPage("wdComponent", "ets/components/FeedBackActivity"); | 138 | static feedBackActivity = new WDRouterPage("wdComponent", "ets/components/FeedBackActivity"); |
| 139 | + | ||
| 140 | + // 人民号主页头像显示 | ||
| 141 | + static showHomePageHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowHomePageHeaderPage"); | ||
| 142 | + | ||
| 143 | + | ||
| 139 | } | 144 | } |
| @@ -55,7 +55,7 @@ export struct WdWebLocalComponent { | @@ -55,7 +55,7 @@ export struct WdWebLocalComponent { | ||
| 55 | .mixedMode(MixedMode.All) | 55 | .mixedMode(MixedMode.All) |
| 56 | .onlineImageAccess(true) | 56 | .onlineImageAccess(true) |
| 57 | .enableNativeEmbedMode(true) | 57 | .enableNativeEmbedMode(true) |
| 58 | - .layoutMode(WebLayoutMode.FIT_CONTENT) | 58 | + // .layoutMode(WebLayoutMode.FIT_CONTENT) |
| 59 | // .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST }) | 59 | // .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST }) |
| 60 | .height(this.webHeight) | 60 | .height(this.webHeight) |
| 61 | .onPageBegin((event) => { | 61 | .onPageBegin((event) => { |
| @@ -69,6 +69,7 @@ export struct DynamicDetailComponent { | @@ -69,6 +69,7 @@ export struct DynamicDetailComponent { | ||
| 69 | @State isNetConnected: boolean = true | 69 | @State isNetConnected: boolean = true |
| 70 | @State isPageEnd: boolean = false | 70 | @State isPageEnd: boolean = false |
| 71 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 71 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 72 | + @State reachEndIncreament: number = 0 | ||
| 72 | 73 | ||
| 73 | async aboutToAppear() { | 74 | async aboutToAppear() { |
| 74 | await this.getContentDetailData() | 75 | await this.getContentDetailData() |
| @@ -709,4 +710,4 @@ interface radiusType { | @@ -709,4 +710,4 @@ interface radiusType { | ||
| 709 | topRight: number | Resource; | 710 | topRight: number | Resource; |
| 710 | bottomLeft: number | Resource; | 711 | bottomLeft: number | Resource; |
| 711 | bottomRight: number | Resource; | 712 | bottomRight: number | Resource; |
| 712 | -} | ||
| 713 | +} |
| @@ -148,18 +148,19 @@ export struct ENewspaperPageComponent { | @@ -148,18 +148,19 @@ export struct ENewspaperPageComponent { | ||
| 148 | this.calendarDialogController.close() | 148 | this.calendarDialogController.close() |
| 149 | } | 149 | } |
| 150 | }) | 150 | }) |
| 151 | - | ||
| 152 | - Image($r('app.media.icon_share')) | ||
| 153 | - .height($r('app.float.top_arrow_size')) | ||
| 154 | - .width($r('app.float.top_arrow_size')) | ||
| 155 | - .alignRules({ | ||
| 156 | - right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 157 | - center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 158 | - }) | ||
| 159 | - .id('e_newspaper_share') | ||
| 160 | - .onClick(() => { | ||
| 161 | - ToastUtils.showToast('分享为公共方法,待开发', 1000); | ||
| 162 | - }) | 151 | + if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 152 | + Image($r('app.media.icon_share')) | ||
| 153 | + .height($r('app.float.top_arrow_size')) | ||
| 154 | + .width($r('app.float.top_arrow_size')) | ||
| 155 | + .alignRules({ | ||
| 156 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 157 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 158 | + }) | ||
| 159 | + .id('e_newspaper_share') | ||
| 160 | + .onClick(() => { | ||
| 161 | + ToastUtils.showToast('分享为公共方法,待开发', 1000); | ||
| 162 | + }) | ||
| 163 | + } | ||
| 163 | } | 164 | } |
| 164 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 165 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) |
| 165 | .height($r('app.float.top_bar_height')) | 166 | .height($r('app.float.top_bar_height')) |
| @@ -311,6 +312,7 @@ export struct ENewspaperPageComponent { | @@ -311,6 +312,7 @@ export struct ENewspaperPageComponent { | ||
| 311 | .width('100%') | 312 | .width('100%') |
| 312 | .height('100%') | 313 | .height('100%') |
| 313 | .backgroundColor($r('app.color.color_80000000')) | 314 | .backgroundColor($r('app.color.color_80000000')) |
| 315 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 314 | .id('e_newspaper_container') | 316 | .id('e_newspaper_container') |
| 315 | 317 | ||
| 316 | if (this.isOpenListDialog) { | 318 | if (this.isOpenListDialog) { |
| @@ -52,6 +52,7 @@ export struct ImageAndTextPageComponent { | @@ -52,6 +52,7 @@ export struct ImageAndTextPageComponent { | ||
| 52 | @State isNetConnected: boolean = true | 52 | @State isNetConnected: boolean = true |
| 53 | @State info: Area | null = null | 53 | @State info: Area | null = null |
| 54 | @State likeNum: number = 0 | 54 | @State likeNum: number = 0 |
| 55 | + @State reachEndIncreament : number = 0 | ||
| 55 | 56 | ||
| 56 | build() { | 57 | build() { |
| 57 | Column() { | 58 | Column() { |
| @@ -141,7 +142,12 @@ export struct ImageAndTextPageComponent { | @@ -141,7 +142,12 @@ export struct ImageAndTextPageComponent { | ||
| 141 | if (this.contentDetailData?.openComment) { | 142 | if (this.contentDetailData?.openComment) { |
| 142 | Divider().strokeWidth(6).color('#f5f5f5') | 143 | Divider().strokeWidth(6).color('#f5f5f5') |
| 143 | CommentComponent({ | 144 | CommentComponent({ |
| 144 | - publishCommentModel: this.publishCommentModel | 145 | + publishCommentModel: this.publishCommentModel, |
| 146 | + fixedHeightMode: false, | ||
| 147 | + reachEndIncreament: this.reachEndIncreament, | ||
| 148 | + reachEndLoadMoreFinish: () => { | ||
| 149 | + | ||
| 150 | + } | ||
| 145 | }).onAreaChange((oldValue: Area, newValue: Area) => { | 151 | }).onAreaChange((oldValue: Area, newValue: Area) => { |
| 146 | this.info = newValue | 152 | this.info = newValue |
| 147 | }) | 153 | }) |
| @@ -157,6 +163,9 @@ export struct ImageAndTextPageComponent { | @@ -157,6 +163,9 @@ export struct ImageAndTextPageComponent { | ||
| 157 | .padding({ bottom: 76 }) | 163 | .padding({ bottom: 76 }) |
| 158 | .scrollBar(BarState.Off) | 164 | .scrollBar(BarState.Off) |
| 159 | .align(Alignment.Top) | 165 | .align(Alignment.Top) |
| 166 | + .onReachEnd(() => { | ||
| 167 | + this.reachEndIncreament += 1 | ||
| 168 | + }) | ||
| 160 | 169 | ||
| 161 | if (!this.isNetConnected) { | 170 | if (!this.isNetConnected) { |
| 162 | EmptyComponent({ | 171 | EmptyComponent({ |
| @@ -228,6 +237,7 @@ export struct ImageAndTextPageComponent { | @@ -228,6 +237,7 @@ export struct ImageAndTextPageComponent { | ||
| 228 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | 237 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) |
| 229 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | 238 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) |
| 230 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | 239 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) |
| 240 | + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) | ||
| 231 | } | 241 | } |
| 232 | if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length && | 242 | if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length && |
| 233 | this.contentDetailData?.audioList[0].audioUrl) { | 243 | this.contentDetailData?.audioList[0].audioUrl) { |
| @@ -340,4 +350,4 @@ export struct ImageAndTextPageComponent { | @@ -340,4 +350,4 @@ export struct ImageAndTextPageComponent { | ||
| 340 | 350 | ||
| 341 | aboutToDisappear() { | 351 | aboutToDisappear() { |
| 342 | } | 352 | } |
| 343 | -} | ||
| 353 | +} |
| 1 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 2 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 3 | +import { InteractMessageModel } from '../../model/InteractMessageModel' | ||
| 1 | 4 | ||
| 2 | @Component | 5 | @Component |
| 3 | export struct InteractMComponent { | 6 | export struct InteractMComponent { |
| 7 | + messageModel:InteractMessageModel = new InteractMessageModel; | ||
| 8 | +///"remark": "{"beReply":"乐事薯片,大家的最爱!!", | ||
| 9 | + // "headUrl":"https: //uatjdcdnphoto.aikan.pdnews.cn//zhbj/img/user/2023122211/2A59F725E69849A38CEE8823B0D9D141.jpg", | ||
| 10 | + // "contentId":"30035774121","contentRelObjectid":"2012","contentTitle":"乐事推出华夏风光限定罐七款城市地标包装让出游“有滋有味”", | ||
| 11 | + // "commentContent":"大家都爱吃!!","userName":"人民日报网友a8dKCV","userId":"504964178466309","contentRelId":"500002866426", | ||
| 12 | + // "shareUrl":"https: //pd-people-uat.pdnews.cn/column/30035774121-500002866426","userType":"1", | ||
| 13 | + // "contentRelType":"1","visitor":"0","contentType":"8"}", | ||
| 14 | + | ||
| 4 | build() { | 15 | build() { |
| 5 | Row(){ | 16 | Row(){ |
| 6 | - Image('') | ||
| 7 | - .backgroundColor(Color.Red) | 17 | + Image(this.messageModel.InteractMsubM.headUrl) |
| 8 | .width(36) | 18 | .width(36) |
| 9 | .height(36) | 19 | .height(36) |
| 10 | .borderRadius(18) | 20 | .borderRadius(18) |
| 11 | 21 | ||
| 12 | Column(){ | 22 | Column(){ |
| 13 | Row(){ | 23 | Row(){ |
| 14 | - Text('用户名') | 24 | + Text(this.messageModel.InteractMsubM.userName) |
| 15 | .fontSize('14fp').fontColor('#222222') | 25 | .fontSize('14fp').fontColor('#222222') |
| 16 | 26 | ||
| 17 | - Text('回复了你的评论') | 27 | + Text(this.buildContentString()) |
| 18 | .fontSize('14fp').fontColor('#999999') | 28 | .fontSize('14fp').fontColor('#999999') |
| 19 | .margin({left:5}) | 29 | .margin({left:5}) |
| 20 | }.width('100%') | 30 | }.width('100%') |
| 21 | 31 | ||
| 22 | - Text('两天前') | 32 | + Text(this.messageModel.time) |
| 23 | .margin({top:2}) | 33 | .margin({top:2}) |
| 24 | - .fontSize('12fp').fontColor('#B0B0B0') | ||
| 25 | - | ||
| 26 | - Text('评论内容') | ||
| 27 | - .margin({top:8,bottom:10}) | ||
| 28 | - .fontSize('16fp').fontColor('#222222') | ||
| 29 | - .width('100%') | ||
| 30 | - .constraintSize({maxHeight:500}) | 34 | + .fontSize('12fp').fontColor('#B0B0B0').margin({top:10,bottom:10}) |
| 31 | 35 | ||
| 32 | - Column(){ | ||
| 33 | - Text('[你的评论]乐事薯片,大家的最爱').fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | ||
| 34 | - .margin({top:5,bottom:5}) | 36 | + if (this.messageModel.contentType === '208' || this.messageModel.contentType === '209'){ |
| 37 | + Text(this.messageModel.message) | ||
| 38 | + .margin({bottom:10}) | ||
| 39 | + .fontSize('16fp').fontColor('#222222') | ||
| 35 | .width('100%') | 40 | .width('100%') |
| 41 | + .constraintSize({maxHeight:500}) | ||
| 42 | + } | ||
| 36 | 43 | ||
| 37 | - Divider() | ||
| 38 | - .color('#f5f5f5') | ||
| 39 | - .backgroundColor('#f5f5f5') | ||
| 40 | - .width('100%') | ||
| 41 | - .height(1) | 44 | + Column(){ |
| 45 | + if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ | ||
| 46 | + Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | ||
| 47 | + .margin({top:15,bottom:10}) | ||
| 48 | + .width('100%') | ||
| 42 | 49 | ||
| 50 | + Divider() | ||
| 51 | + .color('#EDEDED') | ||
| 52 | + .backgroundColor('#EDEDED') | ||
| 53 | + .width('100%') | ||
| 54 | + .height(1) | ||
| 55 | + } | ||
| 43 | Row(){ | 56 | Row(){ |
| 44 | - Text('乐事薯片,大家的最爱!!!!').fontSize('12fp').fontColor('#666666').constraintSize({maxHeight:500}) | 57 | + Image($r('app.media.MessageOriginTextIcon')) |
| 58 | + .width('12') | ||
| 59 | + .height('12') | ||
| 60 | + Text(this.messageModel.InteractMsubM.contentTitle) | ||
| 61 | + .fontSize('12fp') | ||
| 62 | + .fontColor('#666666') | ||
| 63 | + .maxLines(1) | ||
| 64 | + .width('90%') | ||
| 65 | + .textOverflow({overflow:TextOverflow.Ellipsis}) | ||
| 45 | 66 | ||
| 46 | Blank() | 67 | Blank() |
| 47 | 68 | ||
| 48 | Image($r('app.media.mine_user_edit')) | 69 | Image($r('app.media.mine_user_edit')) |
| 49 | .width('12') | 70 | .width('12') |
| 50 | .height('12') | 71 | .height('12') |
| 51 | - }.margin({top:5,bottom:5}).width('100%') | ||
| 52 | - }.alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5) | ||
| 53 | - }.padding({left:5}).alignItems(HorizontalAlign.Start) | ||
| 54 | - }.padding({top:5,left:16,right:16}).width('100%').height(160).alignItems(VerticalAlign.Top).backgroundColor(Color.Red) | 72 | + }.margin({top:10,bottom:15}) |
| 73 | + }.padding({left:10,right:10}).alignItems(HorizontalAlign.Start).backgroundColor('#f5f5f5').borderRadius(5) | ||
| 74 | + .onClick(()=>{ | ||
| 75 | + let contentDTO :ContentDTO = new ContentDTO(); | ||
| 76 | + contentDTO.objectType = this.messageModel.InteractMsubM.contentType | ||
| 77 | + contentDTO.objectId = this.messageModel.InteractMsubM.contentId | ||
| 78 | + ProcessUtils.processPage(contentDTO) | ||
| 79 | + }) | ||
| 80 | + }.padding({left:5,right:5}).alignItems(HorizontalAlign.Start).width('90%') | ||
| 81 | + }.padding({top:10,left:16,right:16}).width('100%').alignItems(VerticalAlign.Top) | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + buildContentString(): string { | ||
| 85 | + let contentString: string = '' | ||
| 86 | + if (this.messageModel.contentType === '206') { | ||
| 87 | + contentString = '赞了你的作品' | ||
| 88 | + }else if(this.messageModel.contentType === '207'){ | ||
| 89 | + contentString = '赞了你的评论' | ||
| 90 | + }else if(this.messageModel.contentType === '208'){ | ||
| 91 | + contentString = '评论了你的作品' | ||
| 92 | + }else if(this.messageModel.contentType === '209'){ | ||
| 93 | + contentString = '回复了你的评论' | ||
| 94 | + }else if(this.messageModel.contentType === '210'){ | ||
| 95 | + contentString = '转发了您的作品' | ||
| 96 | + }else if(this.messageModel.contentType === '211'){ | ||
| 97 | + contentString = '关注了你' | ||
| 98 | + } | ||
| 99 | + return contentString; | ||
| 100 | + } | ||
| 101 | + buildCommentContent(): string { | ||
| 102 | + let contentString : string = this.messageModel.contentType === '207'?this.messageModel.message:this.messageModel.InteractMsubM.beReply; | ||
| 103 | + return contentString; | ||
| 55 | } | 104 | } |
| 56 | } | 105 | } |
| @@ -61,6 +61,8 @@ export struct MorningEveningPaperComponent { | @@ -61,6 +61,8 @@ export struct MorningEveningPaperComponent { | ||
| 61 | @State mixedBgColor: string = '' | 61 | @State mixedBgColor: string = '' |
| 62 | // 顶部安全高度赋值 | 62 | // 顶部安全高度赋值 |
| 63 | @State topSafeHeight: number = 0; | 63 | @State topSafeHeight: number = 0; |
| 64 | + @State bottomSafeHeight: number = 0; | ||
| 65 | + | ||
| 64 | private audioDataList: AudioDataList[] = [] | 66 | private audioDataList: AudioDataList[] = [] |
| 65 | private playerController: WDPlayerController = new WDPlayerController(); | 67 | private playerController: WDPlayerController = new WDPlayerController(); |
| 66 | simpleAudioDialog: CustomDialogController = new CustomDialogController({ | 68 | simpleAudioDialog: CustomDialogController = new CustomDialogController({ |
| @@ -112,6 +114,7 @@ export struct MorningEveningPaperComponent { | @@ -112,6 +114,7 @@ export struct MorningEveningPaperComponent { | ||
| 112 | // await windowHight.setWindowLayoutFullScreen(true); | 114 | // await windowHight.setWindowLayoutFullScreen(true); |
| 113 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 115 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 114 | this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) | 116 | this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) |
| 117 | + this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | ||
| 115 | 118 | ||
| 116 | const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String | 119 | const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String |
| 117 | console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) | 120 | console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) |
| @@ -248,14 +251,15 @@ export struct MorningEveningPaperComponent { | @@ -248,14 +251,15 @@ export struct MorningEveningPaperComponent { | ||
| 248 | }) | 251 | }) |
| 249 | } | 252 | } |
| 250 | } | 253 | } |
| 251 | - .height('100%') | 254 | + .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`) |
| 252 | 255 | ||
| 253 | PaperTitleComponent() | 256 | PaperTitleComponent() |
| 254 | } | 257 | } |
| 255 | .width('100%') | 258 | .width('100%') |
| 256 | .height('100%') | 259 | .height('100%') |
| 257 | .padding({ | 260 | .padding({ |
| 258 | - top: this.topSafeHeight | 261 | + top: this.topSafeHeight, |
| 262 | + bottom: this.bottomSafeHeight | ||
| 259 | }) | 263 | }) |
| 260 | // .backgroundColor(Color.Black) | 264 | // .backgroundColor(Color.Black) |
| 261 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 265 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| @@ -449,6 +449,7 @@ export struct MultiPictureDetailPageComponent { | @@ -449,6 +449,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 449 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | 449 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) |
| 450 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | 450 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) |
| 451 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | 451 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) |
| 452 | + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) | ||
| 452 | } | 453 | } |
| 453 | // this.contentDetailData.photoList = [] | 454 | // this.contentDetailData.photoList = [] |
| 454 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { | 455 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { |
| @@ -72,6 +72,7 @@ export struct SpacialTopicPageComponent { | @@ -72,6 +72,7 @@ export struct SpacialTopicPageComponent { | ||
| 72 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | 72 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) |
| 73 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | 73 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) |
| 74 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | 74 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) |
| 75 | + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) | ||
| 75 | // } | 76 | // } |
| 76 | this.trySendData2H5() | 77 | this.trySendData2H5() |
| 77 | } | 78 | } |
| @@ -113,4 +114,4 @@ export struct SpacialTopicPageComponent { | @@ -113,4 +114,4 @@ export struct SpacialTopicPageComponent { | ||
| 113 | } | 114 | } |
| 114 | this.getDetail() | 115 | this.getDetail() |
| 115 | } | 116 | } |
| 116 | -} | ||
| 117 | +} |
| @@ -20,6 +20,8 @@ export class publishCommentModel { | @@ -20,6 +20,8 @@ export class publishCommentModel { | ||
| 20 | targetType: string = '' | 20 | targetType: string = '' |
| 21 | /*评论总数*/ | 21 | /*评论总数*/ |
| 22 | totalCommentNumer: string = '0' | 22 | totalCommentNumer: string = '0' |
| 23 | + /// 游客评论开关:visitorComment 1:打开;0:关闭 | ||
| 24 | + visitorComment: string = "0" | ||
| 23 | 25 | ||
| 24 | //评论传参 | 26 | //评论传参 |
| 25 | /*评论图片url,多个逗号隔开*/ | 27 | /*评论图片url,多个逗号隔开*/ |
| @@ -8,9 +8,11 @@ import { HttpUtils } from 'wdNetwork/Index'; | @@ -8,9 +8,11 @@ import { HttpUtils } from 'wdNetwork/Index'; | ||
| 8 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 8 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 9 | import NoMoreLayout from '../../page/NoMoreLayout'; | 9 | import NoMoreLayout from '../../page/NoMoreLayout'; |
| 10 | import { EmptyComponent } from '../../view/EmptyComponent'; | 10 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 11 | +import { ContentDetailDTO, Params } from 'wdBean/Index'; | ||
| 11 | 12 | ||
| 12 | const TAG = 'CommentComponent'; | 13 | const TAG = 'CommentComponent'; |
| 13 | 14 | ||
| 15 | + | ||
| 14 | const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸' | 16 | const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸' |
| 15 | 17 | ||
| 16 | // @Entry | 18 | // @Entry |
| @@ -22,14 +24,20 @@ export struct CommentComponent { | @@ -22,14 +24,20 @@ export struct CommentComponent { | ||
| 22 | @State isComments: boolean = true | 24 | @State isComments: boolean = true |
| 23 | /*必传*/ | 25 | /*必传*/ |
| 24 | @ObjectLink publishCommentModel: publishCommentModel | 26 | @ObjectLink publishCommentModel: publishCommentModel |
| 27 | + @Consume contentDetailData: ContentDetailDTO | ||
| 25 | listScroller: ListScroller = new ListScroller(); // scroller控制器 | 28 | listScroller: ListScroller = new ListScroller(); // scroller控制器 |
| 26 | historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset | 29 | historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset |
| 27 | - isloading: boolean = false | ||
| 28 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 30 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 29 | @State dialogController: CustomDialogController | null = null; | 31 | @State dialogController: CustomDialogController | null = null; |
| 30 | 32 | ||
| 31 | // @State private browSingModel: commentListModel = new commentListModel() | 33 | // @State private browSingModel: commentListModel = new commentListModel() |
| 32 | 34 | ||
| 35 | + // 是否为固定高度模式。true时,里面上拉加载更多生效,外层不能包Scroll。 | ||
| 36 | + // false时,外层实现加载更多,并通过reachEndIncreament通知开发加载更多,reachEndLoadMoreFinish 通知上层加载更多完成 | ||
| 37 | + fixedHeightMode: boolean = false | ||
| 38 | + @Prop @Watch("parentOnReachEnd") reachEndIncreament : number = 0 | ||
| 39 | + reachEndLoadMoreFinish?: () => void | ||
| 40 | + | ||
| 33 | // 在自定义组件即将析构销毁时将dialogControlle置空 | 41 | // 在自定义组件即将析构销毁时将dialogControlle置空 |
| 34 | aboutToDisappear() { | 42 | aboutToDisappear() { |
| 35 | this.dialogController = null // 将dialogController置空 | 43 | this.dialogController = null // 将dialogController置空 |
| @@ -180,31 +188,52 @@ export struct CommentComponent { | @@ -180,31 +188,52 @@ export struct CommentComponent { | ||
| 180 | } | 188 | } |
| 181 | } | 189 | } |
| 182 | }, (item: commentItemModel, index: number) => JSON.stringify(item) + index.toString()) | 190 | }, (item: commentItemModel, index: number) => JSON.stringify(item) + index.toString()) |
| 183 | - | 191 | + |
| 184 | // 加载更多 | 192 | // 加载更多 |
| 185 | ListItem() { | 193 | ListItem() { |
| 186 | - if (this.hasMore === false) { | 194 | + if (this.hasMore == false) { |
| 187 | NoMoreLayout() | 195 | NoMoreLayout() |
| 188 | } | 196 | } |
| 189 | } | 197 | } |
| 190 | } | 198 | } |
| 191 | - | ||
| 192 | } | 199 | } |
| 200 | + .margin({bottom: 10}) | ||
| 193 | .onReachEnd(() => { | 201 | .onReachEnd(() => { |
| 202 | + if (!this.fixedHeightMode) { | ||
| 203 | + return | ||
| 204 | + } | ||
| 194 | if (this.hasMore) { | 205 | if (this.hasMore) { |
| 195 | this.getData() | 206 | this.getData() |
| 196 | } | 207 | } |
| 197 | }) | 208 | }) |
| 198 | - .enableScrollInteraction(false) | 209 | + .enableScrollInteraction(this.fixedHeightMode ? true: false) |
| 210 | + // .nestedScroll({ | ||
| 211 | + // scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 212 | + // scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 213 | + // }) | ||
| 199 | } | 214 | } |
| 200 | 215 | ||
| 201 | } | 216 | } |
| 202 | 217 | ||
| 218 | + parentOnReachEnd() { | ||
| 219 | + if (this.fixedHeightMode) { | ||
| 220 | + return | ||
| 221 | + } | ||
| 222 | + if (this.hasMore) { | ||
| 223 | + this.getData() | ||
| 224 | + } else { | ||
| 225 | + if (this.reachEndLoadMoreFinish) { | ||
| 226 | + this.reachEndLoadMoreFinish() | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | + } | ||
| 230 | + | ||
| 203 | //获取数据 | 231 | //获取数据 |
| 204 | async getData() { | 232 | async getData() { |
| 205 | commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, | 233 | commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, |
| 206 | this.publishCommentModel.targetType) | 234 | this.publishCommentModel.targetType) |
| 207 | .then(commentListModel => { | 235 | .then(commentListModel => { |
| 236 | + console.log('评论:', JSON.stringify(commentListModel.list)) | ||
| 208 | this.currentPage++ | 237 | this.currentPage++ |
| 209 | 238 | ||
| 210 | if (Number.parseInt(commentListModel.totalCommentNum) > | 239 | if (Number.parseInt(commentListModel.totalCommentNum) > |
| @@ -237,6 +266,9 @@ export struct CommentComponent { | @@ -237,6 +266,9 @@ export struct CommentComponent { | ||
| 237 | } else { | 266 | } else { |
| 238 | this.hasMore = false | 267 | this.hasMore = false |
| 239 | } | 268 | } |
| 269 | + if (!this.fixedHeightMode && this.reachEndLoadMoreFinish) { | ||
| 270 | + this.reachEndLoadMoreFinish() | ||
| 271 | + } | ||
| 240 | }) | 272 | }) |
| 241 | } | 273 | } |
| 242 | } | 274 | } |
| @@ -247,6 +279,7 @@ struct ChildCommentItem { | @@ -247,6 +279,7 @@ struct ChildCommentItem { | ||
| 247 | @Link publishCommentModel: publishCommentModel | 279 | @Link publishCommentModel: publishCommentModel |
| 248 | @Link dialogController: CustomDialogController | null | 280 | @Link dialogController: CustomDialogController | null |
| 249 | @ObjectLink item: commentItemModel | 281 | @ObjectLink item: commentItemModel |
| 282 | + @Consume contentDetailData: ContentDetailDTO | ||
| 250 | 283 | ||
| 251 | build() { | 284 | build() { |
| 252 | Column() { | 285 | Column() { |
| @@ -271,6 +304,14 @@ struct ChildCommentItem { | @@ -271,6 +304,14 @@ struct ChildCommentItem { | ||
| 271 | .alignContent(Alignment.Center) | 304 | .alignContent(Alignment.Center) |
| 272 | .onClick(() => { | 305 | .onClick(() => { |
| 273 | // TODO 跳转个人详情 | 306 | // TODO 跳转个人详情 |
| 307 | + // 跳转到号主页 | ||
| 308 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 309 | + const params: Params = { | ||
| 310 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 311 | + pageID: '' | ||
| 312 | + } | ||
| 313 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 314 | + } | ||
| 274 | }) | 315 | }) |
| 275 | 316 | ||
| 276 | //昵称 | 317 | //昵称 |
| @@ -455,7 +496,7 @@ struct commentHeaderView { | @@ -455,7 +496,7 @@ struct commentHeaderView { | ||
| 455 | .margin({ left: 8 }) | 496 | .margin({ left: 8 }) |
| 456 | .alignContent(Alignment.Center) | 497 | .alignContent(Alignment.Center) |
| 457 | .onClick(() => { | 498 | .onClick(() => { |
| 458 | - // TODO 跳转个人详情 | 499 | + commentViewModel.jumpToAccountPage(this.item) |
| 459 | }) | 500 | }) |
| 460 | 501 | ||
| 461 | //昵称 | 502 | //昵称 |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentListDialog.ets
0 → 100644
| 1 | +import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | ||
| 2 | +import { publishCommentModel } from '../model/PublishCommentModel' | ||
| 3 | + | ||
| 4 | +@CustomDialog | ||
| 5 | +export struct CommentListDialog { | ||
| 6 | + | ||
| 7 | + /// 内部使用 | ||
| 8 | + private publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 9 | + controller?: CustomDialogController | ||
| 10 | + | ||
| 11 | + /// 外部初始化 | ||
| 12 | + contentDetail?: ContentDetailDTO | ||
| 13 | + pageInfo?: PageInfoDTO | ||
| 14 | + | ||
| 15 | + build() { | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +} |
| @@ -11,11 +11,12 @@ export struct CommentTabComponent { | @@ -11,11 +11,12 @@ export struct CommentTabComponent { | ||
| 11 | } | 11 | } |
| 12 | @ObjectLink publishCommentModel: publishCommentModel | 12 | @ObjectLink publishCommentModel: publishCommentModel |
| 13 | @Prop contentDetail: ContentDetailDTO | 13 | @Prop contentDetail: ContentDetailDTO |
| 14 | + @Prop pageComponentType: number = -1 //1:视频详情页 | ||
| 14 | /*展示类型*/ | 15 | /*展示类型*/ |
| 15 | @State type: number = 1 | 16 | @State type: number = 1 |
| 16 | @State placeHolder: string = '说两句...' | 17 | @State placeHolder: string = '说两句...' |
| 17 | @State dialogController: CustomDialogController | null = null; | 18 | @State dialogController: CustomDialogController | null = null; |
| 18 | - styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | 19 | + styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) |
| 19 | /*回调方法*/ | 20 | /*回调方法*/ |
| 20 | dialogControllerConfirm: () => void = () => { | 21 | dialogControllerConfirm: () => void = () => { |
| 21 | } | 22 | } |
| @@ -46,16 +47,44 @@ export struct CommentTabComponent { | @@ -46,16 +47,44 @@ export struct CommentTabComponent { | ||
| 46 | Row() { | 47 | Row() { |
| 47 | Stack({ alignContent: Alignment.Start }) { | 48 | Stack({ alignContent: Alignment.Start }) { |
| 48 | RelativeContainer() { | 49 | RelativeContainer() { |
| 49 | - Image($r('app.media.comment_img_input_hui')) | ||
| 50 | - .objectFit(ImageFit.Fill) | ||
| 51 | - .resizable({ slice: { top: 1, left: 1, right: 20, bottom: 1 } }) | 50 | + |
| 51 | + if (this.pageComponentType === 1) { | ||
| 52 | + Row() { | ||
| 53 | + | ||
| 54 | + } | ||
| 55 | + .width('100%') | ||
| 56 | + .height(30) | ||
| 57 | + .borderRadius(2) | ||
| 58 | + .backgroundColor(this.pageComponentType === 1 ? '#1a1a1a' : Color.Transparent) | ||
| 59 | + .margin({ | ||
| 60 | + right: 16, | ||
| 61 | + }) | ||
| 52 | .alignRules({ | 62 | .alignRules({ |
| 53 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 63 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 54 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 64 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 55 | right: { anchor: "__container__", align: HorizontalAlign.End }, | 65 | right: { anchor: "__container__", align: HorizontalAlign.End }, |
| 56 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 66 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 57 | }) | 67 | }) |
| 58 | - .id("Image") | 68 | + .id("RowBg") |
| 69 | + } else { | ||
| 70 | + Image($r('app.media.comment_img_input_hui')) | ||
| 71 | + .objectFit(ImageFit.Fill) | ||
| 72 | + .resizable({ | ||
| 73 | + slice: { | ||
| 74 | + top: 1, | ||
| 75 | + left: 1, | ||
| 76 | + right: 20, | ||
| 77 | + bottom: 1 | ||
| 78 | + } | ||
| 79 | + }) | ||
| 80 | + .alignRules({ | ||
| 81 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 82 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 83 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 84 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 85 | + }) | ||
| 86 | + .id("Image") | ||
| 87 | + } | ||
| 59 | Text(this.placeHolder) | 88 | Text(this.placeHolder) |
| 60 | .fontSize(12) | 89 | .fontSize(12) |
| 61 | .fontColor('#999999') | 90 | .fontColor('#999999') |
| @@ -91,7 +120,7 @@ export struct CommentIconComponent { | @@ -91,7 +120,7 @@ export struct CommentIconComponent { | ||
| 91 | @ObjectLink publishCommentModel: publishCommentModel | 120 | @ObjectLink publishCommentModel: publishCommentModel |
| 92 | /*展示类型*/ | 121 | /*展示类型*/ |
| 93 | @State type: number = 1 | 122 | @State type: number = 1 |
| 94 | - styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | 123 | + styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) |
| 95 | // aboutToAppear(): void { | 124 | // aboutToAppear(): void { |
| 96 | // setTimeout(() => { | 125 | // setTimeout(() => { |
| 97 | // this.publishCommentModel.totalCommentNumer = '444' | 126 | // this.publishCommentModel.totalCommentNumer = '444' |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -412,33 +412,7 @@ struct QualityCommentItem { | @@ -412,33 +412,7 @@ struct QualityCommentItem { | ||
| 412 | 412 | ||
| 413 | jumpToAccountOwner() { | 413 | jumpToAccountOwner() { |
| 414 | 414 | ||
| 415 | - let url = HttpUrlUtils.getOtherUserDetailDataUrl() | ||
| 416 | - let item : Record<string, string >= { | ||
| 417 | - "creatorId": this.item.fromCreatorId || "", | ||
| 418 | - "userType": `${this.item.fromUserType}`, | ||
| 419 | - "userId": this.item.fromUserId || "-1", | ||
| 420 | - } | ||
| 421 | - HttpBizUtil.post<ResponseDTO<MasterDetailRes>>(url, item).then((result) => { | ||
| 422 | - if (!result.data || result.data.mainControl != 1) { | ||
| 423 | - ToastUtils.longToast("暂时无法查看该创作者主页") | ||
| 424 | - return | ||
| 425 | - } | ||
| 426 | - | ||
| 427 | - if (result.data.banControl == 1) { | ||
| 428 | - ToastUtils.longToast("该账号已封禁,不予访问") | ||
| 429 | - return | ||
| 430 | - } | ||
| 431 | - | ||
| 432 | - if (result.data.userType === "1") { // 普通用户 | ||
| 433 | - let params: Record<string, string> = {'userId': result.data.userId}; | ||
| 434 | - WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) | ||
| 435 | - } else { // 非普通用户 | ||
| 436 | - ProcessUtils.gotoPeopleShipHomePage(result.data.creatorId) | ||
| 437 | - } | ||
| 438 | - | ||
| 439 | - }).catch(() => { | ||
| 440 | - ToastUtils.longToast("暂时无法查看该创作者主页") | ||
| 441 | - }) | 415 | + commentViewModel.jumpToAccountPage(this.item) |
| 442 | } | 416 | } |
| 443 | 417 | ||
| 444 | jumpToDetail() { | 418 | jumpToDetail() { |
| 1 | +import { MasterDetailRes } from 'wdBean/Index'; | ||
| 1 | import { SpConstants } from 'wdConstant/Index'; | 2 | import { SpConstants } from 'wdConstant/Index'; |
| 2 | -import { DateTimeUtils, Logger, SPHelper, ToastUtils, UserDataLocal } from 'wdKit/Index'; | 3 | +import { |
| 4 | + AccountManagerUtils, | ||
| 5 | + DateTimeUtils, DeviceUtil, Logger, SPHelper, ToastUtils, UserDataLocal } from 'wdKit/Index'; | ||
| 3 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; | 6 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; |
| 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 7 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 8 | +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 5 | import { | 9 | import { |
| 6 | commentItemModel, | 10 | commentItemModel, |
| 7 | commentListModel, | 11 | commentListModel, |
| @@ -160,7 +164,9 @@ class CommentViewModel { | @@ -160,7 +164,9 @@ class CommentViewModel { | ||
| 160 | publishComment(model: publishCommentModel) { | 164 | publishComment(model: publishCommentModel) { |
| 161 | 165 | ||
| 162 | return new Promise<commentItemModel>((success, fail) => { | 166 | return new Promise<commentItemModel>((success, fail) => { |
| 163 | - let url = HttpUrlUtils.getPublishCommentUrl() | 167 | + const visitorMode = model.visitorComment == "1" && AccountManagerUtils.isLoginSync() == false |
| 168 | + let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl() | ||
| 169 | + | ||
| 164 | let bean: Record<string, string> = {}; | 170 | let bean: Record<string, string> = {}; |
| 165 | 171 | ||
| 166 | bean['targetId'] = model.targetId; | 172 | bean['targetId'] = model.targetId; |
| @@ -176,6 +182,11 @@ class CommentViewModel { | @@ -176,6 +182,11 @@ class CommentViewModel { | ||
| 176 | bean['targetType'] = model.targetType | 182 | bean['targetType'] = model.targetType |
| 177 | bean['parentId'] = model.parentId | 183 | bean['parentId'] = model.parentId |
| 178 | 184 | ||
| 185 | + if (visitorMode) { | ||
| 186 | + bean['deviceId'] = DeviceUtil.clientId() | ||
| 187 | + bean['userName'] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string | ||
| 188 | + } | ||
| 189 | + | ||
| 179 | HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { | 190 | HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { |
| 180 | if (data.code != 0) { | 191 | if (data.code != 0) { |
| 181 | ToastUtils.showToast(data.message, 1000); | 192 | ToastUtils.showToast(data.message, 1000); |
| @@ -185,10 +196,9 @@ class CommentViewModel { | @@ -185,10 +196,9 @@ class CommentViewModel { | ||
| 185 | ToastUtils.showToast(data.message, 1000); | 196 | ToastUtils.showToast(data.message, 1000); |
| 186 | let model = data.data as commentItemModel | 197 | let model = data.data as commentItemModel |
| 187 | 198 | ||
| 188 | - let userId = HttpUtils.getUserId() | ||
| 189 | - let FIRSTCOMMENTTIME = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '') | 199 | + let firstCommentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, '') as string |
| 190 | 200 | ||
| 191 | - if (!userId && !FIRSTCOMMENTTIME) { | 201 | + if (visitorMode && firstCommentTime.length == 0) { |
| 192 | //保存首次评论时间 | 202 | //保存首次评论时间 |
| 193 | SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | 203 | SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, DateTimeUtils.formatDate(data.timestamp, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) |
| 194 | } | 204 | } |
| @@ -472,6 +482,36 @@ class CommentViewModel { | @@ -472,6 +482,36 @@ class CommentViewModel { | ||
| 472 | } | 482 | } |
| 473 | return false | 483 | return false |
| 474 | } | 484 | } |
| 485 | + | ||
| 486 | + jumpToAccountPage(commentItem: commentItemModel) { | ||
| 487 | + let url = HttpUrlUtils.getOtherUserDetailDataUrl() | ||
| 488 | + let item : Record<string, string >= { | ||
| 489 | + "creatorId": commentItem.fromCreatorId || "", | ||
| 490 | + "userType": `${commentItem.fromUserType}`, | ||
| 491 | + "userId": commentItem.fromUserId || "-1", | ||
| 492 | + } | ||
| 493 | + HttpBizUtil.post<ResponseDTO<MasterDetailRes>>(url, item).then((result) => { | ||
| 494 | + if (!result.data || result.data.mainControl != 1) { | ||
| 495 | + ToastUtils.longToast("暂时无法查看该创作者主页") | ||
| 496 | + return | ||
| 497 | + } | ||
| 498 | + | ||
| 499 | + if (result.data.banControl == 1) { | ||
| 500 | + ToastUtils.longToast("该账号已封禁,不予访问") | ||
| 501 | + return | ||
| 502 | + } | ||
| 503 | + | ||
| 504 | + if (result.data.userType === "1") { // 普通用户 | ||
| 505 | + let params: Record<string, string> = {'userId': result.data.userId}; | ||
| 506 | + WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) | ||
| 507 | + } else { // 非普通用户 | ||
| 508 | + ProcessUtils.gotoPeopleShipHomePage(result.data.creatorId) | ||
| 509 | + } | ||
| 510 | + | ||
| 511 | + }).catch(() => { | ||
| 512 | + ToastUtils.longToast("暂时无法查看该创作者主页") | ||
| 513 | + }) | ||
| 514 | + } | ||
| 475 | } | 515 | } |
| 476 | 516 | ||
| 477 | 517 |
sight_harmony/features/wdComponent/src/main/ets/components/likeAnimation/LikeAnimationView.ets
0 → 100644
| 1 | +/** | ||
| 2 | + * 直播页面点赞动画 | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +interface animationItem { | ||
| 6 | + x: string | number; | ||
| 7 | + y: string | number; | ||
| 8 | + opacity: number; | ||
| 9 | + name: string; | ||
| 10 | + key: string; | ||
| 11 | + url: Resource | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +@Component | ||
| 15 | +export struct LikeAnimationView { | ||
| 16 | + @State @Watch('countChange') count: number = 0 | ||
| 17 | + @State imgList: Resource[] = | ||
| 18 | + [$r('app.media.like_animation_1'), $r('app.media.like_animation_2'), $r('app.media.like_animation_3')] | ||
| 19 | + @State animationList: animationItem[] = [] | ||
| 20 | + | ||
| 21 | + countChange() { | ||
| 22 | + this.animationList.push({ | ||
| 23 | + name: 'xxxx', | ||
| 24 | + x: 0, | ||
| 25 | + y: 0, | ||
| 26 | + opacity: 1, | ||
| 27 | + key: Math.random() + '', | ||
| 28 | + url: this.getRandomUrl() | ||
| 29 | + | ||
| 30 | + }) | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + getRandomUrl(): Resource { | ||
| 34 | + if (Math.random() >= 0 && Math.random() >= 0.33) { | ||
| 35 | + return this.imgList[0] | ||
| 36 | + } else if (Math.random() >= 0.33 && Math.random() >= 0.66) { | ||
| 37 | + return this.imgList[1] | ||
| 38 | + } else { | ||
| 39 | + return this.imgList[2] | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + startAnimation() { | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + stopAnimation() { | ||
| 48 | + | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + aboutToAppear(): void { | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + aboutToDisappear(): void { | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + build() { | ||
| 58 | + Stack() { | ||
| 59 | + ForEach(this.animationList, (item: animationItem) => { | ||
| 60 | + Image(item.url) | ||
| 61 | + .width(48) | ||
| 62 | + .height(48) | ||
| 63 | + }, (item: animationItem) => item.key) | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + } | ||
| 67 | +} |
| 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | 2 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 3 | +import { PagePersonFunction } from './PagePersonFunction' | ||
| 3 | 4 | ||
| 4 | @Component | 5 | @Component |
| 5 | export default struct MinePagePersonFunctionUI { | 6 | export default struct MinePagePersonFunctionUI { |
| @@ -10,30 +11,7 @@ export default struct MinePagePersonFunctionUI { | @@ -10,30 +11,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 10 | Grid(){ | 11 | Grid(){ |
| 11 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ | 12 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ |
| 12 | GridItem(){ | 13 | GridItem(){ |
| 13 | - Row(){ | ||
| 14 | - Column(){ | ||
| 15 | - Image(item.imgSrc) | ||
| 16 | - .width('46lpx') | ||
| 17 | - .height('46lpx') | ||
| 18 | - .objectFit(ImageFit.Auto) | ||
| 19 | - .interpolation(ImageInterpolation.High) | ||
| 20 | - Text(`${item.msg}`) | ||
| 21 | - .margin({top:'8lpx'}) | ||
| 22 | - .height('23lpx') | ||
| 23 | - .fontColor($r('app.color.color_222222')) | ||
| 24 | - .fontSize('23lpx') | ||
| 25 | - } | ||
| 26 | - .alignItems(HorizontalAlign.Center) | ||
| 27 | - .width('100%') | ||
| 28 | - Blank() | ||
| 29 | - .layoutWeight(1) | ||
| 30 | - if(index % 4 < 3 && index != this.personalData.length-1){ | ||
| 31 | - Text().backgroundColor($r('app.color.color_222222')) | ||
| 32 | - .opacity(0.1) | ||
| 33 | - .width('2lpx') | ||
| 34 | - .height('29lpx') | ||
| 35 | - } | ||
| 36 | - } | 14 | + PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true}) |
| 37 | }.onClick(()=>{ | 15 | }.onClick(()=>{ |
| 38 | console.log(index+"") | 16 | console.log(index+"") |
| 39 | switch (item.msg){ | 17 | switch (item.msg){ |
| @@ -97,4 +75,5 @@ export default struct MinePagePersonFunctionUI { | @@ -97,4 +75,5 @@ export default struct MinePagePersonFunctionUI { | ||
| 97 | .height('234lpx') | 75 | .height('234lpx') |
| 98 | .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) | 76 | .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) |
| 99 | } | 77 | } |
| 100 | -} | ||
| 78 | +} | ||
| 79 | + |
| 1 | +import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct PagePersonFunction{ | ||
| 5 | + @ObjectLink item: MinePagePersonalFunctionsItem | ||
| 6 | + @State noDivider:boolean = false | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + Row(){ | ||
| 10 | + Column(){ | ||
| 11 | + Stack({ alignContent: Alignment.TopEnd }){ | ||
| 12 | + Image(this.item.imgSrc) | ||
| 13 | + .objectFit(ImageFit.Auto) | ||
| 14 | + .interpolation(ImageInterpolation.High) | ||
| 15 | + if (this.item.isShowRedPoint) { | ||
| 16 | + Button() | ||
| 17 | + .type(ButtonType.Circle) | ||
| 18 | + .width("12lpx") | ||
| 19 | + .height("12lpx") | ||
| 20 | + .backgroundColor($r('app.color.color_ED2800')) | ||
| 21 | + } | ||
| 22 | + }.width('46lpx') | ||
| 23 | + .height('46lpx') | ||
| 24 | + | ||
| 25 | + Text(`${this.item.msg}`) | ||
| 26 | + .margin({top:'8lpx'}) | ||
| 27 | + .height('23lpx') | ||
| 28 | + .fontColor($r('app.color.color_222222')) | ||
| 29 | + .fontSize('23lpx') | ||
| 30 | + } | ||
| 31 | + .alignItems(HorizontalAlign.Center) | ||
| 32 | + .width('100%') | ||
| 33 | + Blank() | ||
| 34 | + .layoutWeight(1) | ||
| 35 | + if(!this.noDivider){ | ||
| 36 | + Text().backgroundColor($r('app.color.color_222222')) | ||
| 37 | + .opacity(0.1) | ||
| 38 | + .width('2lpx') | ||
| 39 | + .height('29lpx') | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | +} |
| 1 | import { StringUtils, ToastUtils } from 'wdKit/Index' | 1 | import { StringUtils, ToastUtils } from 'wdKit/Index' |
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 3 | import { MessageItem } from '../../../viewmodel/MessageItem' | 4 | import { MessageItem } from '../../../viewmodel/MessageItem' |
| 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 5 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -86,6 +87,7 @@ export struct MessageListUI { | @@ -86,6 +87,7 @@ export struct MessageListUI { | ||
| 86 | ToastUtils.shortToast(index+"") | 87 | ToastUtils.shortToast(index+"") |
| 87 | switch (index) { | 88 | switch (index) { |
| 88 | case 0: //互动消息 | 89 | case 0: //互动消息 |
| 90 | + WDRouterRule.jumpWithPage(WDRouterPage.interactMessagePage) | ||
| 89 | break; | 91 | break; |
| 90 | case 1: //预约消息 | 92 | case 1: //预约消息 |
| 91 | break; | 93 | break; |
| 1 | 1 | ||
| 2 | -import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | 2 | +import InteractMessageViewModel from '../../viewmodel/InteractMessageViewModel'; |
| 3 | import PageModel from '../../viewmodel/PageModel'; | 3 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | import { CommonConstants, ViewType } from 'wdConstant' | 4 | import { CommonConstants, ViewType } from 'wdConstant' |
| 5 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' | 5 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' |
| 6 | -import { ContentDTO } from 'wdBean' | ||
| 7 | import NoMoreLayout from './NoMoreLayout' | 6 | import NoMoreLayout from './NoMoreLayout' |
| 8 | -import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 9 | -import { CustomSelectUI } from '../view/CustomSelectUI'; | ||
| 10 | -import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; | ||
| 11 | -import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 12 | - | ||
| 13 | import { CustomTitleUI } from '../reusable/CustomTitleUI'; | 7 | import { CustomTitleUI } from '../reusable/CustomTitleUI'; |
| 14 | -import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 15 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; | 8 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; |
| 9 | +import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel'; | ||
| 10 | +import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 16 | 11 | ||
| 17 | @Entry | 12 | @Entry |
| 18 | @Component | 13 | @Component |
| @@ -20,39 +15,40 @@ struct InteractMessagePage { | @@ -20,39 +15,40 @@ struct InteractMessagePage { | ||
| 20 | @State private browSingModel: PageModel = new PageModel() | 15 | @State private browSingModel: PageModel = new PageModel() |
| 21 | isloading : boolean = false | 16 | isloading : boolean = false |
| 22 | @Provide isEditState:boolean = false | 17 | @Provide isEditState:boolean = false |
| 23 | - @State allDatas :ContentDTO[] = []; | 18 | + @State allDatas :InteractMessageModel[] = []; |
| 24 | private scroller: Scroller = new Scroller(); | 19 | private scroller: Scroller = new Scroller(); |
| 25 | - @State likeNum: number = 20 | 20 | + @State likeNum: number = 0 |
| 21 | + @State currentPage: number = 1; | ||
| 26 | 22 | ||
| 27 | aboutToAppear(){ | 23 | aboutToAppear(){ |
| 28 | this.getData() | 24 | this.getData() |
| 25 | + this.getMessageLikeCount() | ||
| 29 | } | 26 | } |
| 30 | 27 | ||
| 31 | build() { | 28 | build() { |
| 32 | Column(){ | 29 | Column(){ |
| 33 | CustomTitleUI({titleName:'互动消息'}) | 30 | CustomTitleUI({titleName:'互动消息'}) |
| 34 | - this.ListLayout() | ||
| 35 | - // if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 36 | - // EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | ||
| 37 | - // }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 38 | - // EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | ||
| 39 | - // }else { | ||
| 40 | - // CustomPullToRefresh({ | ||
| 41 | - // alldata:this.allDatas, | ||
| 42 | - // scroller:this.scroller, | ||
| 43 | - // customList:()=>{ | ||
| 44 | - // this.ListLayout() | ||
| 45 | - // }, | ||
| 46 | - // onRefresh:(resolve)=>{ | ||
| 47 | - // this.browSingModel.currentPage = 0 | ||
| 48 | - // this.getData(resolve) | ||
| 49 | - // }, | ||
| 50 | - // onLoadMore:(resolve)=> { | ||
| 51 | - // this.browSingModel.currentPage++ | ||
| 52 | - // this.getData() | ||
| 53 | - // } | ||
| 54 | - // }) | ||
| 55 | - // } | 31 | + if(this.browSingModel.viewType == ViewType.ERROR){ |
| 32 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | ||
| 33 | + }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 34 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) | ||
| 35 | + }else { | ||
| 36 | + CustomPullToRefresh({ | ||
| 37 | + alldata:this.allDatas, | ||
| 38 | + scroller:this.scroller, | ||
| 39 | + customList:()=>{ | ||
| 40 | + this.ListLayout() | ||
| 41 | + }, | ||
| 42 | + onRefresh:(resolve)=>{ | ||
| 43 | + this.browSingModel.currentPage = 0 | ||
| 44 | + this.getData(resolve) | ||
| 45 | + }, | ||
| 46 | + onLoadMore:(resolve)=> { | ||
| 47 | + this.browSingModel.currentPage++ | ||
| 48 | + this.getData() | ||
| 49 | + } | ||
| 50 | + }) | ||
| 51 | + } | ||
| 56 | 52 | ||
| 57 | } | 53 | } |
| 58 | .width(CommonConstants.FULL_WIDTH) | 54 | .width(CommonConstants.FULL_WIDTH) |
| @@ -66,9 +62,9 @@ struct InteractMessagePage { | @@ -66,9 +62,9 @@ struct InteractMessagePage { | ||
| 66 | } | 62 | } |
| 67 | 63 | ||
| 68 | // 下拉刷新 | 64 | // 下拉刷新 |
| 69 | - ForEach(this.allDatas, (compDTO: ContentDTO, compIndex: number) => { | 65 | + ForEach(this.allDatas, (InteractM: InteractMessageModel, compIndex: number) => { |
| 70 | ListItem() { | 66 | ListItem() { |
| 71 | - InteractMComponent() | 67 | + InteractMComponent({messageModel:InteractM}) |
| 72 | } | 68 | } |
| 73 | }) | 69 | }) |
| 74 | // 加载更多 | 70 | // 加载更多 |
| @@ -112,12 +108,22 @@ struct InteractMessagePage { | @@ -112,12 +108,22 @@ struct InteractMessagePage { | ||
| 112 | } | 108 | } |
| 113 | 109 | ||
| 114 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ | 110 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ |
| 115 | - MyCollectionViewModel.fetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(collectionItem => { | 111 | + InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => { |
| 116 | if(resolve) resolve('刷新成功') | 112 | if(resolve) resolve('刷新成功') |
| 117 | - if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | 113 | + if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) { |
| 118 | this.browSingModel.viewType = ViewType.LOADED; | 114 | this.browSingModel.viewType = ViewType.LOADED; |
| 119 | - this.allDatas.push(...collectionItem.list) | ||
| 120 | - if (collectionItem.list.length === this.browSingModel.pageSize) { | 115 | + |
| 116 | + if (this.currentPage === 1) { | ||
| 117 | + this.allDatas = [] | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + for (let index = 0; index < InteractMessageMItem.list.length; index++) { | ||
| 121 | + const element = InteractMessageMItem.list[index]; | ||
| 122 | + element.InteractMsubM = JSON.parse(element.remark) | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + this.allDatas.push(...InteractMessageMItem.list) | ||
| 126 | + if (InteractMessageMItem.list.length === this.browSingModel.pageSize) { | ||
| 121 | this.browSingModel.currentPage++; | 127 | this.browSingModel.currentPage++; |
| 122 | this.browSingModel.hasMore = true; | 128 | this.browSingModel.hasMore = true; |
| 123 | } else { | 129 | } else { |
| @@ -129,4 +135,11 @@ struct InteractMessagePage { | @@ -129,4 +135,11 @@ struct InteractMessagePage { | ||
| 129 | }) | 135 | }) |
| 130 | } | 136 | } |
| 131 | 137 | ||
| 138 | + async getMessageLikeCount(){ | ||
| 139 | + InteractMessageViewModel.getMessageLikeCount().then(num => { | ||
| 140 | + this.likeNum = num | ||
| 141 | + }) | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + | ||
| 132 | } | 145 | } |
| @@ -53,8 +53,25 @@ export struct MinePageComponent { | @@ -53,8 +53,25 @@ export struct MinePageComponent { | ||
| 53 | this.getUserLogin() | 53 | this.getUserLogin() |
| 54 | this.getFunctionData() | 54 | this.getFunctionData() |
| 55 | this.addLoginStatusObserver() | 55 | this.addLoginStatusObserver() |
| 56 | + this.getMessageData() | ||
| 56 | } | 57 | } |
| 57 | 58 | ||
| 59 | + getMessageData(){ | ||
| 60 | + MinePageDatasModel.getMessageUnReadData().then((value) => { | ||
| 61 | + if(value !=null) { | ||
| 62 | + if(value.activeCount >0 ||value.subscribeCount > 0 || value.systemCount > 0){ | ||
| 63 | + this.personalData.forEach((value) => { | ||
| 64 | + if(value.msg == "消息") | ||
| 65 | + value.isShowRedPoint = true | ||
| 66 | + }) | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | + }).catch((err: Error) => { | ||
| 70 | + console.log(TAG, JSON.stringify(err)) | ||
| 71 | + }) | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + | ||
| 58 | async addLoginStatusObserver(){ | 75 | async addLoginStatusObserver(){ |
| 59 | this.preferences = await SPHelper.default.getPreferences(); | 76 | this.preferences = await SPHelper.default.getPreferences(); |
| 60 | this.preferences.on('change', this.observer); | 77 | this.preferences.on('change', this.observer); |
| @@ -21,6 +21,7 @@ const TAG = 'PageComponent'; | @@ -21,6 +21,7 @@ const TAG = 'PageComponent'; | ||
| 21 | export struct PageComponent { | 21 | export struct PageComponent { |
| 22 | @State private pageModel: PageModel = new PageModel(); | 22 | @State private pageModel: PageModel = new PageModel(); |
| 23 | @State private pageAdvModel: PageAdModel = new PageAdModel(); | 23 | @State private pageAdvModel: PageAdModel = new PageAdModel(); |
| 24 | + @State timer: number = -1 | ||
| 24 | navIndex: number = 0; | 25 | navIndex: number = 0; |
| 25 | pageId: string = ""; | 26 | pageId: string = ""; |
| 26 | channelId: string = ""; | 27 | channelId: string = ""; |
| @@ -29,6 +30,7 @@ export struct PageComponent { | @@ -29,6 +30,7 @@ export struct PageComponent { | ||
| 29 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 | 30 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 |
| 30 | private listScroller: Scroller = new Scroller(); | 31 | private listScroller: Scroller = new Scroller(); |
| 31 | needload: boolean = true; | 32 | needload: boolean = true; |
| 33 | + | ||
| 32 | build() { | 34 | build() { |
| 33 | Column() { | 35 | Column() { |
| 34 | if (this.pageModel.viewType == ViewType.LOADING) { | 36 | if (this.pageModel.viewType == ViewType.LOADING) { |
| @@ -222,9 +224,10 @@ export struct PageComponent { | @@ -222,9 +224,10 @@ export struct PageComponent { | ||
| 222 | } | 224 | } |
| 223 | 225 | ||
| 224 | onChange() { | 226 | onChange() { |
| 225 | - Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); | 227 | + Logger.info(TAG, |
| 228 | + `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 226 | if (this.navIndex === this.currentTopNavSelectedIndex) { | 229 | if (this.navIndex === this.currentTopNavSelectedIndex) { |
| 227 | - if(this.needload){ | 230 | + if (this.needload) { |
| 228 | this.getData(); | 231 | this.getData(); |
| 229 | } | 232 | } |
| 230 | this.needload = false; | 233 | this.needload = false; |
| @@ -242,13 +245,19 @@ export struct PageComponent { | @@ -242,13 +245,19 @@ export struct PageComponent { | ||
| 242 | } | 245 | } |
| 243 | 246 | ||
| 244 | async getData() { | 247 | async getData() { |
| 245 | - Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 246 | - this.pageModel.pageId = this.pageId; | ||
| 247 | - this.pageModel.groupId = this.pageId; | ||
| 248 | - this.pageModel.channelId = this.channelId; | ||
| 249 | - this.pageModel.currentPage = 1; | ||
| 250 | - this.pageModel.pageTotalCompSize = 0; | ||
| 251 | - PageHelper.getInitData(this.pageModel, this.pageAdvModel) | 248 | + if (this.timer) { |
| 249 | + clearTimeout(this.timer) | ||
| 250 | + } | ||
| 251 | + this.timer = setTimeout(() => { | ||
| 252 | + Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 253 | + this.pageModel.pageId = this.pageId; | ||
| 254 | + this.pageModel.groupId = this.pageId; | ||
| 255 | + this.pageModel.channelId = this.channelId; | ||
| 256 | + this.pageModel.currentPage = 1; | ||
| 257 | + this.pageModel.pageTotalCompSize = 0; | ||
| 258 | + PageHelper.getInitData(this.pageModel, this.pageAdvModel) | ||
| 259 | + }, 100) | ||
| 260 | + | ||
| 252 | } | 261 | } |
| 253 | } | 262 | } |
| 254 | 263 |
| 1 | +import { insightIntent } from '@kit.IntentsKit'; | ||
| 1 | import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; | 2 | import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; |
| 2 | import { SpConstants } from 'wdConstant'; | 3 | import { SpConstants } from 'wdConstant'; |
| 3 | import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; | 4 | import { DisplayUtils, LazyDataSource, Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit'; |
| @@ -8,6 +9,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | @@ -8,6 +9,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | ||
| 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; | 9 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; |
| 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | 10 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; |
| 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; | 11 | import { channelSkeleton } from '../skeleton/channelSkeleton'; |
| 12 | +import { common } from '@kit.AbilityKit'; | ||
| 11 | 13 | ||
| 12 | 14 | ||
| 13 | const TAG = 'TopNavigationComponent'; | 15 | const TAG = 'TopNavigationComponent'; |
| @@ -37,6 +39,7 @@ export struct TopNavigationComponent { | @@ -37,6 +39,7 @@ export struct TopNavigationComponent { | ||
| 37 | // 顶导当前选中/焦点下标 | 39 | // 顶导当前选中/焦点下标 |
| 38 | @State currentTopNavSelectedIndex: number = 0; | 40 | @State currentTopNavSelectedIndex: number = 0; |
| 39 | @State currentTopNavName: string = ''; | 41 | @State currentTopNavName: string = ''; |
| 42 | + @State currentTopNavItem: TopNavDTO = {} as TopNavDTO | ||
| 40 | // 顶导数据 | 43 | // 顶导数据 |
| 41 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 44 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 42 | @State compList: LazyDataSource<CompDTO> = new LazyDataSource(); | 45 | @State compList: LazyDataSource<CompDTO> = new LazyDataSource(); |
| @@ -58,6 +61,8 @@ export struct TopNavigationComponent { | @@ -58,6 +61,8 @@ export struct TopNavigationComponent { | ||
| 58 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 | 61 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 |
| 59 | // 传递给page的自动刷新通知 | 62 | // 传递给page的自动刷新通知 |
| 60 | @State autoRefresh2Page: number = 0 | 63 | @State autoRefresh2Page: number = 0 |
| 64 | + //保存当前导航选中时的时间戳 意图开始时间 | ||
| 65 | + @State executedStartTime: number = new Date().getTime() | ||
| 61 | // 当前底导index | 66 | // 当前底导index |
| 62 | @State navIndex: number = 0 | 67 | @State navIndex: number = 0 |
| 63 | @State animationDuration: number = 0 | 68 | @State animationDuration: number = 0 |
| @@ -167,6 +172,7 @@ export struct TopNavigationComponent { | @@ -167,6 +172,7 @@ export struct TopNavigationComponent { | ||
| 167 | this.currentTopNavSelectedIndex = index | 172 | this.currentTopNavSelectedIndex = index |
| 168 | this.currentTopNavName = this.myChannelList[index].name | 173 | this.currentTopNavName = this.myChannelList[index].name |
| 169 | } | 174 | } |
| 175 | + this.currentTopNavItem = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 170 | } | 176 | } |
| 171 | 177 | ||
| 172 | isBroadcast(item: TopNavDTO) { | 178 | isBroadcast(item: TopNavDTO) { |
| @@ -184,6 +190,49 @@ export struct TopNavigationComponent { | @@ -184,6 +190,49 @@ export struct TopNavigationComponent { | ||
| 184 | return item.channelType === 3 | 190 | return item.channelType === 3 |
| 185 | } | 191 | } |
| 186 | 192 | ||
| 193 | + //意图共享 | ||
| 194 | + topNavInsightIntentShare(item: TopNavDTO){ | ||
| 195 | + let tapNavIntent: insightIntent.InsightIntent = { | ||
| 196 | + intentName: 'ViewColumn', | ||
| 197 | + intentVersion: '1.0.1', | ||
| 198 | + identifier: '52dac3b0-6520-4974-81e5-25f0879449b5', | ||
| 199 | + intentActionInfo: { | ||
| 200 | + actionMode: 'EXPECTED', | ||
| 201 | + currentPercentage: 50, | ||
| 202 | + executedTimeSlots: { | ||
| 203 | + executedEndTime: new Date().getTime(), | ||
| 204 | + executedStartTime: this.executedStartTime | ||
| 205 | + } | ||
| 206 | + }, | ||
| 207 | + intentEntityInfo: { | ||
| 208 | + entityName: 'ViewColumn', | ||
| 209 | + entityId: String(item.pageId) || '', | ||
| 210 | + displayName: item.name, | ||
| 211 | + logoURL: 'https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png', | ||
| 212 | + rankingHint: 99, | ||
| 213 | + isPublicData: true | ||
| 214 | + } | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + try { | ||
| 218 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 219 | + // 共享数据 | ||
| 220 | + insightIntent.shareIntent(context, [tapNavIntent], (error) => { | ||
| 221 | + if (error?.code) { | ||
| 222 | + // 处理业务逻辑错误 | ||
| 223 | + console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 224 | + return; | ||
| 225 | + } | ||
| 226 | + // 执行正常业务 | ||
| 227 | + console.log('shareIntent succeed'); | ||
| 228 | + }); | ||
| 229 | + } catch (error) { | ||
| 230 | + // 处理异常 | ||
| 231 | + console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 232 | + } | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + | ||
| 187 | build() { | 236 | build() { |
| 188 | Column() { | 237 | Column() { |
| 189 | // 顶部搜索、日报logo、早晚报 | 238 | // 顶部搜索、日报logo、早晚报 |
| @@ -278,7 +327,11 @@ export struct TopNavigationComponent { | @@ -278,7 +327,11 @@ export struct TopNavigationComponent { | ||
| 278 | if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) && | 327 | if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) && |
| 279 | !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) | 328 | !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) |
| 280 | ) { | 329 | ) { |
| 330 | + //在 tab 切换之前意图共享 | ||
| 331 | + // this.topNavInsightIntentShare(this.currentTopNavItem) | ||
| 332 | + | ||
| 281 | this.currentTopNavSelectedIndex = index; | 333 | this.currentTopNavSelectedIndex = index; |
| 334 | + this.currentTopNavItem = this.myChannelList[index] | ||
| 282 | } | 335 | } |
| 283 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 336 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 284 | // 跳转到播报页面 | 337 | // 跳转到播报页面 |
| @@ -416,9 +469,11 @@ export struct TopNavigationComponent { | @@ -416,9 +469,11 @@ export struct TopNavigationComponent { | ||
| 416 | this.changeByClick = true | 469 | this.changeByClick = true |
| 417 | this.tabsController.changeIndex(index) | 470 | this.tabsController.changeIndex(index) |
| 418 | } | 471 | } |
| 472 | + | ||
| 419 | }) | 473 | }) |
| 420 | } | 474 | } |
| 421 | 475 | ||
| 476 | + | ||
| 422 | aboutToAppear() { | 477 | aboutToAppear() { |
| 423 | //处理新闻tab顶导频道数据 | 478 | //处理新闻tab顶导频道数据 |
| 424 | this.topNavListHandle() | 479 | this.topNavListHandle() |
| @@ -86,7 +86,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -86,7 +86,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 86 | 86 | ||
| 87 | // 加载更多 | 87 | // 加载更多 |
| 88 | ListItem() { | 88 | ListItem() { |
| 89 | - if (this.hasMore) { | 89 | + if (this.hasMore && this.arr && this.arr.length > 0) { |
| 90 | LoadMoreLayout({ isVisible: this.hasMore }) | 90 | LoadMoreLayout({ isVisible: this.hasMore }) |
| 91 | } else if (!this.hasMore && !this.isLoading) { | 91 | } else if (!this.hasMore && !this.isLoading) { |
| 92 | PeopleShipNoMoreData() | 92 | PeopleShipNoMoreData() |
| @@ -43,9 +43,8 @@ export struct PeopleShipHomePageNavComponent { | @@ -43,9 +43,8 @@ export struct PeopleShipHomePageNavComponent { | ||
| 43 | }).onClick(()=>{ | 43 | }).onClick(()=>{ |
| 44 | let params = { | 44 | let params = { |
| 45 | 'headPhotoUrl': this.detailModel.headPhotoUrl, | 45 | 'headPhotoUrl': this.detailModel.headPhotoUrl, |
| 46 | - 'headType': '1' | ||
| 47 | } as Record<string, string>; | 46 | } as Record<string, string>; |
| 48 | - WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) | 47 | + WDRouterRule.jumpWithPage(WDRouterPage.showHomePageHeaderPage,params) |
| 49 | }).margin({ | 48 | }).margin({ |
| 50 | left: '10vp', | 49 | left: '10vp', |
| 51 | }) | 50 | }) |
| @@ -56,9 +56,8 @@ export struct PeopleShipHomePageTopComponent { | @@ -56,9 +56,8 @@ export struct PeopleShipHomePageTopComponent { | ||
| 56 | }).onClick(() => { | 56 | }).onClick(() => { |
| 57 | let params = { | 57 | let params = { |
| 58 | 'headPhotoUrl': this.detailModel.headPhotoUrl, | 58 | 'headPhotoUrl': this.detailModel.headPhotoUrl, |
| 59 | - 'headType': '1' | ||
| 60 | } as Record<string, string>; | 59 | } as Record<string, string>; |
| 61 | - WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage, params) | 60 | + WDRouterRule.jumpWithPage(WDRouterPage.showHomePageHeaderPage, params) |
| 62 | }) | 61 | }) |
| 63 | 62 | ||
| 64 | 63 | ||
| @@ -369,7 +368,11 @@ export struct PeopleShipHomePageTopComponent { | @@ -369,7 +368,11 @@ export struct PeopleShipHomePageTopComponent { | ||
| 369 | 368 | ||
| 370 | private computeShowNum(count: number) { | 369 | private computeShowNum(count: number) { |
| 371 | if (count >= 10000) { | 370 | if (count >= 10000) { |
| 372 | - return `${(count / 10000).toFixed(1)}万` | 371 | + let num = ( count / 10000).toFixed(1) |
| 372 | + if (Number(num.substring(num.length-1)) == 0) { | ||
| 373 | + num = num.substring(0, num.length-2) | ||
| 374 | + } | ||
| 375 | + return num + '万' | ||
| 373 | } | 376 | } |
| 374 | return `${count}` | 377 | return `${count}` |
| 375 | } | 378 | } |
| @@ -96,7 +96,7 @@ struct ReserveMorePage { | @@ -96,7 +96,7 @@ struct ReserveMorePage { | ||
| 96 | ) | 96 | ) |
| 97 | // 加载更多 | 97 | // 加载更多 |
| 98 | ListItem() { | 98 | ListItem() { |
| 99 | - if (this.hasMore) { | 99 | + if (this.hasMore && this.data && this.data.totalCount() > 0) { |
| 100 | LoadMoreLayout({ isVisible: this.hasMore }) | 100 | LoadMoreLayout({ isVisible: this.hasMore }) |
| 101 | } else if (!this.hasMore && !this.isLoading) { | 101 | } else if (!this.hasMore && !this.isLoading) { |
| 102 | PeopleShipNoMoreData() | 102 | PeopleShipNoMoreData() |
| @@ -127,7 +127,7 @@ struct ReserveMorePage { | @@ -127,7 +127,7 @@ struct ReserveMorePage { | ||
| 127 | buildItem(item: ContentDTO, index: number) { | 127 | buildItem(item: ContentDTO, index: number) { |
| 128 | Column() { | 128 | Column() { |
| 129 | Stack() { | 129 | Stack() { |
| 130 | - Image(item.fullColumnImgUrls[0].url) | 130 | + Image(item.fullColumnImgUrls[0]?.url) |
| 131 | .width('100%') | 131 | .width('100%') |
| 132 | .height(196) | 132 | .height(196) |
| 133 | .borderRadius(4) | 133 | .borderRadius(4) |
| @@ -139,8 +139,9 @@ struct ReserveMorePage { | @@ -139,8 +139,9 @@ struct ReserveMorePage { | ||
| 139 | Text(item.newsTitle) | 139 | Text(item.newsTitle) |
| 140 | .fontSize(17) | 140 | .fontSize(17) |
| 141 | .maxLines(2) | 141 | .maxLines(2) |
| 142 | + .lineHeight(25) | ||
| 142 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 143 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 143 | - .margin({ top: 16, left: 12, right: 12 }) | 144 | + .margin({ top: 4, left: 12, right: 12 }) |
| 144 | .alignSelf(ItemAlign.Start) | 145 | .alignSelf(ItemAlign.Start) |
| 145 | Row() { | 146 | Row() { |
| 146 | Row() { | 147 | Row() { |
| @@ -148,6 +149,7 @@ struct ReserveMorePage { | @@ -148,6 +149,7 @@ struct ReserveMorePage { | ||
| 148 | .width(20) | 149 | .width(20) |
| 149 | .height(20) | 150 | .height(20) |
| 150 | .margin({ left: 10, top: 2, bottom: 2, right: 6 }) | 151 | .margin({ left: 10, top: 2, bottom: 2, right: 6 }) |
| 152 | + | ||
| 151 | // Text(DateTimeUtils.formatDate(item.liveInfo.liveStartTime, "MM月dd日 HH:mm")) | 153 | // Text(DateTimeUtils.formatDate(item.liveInfo.liveStartTime, "MM月dd日 HH:mm")) |
| 152 | Text(this.getReserveDate(item.liveInfo.liveStartTime, 1)) | 154 | Text(this.getReserveDate(item.liveInfo.liveStartTime, 1)) |
| 153 | .fontSize(12) | 155 | .fontSize(12) |
| @@ -256,6 +258,9 @@ struct ReserveMorePage { | @@ -256,6 +258,9 @@ struct ReserveMorePage { | ||
| 256 | .height(24) | 258 | .height(24) |
| 257 | .objectFit(ImageFit.Auto) | 259 | .objectFit(ImageFit.Auto) |
| 258 | .id("back_icon") | 260 | .id("back_icon") |
| 261 | + .margin({ | ||
| 262 | + left: '16vp' | ||
| 263 | + }) | ||
| 259 | .alignRules({ | 264 | .alignRules({ |
| 260 | center: { anchor: "__container__", align: VerticalAlign.Center }, | 265 | center: { anchor: "__container__", align: VerticalAlign.Center }, |
| 261 | left: { anchor: "__container__", align: HorizontalAlign.Start } | 266 | left: { anchor: "__container__", align: HorizontalAlign.Start } |
| @@ -267,10 +272,10 @@ struct ReserveMorePage { | @@ -267,10 +272,10 @@ struct ReserveMorePage { | ||
| 267 | Text(this.title)// .height('42lpx') | 272 | Text(this.title)// .height('42lpx') |
| 268 | .maxLines(1) | 273 | .maxLines(1) |
| 269 | .id("title") | 274 | .id("title") |
| 270 | - .fontSize('35lpx') | 275 | + .fontSize('18vp') |
| 271 | .fontWeight(400) | 276 | .fontWeight(400) |
| 272 | .fontColor($r('app.color.color_222222')) | 277 | .fontColor($r('app.color.color_222222')) |
| 273 | - .lineHeight('42lpx') | 278 | + .lineHeight('22vp') |
| 274 | .alignRules({ | 279 | .alignRules({ |
| 275 | center: { anchor: "__container__", align: VerticalAlign.Center }, | 280 | center: { anchor: "__container__", align: VerticalAlign.Center }, |
| 276 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 281 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| @@ -284,11 +289,14 @@ struct ReserveMorePage { | @@ -284,11 +289,14 @@ struct ReserveMorePage { | ||
| 284 | @Builder | 289 | @Builder |
| 285 | LiveImage() { | 290 | LiveImage() { |
| 286 | Row() { | 291 | Row() { |
| 287 | - Image($r('app.media.reserve_icon')) | ||
| 288 | - .width(22) | ||
| 289 | - .height(18) | 292 | + Image($r('app.media.reserve_new_icon')) |
| 293 | + .width(14) | ||
| 294 | + .height(14) | ||
| 295 | + .margin({ | ||
| 296 | + right: 3 | ||
| 297 | + }) | ||
| 290 | Text('预约') | 298 | Text('预约') |
| 291 | - .fontSize('11fp') | 299 | + .fontSize('12vp') |
| 292 | .fontWeight(400) | 300 | .fontWeight(400) |
| 293 | .fontColor(Color.White) | 301 | .fontColor(Color.White) |
| 294 | } | 302 | } |
| @@ -131,10 +131,8 @@ export struct SearchResultComponent { | @@ -131,10 +131,8 @@ export struct SearchResultComponent { | ||
| 131 | .barWidth('100%') | 131 | .barWidth('100%') |
| 132 | .barHeight('84lpx') | 132 | .barHeight('84lpx') |
| 133 | .animationDuration(0) | 133 | .animationDuration(0) |
| 134 | - .onChange((index: number) => { | ||
| 135 | - this.currentIndex = index | ||
| 136 | - }) | ||
| 137 | .width('100%') | 134 | .width('100%') |
| 135 | + .scrollable(false) | ||
| 138 | .layoutWeight(1) | 136 | .layoutWeight(1) |
| 139 | } | 137 | } |
| 140 | }.width('100%') | 138 | }.width('100%') |
| @@ -15,7 +15,7 @@ export struct CustomBottomFuctionUI { | @@ -15,7 +15,7 @@ export struct CustomBottomFuctionUI { | ||
| 15 | .height('20') | 15 | .height('20') |
| 16 | .margin({right:'31lpx' }) | 16 | .margin({right:'31lpx' }) |
| 17 | 17 | ||
| 18 | - Text(this.isAllSelect?'取消':'全选') | 18 | + Text(this.isAllSelect?'取消全选':'全选') |
| 19 | .fontColor($r('app.color.color_222222')) | 19 | .fontColor($r('app.color.color_222222')) |
| 20 | .backgroundColor(Color.White) | 20 | .backgroundColor(Color.White) |
| 21 | } | 21 | } |
| @@ -22,7 +22,7 @@ export struct LikeComponent { | @@ -22,7 +22,7 @@ export struct LikeComponent { | ||
| 22 | @Prop data: Record<string, string> | 22 | @Prop data: Record<string, string> |
| 23 | enableBtn = true | 23 | enableBtn = true |
| 24 | componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 | 24 | componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 |
| 25 | - styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | 25 | + styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景 |
| 26 | @State likeCount: number = 0 //点赞数 | 26 | @State likeCount: number = 0 //点赞数 |
| 27 | 27 | ||
| 28 | //上层传值 样例 | 28 | //上层传值 样例 |
| @@ -50,6 +50,7 @@ export struct LikeComponent { | @@ -50,6 +50,7 @@ export struct LikeComponent { | ||
| 50 | //2: 新闻页中间位置样式 | 50 | //2: 新闻页中间位置样式 |
| 51 | this.likeCompStyle2() | 51 | this.likeCompStyle2() |
| 52 | } else if (this.componentType == 3) { | 52 | } else if (this.componentType == 3) { |
| 53 | + //卡片底部互动样式 | ||
| 53 | this.likeCompStyle3() | 54 | this.likeCompStyle3() |
| 54 | } else if (this.componentType == 4) { | 55 | } else if (this.componentType == 4) { |
| 55 | // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 | 56 | // 直播,点赞按钮底测有灰色圆角背景+右上点赞数量 |
| @@ -67,7 +68,7 @@ export struct LikeComponent { | @@ -67,7 +68,7 @@ export struct LikeComponent { | ||
| 67 | if (this.likesStyle === 1) { | 68 | if (this.likesStyle === 1) { |
| 68 | return { | 69 | return { |
| 69 | url: this.likeStatus ? $r(`app.media.ic_like_check`) : | 70 | url: this.likeStatus ? $r(`app.media.ic_like_check`) : |
| 70 | - this.styleType == 1 ? $r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`), | 71 | + this.styleType == 1 ? this.componentType == 3?$r(`app.media.CarderInteraction_like`):$r('app.media.icon_like_default') : $r(`app.media.ic_like_uncheck`), |
| 71 | name: '赞' | 72 | name: '赞' |
| 72 | } | 73 | } |
| 73 | } else if (this.likesStyle === 2) { | 74 | } else if (this.likesStyle === 2) { |
| @@ -133,8 +134,8 @@ export struct LikeComponent { | @@ -133,8 +134,8 @@ export struct LikeComponent { | ||
| 133 | Image(this.transLikeStyle().url) | 134 | Image(this.transLikeStyle().url) |
| 134 | .width(18) | 135 | .width(18) |
| 135 | .height(18) | 136 | .height(18) |
| 136 | - // Text(this.likeStatus ? '已赞' : '点赞') | ||
| 137 | - Text(this.likeCount > 0 ? this.likeCount.toString() : '点赞') | 137 | + Text(this.likeStatus ? '已赞' : '点赞') |
| 138 | + // Text(this.likeCount > 0 ? this.likeCount.toString() : '点赞') | ||
| 138 | .margin({ left: 4 }) | 139 | .margin({ left: 4 }) |
| 139 | .fontSize(14) | 140 | .fontSize(14) |
| 140 | .fontColor(this.likeStatus ? '#ED2800' : '#666666') | 141 | .fontColor(this.likeStatus ? '#ED2800' : '#666666') |
| @@ -59,6 +59,7 @@ export struct OperRowListView { | @@ -59,6 +59,7 @@ export struct OperRowListView { | ||
| 59 | * 7:图集详情页 | 59 | * 7:图集详情页 |
| 60 | */ | 60 | */ |
| 61 | @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 | 61 | @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 |
| 62 | + @Prop pageComponentType: number = -1 //1:视频详情页 | ||
| 62 | @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 63 | @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 63 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 | 64 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 |
| 64 | @State needLike: boolean = true | 65 | @State needLike: boolean = true |
| @@ -115,6 +116,8 @@ export struct OperRowListView { | @@ -115,6 +116,8 @@ export struct OperRowListView { | ||
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | build() { | 118 | build() { |
| 119 | + // 视频详情页 | ||
| 120 | + | ||
| 118 | Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { | 121 | Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { |
| 119 | // AudioDialog() | 122 | // AudioDialog() |
| 120 | Row() { | 123 | Row() { |
| @@ -162,6 +165,7 @@ export struct OperRowListView { | @@ -162,6 +165,7 @@ export struct OperRowListView { | ||
| 162 | bottom: `${this.bottomSafeHeight}px` | 165 | bottom: `${this.bottomSafeHeight}px` |
| 163 | // bottom: 50 | 166 | // bottom: 50 |
| 164 | }) | 167 | }) |
| 168 | + | ||
| 165 | } | 169 | } |
| 166 | 170 | ||
| 167 | /** | 171 | /** |
| @@ -174,12 +178,16 @@ export struct OperRowListView { | @@ -174,12 +178,16 @@ export struct OperRowListView { | ||
| 174 | CommentTabComponent({ | 178 | CommentTabComponent({ |
| 175 | publishCommentModel: this.publishCommentModel, | 179 | publishCommentModel: this.publishCommentModel, |
| 176 | contentDetail: this.contentDetailData, | 180 | contentDetail: this.contentDetailData, |
| 177 | - onCommentFocus: this.onCommentFocus | 181 | + onCommentFocus: this.onCommentFocus, |
| 182 | + pageComponentType: this.pageComponentType | ||
| 178 | }) | 183 | }) |
| 179 | } | 184 | } |
| 180 | } | 185 | } |
| 181 | - .flexShrink(1) | ||
| 182 | - | 186 | + .layoutWeight(1) |
| 187 | + .margin({ | ||
| 188 | + right: this.pageComponentType === 1 ? 16 : 0, | ||
| 189 | + }) | ||
| 190 | + | ||
| 183 | if (this.showCommentIcon) { | 191 | if (this.showCommentIcon) { |
| 184 | Column() { | 192 | Column() { |
| 185 | if (this.publishCommentModel?.targetId) { | 193 | if (this.publishCommentModel?.targetId) { |
| @@ -330,6 +338,8 @@ export struct OperRowListView { | @@ -330,6 +338,8 @@ export struct OperRowListView { | ||
| 330 | contentList: [{ | 338 | contentList: [{ |
| 331 | contentId: this.contentDetailData?.newsId + '', | 339 | contentId: this.contentDetailData?.newsId + '', |
| 332 | contentType: this.contentDetailData?.newsType + '', | 340 | contentType: this.contentDetailData?.newsType + '', |
| 341 | + relType:this.contentDetailData?.reLInfo?.relType + '', | ||
| 342 | + contentRelId:this.contentDetailData?.reLInfo?.relId + '', | ||
| 333 | }], | 343 | }], |
| 334 | 344 | ||
| 335 | } | 345 | } |
| @@ -2,6 +2,8 @@ import { Action, NewspaperListBean, NewspaperListItemBean, NewspaperPositionItem | @@ -2,6 +2,8 @@ import { Action, NewspaperListBean, NewspaperListItemBean, NewspaperPositionItem | ||
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 3 | import { WDRouterRule } from 'wdRouter/Index' | 3 | import { WDRouterRule } from 'wdRouter/Index' |
| 4 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' | 4 | import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' |
| 5 | +import { Logger } from 'wdKit'; | ||
| 6 | +import { window } from '@kit.ArkUI'; | ||
| 5 | 7 | ||
| 6 | /** | 8 | /** |
| 7 | * 读报纸半屏弹窗 | 9 | * 读报纸半屏弹窗 |
| @@ -35,6 +37,12 @@ export struct ENewspaperListDialog { | @@ -35,6 +37,12 @@ export struct ENewspaperListDialog { | ||
| 35 | // listDialogController: CustomDialogController | 37 | // listDialogController: CustomDialogController |
| 36 | public closeDialog?: () => void | 38 | public closeDialog?: () => void |
| 37 | 39 | ||
| 40 | + // 手势滑动相关 | ||
| 41 | + private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down }) | ||
| 42 | + private topFixedHeight = 124 | ||
| 43 | + @State topHeight: number = 124 | ||
| 44 | + private deviceHeight: number = 0 | ||
| 45 | + | ||
| 38 | //watch监听报纸页码回调 | 46 | //watch监听报纸页码回调 |
| 39 | onCurrentPageNumUpdated(): void { | 47 | onCurrentPageNumUpdated(): void { |
| 40 | console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | 48 | console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) |
| @@ -46,7 +54,13 @@ export struct ENewspaperListDialog { | @@ -46,7 +54,13 @@ export struct ENewspaperListDialog { | ||
| 46 | } | 54 | } |
| 47 | } | 55 | } |
| 48 | 56 | ||
| 49 | - aboutToAppear(): void { | 57 | + async aboutToAppear() { |
| 58 | + // 屏幕高度 - 滑动高度计算 | ||
| 59 | + let windowClass: window.Window = await window.getLastWindow(getContext(this)); | ||
| 60 | + let changeHeight = 85 + 44 + px2vp(windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) | ||
| 61 | + changeHeight += px2vp(windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | ||
| 62 | + this.deviceHeight = px2vp(windowClass.getWindowProperties().windowRect.height) - changeHeight | ||
| 63 | + | ||
| 50 | this.isCurrentViewOpen = true | 64 | this.isCurrentViewOpen = true |
| 51 | console.log("ENewspaperListDialog-aboutToAppear", "currentPageNum:", this.currentPageNum) | 65 | console.log("ENewspaperListDialog-aboutToAppear", "currentPageNum:", this.currentPageNum) |
| 52 | let _scrollIndex = Number.parseInt(this.currentPageNum) | 66 | let _scrollIndex = Number.parseInt(this.currentPageNum) |
| @@ -56,60 +70,76 @@ export struct ENewspaperListDialog { | @@ -56,60 +70,76 @@ export struct ENewspaperListDialog { | ||
| 56 | } | 70 | } |
| 57 | 71 | ||
| 58 | aboutToDisappear() { | 72 | aboutToDisappear() { |
| 59 | - // if (this.pageListDialogController) { | ||
| 60 | - // this.pageListDialogController = null | ||
| 61 | - // } | ||
| 62 | this.isCurrentViewOpen = false | 73 | this.isCurrentViewOpen = false |
| 63 | } | 74 | } |
| 64 | 75 | ||
| 65 | build() { | 76 | build() { |
| 66 | Stack() { | 77 | Stack() { |
| 67 | Column() { | 78 | Column() { |
| 68 | - Row() | ||
| 69 | - .width(43) | ||
| 70 | - .height(4) | ||
| 71 | - .backgroundColor('#EDEDED') | ||
| 72 | - .margin({ | ||
| 73 | - top: 10, | ||
| 74 | - bottom: 10 | ||
| 75 | - }) | 79 | + Column() { |
| 80 | + Row() | ||
| 81 | + .width(43) | ||
| 82 | + .height(4) | ||
| 83 | + .backgroundColor('#EDEDED') | ||
| 84 | + .margin({ | ||
| 85 | + top: 10, | ||
| 86 | + bottom: 10 | ||
| 87 | + }) | ||
| 88 | + .onClick(() => { | ||
| 89 | + if (this.closeDialog) { | ||
| 90 | + this.closeDialog() | ||
| 91 | + } | ||
| 92 | + }) | ||
| 93 | + Row() { | ||
| 94 | + Text(this.currentPageNum) | ||
| 95 | + .fontSize($r('app.float.font_size_36')) | ||
| 96 | + .fontColor($r('app.color.color_222222')) | ||
| 97 | + .fontFamily('BebasNeueBold') | ||
| 98 | + Text('版') | ||
| 99 | + .fontSize($r('app.float.font_size_16')) | ||
| 100 | + .fontColor($r('app.color.color_222222')) | ||
| 101 | + .margin({ bottom: 6 }) | ||
| 102 | + | ||
| 103 | + Image($r('app.media.icon_triangle_black')) | ||
| 104 | + .width($r('app.float.border_radius_6')) | ||
| 105 | + .height($r('app.float.border_radius_6')) | ||
| 106 | + .margin({ left: 2, bottom: 6 }) | ||
| 107 | + } | ||
| 108 | + .alignItems(VerticalAlign.Bottom) | ||
| 109 | + .margin({ left: 15 }) | ||
| 110 | + .alignSelf(ItemAlign.Start) | ||
| 76 | .onClick(() => { | 111 | .onClick(() => { |
| 77 | - if (this.closeDialog) { | ||
| 78 | - this.closeDialog() | 112 | + this.pageDialogShow = !this.pageDialogShow |
| 113 | + if (this.pageDialogShow) { | ||
| 114 | + this.pageListDialogController.open() | ||
| 115 | + } else { | ||
| 116 | + this.pageListDialogController.close() | ||
| 79 | } | 117 | } |
| 80 | }) | 118 | }) |
| 81 | - Row() { | ||
| 82 | - Text(this.currentPageNum) | ||
| 83 | - .fontSize($r('app.float.font_size_36')) | ||
| 84 | - .fontColor($r('app.color.color_222222')) | ||
| 85 | - .fontFamily('BebasNeueBold') | ||
| 86 | - Text('版') | ||
| 87 | - .fontSize($r('app.float.font_size_16')) | ||
| 88 | - .fontColor($r('app.color.color_222222')) | ||
| 89 | - .margin({ bottom: 6 }) | ||
| 90 | 119 | ||
| 91 | - Image($r('app.media.icon_triangle_black')) | ||
| 92 | - .width($r('app.float.border_radius_6')) | ||
| 93 | - .height($r('app.float.border_radius_6')) | ||
| 94 | - .margin({ left: 2, bottom: 6 }) | 120 | + Image($r('app.media.line')) |
| 121 | + .width('100%') | ||
| 122 | + .height(6) | ||
| 123 | + .margin({ top: 20, left: 16, right: 16 }) | ||
| 124 | + .objectFit(ImageFit.Contain) | ||
| 95 | } | 125 | } |
| 96 | - .alignItems(VerticalAlign.Bottom) | ||
| 97 | - .margin({ left: 15 }) | ||
| 98 | - .alignSelf(ItemAlign.Start) | ||
| 99 | - .onClick(() => { | ||
| 100 | - this.pageDialogShow = !this.pageDialogShow | ||
| 101 | - if (this.pageDialogShow) { | ||
| 102 | - this.pageListDialogController.open() | ||
| 103 | - } else { | ||
| 104 | - this.pageListDialogController.close() | ||
| 105 | - } | ||
| 106 | - }) | 126 | + .width('100%') |
| 127 | + .gesture( | ||
| 128 | + PanGesture(this.panOption) | ||
| 129 | + .onActionStart((event: GestureEvent) => { | ||
| 130 | + Logger.debug('ENewspaperListDialog','Pan start') | ||
| 131 | + }) | ||
| 132 | + .onActionUpdate((event: GestureEvent) => { | ||
| 133 | + if (this.topFixedHeight + event.offsetY >= this.topFixedHeight) { | ||
| 134 | + this.topHeight = this.topFixedHeight + event.offsetY | ||
| 135 | + } | ||
| 136 | + Logger.debug('ENewspaperListDialog', 'topHeight:' + this.topHeight) | ||
| 137 | + }) | ||
| 138 | + .onActionEnd(() => { | ||
| 139 | + this.onCloseGestureDialog() | ||
| 140 | + }) | ||
| 141 | + ) | ||
| 107 | 142 | ||
| 108 | - Image($r('app.media.line')) | ||
| 109 | - .width('100%') | ||
| 110 | - .height(6) | ||
| 111 | - .margin({ top: 20, left: 16, right: 16 }) | ||
| 112 | - .objectFit(ImageFit.Contain) | ||
| 113 | 143 | ||
| 114 | List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) { | 144 | List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) { |
| 115 | ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | 145 | ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { |
| @@ -137,7 +167,7 @@ export struct ENewspaperListDialog { | @@ -137,7 +167,7 @@ export struct ENewspaperListDialog { | ||
| 137 | .fontSize($r('app.float.font_size_14')) | 167 | .fontSize($r('app.float.font_size_14')) |
| 138 | .fontColor($r('app.color.color_222222')) | 168 | .fontColor($r('app.color.color_222222')) |
| 139 | .fontWeight(600) | 169 | .fontWeight(600) |
| 140 | - .maxLines(2) | 170 | + // .maxLines(2) |
| 141 | .margin({ | 171 | .margin({ |
| 142 | bottom: 8 | 172 | bottom: 8 |
| 143 | }) | 173 | }) |
| @@ -151,7 +181,7 @@ export struct ENewspaperListDialog { | @@ -151,7 +181,7 @@ export struct ENewspaperListDialog { | ||
| 151 | .margin({ | 181 | .margin({ |
| 152 | bottom: 8 | 182 | bottom: 8 |
| 153 | }) | 183 | }) |
| 154 | - .maxLines(2) | 184 | + // .maxLines(2) |
| 155 | } | 185 | } |
| 156 | 186 | ||
| 157 | if (positionItem.downTitle) { | 187 | if (positionItem.downTitle) { |
| @@ -162,7 +192,7 @@ export struct ENewspaperListDialog { | @@ -162,7 +192,7 @@ export struct ENewspaperListDialog { | ||
| 162 | .margin({ | 192 | .margin({ |
| 163 | bottom: 8 | 193 | bottom: 8 |
| 164 | }) | 194 | }) |
| 165 | - .maxLines(2) | 195 | + // .maxLines(2) |
| 166 | } | 196 | } |
| 167 | if (positionItem.newsTxt) { | 197 | if (positionItem.newsTxt) { |
| 168 | Text(positionItem.newsTxt) | 198 | Text(positionItem.newsTxt) |
| @@ -251,16 +281,13 @@ export struct ENewspaperListDialog { | @@ -251,16 +281,13 @@ export struct ENewspaperListDialog { | ||
| 251 | this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}` | 281 | this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}` |
| 252 | // } | 282 | // } |
| 253 | }) | 283 | }) |
| 254 | - .onScroll((scrollOffset: number, scrollState: ScrollState) => { | ||
| 255 | - // console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset) | ||
| 256 | - // if (this.scrollOffset == 0) { | ||
| 257 | - // this.scrollOffset = 0 | ||
| 258 | - // } | ||
| 259 | - }) | ||
| 260 | } | 284 | } |
| 261 | - .margin({ top: 124 }) | 285 | + // .margin({ top: 124 }) |
| 286 | + .margin({ top: this.topHeight }) | ||
| 287 | + | ||
| 262 | .width('100%') | 288 | .width('100%') |
| 263 | .backgroundColor(Color.White) | 289 | .backgroundColor(Color.White) |
| 290 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | ||
| 264 | .onClick(() => { | 291 | .onClick(() => { |
| 265 | 292 | ||
| 266 | }) | 293 | }) |
| @@ -272,6 +299,33 @@ export struct ENewspaperListDialog { | @@ -272,6 +299,33 @@ export struct ENewspaperListDialog { | ||
| 272 | this.closeDialog() | 299 | this.closeDialog() |
| 273 | } | 300 | } |
| 274 | }) | 301 | }) |
| 302 | + .gesture( | ||
| 303 | + PanGesture(this.panOption) | ||
| 304 | + .onActionStart((event: GestureEvent) => { | ||
| 305 | + Logger.debug('ENewspaperListDialog','Pan start') | ||
| 306 | + }) | ||
| 307 | + .onActionUpdate((event: GestureEvent) => { | ||
| 308 | + if (event) { | ||
| 309 | + if (this.topFixedHeight + event.offsetY >= this.topFixedHeight) { | ||
| 310 | + this.topHeight = this.topFixedHeight + event.offsetY | ||
| 311 | + } | ||
| 312 | + Logger.debug('ENewspaperListDialog', 'topHeight:' + this.topHeight) | ||
| 313 | + } | ||
| 314 | + }) | ||
| 315 | + .onActionEnd(() => { | ||
| 316 | + this.onCloseGestureDialog() | ||
| 317 | + }) | ||
| 318 | + ) | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + onCloseGestureDialog() { | ||
| 322 | + if (this.topHeight >= this.deviceHeight ) { | ||
| 323 | + if (this.closeDialog) { | ||
| 324 | + this.closeDialog() | ||
| 325 | + } | ||
| 326 | + } else { | ||
| 327 | + this.topHeight = this.topFixedHeight | ||
| 328 | + } | ||
| 275 | } | 329 | } |
| 276 | 330 | ||
| 277 | updateRecordsData() { | 331 | updateRecordsData() { |
| 1 | + | ||
| 2 | +/** | ||
| 3 | + * WDMessageCenterMessageType 拉取消息类型 | ||
| 4 | + */ | ||
| 5 | +export const enum WDMessageCenterMessageType { | ||
| 6 | + WDMessageCenterMessageType_Interact = 1, //互动通知 | ||
| 7 | + WDMessageCenterMessageType_Subscribe, //预约消息 | ||
| 8 | + WDMessageCenterMessageType_System, //系统消息 | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +export interface InteractMessageListModel{ | ||
| 13 | + data: InteractMessageMItem | ||
| 14 | + code: number | ||
| 15 | + message: string | ||
| 16 | + success: string | ||
| 17 | + timestamp: number | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +export class InteractMessageMItem{ | ||
| 22 | + pageNum:number = 0 | ||
| 23 | + pageSize:number = 0 | ||
| 24 | + totalCount:number = 0 | ||
| 25 | + hasNext:number = 0 | ||
| 26 | + list:InteractMessageModel[] = [] | ||
| 27 | + | ||
| 28 | + constructor(list?:InteractMessageModel[],pageNum?: number,pageSize?: number,totalCount?: number,hasNext?:number) { | ||
| 29 | + } | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +export class InteractMessageModel { | ||
| 33 | + classify: string = ''; | ||
| 34 | + contentId: string = ''; | ||
| 35 | + contentType: string = ''; | ||
| 36 | + id: number = 0; | ||
| 37 | + message: string = ''; | ||
| 38 | + platform: string = ''; | ||
| 39 | + privateMailId: number = 0; | ||
| 40 | + privateMailIdList: number[] = []; | ||
| 41 | + privateMailIds: string = ''; | ||
| 42 | + privateMailNum: number = 0; | ||
| 43 | + read: boolean = true; | ||
| 44 | + source: string = ''; | ||
| 45 | + time: string = ''; | ||
| 46 | + title: string = ''; | ||
| 47 | + userId: string = ''; | ||
| 48 | + remark: string = ''; | ||
| 49 | + InteractMsubM:InteractMsubModel = new InteractMsubModel; | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +export class InteractMsubModel { | ||
| 53 | + beReply: string = ''; | ||
| 54 | + headUrl: string = ''; | ||
| 55 | + contentId: string = ''; | ||
| 56 | + contentRelObjectid: string = ''; | ||
| 57 | + contentTitle: string = ''; | ||
| 58 | + commentContent: string = ''; | ||
| 59 | + userName: string = ''; | ||
| 60 | + userId: string = ''; | ||
| 61 | + contentRelId: string = ''; | ||
| 62 | + shareUrl: string = ''; | ||
| 63 | + userType: string = ''; | ||
| 64 | + contentRelType: string = ''; | ||
| 65 | + visitor: string = ''; | ||
| 66 | + contentType: string = ''; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +export interface InteractMParams { | ||
| 70 | + contentType?: string; | ||
| 71 | + pageNum?: string; | ||
| 72 | + pageSize?: string; | ||
| 73 | + userId?: string; | ||
| 74 | + createTime?: string; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +export interface InteractMDTO{ | ||
| 78 | + success: boolean; | ||
| 79 | + code: number; | ||
| 80 | + message: string; | ||
| 81 | + data: number; | ||
| 82 | + timestamp?: number; | ||
| 83 | +} |
| @@ -24,6 +24,7 @@ import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperati | @@ -24,6 +24,7 @@ import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperati | ||
| 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; | 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; |
| 25 | import { SpConstants } from 'wdConstant/Index'; | 25 | import { SpConstants } from 'wdConstant/Index'; |
| 26 | import { MessageItem } from '../viewmodel/MessageItem'; | 26 | import { MessageItem } from '../viewmodel/MessageItem'; |
| 27 | +import { MessageUnReadItem } from '../viewmodel/MessageUnReadItem'; | ||
| 27 | 28 | ||
| 28 | const TAG = "MinePageDatasModel" | 29 | const TAG = "MinePageDatasModel" |
| 29 | 30 | ||
| @@ -597,6 +598,33 @@ class MinePageDatasModel{ | @@ -597,6 +598,33 @@ class MinePageDatasModel{ | ||
| 597 | }) | 598 | }) |
| 598 | }) | 599 | }) |
| 599 | } | 600 | } |
| 601 | + | ||
| 602 | + /** | ||
| 603 | + * 获取消息未读数据 | ||
| 604 | + * @param pageSize | ||
| 605 | + * @param pageNum | ||
| 606 | + * @returns | ||
| 607 | + */ | ||
| 608 | + getMessageUnReadData(): Promise<MessageUnReadItem> { | ||
| 609 | + return new Promise<MessageUnReadItem>((success, error) => { | ||
| 610 | + this.fetchMessageUnReadData().then((navResDTO: ResponseDTO<MessageUnReadItem>) => { | ||
| 611 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 612 | + error(null) | ||
| 613 | + return | ||
| 614 | + } | ||
| 615 | + let navigationBean = navResDTO.data as MessageUnReadItem | ||
| 616 | + success(navigationBean); | ||
| 617 | + }).catch((err: Error) => { | ||
| 618 | + error(null) | ||
| 619 | + }) | ||
| 620 | + }) | ||
| 621 | + } | ||
| 622 | + | ||
| 623 | + fetchMessageUnReadData() { | ||
| 624 | + let url = HttpUrlUtils.getMessageUnReadDataUrl() | ||
| 625 | + return WDHttp.get<ResponseDTO<MessageUnReadItem>>(url) | ||
| 626 | + }; | ||
| 627 | + | ||
| 600 | } | 628 | } |
| 601 | 629 | ||
| 602 | const minePageDatasModel = MinePageDatasModel.getInstance() | 630 | const minePageDatasModel = MinePageDatasModel.getInstance() |
| @@ -43,7 +43,6 @@ export interface MyCollectionListModel{ | @@ -43,7 +43,6 @@ export interface MyCollectionListModel{ | ||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | - | ||
| 47 | export interface contentListItemParams{ | 46 | export interface contentListItemParams{ |
| 48 | contentId?:string; | 47 | contentId?:string; |
| 49 | contentType?:string; | 48 | contentType?:string; |
| 1 | +import { router } from '@kit.ArkUI'; | ||
| 2 | + | ||
| 3 | +@Entry | ||
| 4 | +@Component | ||
| 5 | +struct ShowHomePageHeaderPage { | ||
| 6 | + @State headPhotoUrl: string = ''; | ||
| 7 | + @State params:Record<string, string> = router.getParams() as Record<string, string>; | ||
| 8 | + | ||
| 9 | + onPageShow() { | ||
| 10 | + this.headPhotoUrl = this.params?.['headPhotoUrl']; | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + build() { | ||
| 14 | + Row() { | ||
| 15 | + Image(this.headPhotoUrl) | ||
| 16 | + .alt( $r('app.media.WDAccountOwnerHedaerDefaultIcon') ) | ||
| 17 | + .width('100%') | ||
| 18 | + .objectFit(ImageFit.Contain) | ||
| 19 | + } | ||
| 20 | + .width('100%') | ||
| 21 | + .height('100%') | ||
| 22 | + .alignItems(VerticalAlign.Center) | ||
| 23 | + .backgroundColor($r('app.color.color_000000')) | ||
| 24 | + .onClick(()=>{ | ||
| 25 | + router.back() | ||
| 26 | + }) | ||
| 27 | + } | ||
| 28 | +} |
| @@ -4,18 +4,16 @@ import { router } from '@kit.ArkUI'; | @@ -4,18 +4,16 @@ import { router } from '@kit.ArkUI'; | ||
| 4 | @Component | 4 | @Component |
| 5 | struct ShowUserHeaderPage { | 5 | struct ShowUserHeaderPage { |
| 6 | @State headPhotoUrl: string = ''; | 6 | @State headPhotoUrl: string = ''; |
| 7 | - @State headType: string = '' | ||
| 8 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 7 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 9 | 8 | ||
| 10 | onPageShow() { | 9 | onPageShow() { |
| 11 | this.headPhotoUrl = this.params?.['headPhotoUrl']; | 10 | this.headPhotoUrl = this.params?.['headPhotoUrl']; |
| 12 | - this.headType = this.params?.['headType'] ?? ''; | ||
| 13 | } | 11 | } |
| 14 | 12 | ||
| 15 | build() { | 13 | build() { |
| 16 | Row() { | 14 | Row() { |
| 17 | Image(this.headPhotoUrl) | 15 | Image(this.headPhotoUrl) |
| 18 | - .alt(this.headType.length > 0 ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.default_head')) | 16 | + .alt($r('app.media.default_head')) |
| 19 | .width('720lpx') | 17 | .width('720lpx') |
| 20 | .height('720lpx') | 18 | .height('720lpx') |
| 21 | .objectFit(ImageFit.Auto) | 19 | .objectFit(ImageFit.Auto) |
| 1 | +// import { collcetRecordParams, MyCollectionItem, MyCollectionListModel } from '../model/MyCollectionModel'; | ||
| 2 | +import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | ||
| 3 | +import { Logger } from 'wdKit'; | ||
| 4 | +import promptAction from '@ohos.promptAction'; | ||
| 5 | +import { | ||
| 6 | + InteractMDTO, | ||
| 7 | + InteractMessageListModel, InteractMessageMItem, InteractMParams } from '../model/InteractMessageModel'; | ||
| 8 | + | ||
| 9 | +const TAG = "MyCollectionViewModel" | ||
| 10 | + | ||
| 11 | +class InteractMessageViewModel { | ||
| 12 | + private static instance:InteractMessageViewModel | ||
| 13 | + /** | ||
| 14 | + * 单例模式 | ||
| 15 | + * @returns | ||
| 16 | + */ | ||
| 17 | + public static getInstance(): InteractMessageViewModel { | ||
| 18 | + if (!InteractMessageViewModel.instance) { | ||
| 19 | + InteractMessageViewModel.instance = new InteractMessageViewModel(); | ||
| 20 | + } | ||
| 21 | + return InteractMessageViewModel.instance; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + // ///互动通知 | ||
| 25 | + // WDMessageCenterMessageType_Interact = 1, | ||
| 26 | + // | ||
| 27 | + // ///预约消息 | ||
| 28 | + // WDMessageCenterMessageType_Subscribe = 2, | ||
| 29 | + // | ||
| 30 | + // ///系统消息 | ||
| 31 | + // WDMessageCenterMessageType_System = 3 | ||
| 32 | + | ||
| 33 | + BaseGetRequest(contentType:number,pageNum:number){ | ||
| 34 | + let userID = HttpUtils.getUserId(); | ||
| 35 | + let url = HttpUrlUtils.getMessageListDataUrl()+`?contentType=${contentType}&userId=${userID}&pageSize=${20}&pageNum=${pageNum}` | ||
| 36 | + return WDHttp.get<InteractMessageListModel>(url) | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + fetchMessageList(contentType:number,pageNum:number):Promise<InteractMessageMItem>{ | ||
| 41 | + return new Promise((success,error) => { | ||
| 42 | + this.BaseGetRequest(contentType,pageNum).then((navResDTO: InteractMessageListModel) => { | ||
| 43 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 44 | + return | ||
| 45 | + } | ||
| 46 | + Logger.info(TAG, "fetchMessageList then,navResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 47 | + success(navResDTO.data) | ||
| 48 | + }).catch((err: Error) => { | ||
| 49 | + Logger.error(TAG, `fetchMessageList catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 50 | + error("page data invalid"); | ||
| 51 | + }) | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + getMessageLikeCount():Promise<number>{ | ||
| 56 | + return new Promise((success,error) => { | ||
| 57 | + WDHttp.get<InteractMDTO>(HttpUrlUtils.getMessageLikeCount()).then((navResDTO: InteractMDTO) => { | ||
| 58 | + if (navResDTO.code == 0) { | ||
| 59 | + success(navResDTO.data) | ||
| 60 | + } | ||
| 61 | + }) | ||
| 62 | + .catch((error: Error) => { | ||
| 63 | + Logger.info(TAG,'executeCollcet','ResponseDTO') | ||
| 64 | + }) | ||
| 65 | + }) | ||
| 66 | + } | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +const interactMViewModel = InteractMessageViewModel.getInstance(); | ||
| 70 | + | ||
| 71 | +export default interactMViewModel as InteractMessageViewModel |
| 1 | +export class MessageUnReadItem{ | ||
| 2 | + activeCount: number = 0 //互动通知未读数 | ||
| 3 | + subscribeCount: number = 0 //预约消息未读数 | ||
| 4 | + systemCount: number = 0 //系统通知未读数 | ||
| 5 | + | ||
| 6 | + subscribeInfo: SubscribeInfo = new SubscribeInfo() | ||
| 7 | + systemInfo: SystemInfo = new SystemInfo() | ||
| 8 | + activeInfo: ActiveInfo = new ActiveInfo | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | +class SubscribeInfo{ | ||
| 12 | + classify: string = "" | ||
| 13 | + contentId: string = "" | ||
| 14 | + contentType: string = "" | ||
| 15 | + id: number = -1 | ||
| 16 | + message: string = "" | ||
| 17 | + platform: string = "" | ||
| 18 | + privateMailId: number = -1 | ||
| 19 | + privateMailIdList: Array< string > = [] | ||
| 20 | + privateMailIds: string = "" | ||
| 21 | + privateMailNum: number = -1 | ||
| 22 | + read: boolean = false | ||
| 23 | + source: string = "" | ||
| 24 | + time: string = "" | ||
| 25 | + title: string = "" | ||
| 26 | + userId: number = -1 | ||
| 27 | + remark: string = "" | ||
| 28 | +} | ||
| 29 | +class SystemInfo{ | ||
| 30 | + classify: string = "" | ||
| 31 | + contentType: string = "" | ||
| 32 | + id: number = -1 | ||
| 33 | + message: string = "" | ||
| 34 | + platform: string = "" | ||
| 35 | + privateMailId: number = -1 | ||
| 36 | + privateMailIdList: Array< string > = [] | ||
| 37 | + privateMailIds: string = "" | ||
| 38 | + privateMailNum: number = -1 | ||
| 39 | + read: boolean = false | ||
| 40 | + source: string = "" | ||
| 41 | + time: string = "" | ||
| 42 | + title: string = "" | ||
| 43 | + userId: number = -1 | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +class ActiveInfo{ | ||
| 47 | + id:string = "" | ||
| 48 | + message: string = "" | ||
| 49 | + time: string = "" | ||
| 50 | + title: string = "" | ||
| 51 | +} |
| 1 | 1 | ||
| 2 | import FunctionsItem from './FunctionsItem' | 2 | import FunctionsItem from './FunctionsItem' |
| 3 | 3 | ||
| 4 | +@Observed | ||
| 4 | export default class MinePagePersonalFunctionsItem extends FunctionsItem { | 5 | export default class MinePagePersonalFunctionsItem extends FunctionsItem { |
| 6 | + isShowRedPoint:boolean = false | ||
| 5 | } | 7 | } |
sight_harmony/features/wdComponent/src/main/resources/base/media/MessageOriginTextIcon.png
0 → 100644
735 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/comment_img_input_black.png
0 → 100644
2.5 KB
10.1 KB
28.4 KB
13.3 KB
2.09 KB
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | "components/page/ThemeListPage", | 24 | "components/page/ThemeListPage", |
| 25 | "pages/ShowUserHeaderPage", | 25 | "pages/ShowUserHeaderPage", |
| 26 | "pages/MineMessagePage", | 26 | "pages/MineMessagePage", |
| 27 | - "components/page/InteractMessagePage" | 27 | + "components/page/InteractMessagePage", |
| 28 | + "pages/ShowHomePageHeaderPage" | ||
| 28 | ] | 29 | ] |
| 29 | } | 30 | } |
| @@ -70,6 +70,7 @@ export struct DetailPlayLiveCommon { | @@ -70,6 +70,7 @@ export struct DetailPlayLiveCommon { | ||
| 70 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | 70 | this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) |
| 71 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | 71 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) |
| 72 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | 72 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) |
| 73 | + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment) | ||
| 73 | this.publishCommentModel.commentContent = '' | 74 | this.publishCommentModel.commentContent = '' |
| 74 | // } | 75 | // } |
| 75 | } | 76 | } |
| @@ -121,11 +121,12 @@ export struct PlayUIComponent { | @@ -121,11 +121,12 @@ export struct PlayUIComponent { | ||
| 121 | } | 121 | } |
| 122 | } | 122 | } |
| 123 | .width('100%') | 123 | .width('100%') |
| 124 | + // .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)') | ||
| 124 | .padding({ | 125 | .padding({ |
| 125 | top: 15, | 126 | top: 15, |
| 126 | bottom: 6, | 127 | bottom: 6, |
| 127 | - left: 10, | ||
| 128 | - right: 10 | 128 | + left: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp', |
| 129 | + right: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp' | ||
| 129 | }) | 130 | }) |
| 130 | .alignItems(HorizontalAlign.Start) | 131 | .alignItems(HorizontalAlign.Start) |
| 131 | .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None) | 132 | .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None) |
| @@ -292,8 +293,8 @@ export struct PlayUIComponent { | @@ -292,8 +293,8 @@ export struct PlayUIComponent { | ||
| 292 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | 293 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) |
| 293 | .width('100%') | 294 | .width('100%') |
| 294 | .padding({ | 295 | .padding({ |
| 295 | - left: 10, | ||
| 296 | - right: 10, | 296 | + left: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp', |
| 297 | + right: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp', | ||
| 297 | top: 15, | 298 | top: 15, |
| 298 | bottom: 15 | 299 | bottom: 15 |
| 299 | }) | 300 | }) |
| @@ -28,11 +28,11 @@ export struct TopPlayComponent { | @@ -28,11 +28,11 @@ export struct TopPlayComponent { | ||
| 28 | 28 | ||
| 29 | updateData() { | 29 | updateData() { |
| 30 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 30 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 31 | - if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.previewUrl && this.liveDetailsBean.liveInfo.previewUrl.length > 0) { | 31 | + if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.previewUrl && |
| 32 | + this.liveDetailsBean.liveInfo.previewUrl.length > 0) { | ||
| 32 | this.imgUrl = this.liveDetailsBean.liveInfo.previewUrl | 33 | this.imgUrl = this.liveDetailsBean.liveInfo.previewUrl |
| 33 | Logger.debug(TAG, 'ok+' + `${this.imgUrl}`) | 34 | Logger.debug(TAG, 'ok+' + `${this.imgUrl}`) |
| 34 | - } | ||
| 35 | - else if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | 35 | + } else if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { |
| 36 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 36 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url |
| 37 | Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) | 37 | Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) |
| 38 | } | 38 | } |
| @@ -81,6 +81,7 @@ export struct TopPlayComponent { | @@ -81,6 +81,7 @@ export struct TopPlayComponent { | ||
| 81 | .alignSelf(ItemAlign.Center) | 81 | .alignSelf(ItemAlign.Center) |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | - aboutToDisappear(): void { | 84 | + async aboutToDisappear(): Promise<void> { |
| 85 | + await this.playerController?.release() | ||
| 85 | } | 86 | } |
| 86 | } | 87 | } |
| @@ -115,6 +115,7 @@ export struct PlayerCommentComponent { | @@ -115,6 +115,7 @@ export struct PlayerCommentComponent { | ||
| 115 | // 收藏、分享、点赞是否需要根据字段显隐 | 115 | // 收藏、分享、点赞是否需要根据字段显隐 |
| 116 | OperRowListView({ | 116 | OperRowListView({ |
| 117 | styleType: 3, | 117 | styleType: 3, |
| 118 | + componentType: 4, | ||
| 118 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 119 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 119 | contentDetailData: this.contentDetailData, | 120 | contentDetailData: this.contentDetailData, |
| 120 | publishCommentModel: this.publishCommentModel, | 121 | publishCommentModel: this.publishCommentModel, |
| @@ -37,11 +37,10 @@ export struct PlayerComponent { | @@ -37,11 +37,10 @@ export struct PlayerComponent { | ||
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | - aboutToDisappear(): void { | ||
| 41 | - | 40 | + async aboutToDisappear(): Promise<void> { |
| 42 | this.playerController?.pause() | 41 | this.playerController?.pause() |
| 43 | this.playerController?.stop() | 42 | this.playerController?.stop() |
| 44 | - this.playerController?.release() | 43 | + await this.playerController?.release() |
| 45 | } | 44 | } |
| 46 | 45 | ||
| 47 | updateData() { | 46 | updateData() { |
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/CommentComponentPage.ets
0 → 100644
| 1 | +import { ContentDetailDTO } from 'wdBean/Index' | ||
| 2 | +import { | ||
| 3 | + publishCommentModel | ||
| 4 | +} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel' | ||
| 5 | +import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent' | ||
| 6 | + | ||
| 7 | +@Component | ||
| 8 | +export struct CommentComponentPage { | ||
| 9 | + scroller: Scroller = new Scroller() | ||
| 10 | + @Consume contentDetailData: ContentDetailDTO | ||
| 11 | + @Consume showCommentList: boolean | ||
| 12 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 13 | + | ||
| 14 | + aboutToAppear(): void { | ||
| 15 | + | ||
| 16 | + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 17 | + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | ||
| 18 | + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 19 | + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType) | ||
| 20 | + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | ||
| 21 | + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | ||
| 22 | + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + build() { | ||
| 26 | + Scroll(this.scroller) { | ||
| 27 | + Stack() { | ||
| 28 | + CommentComponent({ | ||
| 29 | + publishCommentModel: this.publishCommentModel | ||
| 30 | + }) | ||
| 31 | + Image($r("app.media.ic_close_black")) | ||
| 32 | + .width(20) | ||
| 33 | + .height(20) | ||
| 34 | + .onClick(() => { | ||
| 35 | + this.showCommentList = false | ||
| 36 | + }) | ||
| 37 | + .margin({ top: 10, right: 20 }) | ||
| 38 | + .position({ x: '100%' }) | ||
| 39 | + .markAnchor({ x: '100%' }) | ||
| 40 | + | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + .zIndex(1000) | ||
| 44 | + .backgroundColor(Color.White) | ||
| 45 | + | ||
| 46 | + } | ||
| 47 | +} |
| 1 | import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; | 1 | import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; |
| 2 | -import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer'; | 2 | +import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer'; |
| 3 | import { ContentDetailRequest } from 'wdDetailPlayApi'; | 3 | import { ContentDetailRequest } from 'wdDetailPlayApi'; |
| 4 | import { | 4 | import { |
| 5 | batchLikeAndCollectParams, | 5 | batchLikeAndCollectParams, |
| @@ -11,6 +11,7 @@ import { HttpUtils } from 'wdNetwork/Index'; | @@ -11,6 +11,7 @@ import { HttpUtils } from 'wdNetwork/Index'; | ||
| 11 | import { DateTimeUtils } from 'wdKit/Index'; | 11 | import { DateTimeUtils } from 'wdKit/Index'; |
| 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; | 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; |
| 13 | import { PlayerRightView } from '../view/PlayerRightView'; | 13 | import { PlayerRightView } from '../view/PlayerRightView'; |
| 14 | +import { CommentComponentPage } from './CommentComponentPage'; | ||
| 14 | 15 | ||
| 15 | const TAG = 'DetailPlayShortVideoPage'; | 16 | const TAG = 'DetailPlayShortVideoPage'; |
| 16 | 17 | ||
| @@ -32,6 +33,7 @@ export struct DetailPlayShortVideoPage { | @@ -32,6 +33,7 @@ export struct DetailPlayShortVideoPage { | ||
| 32 | @Provide followStatus: string = '0' // 关注状态 | 33 | @Provide followStatus: string = '0' // 关注状态 |
| 33 | @Provide isOpenDetail: boolean = false // 查看详情按钮点击 | 34 | @Provide isOpenDetail: boolean = false // 查看详情按钮点击 |
| 34 | @Provide isDragging: boolean = false // 拖动时间进度条 | 35 | @Provide isDragging: boolean = false // 拖动时间进度条 |
| 36 | + @Provide showCommentList: boolean = false | ||
| 35 | @Consume @Watch('videoStatusChange') switchVideoStatus: boolean | 37 | @Consume @Watch('videoStatusChange') switchVideoStatus: boolean |
| 36 | @Consume @Watch('pageShowChange') pageShow: number | 38 | @Consume @Watch('pageShowChange') pageShow: number |
| 37 | @Consume topSafeHeight: number | 39 | @Consume topSafeHeight: number |
| @@ -148,6 +150,7 @@ export struct DetailPlayShortVideoPage { | @@ -148,6 +150,7 @@ export struct DetailPlayShortVideoPage { | ||
| 148 | this.progressVal = Math.floor(position * 100 / duration); | 150 | this.progressVal = Math.floor(position * 100 / duration); |
| 149 | } | 151 | } |
| 150 | this.queryNewsInfoOfUser() | 152 | this.queryNewsInfoOfUser() |
| 153 | + | ||
| 151 | } | 154 | } |
| 152 | 155 | ||
| 153 | async aboutToDisappear(): Promise<void> { | 156 | async aboutToDisappear(): Promise<void> { |
| @@ -163,10 +166,14 @@ export struct DetailPlayShortVideoPage { | @@ -163,10 +166,14 @@ export struct DetailPlayShortVideoPage { | ||
| 163 | PlayerBottomView({ | 166 | PlayerBottomView({ |
| 164 | playerController: this.playerController | 167 | playerController: this.playerController |
| 165 | }) | 168 | }) |
| 169 | + | ||
| 166 | PlayerRightView({ | 170 | PlayerRightView({ |
| 167 | playerController: this.playerController | 171 | playerController: this.playerController |
| 168 | }) | 172 | }) |
| 169 | 173 | ||
| 174 | + CommentComponentPage({}).visibility(this.showCommentList ? Visibility.Visible : Visibility.None) | ||
| 175 | + .position({ y: '100%' }) | ||
| 176 | + .markAnchor({ y: '100%' }) | ||
| 170 | } | 177 | } |
| 171 | .height('100%') | 178 | .height('100%') |
| 172 | .width('100%') | 179 | .width('100%') |
| @@ -192,6 +199,7 @@ export struct DetailPlayShortVideoPage { | @@ -192,6 +199,7 @@ export struct DetailPlayShortVideoPage { | ||
| 192 | 199 | ||
| 193 | @Builder | 200 | @Builder |
| 194 | playerViewBuilder() { | 201 | playerViewBuilder() { |
| 202 | + | ||
| 195 | WDPlayerRenderView({ | 203 | WDPlayerRenderView({ |
| 196 | playerController: this.playerController, | 204 | playerController: this.playerController, |
| 197 | onLoad: async () => { | 205 | onLoad: async () => { |
| @@ -205,10 +213,13 @@ export struct DetailPlayShortVideoPage { | @@ -205,10 +213,13 @@ export struct DetailPlayShortVideoPage { | ||
| 205 | .padding({ | 213 | .padding({ |
| 206 | bottom: this.videoLandScape === 1 ? 115 : 0, | 214 | bottom: this.videoLandScape === 1 ? 115 : 0, |
| 207 | }) | 215 | }) |
| 216 | + .layoutWeight(1) | ||
| 208 | .align(this.videoLandScape === 0 ? Alignment.Top : Alignment.Center) | 217 | .align(this.videoLandScape === 0 ? Alignment.Top : Alignment.Center) |
| 209 | .onClick(() => { | 218 | .onClick(() => { |
| 210 | console.error('WDPlayerRenderView=== onClick') | 219 | console.error('WDPlayerRenderView=== onClick') |
| 211 | this.playerController?.switchPlayOrPause(); | 220 | this.playerController?.switchPlayOrPause(); |
| 212 | }) | 221 | }) |
| 222 | + | ||
| 223 | + | ||
| 213 | } | 224 | } |
| 214 | } | 225 | } |
| @@ -43,7 +43,7 @@ export struct DetailDialog { | @@ -43,7 +43,7 @@ export struct DetailDialog { | ||
| 43 | .height(200) | 43 | .height(200) |
| 44 | 44 | ||
| 45 | Row() { | 45 | Row() { |
| 46 | - Image($r('app.media.ic_close')) | 46 | + Image($r("app.media.ic_close_white")) |
| 47 | .height(24).margin({ top: 20 }).onClick(() => { | 47 | .height(24).margin({ top: 20 }).onClick(() => { |
| 48 | this.controller.close() | 48 | this.controller.close() |
| 49 | if (this.isOpenDetail) { | 49 | if (this.isOpenDetail) { |
| @@ -3,20 +3,56 @@ import { PlayerTitleView } from './PlayerTitleView' | @@ -3,20 +3,56 @@ import { PlayerTitleView } from './PlayerTitleView' | ||
| 3 | import { PlayerProgressView } from './PlayerProgressView' | 3 | import { PlayerProgressView } from './PlayerProgressView' |
| 4 | import { PlayerCommentView } from './PlayerCommentView' | 4 | import { PlayerCommentView } from './PlayerCommentView' |
| 5 | import { PlayerTimeSeekView } from './PlayerTimeSeekView' | 5 | import { PlayerTimeSeekView } from './PlayerTimeSeekView' |
| 6 | +import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView' | ||
| 7 | +import { | ||
| 8 | + publishCommentModel | ||
| 9 | +} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel' | ||
| 10 | +import { ContentDetailDTO } from 'wdBean/Index'; | ||
| 11 | +import { WindowModel } from 'wdKit/Index'; | ||
| 6 | 12 | ||
| 7 | @Component | 13 | @Component |
| 8 | export struct PlayerBottomView { | 14 | export struct PlayerBottomView { |
| 9 | private playerController?: WDPlayerController; | 15 | private playerController?: WDPlayerController; |
| 16 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 10 | @Consume showComment?: boolean | 17 | @Consume showComment?: boolean |
| 11 | @Consume isOpenDetail?: boolean | 18 | @Consume isOpenDetail?: boolean |
| 12 | @Consume isDragging?: boolean | 19 | @Consume isDragging?: boolean |
| 20 | + @Consume contentDetailData: ContentDetailDTO | ||
| 21 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 22 | + | ||
| 23 | + aboutToAppear(): void { | ||
| 24 | + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 25 | + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | ||
| 26 | + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 27 | + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType) | ||
| 28 | + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | ||
| 29 | + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | ||
| 30 | + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | ||
| 31 | + this.publishCommentModel.commentContent = '' | ||
| 32 | + } | ||
| 13 | 33 | ||
| 14 | build() { | 34 | build() { |
| 15 | Column() { | 35 | Column() { |
| 16 | PlayerTitleView() | 36 | PlayerTitleView() |
| 17 | PlayerProgressView({ playerController: this.playerController }) | 37 | PlayerProgressView({ playerController: this.playerController }) |
| 18 | if (this.showComment) { | 38 | if (this.showComment) { |
| 19 | - PlayerCommentView() | 39 | + // PlayerCommentView() |
| 40 | + OperRowListView({ | ||
| 41 | + pageComponentType: 1, | ||
| 42 | + styleType: 3, | ||
| 43 | + componentType: 4, | ||
| 44 | + operationButtonList: ['comment',], | ||
| 45 | + contentDetailData: this.contentDetailData, | ||
| 46 | + publishCommentModel: this.publishCommentModel, | ||
| 47 | + showCommentIcon: false, | ||
| 48 | + onBack: () => { | ||
| 49 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 50 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 51 | + } | ||
| 52 | + }) | ||
| 53 | + .padding({ | ||
| 54 | + bottom: -this.bottomSafeHeight + 'px' | ||
| 55 | + }) | ||
| 20 | } | 56 | } |
| 21 | } | 57 | } |
| 22 | .alignItems(HorizontalAlign.Start) | 58 | .alignItems(HorizontalAlign.Start) |
| @@ -32,6 +32,7 @@ export struct PlayerRightView { | @@ -32,6 +32,7 @@ export struct PlayerRightView { | ||
| 32 | @Consume isOpenDetail: boolean | 32 | @Consume isOpenDetail: boolean |
| 33 | @Consume isDragging: boolean | 33 | @Consume isDragging: boolean |
| 34 | @Consume showComment?: boolean | 34 | @Consume showComment?: boolean |
| 35 | + @Consume showCommentList: boolean | ||
| 35 | @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 36 | @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 36 | 37 | ||
| 37 | aboutToAppear() { | 38 | aboutToAppear() { |
| @@ -343,7 +344,8 @@ export struct PlayerRightView { | @@ -343,7 +344,8 @@ export struct PlayerRightView { | ||
| 343 | } | 344 | } |
| 344 | .margin({ bottom: 20 }) | 345 | .margin({ bottom: 20 }) |
| 345 | .onClick((event: ClickEvent) => { | 346 | .onClick((event: ClickEvent) => { |
| 346 | - ToastUtils.showToast('评论为公共方法,待开发', 1000); | 347 | + // ToastUtils.showToast('评论为公共方法,待开发', 1000); |
| 348 | + this.showCommentList = true | ||
| 347 | }) | 349 | }) |
| 348 | } | 350 | } |
| 349 | 351 |
| @@ -5,6 +5,14 @@ | @@ -5,6 +5,14 @@ | ||
| 5 | "value": "#FFFFFF" | 5 | "value": "#FFFFFF" |
| 6 | }, | 6 | }, |
| 7 | { | 7 | { |
| 8 | + "name": "color_transparent", | ||
| 9 | + "value": "#00000000" | ||
| 10 | + }, | ||
| 11 | + { | ||
| 12 | + "name": "color_222222", | ||
| 13 | + "value": "#222222" | ||
| 14 | + }, | ||
| 15 | + { | ||
| 8 | "name": "play_track_color", | 16 | "name": "play_track_color", |
| 9 | "value": "#1AFFFFFF" | 17 | "value": "#1AFFFFFF" |
| 10 | }, | 18 | }, |
| @@ -29,6 +37,18 @@ | @@ -29,6 +37,18 @@ | ||
| 29 | "value": "#4DFFFFFF" | 37 | "value": "#4DFFFFFF" |
| 30 | }, | 38 | }, |
| 31 | { | 39 | { |
| 40 | + "name": "color_666666", | ||
| 41 | + "value": "#666666" | ||
| 42 | + }, | ||
| 43 | + { | ||
| 44 | + "name": "color_B0B0B0", | ||
| 45 | + "value": "#B0B0B0" | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + "name": "color_EDEDED", | ||
| 49 | + "value": "#EDEDED" | ||
| 50 | + }, | ||
| 51 | + { | ||
| 32 | "name": "divider_color", | 52 | "name": "divider_color", |
| 33 | "value": "#D3D3D3" | 53 | "value": "#D3D3D3" |
| 34 | }, | 54 | }, |
| @@ -3,6 +3,22 @@ | @@ -3,6 +3,22 @@ | ||
| 3 | { | 3 | { |
| 4 | "name": "shared_desc", | 4 | "name": "shared_desc", |
| 5 | "value": "description" | 5 | "value": "description" |
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "name": "footer_text", | ||
| 9 | + "value": "已显示全部内容" | ||
| 10 | + }, | ||
| 11 | + { | ||
| 12 | + "name": "pull_up_load_text", | ||
| 13 | + "value": "加载中..." | ||
| 14 | + }, | ||
| 15 | + { | ||
| 16 | + "name": "pull_down_refresh_text", | ||
| 17 | + "value": "下拉刷新" | ||
| 18 | + }, | ||
| 19 | + { | ||
| 20 | + "name": "release_refresh_text", | ||
| 21 | + "value": "松开刷新" | ||
| 6 | } | 22 | } |
| 7 | ] | 23 | ] |
| 8 | } | 24 | } |
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_hyphen.png
0 → 100644
244 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_hyphen_block.png
0 → 100644
242 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_icon.png
0 → 100644
1.05 KB
934 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_icon_white.png
0 → 100644
866 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_icon_zhiding.png
0 → 100644
2.7 KB
2.5 KB
1.75 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_pickUp.png
0 → 100644
354 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_reply.png
0 → 100644
333 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_rmh_tag.png
0 → 100644
2.01 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_unfold.png
0 → 100644
373 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/default_head.png
0 → 100644
4.9 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_close.png
deleted
100644 → 0
908 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_close_black.png
0 → 100644
1.03 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_close_white.png
0 → 100644
980 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_collect_check1.png
0 → 100644
2.19 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_like_back.png
0 → 100644
617 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_pull_down_refresh.png
0 → 100644
1.88 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_pull_up_load.gif
0 → 100644
1.75 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/icon_arrow_left.png
0 → 100644
734 Bytes
570 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/icon_like_default.png
0 → 100644
1.15 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/icon_listen.png
0 → 100644
1.67 KB
3.21 KB
2.41 KB
2.65 KB
1.89 KB
487 Bytes
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/wdInput_delete.png
0 → 100644
1.58 KB
| @@ -2,7 +2,10 @@ import HuaweiAuth from './utils/HuaweiAuth' | @@ -2,7 +2,10 @@ import HuaweiAuth from './utils/HuaweiAuth' | ||
| 2 | import { JumpInterceptorAction, RouterJumpInterceptor, WDRouterPage } from 'wdRouter' | 2 | import { JumpInterceptorAction, RouterJumpInterceptor, WDRouterPage } from 'wdRouter' |
| 3 | import { BusinessError } from '@kit.BasicServicesKit' | 3 | import { BusinessError } from '@kit.BasicServicesKit' |
| 4 | import { router } from '@kit.ArkUI' | 4 | import { router } from '@kit.ArkUI' |
| 5 | -import { AccountManagerUtils } from 'wdKit/Index' | 5 | +import { AccountManagerUtils, SPHelper } from 'wdKit/Index' |
| 6 | +import { LoginViewModel } from './pages/login/LoginViewModel' | ||
| 7 | +import { SpConstants } from 'wdConstant/Index' | ||
| 8 | +import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo' | ||
| 6 | 9 | ||
| 7 | class LoginJumpHandler implements JumpInterceptorAction { | 10 | class LoginJumpHandler implements JumpInterceptorAction { |
| 8 | 11 | ||
| @@ -37,4 +40,14 @@ export class LoginModule { | @@ -37,4 +40,14 @@ export class LoginModule { | ||
| 37 | } | 40 | } |
| 38 | 41 | ||
| 39 | } | 42 | } |
| 43 | + | ||
| 44 | + // 启动进入主页 和 每次登录成功调用 | ||
| 45 | + static reportDeviceInfo() { | ||
| 46 | + ReportDeviceInfo.reportDeviceInfo().then((res) => { | ||
| 47 | + let nickName = res.touristNickName | ||
| 48 | + if (res.touristNickName) { | ||
| 49 | + SPHelper.default.save(SpConstants.TOURIST_NICK_NAME, res.touristNickName) | ||
| 50 | + } | ||
| 51 | + }) | ||
| 52 | + } | ||
| 40 | } | 53 | } |
| @@ -82,6 +82,30 @@ export class LoginModel { | @@ -82,6 +82,30 @@ export class LoginModel { | ||
| 82 | }) | 82 | }) |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | + // loginType 0:手机号密码 2:手机号登录 3:QQ 4:微信 5:微博 6:APPLEID 7:手机号一键登录8:账号+密码 9:华为一键登录 | ||
| 86 | + thirdPartLogin(loginType: number, otherParams: Record<string, string|number>) { | ||
| 87 | + otherParams['loginType'] = loginType | ||
| 88 | + otherParams['deviceId'] = HttpUtils.getDeviceId() | ||
| 89 | + | ||
| 90 | + return new Promise<LoginBean>((success, fail) => { | ||
| 91 | + HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), otherParams).then((data: ResponseDTO<LoginBean>) => { | ||
| 92 | + Logger.debug("LoginViewModel:success2 ", data.message) | ||
| 93 | + if (!data) { | ||
| 94 | + fail("数据为空") | ||
| 95 | + return | ||
| 96 | + } | ||
| 97 | + if (!data.data||data.code != 0) { | ||
| 98 | + fail(data.message) | ||
| 99 | + return | ||
| 100 | + } | ||
| 101 | + success(data.data) | ||
| 102 | + }, (error: Error) => { | ||
| 103 | + fail(error.message) | ||
| 104 | + Logger.debug("LoginViewModel:error2 ", error.toString()) | ||
| 105 | + }) | ||
| 106 | + }) | ||
| 107 | + } | ||
| 108 | + | ||
| 85 | // {"password":"523acd319228efde34e8a30268ee8ca5e4fc421d72affa531676e1765940d22c","phone":"13625644528","loginType":0,"oldPassword":"BA5FD74F827AF9B271FE17CADC489C36","deviceId":"60da5af6-9c59-3566-8622-8c6c00710994"} | 109 | // {"password":"523acd319228efde34e8a30268ee8ca5e4fc421d72affa531676e1765940d22c","phone":"13625644528","loginType":0,"oldPassword":"BA5FD74F827AF9B271FE17CADC489C36","deviceId":"60da5af6-9c59-3566-8622-8c6c00710994"} |
| 86 | appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { | 110 | appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { |
| 87 | let bean: Record<string, string | number> = {}; | 111 | let bean: Record<string, string | number> = {}; |
| @@ -407,14 +407,9 @@ struct LoginPage { | @@ -407,14 +407,9 @@ struct LoginPage { | ||
| 407 | 407 | ||
| 408 | queryUserDetail(){ | 408 | queryUserDetail(){ |
| 409 | this.loginViewModel.queryUserDetail().then(()=>{ | 409 | this.loginViewModel.queryUserDetail().then(()=>{ |
| 410 | - router.back({ | ||
| 411 | - url: `${WDRouterPage.getBundleInfo()}` | ||
| 412 | - } | ||
| 413 | - ) | 410 | + router.back() |
| 414 | }).catch(()=>{ | 411 | }).catch(()=>{ |
| 415 | - router.back({ | ||
| 416 | - url: `${WDRouterPage.getBundleInfo()}` | ||
| 417 | - }) | 412 | + router.back() |
| 418 | }) | 413 | }) |
| 419 | } | 414 | } |
| 420 | 415 |
-
Please register or login to post a comment